]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_PropertyPanel.h
Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom 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  public slots:
63   void updateContentWidget(FeaturePtr theFeature);
64   // Enables / disables "ok" ("accept") button
65   void setAcceptEnabled(bool);
66
67   // Makes the given widget active, highlights it and removes
68   // highlighting from the previous active widget
69   // emits widgetActivated(theWidget) signal
70   virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
71
72  signals:
73   /// Signal about the point 2d set to the feature
74   /// \param the feature
75   /// \param the attribute of the feature
76   //void storedPoint2D(ObjectPtr theFeature, const std::string& theAttribute);
77
78
79  private:
80   QWidget* myCustomWidget;
81   QList<ModuleBase_ModelWidget*> myWidgets;
82   QVBoxLayout* myMainLayout;
83   ModuleBase_ModelWidget* myActiveWidget;
84 };
85
86 #endif /* XGUI_PROPERTYPANEL_H_ */