kcmoduleinfo.h
00001 /* 00002 Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> 00003 Copyright (c) 2000 Matthias Elter <elter@kde.org> 00004 Copyright (c) 2003 Daniel Molkentin <molkentin@kde.org> 00005 Copyright (c) 2003 Matthias Kretz <kretz@kde.org> 00006 00007 This file is part of the KDE project 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Library General Public 00011 License version 2, as published by the Free Software Foundation. 00012 00013 This library is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Library General Public License for more details. 00017 00018 You should have received a copy of the GNU Library General Public License 00019 along with this library; see the file COPYING.LIB. If not, write to 00020 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00021 Boston, MA 02111-1307, USA. 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 00067 KCModuleInfo( KService::Ptr moduleInfo ); 00068 00069 00075 KCModuleInfo( const KCModuleInfo &rhs ); 00076 00080 KCModuleInfo &operator=( const KCModuleInfo &rhs ); 00081 00088 bool operator==( const KCModuleInfo &rhs ) const; 00089 00093 bool operator!=( const KCModuleInfo &rhs ) const; 00094 00098 ~KCModuleInfo(); 00099 00103 QString fileName() const { return _fileName; }; 00104 00108 const QStringList &keywords() const { return _keywords; }; 00109 00113 QString moduleName() const { return _name; }; 00114 // changed from name() to avoid ambiguity with QObject::name() on multiple inheritance 00115 00119 KService::Ptr service() const { return _service; }; 00120 00124 QString comment() const { return _comment; }; 00125 00129 QString icon() const { return _icon; }; 00130 00134 QString docPath() const; 00135 00139 QString library() const { return _lib; }; 00140 00144 QString handle() const; 00145 00150 int weight() const; 00151 00155 bool needsRootPrivileges() const; 00156 00161 bool isHiddenByDefault() const KDE_DEPRECATED; 00162 00163 protected: 00164 00169 void setKeywords(const QStringList &keyword) { _keywords = keyword; }; 00170 00175 void setName(const QString &name) { _name = name; }; 00176 00181 void setComment(const QString &comment) { _comment = comment; }; 00182 00187 void setIcon(const QString &icon) { _icon = icon; }; 00188 00193 void setLibrary(const QString &lib) { _lib = lib; }; 00194 00199 void setHandle(const QString &handle) { _handle = handle; }; 00200 00207 void setWeight(int weight) { _weight = weight; }; 00208 00214 void setNeedsRootPrivileges(bool needsRootPrivileges) 00215 { _needsRootPrivileges = needsRootPrivileges; }; 00216 00220 void setIsHiddenByDefault(bool isHiddenByDefault) 00221 { _isHiddenByDefault = isHiddenByDefault; }; 00222 00227 void setDocPath(const QString &p) { _doc = p; }; 00228 00233 void loadAll(); 00234 00235 private: 00236 00240 void init(KService::Ptr s); 00241 00242 private: 00243 00244 // KDE4 These needs to be moved to KCModuleInfoPrivate 00245 QStringList _keywords; 00246 QString _name, _icon, _lib, _handle, _fileName, _doc, _comment; 00247 bool _needsRootPrivileges : 1; 00248 bool _isHiddenByDefault : 1; 00249 bool _allLoaded : 1; 00250 int _weight; 00251 00252 KService::Ptr _service; 00253 00254 class KCModuleInfoPrivate; 00255 KCModuleInfoPrivate *d; 00256 00257 }; 00258 00259 #endif // KCMODULEINFO_H 00260 00261 // vim: ts=2 sw=2 et