]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModuleBase/ModuleBase_IWidgetCreator.h
Salome HOME
Correction for Linux compilation
[modules/shaper.git] / src / ModuleBase / ModuleBase_IWidgetCreator.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 #ifndef ModuleBase_IWidgetCreator_H
4 #define ModuleBase_IWidgetCreator_H
5
6 #include "ModuleBase.h"
7
8 #include <set>
9 #include <string>
10 #include <memory>
11
12 class ModuleBase_ModelWidget;
13
14 class QWidget;
15
16 /** 
17 * \ingroup GUI
18 * Interface to WidgetCreator which can create specific widgets by type
19 */
20 class MODULEBASE_EXPORT ModuleBase_IWidgetCreator
21 {
22 public:
23   /// Default constructor
24   ModuleBase_IWidgetCreator();
25
26   /// Virtual destructor
27   ~ModuleBase_IWidgetCreator();
28
29   /// Returns a list of possible widget types, which this creator can process
30   /// \param theTypes
31   virtual const std::set<std::string>& widgetTypes() = 0;
32
33    /// Create widget by its type
34    /// \param theType a type
35    /// \param theParent a parent widget
36   virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType,
37                                                      QWidget* theParent = NULL) = 0;
38 };
39
40 typedef std::shared_ptr<ModuleBase_IWidgetCreator> WidgetCreatorPtr;
41
42
43 #endif