OSDN Git Service

Move the directories
[kita/kita.git] / src / libkita / thread.h
1 /***************************************************************************
2 *   Copyright (C) 2004 by Kita Developers                                 *
3 *   ikemo@users.sourceforge.jp                                            *
4 *                                                                         *
5 *   This program is free software; you can redistribute it and/or modify  *
6 *   it under the terms of the GNU General Public License as published by  *
7 *   the Free Software Foundation; either version 2 of the License, or     *
8 *   (at your option) any later version.                                   *
9 ***************************************************************************/
10 #ifndef KITATHREAD_H
11 #define KITATHREAD_H
12
13 #include <QtCore/QMultiHash>
14 #include <QtCore/QList>
15
16 #include <kurl.h>
17
18 namespace Kita
19 {
20     /**
21     @author Hideki Ikemoto
22     */
23     class KDE_EXPORT Thread
24     {
25         static QMultiHash<QString, Thread*>* m_threadDict;
26
27         KUrl m_datUrl;
28         QString m_threadName;
29         int m_resNum;
30         int m_readNum;
31         int m_viewPos;
32         QList<int> m_markList;
33
34     public:
35         Thread(const KUrl& datUrl);
36         ~Thread();
37
38         const KUrl& datUrl() const;
39
40         const QString& threadName() const;
41         void setThreadName(const QString& name);
42
43         int resNum() const;
44         void setResNum(int num);
45
46         int readNum() const;
47         void setReadNum(int num);
48
49         int viewPos() const;
50         void setViewPos(int viewPos);
51
52         const QList<int>& markList() const;
53         void setMarkList(const QList<int>& markList);
54         bool isMarked(int num);
55         bool setMark(int num, bool newStatus);
56
57         /*----------------------*/
58
59         static Thread* getByUrl(const KUrl& datUrl);
60         static Thread* getByUrlNew(const KUrl& datUrl);
61         static void replace(const QString& fromUrl, const QString& toUrl);
62     };
63 }
64
65 #endif