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
00048 class KUTILS_EXPORT KCModuleInfo
00049 {
00050
00051 public:
00052
00060 KCModuleInfo(const QString& desktopFile);
00061
00069 KCModuleInfo( KService::Ptr moduleInfo );
00070
00071
00077 KCModuleInfo( const KCModuleInfo &rhs );
00078
00084 KCModuleInfo();
00085
00089 KCModuleInfo &operator=( const KCModuleInfo &rhs );
00090
00097 bool operator==( const KCModuleInfo &rhs ) const;
00098
00102 bool operator!=( const KCModuleInfo &rhs ) const;
00103
00107 ~KCModuleInfo();
00108
00112 QString fileName() const { return _fileName; };
00113
00117 const QStringList &keywords() const { return _keywords; };
00118
00125 QString factoryName() const;
00126
00130 QString moduleName() const { return _name; };
00131
00132
00136 KService::Ptr service() const { return _service; };
00137
00141 QString comment() const { return _comment; };
00142
00146 QString icon() const { return _icon; };
00147
00151 QString docPath() const;
00152
00156 QString library() const { return _lib; };
00157
00161 QString handle() const;
00162
00167 int weight() const;
00168
00172 bool needsRootPrivileges() const;
00173
00178 bool isHiddenByDefault() const KDE_DEPRECATED;
00179
00180
00186 bool needsTest() const;
00187
00188
00189 protected:
00190
00195 void setKeywords(const QStringList &keyword) { _keywords = keyword; };
00196
00201 void setName(const QString &name) { _name = name; };
00202
00207 void setComment(const QString &comment) { _comment = comment; };
00208
00213 void setIcon(const QString &icon) { _icon = icon; };
00214
00219 void setLibrary(const QString &lib) { _lib = lib; };
00220
00225 void setHandle(const QString &handle) { _handle = handle; };
00226
00233 void setWeight(int weight) { _weight = weight; };
00234
00235
00241 void setNeedsTest( bool val );
00242
00248 void setNeedsRootPrivileges(bool needsRootPrivileges)
00249 { _needsRootPrivileges = needsRootPrivileges; };
00250
00254 void setIsHiddenByDefault(bool isHiddenByDefault)
00255 { _isHiddenByDefault = isHiddenByDefault; };
00256
00261 void setDocPath(const QString &p) { _doc = p; };
00262
00267 void loadAll();
00268
00269 private:
00270
00274 void init(KService::Ptr s);
00275
00276 private:
00277
00278
00279 QStringList _keywords;
00280 QString _name, _icon, _lib, _handle, _fileName, _doc, _comment;
00281 bool _needsRootPrivileges : 1;
00282 bool _isHiddenByDefault : 1;
00283 bool _allLoaded : 1;
00284 int _weight;
00285
00286 KService::Ptr _service;
00287
00288 class KCModuleInfoPrivate;
00289 KCModuleInfoPrivate *d;
00290
00291 };
00292
00293 #endif // KCMODULEINFO_H
00294
00295
|