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";
34 * Realization of Property panel object.
36 class XGUI_EXPORT XGUI_PropertyPanel : public ModuleBase_IPropertyPanel
42 /// \param theParent is a parent of the property panel
43 XGUI_PropertyPanel(QWidget* theParent);
45 virtual ~XGUI_PropertyPanel();
47 /// Returns main widget of the property panel, which children will be created
48 /// by WidgetFactory using the XML definition
49 QWidget* contentWidget();
51 /// Brings back all widget created by widget factory for signal/slot
52 /// connections and further processing
53 void setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets);
55 /// Returns all property panel's widget created by WidgetFactory
56 virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const;
58 /// Removes all widgets in the widget area of the property panel
61 /// Returns currently active widget
62 virtual ModuleBase_ModelWidget* activeWidget() const { return myActiveWidget; }
64 /// Activate the next widget in the property panel
65 /// \param theWidget a widget. The next widget should be activated
66 virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget);
68 /// Activate the next from current widget in the property panel
69 virtual void activateNextWidget();
71 /// \brief Enable/Disable stretch area in the panel
72 void setStretchEnabled(bool isEnabled);
74 /// Set Enable/Disable state of Cancel button
75 /// \param theEnabled Enable/Disable state of Cancel button
76 virtual void setCancelEnabled(bool theEnabled);
78 /// \return Enable/Disable state of Cancel button
79 virtual bool isCancelEnabled() const;
81 /// Editing mode depends on mode of current operation. This value is defined by it.
82 /// \param isEditing state of editing mode flag
83 virtual void setEditingMode(bool isEditing);
87 /// \brief Update all widgets in property panel with values from the given feature
88 /// \param theFeature a Feature to update values in widgets
89 void updateContentWidget(FeaturePtr theFeature);
91 /// Enables / disables "ok" ("accept") button
92 /// \param toEnable enable/disable state of button
93 void setAcceptEnabled(bool toEnable);
96 * Makes the given widget active, highlights it and removes
97 * highlighting from the previous active widget
98 * emits widgetActivated(theWidget) signal
99 * \param theWidget which has to be activated
101 virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
104 QWidget* myCustomWidget;
105 QList<ModuleBase_ModelWidget*> myWidgets;
106 QVBoxLayout* myMainLayout;
108 /// Currently active widget
109 ModuleBase_ModelWidget* myActiveWidget;
112 #endif /* XGUI_PROPERTYPANEL_H_ */