]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_PropertyPanel.h
Salome HOME
Merge branch 'BR_PYTHON_PLUGIN' of newgeom:newgeom.git into Dev_0.6.1
[modules/shaper.git] / src / XGUI / XGUI_PropertyPanel.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 /*
4  * XGUI_PropertyPanel.h
5  *
6  *  Created on: Apr 29, 2014
7  *      Author: sbh
8  */
9
10 #ifndef XGUI_PROPERTYPANEL_H_
11 #define XGUI_PROPERTYPANEL_H_
12
13 #include "XGUI.h"
14
15 #include <ModuleBase_ModelWidget.h>
16 #include <ModuleBase_IPropertyPanel.h>
17
18 #include <QList>
19
20 class QKeyEvent;
21 class QVBoxLayout;
22
23 const static char* PROP_PANEL = "property_panel_dock";
24 const static char* PROP_PANEL_OK = "property_panel_ok";
25 const static char* PROP_PANEL_CANCEL = "property_panel_cancel";
26
27 class XGUI_EXPORT XGUI_PropertyPanel : public ModuleBase_IPropertyPanel
28 {
29 Q_OBJECT
30  public:
31
32
33   XGUI_PropertyPanel(QWidget* theParent);
34   virtual ~XGUI_PropertyPanel();
35
36   /// Returns main widget of the property panel, which children will be created
37   /// by WidgetFactory using the XML definition
38   QWidget* contentWidget();
39
40   /// Brings back all widget created by widget factory for signal/slot
41   /// connections and further processing
42   void setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets);
43
44   /// Returns all property panel's widget created by WidgetFactory
45   virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const;
46
47   /// Removes all widgets in the widget area of the property panel
48   void cleanContent();
49
50   /// Returns currently active widget
51   virtual ModuleBase_ModelWidget* activeWidget() const { return myActiveWidget; }
52
53   /// Activate the next widget in the property panel
54   /// \param theWidget a widget. The next widget should be activated
55   virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget);
56
57   /// Activate the next from current widget in the property panel
58   virtual void activateNextWidget();
59
60   void setStretchEnabled(bool isEnabled);
61
62   /// Set Enable/Disable state of Ok button
63   virtual void setOkEnabled(bool theEnabled);
64
65   /// Returns state of Ok button
66   virtual bool isOkEnabled() const;
67
68   /// Set Enable/Disable state of Ok button
69   virtual void setCancelEnabled(bool theEnabled);
70
71   /// Returns state of Ok button
72   virtual bool isCancelEnabled() const;
73
74  public slots:
75   void updateContentWidget(FeaturePtr theFeature);
76   // Enables / disables "ok" ("accept") button
77   void setAcceptEnabled(bool);
78
79   // Makes the given widget active, highlights it and removes
80   // highlighting from the previous active widget
81   // emits widgetActivated(theWidget) signal
82   virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
83
84  signals:
85   /// Signal about the point 2d set to the feature
86   /// \param the feature
87   /// \param the attribute of the feature
88   //void storedPoint2D(ObjectPtr theFeature, const std::string& theAttribute);
89
90
91  private:
92   QWidget* myCustomWidget;
93   QList<ModuleBase_ModelWidget*> myWidgets;
94   QVBoxLayout* myMainLayout;
95   ModuleBase_ModelWidget* myActiveWidget;
96 };
97
98 #endif /* XGUI_PROPERTYPANEL_H_ */