Salome HOME
Merge branch 'Dev_2.1.0' of salome:modules/shaper into Dev_2.1.0
[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 ModuleBase_IWorkshop;
13 class QWidget;
14
15 /** 
16 * \ingroup GUI
17 * Interface to WidgetCreator which can create specific widgets by type
18 */
19 class SketchShapePlugin_WidgetCreator : public ModuleBase_IWidgetCreator
20 {
21 public:
22   /// Default constructor
23   SketchShapePlugin_WidgetCreator();
24
25   /// Virtual destructor
26   ~SketchShapePlugin_WidgetCreator() {}
27
28   /// Returns a container of possible page types, which this creator can process
29   /// \returns types
30   virtual const std::set<std::string>& pageTypes();
31
32   /// Returns a list of possible widget types, which this creator can process
33   /// \returns types
34   virtual const std::set<std::string>& widgetTypes();
35
36   /// Create page by its type
37   /// \param theType a type
38   /// \param theParent a parent widget
39   virtual ModuleBase_PageBase* createPageByType(const std::string& theType,
40                                                 QWidget* theParent,
41                                                 Config_WidgetAPI* theWidgetApi,
42                                                 std::string theParentId);
43
44   /// Create widget by its type
45   /// \param theType a type
46   /// \param theParent a parent widget
47   virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType,
48                                                      QWidget* theParent,
49                                                      Config_WidgetAPI* theWidgetApi,
50                                                      std::string theParentId,
51                                                      ModuleBase_IWorkshop* theWorkshop);
52
53 private:
54   std::set<std::string> myPages; /// types of pages
55   std::set<std::string> myWidgets; /// types of widgets
56 };
57
58 typedef std::shared_ptr<SketchShapePlugin_WidgetCreator> SketchShapePlguinWidgetCreatorPtr;
59
60 #endif