1 | |
2 | /* |
3 | * kcmcategoryitem.h |
4 | * |
5 | * Copyright (C) 2010 David Hubner <hubnerd@ntlworld.com> |
6 | * |
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. |
11 | * |
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. |
16 | * |
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. |
20 | * |
21 | */ |
22 | |
23 | #ifndef KCMCATEGORYITEM |
24 | #define KCMCATEGORYITEM |
25 | |
26 | #include "kcmtreeitem.h" |
27 | |
28 | //KDE |
29 | #include <KCModuleInfo> |
30 | #include <KIcon> |
31 | |
32 | class KcmCategoryItem : public KcmTreeItem |
33 | { |
34 | public: |
35 | |
36 | /** |
37 | * Category Tree Item for InfoKcmModel. Holds information about a Category |
38 | * |
39 | * @param module pointer to KCM module |
40 | * @param parent objects parent |
41 | */ |
42 | explicit KcmCategoryItem(const KService::Ptr module, KcmTreeItem *parent=0); |
43 | |
44 | /** |
45 | * Category Tree Item for InfoKcmModel. Holds information about a Category |
46 | * |
47 | * @note Used for root folder objects |
48 | */ |
49 | explicit KcmCategoryItem(const QString& category); |
50 | |
51 | /** |
52 | * Get data of tree item |
53 | */ |
54 | QString data() const; |
55 | |
56 | /** |
57 | * Get category of tree item. |
58 | * Set in X-KDE-KInfoCenter-Category |
59 | */ |
60 | QString category() const; |
61 | |
62 | /** |
63 | * Gets the item type. |
64 | */ |
65 | itemType type() const; |
66 | |
67 | /** |
68 | * Get tree item KCMs Data |
69 | */ |
70 | KCModuleInfo kcm() const; |
71 | |
72 | /** |
73 | * Get tree items KCM's weight |
74 | */ |
75 | int weight(); |
76 | |
77 | /** |
78 | * Get icon tied to KCM |
79 | */ |
80 | KIcon icon() const; |
81 | |
82 | /** |
83 | * Get whatsThis information from KCM |
84 | */ |
85 | QString whatsThis() const; |
86 | |
87 | /** |
88 | * Get KCM tree item keywords |
89 | */ |
90 | QStringList keywords() const; |
91 | |
92 | private: |
93 | |
94 | const QString m_category; |
95 | }; |
96 | |
97 | #endif //KCMCATEGORYITEM |
98 | |
99 | |