Salome HOME
Construction of vertices/edges/faces on the base of sketch: Widget Creator Factory
[modules/shaper.git] / src / SketchShapePlugin / SketchShapePlugin_WidgetCreator.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 #ifndef SketchShapePlugin_WidgetCreator_H
4 #define SketchShapePlugin_WidgetCreator_H
5
6 #include <ModuleBase_IWidgetCreator.h>
7
8 #include <string>
9 #include <set>
10
11 class ModuleBase_ModelWidget;
12 class QWidget;
13
14 /** 
15 * \ingroup GUI
16 * Interface to WidgetCreator which can create specific widgets by type
17 */
18 class SketchShapePlugin_WidgetCreator : public ModuleBase_IWidgetCreator
19 {
20 public:
21   /// Default constructor
22   SketchShapePlugin_WidgetCreator();
23
24   /// Virtual destructor
25   ~SketchShapePlugin_WidgetCreator() {}
26
27   /// Returns a list of possible widget types, which this creator can process
28   /// \return theTypes
29   virtual const std::set<std::string>& widgetTypes();
30
31   /// Create widget by its type
32   /// \param theType a type
33   /// \param theParent a parent widget
34   virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType,
35                                                      QWidget* theParent = NULL);
36
37 private:
38   std::set<std::string> myTypes; /// types of widgets
39 };
40
41 typedef std::shared_ptr<SketchShapePlugin_WidgetCreator> SketchShapePlguinWidgetCreatorPtr;
42
43 #endif