Salome HOME
Update classes documentation
[modules/shaper.git] / src / ModuleBase / ModuleBase_IWidgetCreator.h
index d544ecfe70f69951e18e2c5c71bca55f3e495191..b3018f044aa2f9fd30f0dfa69ebcd4bf9f537ab3 100755 (executable)
@@ -5,10 +5,17 @@
 
 #include "ModuleBase.h"
 
+#include "ModelAPI_Feature.h"
+
 #include <set>
 #include <string>
+#include <memory>
 
 class ModuleBase_ModelWidget;
+class ModuleBase_PageBase;
+class ModuleBase_IWorkshop;
+
+class Config_WidgetAPI;
 
 class QWidget;
 
@@ -25,15 +32,49 @@ public:
   /// Virtual destructor
   ~ModuleBase_IWidgetCreator();
 
-  /// Returns a list of possible widget types, which this creator can process
-  /// \param theTypes
-  virtual const std::set<std::string>& widgetTypes() = 0;
+  /// Returns a container of possible page types, which this creator can process
+  /// The default implementation is empty
+  /// \param theTypes a list of type names
+  virtual void panelTypes(std::set<std::string>& theTypes) {}
+
+  /// Returns a container of possible page types, which this creator can process
+  /// The default implementation is empty
+  /// \param theTypes a list of type names
+  virtual void pageTypes(std::set<std::string>& theTypes) {}
+
+  /// Returns a container of possible widget types, which this creator can process
+  /// \param theTypes a list of type names
+  virtual void widgetTypes(std::set<std::string>& theTypes) {}
+
+  /// Create panel control by its type.
+  /// The default implementation is empty
+  /// \param theType a panel type
+  /// \param theParent a parent widget
+  /// \param theFeature a feature modified in the panel
+  /// \return created widget or null
+  virtual QWidget* createPanelByType(const std::string& theType,
+                                     QWidget* theParent,
+                                     const FeaturePtr& theFeature);
+
+  /// Create page by its type
+  /// The default implementation is empty
+  /// \param theType a type
+  /// \param theParent a parent widget
+  /// \param theWidgetApi a low-level API for reading xml definitions of widgets
+  virtual ModuleBase_PageBase* createPageByType(const std::string& theType,
+                                                QWidget* theParent,
+                                                Config_WidgetAPI* theWidgetApi);
 
-   /// Create widget by its type
-   /// \param theType a type
-   /// \param theParent a parent widget
+  /// Create widget by its type
+  /// The default implementation is empty
+  /// \param theType a type
+  /// \param theParent a parent widget
+  /// \param theWidgetApi a low-level API for reading xml definitions of widgets
+  /// \param theWorkshop a workshop class instance
   virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType,
-                                                     QWidget* theParent = NULL) = 0;
+                                                     QWidget* theParent,
+                                                     Config_WidgetAPI* theWidgetApi,
+                                                     ModuleBase_IWorkshop* theWorkshop);
 };
 
 typedef std::shared_ptr<ModuleBase_IWidgetCreator> WidgetCreatorPtr;