OSDN Git Service

Rename boardmanager.cpp and boardmanager.h
[kita/kita.git] / src / libkita / threadindex.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 KITATHREADINDEX_H
11 #define KITATHREADINDEX_H
12
13 #include <QtCore/QList>
14 #include <QtCore/QString>
15
16 #include <kurl.h>
17
18 class KConfig;
19
20 namespace Kita
21 {
22     class Thread;
23
24     /**
25     @author Hideki Ikemoto
26     */
27     class KDE_EXPORT ThreadIndex
28     {
29     public:
30         ThreadIndex(const KUrl& url);
31
32         QString getSubject() const;
33         void setSubject(const QString& str);
34
35         int getResNum() const;
36         void setResNum(int resNum);
37
38         int getReadNum() const;
39         void setReadNum(int readNum);
40
41         int getViewPos() const;
42         void setViewPos(int viewPos);
43
44         void setMarkList(const QList<int>& markList);
45
46         /*---------------------------------*/
47
48         void loadIndex(Thread* thread, bool checkCached = true) const;
49         void saveIndex(const Thread* thread);
50
51     private:
52
53         QString getSubjectPrivate(const KConfig& config) const;
54         void setSubjectPrivate(KConfig& config, const QString& str);
55
56         int getResNumPrivate(KConfig& config) const;
57         void setResNumPrivate(KConfig& config, int resNum);
58
59         int getReadNumPrivate(KConfig& config, bool checkCached) const;
60         void setReadNumPrivate(KConfig& config, int readNum);
61
62         int getViewPosPrivate(const KConfig& config) const;
63         void setViewPosPrivate(KConfig& config, int viewPos);
64
65         QList<int> getMarkListPrivate(const KConfig& config) const;
66         void setMarkListPrivate(KConfig& config, const QList<int>& markList);
67
68         KUrl m_url;
69         QString m_indexPath;
70     };
71 }
72
73 #endif