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 main widget of the property panel, which children will be created
54 /// by WidgetFactory using the XML definition
55 ModuleBase_PageBase* contentWidget();
57 /// Brings back all widget created by widget factory for signal/slot
58 /// connections and further processing
59 void setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets);
61 /// Returns all property panel's widget created by WidgetFactory
62 virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const;
64 /// Removes all widgets in the widget area of the property panel
67 /// Returns currently active widget
68 virtual ModuleBase_ModelWidget* activeWidget() const { return myActiveWidget; }
70 /// Activate the next widget in the property panel
71 /// \param theWidget a widget. The next widget should be activated
72 virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget);
74 /// Activate the next from current widget in the property panel
75 virtual void activateNextWidget();
77 /// Set Enable/Disable state of Cancel button
78 /// \param theEnabled Enable/Disable state of Cancel button
79 virtual void setCancelEnabled(bool theEnabled);
81 /// \return Enable/Disable state of Cancel button
82 virtual bool isCancelEnabled() const;
84 /// Editing mode depends on mode of current operation. This value is defined by it.
85 /// \param isEditing state of editing mode flag
86 virtual void setEditingMode(bool isEditing);
88 //! Allows to set predefined actions for the property panel fetched from the ActionsMgr
89 void setupActions(XGUI_ActionsMgr* theMgr);
93 /// \brief Update all widgets in property panel with values from the given feature
94 /// \param theFeature a Feature to update values in widgets
95 void updateContentWidget(FeaturePtr theFeature);
98 * Makes the given widget active, highlights it and removes
99 * highlighting from the previous active widget
100 * emits widgetActivated(theWidget) signal
101 * \param theWidget which has to be activated
103 virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
106 ModuleBase_PageWidget* myPanelPage;
107 QList<ModuleBase_ModelWidget*> myWidgets;
109 /// Currently active widget
110 ModuleBase_ModelWidget* myActiveWidget;
113 #endif /* XGUI_PROPERTYPANEL_H_ */