libqutim 0.3.1.0
|
00001 /**************************************************************************** 00002 ** 00003 ** qutIM - instant messenger 00004 ** 00005 ** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru> 00006 ** 00007 ***************************************************************************** 00008 ** 00009 ** $QUTIM_BEGIN_LICENSE$ 00010 ** This program is free software: you can redistribute it and/or modify 00011 ** it under the terms of the GNU General Public License as published by 00012 ** the Free Software Foundation, either version 3 of the License, or 00013 ** (at your option) any later version. 00014 ** 00015 ** This program is distributed in the hope that it will be useful, 00016 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00018 ** See the GNU General Public License for more details. 00019 ** 00020 ** You should have received a copy of the GNU General Public License 00021 ** along with this program. If not, see http://www.gnu.org/licenses/. 00022 ** $QUTIM_END_LICENSE$ 00023 ** 00024 ****************************************************************************/ 00025 00026 #ifndef EXTENSIONINFO_H 00027 #define EXTENSIONINFO_H 00028 00029 #include "personinfo.h" 00030 #include "extensionicon.h" 00031 #include "objectgenerator.h" 00032 #include <QMetaType> 00033 #include <QtGui/QIcon> 00034 00035 namespace qutim_sdk_0_3 00036 { 00037 class ExtensionInfoData; 00038 00039 class LIBQUTIM_EXPORT ExtensionInfo 00040 { 00041 public: 00042 ExtensionInfo(const LocalizedString &name = LocalizedString(), 00043 const LocalizedString &description = LocalizedString(), 00044 const ObjectGenerator *generator = 0, ExtensionIcon icon = ExtensionIcon()); 00045 ExtensionInfo(const ExtensionInfo &other); 00046 ~ExtensionInfo(); 00047 ExtensionInfo &operator =(const ExtensionInfo &other); 00048 ExtensionInfo &setName(const LocalizedString &name); 00049 ExtensionInfo &setDescription(const LocalizedString &description); 00050 ExtensionInfo &setIcon(const ExtensionIcon &icon); 00051 ExtensionInfo &setGenerator(const ObjectGenerator *generator); 00052 QList<PersonInfo> authors() const; 00053 LocalizedString name() const; 00054 LocalizedString description() const; 00055 const ObjectGenerator *generator() const; 00056 ExtensionIcon icon() const; 00057 private: 00058 QSharedDataPointer<ExtensionInfoData> d; 00059 public: 00060 typedef ExtensionInfoData Data; 00061 Data *data() const; 00062 }; 00063 00064 typedef QList<ExtensionInfo> ExtensionInfoList; 00065 00066 LIBQUTIM_EXPORT ExtensionInfoList extensionList(); 00067 00068 // TODO: Add possibility for getting ExtensionInfoList of avalaible modules 00069 // 00070 // LIBQUTIM_EXPORT ExtensionInfoList extensionList(const QMetaObject *module); 00071 // LIBQUTIM_EXPORT ExtensionInfoList extensionList(const char *iid); 00072 // template<typename T> inline ExtensionInfoList extensionList(const QObject *) 00073 // { return moduleGenerators(&T::staticMetaObject); } 00074 // template<typename T> inline ExtensionInfoList extensionList(const void *) 00075 // { return moduleGenerators(qobject_interface_iid<T *>()); } 00076 // template<typename T> inline ExtensionInfoList moduleGenerators() 00077 // { return extensionList<T>(reinterpret_cast<T *>(0)); } 00078 } 00079 00080 Q_DECLARE_METATYPE(qutim_sdk_0_3::ExtensionInfo) 00081 00082 #endif // EXTENSIONINFO_H 00083