kcmoduleinfo.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KCMODULEINFO_H
00025 #define KCMODULEINFO_H
00026
00027 #include <kservice.h>
00028
00029 class QPixmap;
00030 class QString;
00031 class QStringList;
00032
00049 class KUTILS_EXPORT KCModuleInfo
00050 {
00051
00052 public:
00053
00061 KCModuleInfo(const QString& desktopFile);
00062
00070 KCModuleInfo( KService::Ptr moduleInfo );
00071
00072
00078 KCModuleInfo( const KCModuleInfo &rhs );
00079
00085 KCModuleInfo();
00086
00090 KCModuleInfo &operator=( const KCModuleInfo &rhs );
00091
00098 bool operator==( const KCModuleInfo &rhs ) const;
00099
00103 bool operator!=( const KCModuleInfo &rhs ) const;
00104
00108 ~KCModuleInfo();
00109
00113 QString fileName() const { return _fileName; };
00114
00118 const QStringList &keywords() const { return _keywords; };
00119
00126 QString factoryName() const;
00127
00131 QString moduleName() const { return _name; };
00132
00133
00137 KService::Ptr service() const { return _service; };
00138
00142 QString comment() const { return _comment; };
00143
00147 QString icon() const { return _icon; };
00148
00152 QString docPath() const;
00153
00157 QString library() const { return _lib; };
00158
00162 QString handle() const;
00163
00168 int weight() const;
00169
00173 bool needsRootPrivileges() const;
00174
00179 bool isHiddenByDefault() const KDE_DEPRECATED;
00180
00181
00187 bool needsTest() const;
00188
00189
00190 protected:
00191
00196 void setKeywords(const QStringList &keyword) { _keywords = keyword; };
00197
00202 void setName(const QString &name) { _name = name; };
00203
00208 void setComment(const QString &comment) { _comment = comment; };
00209
00214 void setIcon(const QString &icon) { _icon = icon; };
00215
00220 void setLibrary(const QString &lib) { _lib = lib; };
00221
00226 void setHandle(const QString &handle) { _handle = handle; };
00227
00234 void setWeight(int weight) { _weight = weight; };
00235
00236
00242 void setNeedsTest( bool val );
00243
00249 void setNeedsRootPrivileges(bool needsRootPrivileges)
00250 { _needsRootPrivileges = needsRootPrivileges; };
00251
00255 void setIsHiddenByDefault(bool isHiddenByDefault)
00256 { _isHiddenByDefault = isHiddenByDefault; };
00257
00262 void setDocPath(const QString &p) { _doc = p; };
00263
00268 void loadAll();
00269
00270 private:
00271
00275 void init(KService::Ptr s);
00276
00277 private:
00278
00279
00280 QStringList _keywords;
00281 QString _name, _icon, _lib, _handle, _fileName, _doc, _comment;
00282 bool _needsRootPrivileges : 1;
00283 bool _isHiddenByDefault : 1;
00284 bool _allLoaded : 1;
00285 int _weight;
00286
00287 KService::Ptr _service;
00288
00289 class KCModuleInfoPrivate;
00290 KCModuleInfoPrivate *d;
00291
00292 };
00293
00294 #endif // KCMODULEINFO_H
00295
00296
|