BALLPlugin.h

Go to the documentation of this file.
00001 #ifndef BALL_PLUGIN_BALLPLUGIN_H
00002 #define BALL_PLUGIN_BALLPLUGIN_H
00003 
00004 #ifndef BALL_COMMON_GLOBAL_H
00005 # include <BALL/COMMON/global.h>
00006 #endif
00007 
00008 #include <QtCore/QString>
00009 #include <QtCore/QtPlugin>
00010 #include <QtCore/QVariant>
00011 
00012 class QPixmap;
00013 class QDialog;
00014 
00015 namespace BALL
00016 {
00017 
00018   class PluginHandler;
00019 
00020   class BALL_EXPORT BALLPlugin
00021   {
00022     public:
00023       virtual ~BALLPlugin() {}
00024 
00030       virtual QString getName() const = 0;
00031 
00037       virtual QString getDescription() const = 0;
00038 
00044       virtual bool isActive() = 0;
00045 
00051       virtual bool activate() = 0;
00052 
00058       virtual bool deactivate() = 0;
00059   };
00060 }
00061 
00062 template<typename T>
00063 T qobject_cast(BALL::BALLPlugin* plugin)
00064 {
00065   return qobject_cast<T>(dynamic_cast<QObject*>(plugin));
00066 }
00067 
00068 Q_DECLARE_METATYPE(BALL::BALLPlugin*)
00069 Q_DECLARE_INTERFACE(BALL::BALLPlugin, "org.ball-project.Plugin.BALLPlugin/1.0")
00070 
00071 #endif //BALL_PLUGIN_BALLPLUGIN_H
00072