1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : SALOME_PYQT_ModuleLight.h
21 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
23 #ifndef SALOME_PYQT_MODULELIGHT_H
24 #define SALOME_PYQT_MODULELIGHT_H
26 #include "SALOME_PYQT_GUILight.h"
28 #include "PyInterp_Interp.h" // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
29 #include "LightApp_Module.h"
33 #include <QStringList>
37 class SALOME_PYQT_DataObjectLight;
39 class SALOME_PYQT_LIGHT_EXPORT SALOME_PYQT_ModuleLight: public LightApp_Module
44 SALOME_PYQT_ModuleLight();
45 ~SALOME_PYQT_ModuleLight();
48 // module activation, preferences, menus
49 void initialize( CAM_Application* );
50 bool activateModule( SUIT_Study* );
51 bool deactivateModule( SUIT_Study* );
52 void windows( QMap<int, int>& ) const;
53 void viewManagers( QStringList& ) const;
54 void studyActivated();
55 void contextMenuPopup( const QString&, QMenu*, QString& );
56 void createPreferences();
57 void preferencesChanged( const QString&, const QString& );
59 // persistence & dump python
60 void save( QStringList& );
61 bool load( const QStringList& );
62 void dumpPython( QStringList& );
64 // drag-n-drop support
65 bool isDraggable( const SUIT_DataObject* ) const;
66 bool isDropAccepted( const SUIT_DataObject* ) const;
67 void dropObjects( const DataObjectList&, SUIT_DataObject*,
68 const int, Qt::DropAction );
70 // data model management
71 QString createObject( const QString& );
72 QString createObject( const QString&,
77 void setName( const QString&, const QString& );
78 QString getName( const QString& ) const;
80 void setIcon( const QString&, const QString& );
82 void setToolTip( const QString&, const QString& );
83 QString getToolTip( const QString& ) const;
85 void setColor( const QString&, const QColor& );
86 QColor getColor( const QString& ) const;
88 void setReference( const QString&, const QString& );
89 QString getReference( const QString& ) const;
91 void removeObject( const QString& );
92 void removeChildren( const QString& );
94 QStringList getChildren( const QString&, const bool = false ) const;
97 CAM_DataModel* createDataModel();
100 SALOME_PYQT_DataObjectLight*
101 findObject( const QString& ) const;
104 PyModuleHelper* myHelper;
107 #endif // SALOME_PYQT_MODULELIGHT_H