File: docentry.h

package info (click to toggle)
khelpcenter 4:18.04.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,720 kB
  • sloc: cpp: 5,955; xml: 249; perl: 86; makefile: 5; sh: 3
file content (118 lines) | stat: -rw-r--r-- 2,515 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118

#ifndef KHC_DOCENTRY_H
#define KHC_DOCENTRY_H

#include <QString>
#include <QList>
#include <QFileInfo>

namespace KHC {

  class DocEntry
  {
    public:
      typedef QList<DocEntry *> List;

      DocEntry();

      explicit DocEntry( const QString &name, const QString &url = QString(),
		const QString &icon = QString() );

      void setName( const QString & );
      QString name() const;

      void setSearch( const QString & );
      QString search() const;

      void setIcon( const QString & );
      QString icon() const;

      void setUrl( const QString & );
      QString url() const;

      void setInfo( const QString & );
      QString info() const;

      void setLang( const QString & );
      QString lang() const;

      void setIdentifier( const QString & );
      QString identifier() const;

      void setIndexer( const QString & );
      QString indexer() const;

      void setIndexTestFile( const QString & );
      QString indexTestFile() const;

      void setWeight( int );
      int weight() const;

      void setSearchMethod( const QString & );
      QString searchMethod() const;

      void enableSearch( bool enabled );
      bool searchEnabled() const;

      void setSearchEnabledDefault( bool enabled );
      bool searchEnabledDefault() const;

      void setDocumentType( const QString & );
      QString documentType() const;

      void setDirectory( bool );
      bool isDirectory() const;

      bool readFromFile( const QFileInfo &fileInfo );

      bool docExists() const;

      void addChild( DocEntry * );
      bool hasChildren() const;
      DocEntry *firstChild() const;
      List children() const;

      void setParent( DocEntry * );
      DocEntry *parent() const;

      void setNextSibling( DocEntry * );
      DocEntry *nextSibling() const;

      QString khelpcenterSpecial() const;

      bool isSearchable() const;

      void dump() const;

    protected:
      void init();

    private:
      QString mName;
      QString mSearch;
      QString mIcon;
      QString mUrl;
      QString mInfo;
      QString mLang;
      mutable QString mIdentifier;
      QString mIndexer;
      QString mIndexTestFile;
      QString mSearchMethod;
      QString mDocumentType;

      QString mKhelpcenterSpecial;

      List mChildren;
      DocEntry *mParent;
      DocEntry *mNextSibling;

      int mWeight;
      bool mSearchEnabled : 1;
      bool mSearchEnabledDefault : 1;
      bool mDirectory : 1;
  };

}

#endif //KHC_DOCENTRY_H
// vim:ts=2:sw=2:et