1 /***************************************************************************
2 * Copyright (C) 2004 by Kita Developers *
3 * ikemo@users.sourceforge.jp *
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 KITADATMANAGER_H
11 #define KITADATMANAGER_H
13 #include <QtCore/QList>
24 typedef QList<DatInfo*> DatInfoList;
26 class KDE_EXPORT DatManager
28 static DatInfoList m_datInfoList;
31 explicit DatManager(const KUrl& url);
33 bool createDatInfo() const;
34 DatInfo* getDatInfoPointer() const;
35 static void deleteAllDatInfo();
38 bool updateCache(const QObject* parent) const;
39 int getResponseCode() const;
40 int getServerTime() const;
41 bool deleteCache() const;
42 bool isLoadingNow() const;
43 void stopLoading() const;
46 QString getDat(int num) const;
47 QString getId(int num) const;
48 QString getPlainName(int num) const;
49 QString getPlainBody(int num) const;
50 QString getPlainTitle(int num) const;
52 QString threadName() const; /* = subject of thread */
53 QString threadId() const;
56 QString getHtml(int startnum, int endnum,
57 bool checkAbone = true) const;
58 QString getHtmlById(const QString& strid, int &count) const;
59 QString getTreeByRes(int rootnum, int &count) const;
60 QString getTreeByResReverse(int rootnum, int &count) const;
63 int getResNum() const;
64 int getReadNum() const;
65 int getViewPos() const;
66 void setViewPos(int num) const;
67 int getDatSize() const;
68 int getNumById(const QString& strid) const;
71 /* another information */
72 bool isThreadRecorded() const;
73 bool is2chThread() const;
74 bool isResValid(int num) const;
75 bool isBroken() const;
76 bool isResBroken(int num) const;
77 bool checkId(const QString& strid, int num) const;
78 bool checkWord(const QStringList& stlist, int num, bool checkOr) const;
79 bool isMarked(int num) const;
80 void setMark(int num, bool mark) const;
84 bool checkAbone(int num) const;
85 void resetAbone() const;
87 /* check if the thread is shown on the main thread tab. */
88 bool isMainThreadOpened() const;
89 void setMainThreadOpened(bool isOpened) const;
91 /* obsolete. Don't use them. */
93 QString threadUrl() const;
96 DatInfo* getDatInfo(bool checkCached = true) const;
97 DatInfo* searchDatInfo() const;
98 DatInfo* recordDatInfo(bool checkCached) const;
103 DatInfo* m_searchDatInfo;
105 DatManager(const DatManager&);
106 DatManager& operator=(const DatManager&);