Version: 9.16.0
SALOME_PYQT_ModuleLight.h
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
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// File : SALOME_PYQT_ModuleLight.h
21// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
22
23#ifndef SALOME_PYQT_MODULELIGHT_H
24#define SALOME_PYQT_MODULELIGHT_H
25
27
28#include "PyInterp_Interp.h" // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
29#include "LightApp_Module.h"
30
31#include <QIcon>
32#include <QMap>
33#include <QStringList>
34
35class QMenu;
36class PyModuleHelper;
39
41{
42 Q_OBJECT
43
44public:
47
48public:
49 // module activation, preferences, menus
53 void onModelClosed();
54 void windows( QMap<int, int>& ) const;
55 void viewManagers( QStringList& ) const;
56 void studyActivated();
57 void contextMenuPopup( const QString&, QMenu*, QString& );
58 void createPreferences();
59 void preferencesChanged( const QString&, const QString& );
60
61 // persistence & dump python
62 void save( QStringList&, const QString& );
63 bool load( const QStringList&, const QString& );
64 void dumpPython( QStringList& );
65
66 // drag-n-drop support
67 bool isDraggable( const SUIT_DataObject* ) const;
68 bool isDropAccepted( const SUIT_DataObject* ) const;
70 const int, Qt::DropAction );
71
72 // data model management
73 QString createObject( const QString& );
74 QString createObject( const QString&,
75 const QString&,
76 const QString&,
77 const QString& );
78
79 void setName( const QString&, const QString& );
80 QString getName( const QString& ) const;
81
82 void setIcon( const QString&, const QString& );
83
84 void setToolTip( const QString&, const QString& );
85 QString getToolTip( const QString& ) const;
86
87 void setColor( const QString&, const QColor& );
88 QColor getColor( const QString& ) const;
89
90 void setReference( const QString&, const QString& );
91 QString getReference( const QString& ) const;
92
93 void removeObject( const QString& );
94 void removeChildren( const QString& );
95
96 void setObjectPosition( const QString&, int );
97 int getObjectPosition( const QString& );
98
99 QStringList getChildren( const QString&, const bool = false ) const;
100
101 void enableSelector();
102 void disableSelector();
103 void setLocalSelected(const QStringList &);
104 void getSelected( DataObjectList& ) const;
105// unsigned long getModifiedTime() const;
106// SUIT_DataObject* root() const;
107 void setSelected( const QStringList&, const bool = false );
108
109protected:
111
112private:
114 findObject( const QString& ) const;
115
116signals:
119
120private:
123};
124
125#endif // SALOME_PYQT_MODULELIGHT_H
#define SALOME_PYQT_LIGHT_EXPORT
Definition: SALOME_PYQT_GUILight.h:38
QList< SUIT_DataObject * > DataObjectList
Definition: SALOME_PYQT_PyModule.h:47
Introduces an application class which provides modular architecture.
Definition: CAM_Application.h:39
Base class for all data models used in CAM-based applications.
Definition: CAM_DataModel.h:37
void setName(const QString &)
Set module (internal) name.
Definition: CAM_Module.cxx:410
Definition: LightApp_Module.h:64
virtual void studyActivated()
Definition: LightApp_Module.h:93
virtual void initialize(CAM_Application *)
Definition: LightApp_Module.cxx:128
virtual void viewManagers(QStringList &) const
Definition: LightApp_Module.cxx:143
virtual bool isDropAccepted(const SUIT_DataObject *) const
Definition: LightApp_Module.cxx:777
virtual void contextMenuPopup(const QString &, QMenu *, QString &)
Definition: LightApp_Module.cxx:148
virtual void onModelClosed()
Definition: LightApp_Module.cxx:442
virtual bool isDraggable(const SUIT_DataObject *) const
Definition: LightApp_Module.cxx:768
virtual CAM_DataModel * createDataModel()
Definition: LightApp_Module.cxx:420
virtual void createPreferences()
Definition: LightApp_Module.cxx:328
virtual bool activateModule(SUIT_Study *)
Definition: LightApp_Module.cxx:221
virtual void preferencesChanged(const QString &, const QString &)
Definition: LightApp_Module.cxx:333
virtual void dropObjects(const DataObjectList &, SUIT_DataObject *, const int, Qt::DropAction)
Definition: LightApp_Module.cxx:787
virtual bool deactivateModule(SUIT_Study *)
Definition: LightApp_Module.cxx:263
virtual void windows(QMap< int, int > &) const
Definition: LightApp_Module.cxx:138
This class implements API helper for all the Python-based SALOME GUI modules.
Definition: SALOME_PYQT_PyModule.h:50
Definition: SALOME_PYQT_DataObjectLight.h:37
This class implements GUI module for "light-weight" (no-CORBA-engine) Python-based SALOME modules.
Definition: SALOME_PYQT_ModuleLight.h:41
SALOME_PYQT_Selector * mySelector
Definition: SALOME_PYQT_ModuleLight.h:122
PyModuleHelper * myHelper
Definition: SALOME_PYQT_ModuleLight.h:121
Object browser selection handler class.
Definition: SALOME_PYQT_Selector.h:43
Data object representing the data instance in the tree-like hierarchy.
Definition: SUIT_DataObject.h:49
Definition: SUIT_Study.h:41