Salome HOME
7d3e734b493e2f81b23f0a126d725fcdd24f6664
[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 container of possible page types, which this creator can process
28   /// \returns types
29   virtual const std::set<std::string>& pageTypes();
30
31   /// Returns a list of possible widget types, which this creator can process
32   /// \returns types
33   virtual const std::set<std::string>& widgetTypes();
34
35   /// Create page by its type
36   /// \param theType a type
37   /// \param theParent a parent widget
38   virtual ModuleBase_PageBase* createPageByType(const std::string& theType,
39                                                 QWidget* theParent);
40
41   /// Create widget by its type
42   /// \param theType a type
43   /// \param theParent a parent widget
44   virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType,
45                                                      QWidget* theParent = NULL);
46
47 private:
48   std::set<std::string> myPages; /// types of pages
49   std::set<std::string> myTypes; /// types of widgets
50 };
51
52 typedef std::shared_ptr<SketchShapePlugin_WidgetCreator> SketchShapePlguinWidgetCreatorPtr;
53
54 #endif