00001 #ifndef BALL_PLUGIN_PLUGINHANDLER_H 00002 #define BALL_PLUGIN_PLUGINHANDLER_H 00003 00004 00005 #ifndef BALL_COMMON_GLOBAL_H 00006 # include <BALL/COMMON/global.h> 00007 #endif 00008 00009 #include <list> 00010 #include <QtCore/QReadWriteLock> 00011 00012 namespace BALL 00013 { 00014 class BALLPlugin; 00015 00027 class BALL_EXPORT PluginHandler 00028 { 00029 public: 00033 virtual ~PluginHandler(); 00034 00043 virtual bool canHandle(BALLPlugin* plugin) const = 0; 00044 00055 bool startPlugin(BALLPlugin* plugin); 00056 00064 bool stopPlugin(BALLPlugin* plugin); 00065 00072 virtual bool isRunning(BALLPlugin* plugin) const; 00073 00074 protected: 00084 virtual bool specificSetup_(BALLPlugin* plugin) = 0; 00085 00095 virtual bool specificShutdown_(BALLPlugin* plugin) = 0; 00096 00097 private: 00098 mutable QReadWriteLock mutex_; 00099 std::list<BALLPlugin*> running_plugins_; 00100 }; 00101 } 00102 00103 #endif //BALL_PLUGIN_PLUGINHANDLER_H 00104