Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom into Dev_0.7.1
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetFactory.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 /*
4  * ModuleBase_WidgetFactory.h
5  *
6  *  Created on: Apr 3, 2014
7  *      Author: sbh
8  */
9
10 #ifndef ModuleBase_WidgetFactory_H_
11 #define ModuleBase_WidgetFactory_H_
12
13 #include "ModuleBase.h"
14 #include "ModuleBase_ModelWidget.h"
15
16 #include <QString>
17 #include <QList>
18
19 class QObject;
20 class QWidget;
21 class Config_WidgetAPI;
22 class ModuleBase_IWorkshop;
23
24 class MODULEBASE_EXPORT ModuleBase_WidgetFactory
25 {
26  public:
27   ModuleBase_WidgetFactory(const std::string& theXmlRepresentation,
28                            ModuleBase_IWorkshop* theWorkshop);
29   virtual ~ModuleBase_WidgetFactory();
30
31   void createWidget(QWidget* theParent);
32
33   QList<ModuleBase_ModelWidget*> getModelWidgets() const
34   {
35     return myModelWidgets;
36   }
37
38  protected:
39   //Widgets
40   QWidget* createWidgetByType(const std::string& theType, QWidget* theParent = NULL);
41   QWidget* createContainer(const std::string& theType, QWidget* theParent = NULL);
42   QWidget* labelControl(QWidget* theParent);
43   QWidget* doubleSpinBoxControl(QWidget* theParent);
44   QWidget* doubleValueEditor(QWidget* theParent);
45   QWidget* shapeSelectorControl(QWidget* theParent);
46   QWidget* booleanControl(QWidget* theParent);
47   QWidget* fileSelectorControl(QWidget* theParent);
48   QWidget* choiceControl(QWidget* theParent);
49   QWidget* lineEditControl(QWidget* theParent);
50   QWidget* multiSelectorControl(QWidget* theParent);
51
52
53   QString qs(const std::string& theStdString) const;
54
55  private:
56   Config_WidgetAPI* myWidgetApi;
57   ModuleBase_IWorkshop* myWorkshop;
58
59   QList<ModuleBase_ModelWidget*> myModelWidgets;
60   std::string myParentId;
61 };
62
63 #endif /* ModuleBase_WidgetFactory_H_ */