1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
6 * Created on: Apr 29, 2014
10 #ifndef XGUI_PROPERTYPANEL_H_
11 #define XGUI_PROPERTYPANEL_H_
15 #include <ModuleBase_ModelWidget.h>
16 #include <ModuleBase_IPropertyPanel.h>
20 class XGUI_ActionsMgr;
23 class ModuleBase_PageBase;
24 class ModuleBase_PageWidget;
26 /// Internal name of property panel widget
27 const static char* PROP_PANEL = "property_panel_dock";
29 /// Internal name of Ok button
30 const static char* PROP_PANEL_OK = "property_panel_ok";
32 /// Internal name of Cancel button
33 const static char* PROP_PANEL_CANCEL = "property_panel_cancel";
35 /// Internal name of Help button
36 const static char* PROP_PANEL_HELP = "property_panel_help";
40 * Realization of Property panel object.
42 class XGUI_EXPORT XGUI_PropertyPanel : public ModuleBase_IPropertyPanel
48 /// \param theParent is a parent of the property panel
49 XGUI_PropertyPanel(QWidget* theParent);
51 virtual ~XGUI_PropertyPanel();
53 /// Returns header widget
54 virtual QWidget* headerWidget() const { return myHeaderWidget; }
56 /// Returns main widget of the property panel, which children will be created
57 /// by WidgetFactory using the XML definition
58 ModuleBase_PageBase* contentWidget();
60 /// Brings back all widget created by widget factory for signal/slot
61 /// connections and further processing
62 void setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets);
64 /// Returns all property panel's widget created by WidgetFactory
65 virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const;
67 /// Removes all widgets in the widget area of the property panel
68 virtual void cleanContent();
70 /// Returns currently active widget
71 virtual ModuleBase_ModelWidget* activeWidget() const { return myActiveWidget; }
73 /// Activate the next widget in the property panel
74 /// \param theWidget a widget. The next widget should be activated
75 virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget);
77 /// Activate the next from current widget in the property panel
78 virtual void activateNextWidget();
80 /// Set Enable/Disable state of Cancel button
81 /// \param theEnabled Enable/Disable state of Cancel button
82 virtual void setCancelEnabled(bool theEnabled);
84 /// \return Enable/Disable state of Cancel button
85 virtual bool isCancelEnabled() const;
87 /// Editing mode depends on mode of current operation. This value is defined by it.
88 /// \param isEditing state of editing mode flag
89 virtual void setEditingMode(bool isEditing);
91 //! Allows to set predefined actions for the property panel fetched from the ActionsMgr
92 void setupActions(XGUI_ActionsMgr* theMgr);
94 /// Returns widget processed by preselection
95 virtual ModuleBase_ModelWidget* preselectionWidget() const;
97 /// Sets widget processed by preselection
98 virtual void setPreselectionWidget(ModuleBase_ModelWidget* theWidget);
102 /// \brief Update all widgets in property panel with values from the given feature
103 /// \param theFeature a Feature to update values in widgets
104 void updateContentWidget(FeaturePtr theFeature);
107 * Makes the given widget active, highlights it and removes
108 * highlighting from the previous active widget
109 * emits widgetActivated(theWidget) signal
110 * \param theWidget which has to be activated
112 virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
115 QWidget* myHeaderWidget;
118 ModuleBase_PageWidget* myPanelPage;
119 QList<ModuleBase_ModelWidget*> myWidgets;
121 /// Currently active widget
122 ModuleBase_ModelWidget* myActiveWidget;
123 /// Currently widget processed by preselection
124 ModuleBase_ModelWidget* myPreselectionWidget;
127 #endif /* XGUI_PROPERTYPANEL_H_ */