1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #ifndef ModuleBase_IWidgetCreator_H
4 #define ModuleBase_IWidgetCreator_H
6 #include "ModuleBase.h"
12 class ModuleBase_ModelWidget;
13 class ModuleBase_PageBase;
14 class ModuleBase_IWorkshop;
16 class Config_WidgetAPI;
22 * Interface to WidgetCreator which can create specific widgets by type
24 class MODULEBASE_EXPORT ModuleBase_IWidgetCreator
27 /// Default constructor
28 ModuleBase_IWidgetCreator();
30 /// Virtual destructor
31 ~ModuleBase_IWidgetCreator();
33 /// Returns a container of possible page types, which this creator can process
35 virtual const std::set<std::string>& pageTypes() = 0;
37 /// Returns a container of possible widget types, which this creator can process
39 virtual const std::set<std::string>& widgetTypes() = 0;
41 /// Create page by its type
42 /// \param theType a type
43 /// \param theParent a parent widget
44 virtual ModuleBase_PageBase* createPageByType(const std::string& theType,
46 Config_WidgetAPI* theWidgetApi,
47 std::string theParentId) = 0;
49 /// Create widget by its type
50 /// \param theType a type
51 /// \param theParent a parent widget
52 virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType,
54 Config_WidgetAPI* theWidgetApi,
55 std::string theParentId,
56 ModuleBase_IWorkshop* theWorkshop) = 0;
59 typedef std::shared_ptr<ModuleBase_IWidgetCreator> WidgetCreatorPtr;