Salome HOME
f8f67a6e4afb9b488cbeefdd150376d07f90120b
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetFactory.h
1 /*
2  * ModuleBase_WidgetFactory.h
3  *
4  *  Created on: Apr 3, 2014
5  *      Author: sbh
6  */
7
8 #ifndef ModuleBase_WidgetFactory_H_
9 #define ModuleBase_WidgetFactory_H_
10
11 #include "ModuleBase.h"
12 #include "ModuleBase_ModelWidget.h"
13
14 #include <QString>
15 #include <QList>
16
17 class QObject;
18 class QWidget;
19 class Config_WidgetAPI;
20 class ModuleBase_IWorkshop;
21
22 class MODULEBASE_EXPORT ModuleBase_WidgetFactory
23 {
24 public:
25   ModuleBase_WidgetFactory(const std::string& theXmlRepresentation, ModuleBase_IWorkshop* theWorkshop);
26   virtual ~ModuleBase_WidgetFactory();
27
28   void createWidget(QWidget* theParent);
29
30   QList<ModuleBase_ModelWidget*> getModelWidgets() const
31   {
32     return myModelWidgets;
33   }
34
35 protected:
36   //Widgets
37   QWidget* createWidgetByType(const std::string& theType, QWidget* theParent = NULL);
38   QWidget* labelControl(QWidget* theParent);
39   QWidget* doubleSpinBoxControl(QWidget* theParent);
40   QWidget* pointSelectorControl(QWidget* theParent);
41   QWidget* createContainer(const std::string& theType, QWidget* theParent = NULL);
42   QWidget* selectorControl(QWidget* theParent);
43   QWidget* booleanControl(QWidget* theParent);
44   QWidget* point2dDistanceControl(QWidget* theParent);
45
46   QString qs(const std::string& theStdString) const;
47
48 private:
49   Config_WidgetAPI* myWidgetApi;
50   ModuleBase_IWorkshop*   myWorkshop;
51
52   QList<ModuleBase_ModelWidget*> myModelWidgets;
53 };
54
55 #endif /* ModuleBase_WidgetFactory_H_ */