SHAPER 9.16.0
ModuleBase_IPropertyPanel.h
1// Copyright (C) 2014-2026 CEA, EDF
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef ModuleBase_PROPERTYPANEL_H_
21#define ModuleBase_PROPERTYPANEL_H_
22
23#include "ModuleBase.h"
24
25#include <QDockWidget>
26#include <QKeyEvent>
27
29
34class MODULEBASE_EXPORT ModuleBase_IPropertyPanel : public QDockWidget
35{
36Q_OBJECT
37public:
41
43 virtual QWidget* headerWidget() const = 0;
44
49 virtual ModuleBase_ModelWidget* activeWidget(const bool isUseCustomWidget = false) const = 0;
50
52 virtual const QList<ModuleBase_ModelWidget*>& modelWidgets() const = 0;
53
56 virtual ModuleBase_ModelWidget* modelWidget(const std::string& theAttributeId) const;
57
59 virtual void cleanContent() = 0;
60
63 virtual void setEditingMode(bool isEditing) { myIsEditing = isEditing; }
64
66 bool isEditingMode() const { return myIsEditing; }
67
69 virtual void setFocusOnOkButton() = 0;
70
73 virtual void setCancelEnabled(bool theEnabled) = 0;
74
76 virtual bool isCancelEnabled() const = 0;
77
80
82 virtual void setPreselectionWidget(ModuleBase_ModelWidget* theWidget) = 0;
83
86 ModuleBase_ModelWidget* findFirstAcceptingValueWidget();
87
89 virtual void onAcceptData() = 0;
90
92 virtual bool isModified() const;
93
96 static ModuleBase_ModelWidget* findFirstAcceptingValueWidget(
97 const QList<ModuleBase_ModelWidget*>& theWidgets);
98
99signals:
103 void keyReleased(QObject* theObject, QKeyEvent* theEvent);
104
108
111 //void widgetActivated(ModuleBase_ModelWidget* theWidget);
112
115 void noMoreWidgets(const std::string& thePreviousAttributeID);
116
117public slots:
120 virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget) = 0;
121
123 virtual void activateNextWidget() = 0;
124
131 virtual void activateWidget(ModuleBase_ModelWidget* theWidget,
132 const bool theEmitSignal = true) = 0;
133
134protected:
135
138};
139
140#endif
A class for Property panel object definition.
Definition: ModuleBase_IPropertyPanel.h:35
bool myIsEditing
Flag which shows that current operation is in editing mode.
Definition: ModuleBase_IPropertyPanel.h:137
virtual void setPreselectionWidget(ModuleBase_ModelWidget *theWidget)=0
Sets widget processed by preselection.
void noMoreWidgets(const std::string &thePreviousAttributeID)
The signal about the widget activation.
virtual void activateWidget(ModuleBase_ModelWidget *theWidget, const bool theEmitSignal=true)=0
Makes the given widget active, highlights it and removes highlighting from the previous active widget...
virtual const QList< ModuleBase_ModelWidget * > & modelWidgets() const =0
Returns all property panel's widget created by WidgetFactory.
virtual void cleanContent()=0
Removes all widgets in the widget area of the property panel.
virtual void onAcceptData()=0
The method is called on accepting of operation.
virtual void activateNextWidget()=0
Activate the next from current widget in the property panel.
virtual void setEditingMode(bool isEditing)
Editing mode depends on mode of current operation.
Definition: ModuleBase_IPropertyPanel.h:63
bool isEditingMode() const
Definition: ModuleBase_IPropertyPanel.h:66
virtual ModuleBase_ModelWidget * activeWidget(const bool isUseCustomWidget=false) const =0
Returns currently active widget.
virtual ModuleBase_ModelWidget * preselectionWidget() const =0
Returns widget processed by preselection.
virtual void setCancelEnabled(bool theEnabled)=0
Set Enable/Disable state of Cancel button.
virtual bool isCancelEnabled() const =0
virtual QWidget * headerWidget() const =0
Returns header widget.
virtual void setFocusOnOkButton()=0
Set focus on the Ok button.
void keyReleased(QObject *theObject, QKeyEvent *theEvent)
The signal about key release on the control, that corresponds to the attribute.
virtual void activateNextWidget(ModuleBase_ModelWidget *theWidget)=0
Activate the next widget in the property panel.
void beforeWidgetActivated(ModuleBase_ModelWidget *theWidget)
The signal about the widget activation.
An abstract custom widget class.
Definition: ModuleBase_ModelWidget.h:60