Salome HOME
Issue #1368: Creation of a Qt panel. SamplePanelPlugin feature providing
[modules/shaper.git] / src / SamplePanelPlugin / SamplePanelPlugin_WidgetCreator.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        SamplePanelPlugin_WidgetCreator.h
4 // Created:     29 Mar 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef SamplePanelPlugin_WidgetCreator_H
8 #define SamplePanelPlugin_WidgetCreator_H
9
10 #include "SamplePanelPlugin.h"
11
12 #include <ModuleBase_IWidgetCreator.h>
13
14 #include <string>
15 #include <set>
16
17 class QWidget;
18
19 /** 
20 * \ingroup GUI
21 * Interface to WidgetCreator which can create specific widgets by type
22 */
23 class SamplePanelPlugin_WidgetCreator : public ModuleBase_IWidgetCreator
24 {
25 public:
26   /// Default constructor
27   SamplePanelPlugin_WidgetCreator();
28
29   /// Virtual destructor
30   ~SamplePanelPlugin_WidgetCreator() {}
31
32   /// Returns a container of possible page types, which this creator can process
33   /// \param theTypes a list of type names
34   virtual void panelTypes(std::set<std::string>& theTypes);
35
36   /// Create panel control by its type.
37   /// \param theType a panel type
38   /// \param theParent a parent widget
39   /// \return created widget or null
40   virtual QWidget* createPanelByType(const std::string& theType,
41                                      QWidget* theParent);
42 private:
43   std::set<std::string> myPanelTypes; /// types of panels
44 };
45
46 typedef std::shared_ptr<SamplePanelPlugin_WidgetCreator> SamplePanelWidgetCreatorPtr;
47
48 #endif