1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 * ModuleBase_IPropertyPanel.h
6 * Created on: Oct 01, 2014
10 #ifndef ModuleBase_PROPERTYPANEL_H_
11 #define ModuleBase_PROPERTYPANEL_H_
13 #include "ModuleBase.h"
15 #include <QDockWidget>
18 class ModuleBase_ModelWidget;
22 * A class for Property panel object definition
24 class MODULEBASE_EXPORT ModuleBase_IPropertyPanel : public QDockWidget
29 /// \param theParent is a parent of the property panel
30 ModuleBase_IPropertyPanel(QWidget* theParent);
32 /// Returns header widget
33 virtual QWidget* headerWidget() const = 0;
35 /// Returns currently active widget
36 virtual ModuleBase_ModelWidget* activeWidget() const = 0;
38 /// Returns all property panel's widget created by WidgetFactory
39 virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const = 0;
41 /// Removes all widgets in the widget area of the property panel
42 virtual void cleanContent() = 0;
44 /// Editing mode depends on mode of current operation. This value is defined by it.
45 /// \param isEditing state of editing mode flag
46 virtual void setEditingMode(bool isEditing) { myIsEditing = isEditing; }
48 /// \return State of editing mode flag
49 bool isEditingMode() const { return myIsEditing; }
51 /// Set focus on the Ok button
52 virtual void setFocusOnOkButton() = 0;
54 /// Set Enable/Disable state of Cancel button
55 /// \param theEnabled Enable/Disable state of Cancel button
56 virtual void setCancelEnabled(bool theEnabled) = 0;
58 /// \return Enable/Disable state of Cancel button
59 virtual bool isCancelEnabled() const = 0;
61 /// Returns widget processed by preselection
62 virtual ModuleBase_ModelWidget* preselectionWidget() const = 0;
64 /// Sets widget processed by preselection
65 virtual void setPreselectionWidget(ModuleBase_ModelWidget* theWidget) = 0;
67 /// Returns the first widget, where canSetValue returns true
68 /// \return a widget or null
69 ModuleBase_ModelWidget* findFirstAcceptingValueWidget();
71 /// Returns the first widget, where canSetValue returns true
72 /// \return a widget or null
73 static ModuleBase_ModelWidget* findFirstAcceptingValueWidget(
74 const QList<ModuleBase_ModelWidget*>& theWidgets);
77 /// The signal about key release on the control, that corresponds to the attribute
78 /// \param theEvent key release event
79 void keyReleased(QKeyEvent* theEvent);
81 /// The signal about the widget activation
82 /// \param theWidget the activated widget
83 void beforeWidgetActivated(ModuleBase_ModelWidget* theWidget);
85 /// The signal about the widget activation
86 /// \param theWidget the activated widget
87 void widgetActivated(ModuleBase_ModelWidget* theWidget);
89 /// Emited when there is no next widget
90 /// \param thePreviousAttributeID an attribute key of the previous active widget
91 void noMoreWidgets(const std::string& thePreviousAttributeID);
94 /// Activate the next widget in the property panel
95 /// \param theWidget a widget. The next widget should be activated
96 virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget) = 0;
98 /// Activate the next from current widget in the property panel
99 virtual void activateNextWidget() = 0;
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) = 0;
111 /// Flag which shows that current operation is in editing mode