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>
23 /// Internal name of property panel widget
24 const static char* PROP_PANEL = "property_panel_dock";
26 /// Internal name of Ok button
27 const static char* PROP_PANEL_OK = "property_panel_ok";
29 /// Internal name of Cancel button
30 const static char* PROP_PANEL_CANCEL = "property_panel_cancel";
33 * Realization of Property panel object.
35 class XGUI_EXPORT XGUI_PropertyPanel : public ModuleBase_IPropertyPanel
41 /// \param theParent is a parent of the property panel
42 XGUI_PropertyPanel(QWidget* theParent);
44 virtual ~XGUI_PropertyPanel();
46 /// Returns main widget of the property panel, which children will be created
47 /// by WidgetFactory using the XML definition
48 QWidget* contentWidget();
50 /// Brings back all widget created by widget factory for signal/slot
51 /// connections and further processing
52 void setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets);
54 /// Returns all property panel's widget created by WidgetFactory
55 virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const;
57 /// Removes all widgets in the widget area of the property panel
60 /// Returns currently active widget
61 virtual ModuleBase_ModelWidget* activeWidget() const { return myActiveWidget; }
63 /// Activate the next widget in the property panel
64 /// \param theWidget a widget. The next widget should be activated
65 virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget);
67 /// Activate the next from current widget in the property panel
68 virtual void activateNextWidget();
70 /// \brief Enable/Disable stretch area in the panel
71 void setStretchEnabled(bool isEnabled);
73 /// Set Enable/Disable state of Ok button
74 /// \param theEnabled Enable/Disable state of Ok button
75 virtual void setOkEnabled(bool theEnabled);
77 /// \return Enable/disable state of Ok button
78 virtual bool isOkEnabled() const;
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);
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);
97 /// Enables / disables "ok" ("accept") button
98 /// \param toEnable enable/disable state of button
99 void setAcceptEnabled(bool toEnable);
102 * Makes the given widget active, highlights it and removes
103 * highlighting from the previous active widget
104 * emits widgetActivated(theWidget) signal
105 * \param theWidget which has to be activated
107 virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
110 QWidget* myCustomWidget;
111 QList<ModuleBase_ModelWidget*> myWidgets;
112 QVBoxLayout* myMainLayout;
114 /// Currently active widget
115 ModuleBase_ModelWidget* myActiveWidget;
118 #endif /* XGUI_PROPERTYPANEL_H_ */