- Search plugin parses opensearch.xml files and adds them to combobox
[qtrapids] / src / plugins / PluginInterface.h
index d5ed6c8..a5ea554 100644 (file)
@@ -37,8 +37,11 @@ namespace qtrapids
                * that implement the additional functionality
                * @note Implementing plugin host should inherit QObject.
        */
-       class PluginHostInterface {
+       class PluginHostInterface 
+       {
                public:
+                       
+                       
                        /// @enum PluginWidgetType Allows plugin host to differentiate actions 
                        /// when passed as parameter to addWidget(). E.g. Popup a dialog or append tab etc.
                        /// @todo add new types
@@ -85,10 +88,20 @@ namespace qtrapids
                * The host application uses PluginInterface interface for calling the plugins
                * that extend the Host functionality
        */
-       class PluginInterface : public QObject {
+       class PluginInterface : public QObject 
+       {
                public:
+                       
+                       /// @struct Info Used to supply information from the host application to the plugin 
+                       /// for initialization.
+                       struct Info {
+                               Info() : directory("") {} //Constructor
+                               QString directory; ///< directory from which the plugin is loaded
+                               // ...
+                       };
+                       
                        /// @brief Initializes the plugin instance.
-                       virtual void initialize(PluginHostInterface* host) = 0;
+                       virtual void initialize(PluginHostInterface* host, Info info = Info()) = 0;
                        virtual QWidget* getGui() = 0;
        };