1 | |
---|---|
2 | #ifndef KHC_DOCENTRY_H |
3 | #define KHC_DOCENTRY_H |
4 | |
5 | #include <QString> |
6 | #include <QList> |
7 | |
8 | namespace KHC { |
9 | |
10 | class DocEntry |
11 | { |
12 | public: |
13 | typedef QList<DocEntry *> List; |
14 | |
15 | DocEntry(); |
16 | |
17 | explicit DocEntry( const QString &name, const QString &url = QString(), |
18 | const QString &icon = QString() ); |
19 | |
20 | void setName( const QString & ); |
21 | QString name() const; |
22 | |
23 | void setSearch( const QString & ); |
24 | QString search() const; |
25 | |
26 | void setIcon( const QString & ); |
27 | QString icon() const; |
28 | |
29 | void setUrl( const QString & ); |
30 | QString url() const; |
31 | |
32 | void setInfo( const QString & ); |
33 | QString info() const; |
34 | |
35 | void setLang( const QString & ); |
36 | QString lang() const; |
37 | |
38 | void setIdentifier( const QString & ); |
39 | QString identifier() const; |
40 | |
41 | void setIndexer( const QString & ); |
42 | QString indexer() const; |
43 | |
44 | void setIndexTestFile( const QString & ); |
45 | QString indexTestFile() const; |
46 | |
47 | void setWeight( int ); |
48 | int weight() const; |
49 | |
50 | void setSearchMethod( const QString & ); |
51 | QString searchMethod() const; |
52 | |
53 | void enableSearch( bool enabled ); |
54 | bool searchEnabled() const; |
55 | |
56 | void setSearchEnabledDefault( bool enabled ); |
57 | bool searchEnabledDefault() const; |
58 | |
59 | void setDocumentType( const QString & ); |
60 | QString documentType() const; |
61 | |
62 | void setDirectory( bool ); |
63 | bool isDirectory() const; |
64 | |
65 | bool readFromFile( const QString &fileName ); |
66 | |
67 | bool indexExists( const QString &indexDir ); |
68 | |
69 | bool docExists() const; |
70 | |
71 | void addChild( DocEntry * ); |
72 | bool hasChildren(); |
73 | DocEntry *firstChild(); |
74 | List children(); |
75 | |
76 | void setParent( DocEntry * ); |
77 | DocEntry *parent(); |
78 | |
79 | void setNextSibling( DocEntry * ); |
80 | DocEntry *nextSibling(); |
81 | |
82 | QString khelpcenterSpecial() const; |
83 | |
84 | bool isSearchable(); |
85 | |
86 | void dump() const; |
87 | |
88 | protected: |
89 | void init(); |
90 | |
91 | private: |
92 | QString mName; |
93 | QString mSearch; |
94 | QString mIcon; |
95 | QString mUrl; |
96 | QString mInfo; |
97 | QString mLang; |
98 | mutable QString mIdentifier; |
99 | QString mIndexer; |
100 | QString mIndexTestFile; |
101 | int mWeight; |
102 | QString mSearchMethod; |
103 | bool mSearchEnabled; |
104 | bool mSearchEnabledDefault; |
105 | QString mDocumentType; |
106 | bool mDirectory; |
107 | |
108 | QString mKhelpcenterSpecial; |
109 | |
110 | List mChildren; |
111 | DocEntry *mParent; |
112 | DocEntry *mNextSibling; |
113 | }; |
114 | |
115 | } |
116 | |
117 | #endif //KHC_DOCENTRY_H |
118 | // vim:ts=2:sw=2:et |
119 |