1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
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_Selector;
38 class SALOME_PYQT_DataObjectLight;
40 class SALOME_PYQT_LIGHT_EXPORT SALOME_PYQT_ModuleLight: public LightApp_Module
45 SALOME_PYQT_ModuleLight();
46 ~SALOME_PYQT_ModuleLight();
49 // module activation, preferences, menus
50 void initialize( CAM_Application* );
51 bool activateModule( SUIT_Study* );
52 bool deactivateModule( SUIT_Study* );
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& );
61 // persistence & dump python
62 void save( QStringList&, const QString& );
63 bool load( const QStringList&, const QString& );
64 void dumpPython( QStringList& );
66 // drag-n-drop support
67 bool isDraggable( const SUIT_DataObject* ) const;
68 bool isDropAccepted( const SUIT_DataObject* ) const;
69 void dropObjects( const DataObjectList&, SUIT_DataObject*,
70 const int, Qt::DropAction );
72 // data model management
73 QString createObject( const QString& );
74 QString createObject( const QString&,
79 void setName( const QString&, const QString& );
80 QString getName( const QString& ) const;
82 void setIcon( const QString&, const QString& );
84 void setToolTip( const QString&, const QString& );
85 QString getToolTip( const QString& ) const;
87 void setColor( const QString&, const QColor& );
88 QColor getColor( const QString& ) const;
90 void setReference( const QString&, const QString& );
91 QString getReference( const QString& ) const;
93 void removeObject( const QString& );
94 void removeChildren( const QString& );
96 void setObjectPosition( const QString&, int );
97 int getObjectPosition( const QString& );
99 QStringList getChildren( const QString&, const bool = false ) const;
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 );
110 CAM_DataModel* createDataModel();
113 SALOME_PYQT_DataObjectLight*
114 findObject( const QString& ) const;
117 void selectionChanged();
118 void localSelectionChanged();
121 PyModuleHelper* myHelper;
122 SALOME_PYQT_Selector* mySelector;
125 #endif // SALOME_PYQT_MODULELIGHT_H