-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#define SALOME_PYQT_MODULE_H
#include "SALOME_PYQT_GUI.h"
-#include "SALOME_PYQT_PyInterp.h" // this include must be first (see PyInterp_base.h)!*/
-#include "SALOME_PYQT_ModuleLight.h"
-#include "SalomeApp_Module.h"
-#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(SALOME_Component)
+#include "PyInterp_Interp.h" // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
+#include "SalomeApp_Module.h"
+class PyModuleHelper;
-class SALOME_PYQT_EXPORT SALOME_PYQT_Module: public SalomeApp_Module,
- public SALOME_PYQT_ModuleLight
+class SALOME_PYQT_EXPORT SALOME_PYQT_Module: public SalomeApp_Module
{
- Q_OBJECT;
+ Q_OBJECT
public:
SALOME_PYQT_Module();
~SALOME_PYQT_Module();
- /* get module engine IOR */
- virtual QString engineIOR() const;
-
-public slots:
- virtual bool activateModule( SUIT_Study* );
- void preferenceChanged( const QString&,
- const QString&,
- const QString& );
- void onGUIEvent();
- void onActiveViewChanged( SUIT_ViewWindow* );
- void onViewClosed( SUIT_ViewWindow* );
- void onViewTryClose( SUIT_ViewWindow* );
- void onViewCloned( SUIT_ViewWindow* );
+ // engine management
+ QString engineIOR() const;
-protected:
- /* create data model */
- virtual CAM_DataModel* createDataModel();
-
- Engines::EngineComponent_var getEngine() const;
-
-private:
- void getEngineIOR();
+ // module activation, preferences, menus
+ void initialize( CAM_Application* );
+ bool activateModule( SUIT_Study* );
+ bool deactivateModule( SUIT_Study* );
+ void windows( QMap<int, int>& ) const;
+ void viewManagers( QStringList& ) const;
+ void studyActivated();
+ void contextMenuPopup( const QString&, QMenu*, QString& );
+ void createPreferences();
+ void preferencesChanged( const QString&, const QString& );
+ void studyClosed( SUIT_Study* );
+ // drag-n-drop support
+ bool isDraggable( const SUIT_DataObject* ) const;
+ bool isDropAccepted( const SUIT_DataObject* ) const;
+ void dropObjects( const DataObjectList&, SUIT_DataObject*,
+ const int, Qt::DropAction );
private:
- QString myIOR;
+ PyModuleHelper* myHelper;
};
#endif // SALOME_PYQT_MODULE_H