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;
19 * Interface to WidgetCreator which can create specific widgets by type
21 class MODULEBASE_EXPORT ModuleBase_IWidgetCreator
24 /// Default constructor
25 ModuleBase_IWidgetCreator();
27 /// Virtual destructor
28 ~ModuleBase_IWidgetCreator();
30 /// Returns a container of possible page types, which this creator can process
32 virtual const std::set<std::string>& pageTypes() = 0;
34 /// Returns a container of possible widget types, which this creator can process
36 virtual const std::set<std::string>& widgetTypes() = 0;
38 /// Create page by its type
39 /// \param theType a type
40 /// \param theParent a parent widget
41 virtual ModuleBase_PageBase* createPageByType(const std::string& theType,
42 QWidget* theParent) = 0;
44 /// Create widget by its type
45 /// \param theType a type
46 /// \param theParent a parent widget
47 virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType,
48 QWidget* theParent = NULL) = 0;
51 typedef std::shared_ptr<ModuleBase_IWidgetCreator> WidgetCreatorPtr;