Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[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,
26                            ModuleBase_IWorkshop* theWorkshop);
27   virtual ~ModuleBase_WidgetFactory();
28
29   void createWidget(QWidget* theParent);
30
31   QList<ModuleBase_ModelWidget*> getModelWidgets() const
32   {
33     return myModelWidgets;
34   }
35
36  protected:
37   //Widgets
38   QWidget* createWidgetByType(const std::string& theType, QWidget* theParent = NULL);
39   QWidget* createContainer(const std::string& theType, QWidget* theParent = NULL);
40   QWidget* labelControl(QWidget* theParent);
41   QWidget* doubleSpinBoxControl(QWidget* theParent);
42   QWidget* pointSelectorControl(QWidget* theParent);
43   QWidget* featureSelectorControl(QWidget* theParent);
44   QWidget* featureOrAttributeSelectorControl(QWidget* theParent);
45   QWidget* doubleValueEditor(QWidget* theParent);
46   QWidget* shapeSelectorControl(QWidget* theParent);
47   QWidget* booleanControl(QWidget* theParent);
48   QWidget* point2dDistanceControl(QWidget* theParent);
49   QWidget* fileSelectorControl(QWidget* theParent);
50   QWidget* choiceControl(QWidget* theParent);
51
52   QString qs(const std::string& theStdString) const;
53
54  private:
55   Config_WidgetAPI* myWidgetApi;
56   ModuleBase_IWorkshop* myWorkshop;
57
58   QList<ModuleBase_ModelWidget*> myModelWidgets;
59   std::string myParentId;
60 };
61
62 #endif /* ModuleBase_WidgetFactory_H_ */