X-Git-Url: http://git.maemo.org/git/?p=qtrapids;a=blobdiff_plain;f=src%2Fplugins%2FPluginInterface.h;fp=src%2Fplugins%2FPluginInterface.h;h=d5ed6c81f5188c417637d8701138334c88fbbd69;hp=33cd4912383a989a1878aa26a58335ace0896870;hb=5032546701da06d7307fc543d74be93e5319c350;hpb=d843508b9e84901695a6f72152d5366ebd957ad6 diff --git a/src/plugins/PluginInterface.h b/src/plugins/PluginInterface.h index 33cd491..d5ed6c8 100644 --- a/src/plugins/PluginInterface.h +++ b/src/plugins/PluginInterface.h @@ -21,7 +21,8 @@ #define PLUGININTERFACE_H #include -#include +#include +//#include namespace qtrapids { @@ -44,23 +45,37 @@ namespace qtrapids enum PluginWidgetType { BASE_WIDGET, TAB_PAGE, - UNKNOWN + UNKNOWN_TYPE + }; + + /// @enum PluginRequest for requesting host application functionality + /// E.g. open torrent file etc. + /// @todo Additional functionality request constants. + enum PluginRequest { + OPEN_FILE, + UNKNOWN_REQUEST }; /// @brief Sets the plugin GUI element to host application /// @note It is up to the host application to decide how to manage /// and show the actual widget. - virtual bool setGui(QWidget* widget, PluginWidgetType type = UNKNOWN) = 0; + virtual bool setGui(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE) = 0; /// @brief Adds additional plugin wigdets to the host application. /// This functio can be called by the plugin recursively, i.e. when GUI events occur /// The host application must handle placing the additional widgets. /// @todo Could we implement this using in a more manageable way, e.g. signal-slot? - virtual void addPluginWidget(QWidget* widget, PluginWidgetType type = UNKNOWN) = 0; - virtual void addToolbar(QWidget* widget, PluginWidgetType type = UNKNOWN) = 0; - virtual void addToolItem(QWidget* widget, PluginWidgetType type = UNKNOWN) = 0; - virtual void addMenu(QWidget* widget, PluginWidgetType type = UNKNOWN) = 0; - virtual void addMenuItem(QWidget* widget, PluginWidgetType type = UNKNOWN) = 0; + virtual void addPluginWidget(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE) = 0; + virtual void addToolbar(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE) = 0; + virtual void addToolItem(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE) = 0; + virtual void addMenu(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE) = 0; + virtual void addMenuItem(QWidget* widget, PluginWidgetType type = UNKNOWN_TYPE) = 0; + + /// @brief Plugin can request to host application functionality. + /// Host application defines the service policy for plugin requests. + /// @todo Sending events would benefit from Qt signal, how to define + /// signal in an abstract interface? + virtual bool eventRequest(QVariant param, PluginRequest req = UNKNOWN_REQUEST) = 0; };