X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetCreatorFactory.h;h=98f4d211d1b514d8f5d6f83e70766e6da8f1b0b0;hb=e48efe1ec56a7d7e0d8a57fc05f8220b846ea995;hp=40db320086f97470c398c924a2febeee4522331c;hpb=eaedfec1bd44832c5c1b75265a034d5b79340420;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.h b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.h index 40db32008..98f4d211d 100755 --- a/src/ModuleBase/ModuleBase_WidgetCreatorFactory.h +++ b/src/ModuleBase/ModuleBase_WidgetCreatorFactory.h @@ -17,6 +17,8 @@ #include class ModuleBase_ModelWidget; +class ModuleBase_PageBase; +class ModuleBase_IWorkshop; class QWidget; @@ -38,18 +40,36 @@ class MODULEBASE_EXPORT ModuleBase_WidgetCreatorFactory /// \param theCreator a new widget creator void registerCreator(const WidgetCreatorPtr& theCreator); + /// Returns true if there is a creator, which can make a page by the type + /// \param theType a type + bool hasPageWidget(const std::string& theType); + + /// Create page by its type + /// \param theType a type + /// \param theParent a parent widget + ModuleBase_PageBase* createPageByType(const std::string& theType, + QWidget* theParent, + Config_WidgetAPI* theWidgetApi, + std::string theParentId); + /// Create widget by its type /// \param theType a type /// \param theParent a parent widget ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, - QWidget* theParent = NULL); + QWidget* theParent, + Config_WidgetAPI* theWidgetApi, + std::string theParentId, + ModuleBase_IWorkshop* theWorkshop); private: /// Constructor is hidden ModuleBase_WidgetCreatorFactory(); - /// List of created model widgets - QMap myModelWidgets; + /// Map of widget type in XML to creator + QMap myCreators; + + /// Map of widget page in XML to creator + QMap myPageToCreator; }; typedef std::shared_ptr WidgetCreatorFactoryPtr;