OSDN Git Service

Move the directories
[kita/kita.git] / src / libkita / thread.h
diff --git a/src/libkita/thread.h b/src/libkita/thread.h
new file mode 100644 (file)
index 0000000..b9d1245
--- /dev/null
@@ -0,0 +1,65 @@
+/***************************************************************************
+*   Copyright (C) 2004 by Kita Developers                                 *
+*   ikemo@users.sourceforge.jp                                            *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+***************************************************************************/
+#ifndef KITATHREAD_H
+#define KITATHREAD_H
+
+#include <QtCore/QMultiHash>
+#include <QtCore/QList>
+
+#include <kurl.h>
+
+namespace Kita
+{
+    /**
+    @author Hideki Ikemoto
+    */
+    class KDE_EXPORT Thread
+    {
+        static QMultiHash<QString, Thread*>* m_threadDict;
+
+        KUrl m_datUrl;
+        QString m_threadName;
+        int m_resNum;
+        int m_readNum;
+        int m_viewPos;
+        QList<int> m_markList;
+
+    public:
+        Thread(const KUrl& datUrl);
+        ~Thread();
+
+        const KUrl& datUrl() const;
+
+        const QString& threadName() const;
+        void setThreadName(const QString& name);
+
+        int resNum() const;
+        void setResNum(int num);
+
+        int readNum() const;
+        void setReadNum(int num);
+
+        int viewPos() const;
+        void setViewPos(int viewPos);
+
+        const QList<int>& markList() const;
+        void setMarkList(const QList<int>& markList);
+        bool isMarked(int num);
+        bool setMark(int num, bool newStatus);
+
+        /*----------------------*/
+
+        static Thread* getByUrl(const KUrl& datUrl);
+        static Thread* getByUrlNew(const KUrl& datUrl);
+        static void replace(const QString& fromUrl, const QString& toUrl);
+    };
+}
+
+#endif