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
34 /// \param theTypes a list of type names
35 virtual void panelTypes(std::set<std::string>& theTypes) {}
37 /// Returns a container of possible page types, which this creator can process
38 /// \param a list of type names
39 virtual void pageTypes(std::set<std::string>& theTypes) {}
41 /// Returns a container of possible widget types, which this creator can process
42 /// \param a list of type names
43 virtual void widgetTypes(std::set<std::string>& theTypes) {}
45 /// Create panel control by its type.
46 /// \param theType a panel type
47 /// \param theParent a parent widget
48 /// \return created widget or null
49 virtual QWidget* createPanelByType(const std::string& theType,
52 /// Create page by its type
53 /// \param theType a type
54 /// \param theParent a parent widget
55 /// \param theData a low-level API for reading xml definitions of widgets
56 virtual ModuleBase_PageBase* createPageByType(const std::string& theType,
58 Config_WidgetAPI* theWidgetApi);
60 /// Create widget by its type
61 /// \param theType a type
62 /// \param theParent a parent widget
63 /// \param theData a low-level API for reading xml definitions of widgets
64 virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType,
66 Config_WidgetAPI* theWidgetApi,
67 ModuleBase_IWorkshop* theWorkshop);
70 typedef std::shared_ptr<ModuleBase_IWidgetCreator> WidgetCreatorPtr;