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;
24 /// Internal name of property panel widget
25 const static char* PROP_PANEL = "property_panel_dock";
27 /// Internal name of Ok button
28 const static char* PROP_PANEL_OK = "property_panel_ok";
30 /// Internal name of Cancel button
31 const static char* PROP_PANEL_CANCEL = "property_panel_cancel";
33 /// Internal name of Help button
34 const static char* PROP_PANEL_HELP = "property_panel_help";
38 * Realization of Property panel object.
40 class XGUI_EXPORT XGUI_PropertyPanel : public ModuleBase_IPropertyPanel
46 /// \param theParent is a parent of the property panel
47 XGUI_PropertyPanel(QWidget* theParent);
49 virtual ~XGUI_PropertyPanel();
51 /// Returns main widget of the property panel, which children will be created
52 /// by WidgetFactory using the XML definition
53 QWidget* contentWidget();
55 /// Brings back all widget created by widget factory for signal/slot
56 /// connections and further processing
57 void setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets);
59 /// Returns all property panel's widget created by WidgetFactory
60 virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const;
62 /// Removes all widgets in the widget area of the property panel
65 /// Returns currently active widget
66 virtual ModuleBase_ModelWidget* activeWidget() const { return myActiveWidget; }
68 /// Activate the next widget in the property panel
69 /// \param theWidget a widget. The next widget should be activated
70 virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget);
72 /// Activate the next from current widget in the property panel
73 virtual void activateNextWidget();
75 /// \brief Enable/Disable stretch area in the panel
76 void setStretchEnabled(bool isEnabled);
78 /// Set Enable/Disable state of Cancel button
79 /// \param theEnabled Enable/Disable state of Cancel button
80 virtual void setCancelEnabled(bool theEnabled);
82 /// \return Enable/Disable state of Cancel button
83 virtual bool isCancelEnabled() const;
85 /// Editing mode depends on mode of current operation. This value is defined by it.
86 /// \param isEditing state of editing mode flag
87 virtual void setEditingMode(bool isEditing);
89 //! Allows to set predefined actions for the property panel fetched from the ActionsMgr
90 void setupActions(XGUI_ActionsMgr* theMgr);
94 /// \brief Update all widgets in property panel with values from the given feature
95 /// \param theFeature a Feature to update values in widgets
96 void updateContentWidget(FeaturePtr theFeature);
99 * Makes the given widget active, highlights it and removes
100 * highlighting from the previous active widget
101 * emits widgetActivated(theWidget) signal
102 * \param theWidget which has to be activated
104 virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
107 QWidget* myCustomWidget;
108 QList<ModuleBase_ModelWidget*> myWidgets;
109 QVBoxLayout* myMainLayout;
111 /// Currently active widget
112 ModuleBase_ModelWidget* myActiveWidget;
115 #endif /* XGUI_PROPERTYPANEL_H_ */