00001 #ifndef BALL_PLUGIN_PLUGINHANDLER_H 00002 #define BALL_PLUGIN_PLUGINHANDLER_H 00003 00004 #include <list> 00005 #include <QtCore/QReadWriteLock> 00006 00007 namespace BALL 00008 { 00009 class BALLPlugin; 00010 00022 class PluginHandler 00023 { 00024 public: 00028 virtual ~PluginHandler(); 00029 00038 virtual bool canHandle(BALLPlugin* plugin) const = 0; 00039 00050 bool startPlugin(BALLPlugin* plugin); 00051 00059 bool stopPlugin(BALLPlugin* plugin); 00060 00067 virtual bool isRunning(BALLPlugin* plugin) const; 00068 00069 protected: 00079 virtual bool specificSetup_(BALLPlugin* plugin) = 0; 00080 00090 virtual bool specificShutdown_(BALLPlugin* plugin) = 0; 00091 00092 private: 00093 mutable QReadWriteLock mutex_; 00094 std::list<BALLPlugin*> running_plugins_; 00095 }; 00096 } 00097 00098 #endif //BALL_PLUGIN_PLUGINHANDLER_H 00099