KDECore
kplugininfo.h
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright (C) 2003,2007 Matthias Kretz <kretz@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 00018 */ 00019 00020 #ifndef KDECORE_KPLUGININFO_H 00021 #define KDECORE_KPLUGININFO_H 00022 00023 #include <QtCore/QExplicitlySharedDataPointer> 00024 #include <QtCore/QString> 00025 #include <QtCore/QMap> 00026 #include <QtCore/QStringList> 00027 00028 #include <kconfiggroup.h> 00029 #include <kservice.h> 00030 #include <kaboutdata.h> 00031 #include <QtCore/QList> 00032 00033 class KPluginInfoPrivate; 00034 00043 class KDECORE_EXPORT KPluginInfo 00044 { 00045 public: 00046 typedef QList<KPluginInfo> List; 00047 00084 explicit KPluginInfo( const QString & filename, const char* resource = 0 ); 00085 00112 explicit KPluginInfo( const KService::Ptr service ); 00113 00119 KPluginInfo(); 00120 00121 ~KPluginInfo(); 00122 00131 static KPluginInfo::List fromServices(const KService::List &services, const KConfigGroup &config = KConfigGroup()); 00132 00142 static KPluginInfo::List fromFiles(const QStringList &files, const KConfigGroup &config = KConfigGroup()); 00143 00152 static KPluginInfo::List fromKPartsInstanceName(const QString &componentName, const KConfigGroup &config = KConfigGroup()); 00153 00157 bool isHidden() const; 00158 00165 void setPluginEnabled(bool enabled); 00166 00173 bool isPluginEnabled() const; 00174 00180 bool isPluginEnabledByDefault() const; 00181 00187 QVariant property( const QString & key ) const; 00188 00192 QString name() const; 00193 00197 QString comment() const; 00198 00202 QString icon() const; 00203 00207 QString entryPath() const; 00208 00212 QString author() const; 00213 00217 QString email() const; 00218 00222 QString category() const; 00223 00228 QString pluginName() const; 00229 00233 QString version() const; 00234 00238 QString website() const; 00239 00240 00244 QString license() const; 00245 00258 KAboutLicense fullLicense() const; 00259 00264 QStringList dependencies() const; 00265 00275 KService::Ptr service() const; 00276 00281 QList<KService::Ptr> kcmServices() const; 00282 00288 void setConfig(const KConfigGroup &config); 00289 00294 KConfigGroup config() const; 00295 00302 void save(KConfigGroup config = KConfigGroup()); 00303 00310 void load(const KConfigGroup &config = KConfigGroup()); 00311 00315 void defaults(); 00316 00321 bool isValid() const; 00322 00326 KPluginInfo(const KPluginInfo ©); 00327 00331 KPluginInfo &operator=(const KPluginInfo &rhs); 00332 00336 bool operator==(const KPluginInfo &rhs) const; 00337 00341 bool operator!=(const KPluginInfo &rhs) const; 00342 00346 bool operator<(const KPluginInfo &rhs) const; 00347 00351 bool operator>(const KPluginInfo &rhs) const; 00352 00353 private: 00354 friend KDECORE_EXPORT uint qHash(const KPluginInfo &); 00355 QExplicitlySharedDataPointer<KPluginInfoPrivate> d; 00356 }; 00357 00358 KDECORE_EXPORT uint qHash(const KPluginInfo &); 00359 00360 #endif // KDECORE_KPLUGININFO_H