X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLightApp%2FLightApp_Module.h;h=49729b95e1458142cdd7473e727abc9b0d8a28f1;hb=8d54f199bd9ead3c2f0c704322975198e65264d6;hp=17a95366f5dea8a5a2be19c3d728d6b85bac2372;hpb=399155730966dfc225fbb24f66204b05664385f2;p=modules%2Fgui.git diff --git a/src/LightApp/LightApp_Module.h b/src/LightApp/LightApp_Module.h index 17a95366f..49729b95e 100644 --- a/src/LightApp/LightApp_Module.h +++ b/src/LightApp/LightApp_Module.h @@ -1,42 +1,47 @@ -// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// +// Copyright (C) 2007-2014 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. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// License as published by the Free Software Foundation; either +// 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 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // File: LightApp_Module.h // Created: 6/20/2005 16:25:06 AM // Author: OCC team -// Copyright (C) CEA 2005 #ifndef LIGHTAPP_MODULE_H #define LIGHTAPP_MODULE_H #include "LightApp.h" +#include "LightApp_Preferences.h" #include +#include + class LightApp_Application; -class LightApp_Preferences; class LightApp_Selection; class LightApp_Operation; class LightApp_SwitchOp; -class LightApp_ShowHideOp; class LightApp_Displayer; +class LightApp_SelectionMgr; class SUIT_Study; -class SUIT_DataObject; +//class SUIT_DataObject; class SUIT_Operation; class SUIT_ViewManager; class CAM_Application; @@ -46,6 +51,10 @@ class QtxPopupMgr; class QString; class QVariant; +#ifdef WIN32 +#pragma warning ( disable:4251 ) +#endif + /*! \class LightApp_Module Base class for all light modules @@ -63,7 +72,7 @@ public: virtual void windows( QMap& ) const; virtual void viewManagers( QStringList& ) const; - virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& ); + virtual void contextMenuPopup( const QString&, QMenu*, QString& ); virtual void createPreferences(); @@ -71,19 +80,31 @@ public: virtual void update( const int ); // Update viewer or/and object browser etc. in accordance with update flags - // ( see SalomeApp_UpdateFlags enumeration ). Derived modules can redefine this method + // (see SalomeApp_UpdateFlags enumeration). Derived modules can redefine this method // for their own purposes virtual void updateObjBrowser( bool = true, SUIT_DataObject* = 0 ); - // Update object bropwser ( for updating model or whole object browser use update() method - // can be used ) + // Update object browser (for updating model or whole object browser use update() method) virtual void selectionChanged(); virtual void preferencesChanged( const QString&, const QString& ); + virtual void message( const QString& ); virtual void studyActivated() {}; virtual LightApp_Displayer* displayer(); + virtual LightApp_Selection* createSelection() const; + + virtual bool canCopy() const; + virtual bool canPaste() const; + virtual bool isDraggable( const SUIT_DataObject* ) const; + virtual bool isDropAccepted( const SUIT_DataObject* ) const; + virtual void dropObjects( const DataObjectList&, SUIT_DataObject*, + const int, Qt::DropAction ); + virtual void copy(); + virtual void paste(); + virtual bool renameAllowed( const QString& ) const; + virtual bool renameObject( const QString&, const QString& ); public slots: virtual bool activateModule( SUIT_Study* ); @@ -107,12 +128,14 @@ protected: LightApp_Preferences* preferences() const; virtual CAM_DataModel* createDataModel(); - virtual LightApp_Selection* createSelection() const; + + virtual bool reusableOperation( const int id ); int addPreference( const QString& label ); - int addPreference( const QString& label, const int pId, const int = -1, - const QString& section = QString::null, - const QString& param = QString::null ); + int addPreference( const QString& label, const int pId, + const int type = LightApp_Preferences::Auto, + const QString& section = QString(), + const QString& param = QString() ); QVariant preferenceProperty( const int, const QString& ) const; void setPreferenceProperty( const int, const QString&, const QVariant& ); @@ -128,6 +151,10 @@ protected: virtual void updateControls(); + virtual bool isSelectionCompatible(); + + LightApp_Operation* operation( const int ) const; + private: typedef QMap MapOfOperation; @@ -140,4 +167,8 @@ protected: int myDisplay, myErase, myDisplayOnly, myEraseAll; }; +#ifdef WIN32 +#pragma warning ( default:4251 ) +#endif + #endif