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 Cancel button
74 /// \param theEnabled Enable/Disable state of Cancel button
75 virtual void setCancelEnabled(bool theEnabled);
77 /// \return Enable/Disable state of Cancel button
78 virtual bool isCancelEnabled() const;
80 /// Editing mode depends on mode of current operation. This value is defined by it.
81 /// \param isEditing state of editing mode flag
82 virtual void setEditingMode(bool isEditing);
86 /// \brief Update all widgets in property panel with values from the given feature
87 /// \param theFeature a Feature to update values in widgets
88 void updateContentWidget(FeaturePtr theFeature);
90 /// Enables / disables "ok" ("accept") button
91 /// \param toEnable enable/disable state of button
92 void setAcceptEnabled(bool toEnable);
95 * Makes the given widget active, highlights it and removes
96 * highlighting from the previous active widget
97 * emits widgetActivated(theWidget) signal
98 * \param theWidget which has to be activated
100 virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
103 QWidget* myCustomWidget;
104 QList<ModuleBase_ModelWidget*> myWidgets;
105 QVBoxLayout* myMainLayout;
107 /// Currently active widget
108 ModuleBase_ModelWidget* myActiveWidget;
111 #endif /* XGUI_PROPERTYPANEL_H_ */