Salome HOME
Issue #1348 Creation of a Qt panel: providing additional sample for ModuleBase_ModelW...
[modules/shaper.git] / src / SamplePanelPlugin / SamplePanelPlugin_ModelWidgetCreator.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        SamplePanelPlugin_ModelWidgetCreator.h
4 // Created:     29 Mar 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef SamplePanelPlugin_ModelWidgetCreator_H
8 #define SamplePanelPlugin_ModelWidgetCreator_H
9
10 #include "SamplePanelPlugin.h"
11
12 #include <ModuleBase_IWidgetCreator.h>
13
14 #include <string>
15 #include <set>
16
17 class ModuleBase_IWorkshop;
18 class Config_WidgetAPI;
19 class QWidget;
20
21 /** 
22 * \ingroup GUI
23 * Interface to WidgetCreator which can create specific widgets by type
24 */
25 class SamplePanelPlugin_ModelWidgetCreator : public ModuleBase_IWidgetCreator
26 {
27 public:
28   /// Default constructor
29   SamplePanelPlugin_ModelWidgetCreator();
30
31   /// Virtual destructor
32   ~SamplePanelPlugin_ModelWidgetCreator() {}
33
34   /// Returns a container of possible widget types, which this creator can process
35   /// \param a list of type names
36   virtual void widgetTypes(std::set<std::string>& theTypes);
37
38   /// Create widget by its type
39   /// The default implementation is empty
40   /// \param theType a type
41   /// \param theParent a parent widget
42   /// \param theData a low-level API for reading xml definitions of widgets
43   /// \param theWorkshop a current workshop
44   /// \return a created model widget or null
45   virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType,
46                                                      QWidget* theParent,
47                                                      Config_WidgetAPI* theWidgetApi,
48                                                      ModuleBase_IWorkshop* /*theWorkshop*/);
49 private:
50   std::set<std::string> myModelWidgetTypes; /// types of widgets
51 };
52
53 #endif