5
* Copyright (C) 2010 David Hubner <hubnerd@ntlworld.com>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
#include <KCModuleInfo>
39
* KCM Tree Item for InfoKcmModel. Holds information about a KCM
41
* @param module pointer to KCM module
42
* @param parent objects parent
44
explicit KcmTreeItem(const KService::Ptr module, KcmTreeItem *parent=0);
47
* KCM Tree Item for InfoKcmModel. Holds information about a KCM
49
* @note Used for root folder objects
55
* Enumeration of the possible tree item types
58
enum itemType { KCM=0, CATEGORY };
63
virtual ~KcmTreeItem();
66
* Add child tree item to parent
68
void addChild(KcmTreeItem *);
73
* @param row row where child is located
75
KcmTreeItem *child(const int row);
78
* Get amount of children
83
* Get parent of current tree item
85
KcmTreeItem *parent();
88
* Get index of tree item
90
int indexOf(KcmTreeItem *);
93
* Get amount of columns that tree item contains.
99
* Get row of tree item
104
* Get data of tree item
106
virtual QString data() const;
109
* Get category of tree item.
110
* Set in X-KDE-KInfoCenter-Category
112
virtual QString category() const;
115
* Gets the item type.
117
virtual itemType type() const;
120
* Check if children of tree item contains a category.
121
* Used in search implementation
123
KcmTreeItem *containsCategory(const QString&);
126
* Get tree item KCMs Data
128
virtual KCModuleInfo kcm() const;
131
* Get tree items KCM's weight
133
virtual int weight();
136
* Get icon tied to KCM
138
virtual KIcon icon() const;
141
* Get whatsThis information from KCM
143
virtual QString whatsThis() const;
146
* Check if there are any children tree items keywords that
147
* have a certain regexp pattern
149
bool childrenRegExp(const QRegExp& pattern);
152
* Get KCM tree item keywords
154
virtual QStringList keywords() const;
158
QList<KcmTreeItem *> m_children;
159
KcmTreeItem *m_parent;
160
const KService::Ptr m_module;
162
const KCModuleInfo *m_moduleInfo;
165
#endif // KCMTREEITEM