Salome HOME
dfff4fa71ba20e762e93dd89ebbbf2bfe4319c29
[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
11 class ModuleBase_ModelWidget;
12
13 class QWidget;
14
15 /** 
16 * \ingroup GUI
17 * Interface to WidgetCreator which can create specific widgets by type
18 */
19 class MODULEBASE_EXPORT ModuleBase_IWidgetCreator
20 {
21 public:
22   /// Default constructor
23   ModuleBase_IWidgetCreator();
24
25   /// Virtual destructor
26   ~ModuleBase_IWidgetCreator();
27
28   /// Returns a list of possible widget types, which this creator can process
29   /// \param theTypes
30   virtual const std::set<std::string>& widgetTypes() = 0;
31
32    /// Create widget by its type
33    /// \param theType a type
34    /// \param theParent a parent widget
35   virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType,
36                                                      QWidget* theParent = NULL) = 0;
37 };
38
39
40 #endif