1 // SUPERV SUPERVGUI : GUI for Supervisor component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : SUPERVGUI_Clipboard.h
25 // Author : Alexander SLADKOV
28 #ifndef SUPERVGUI_Clipboard_H
29 #define SUPERVGUI_Clipboard_H
33 #include "utilities.h"
34 #include "SALOME_LifeCycleCORBA.hxx"
35 #include "SUIT_Session.h"
36 #include "SUIT_Desktop.h"
37 #include CORBA_CLIENT_HEADER(SUPERV)
39 class SUPERVGUI_CanvasNode;
41 class SUPERVGUI_Clipboard : public QObject {
46 // constructor made protected. Access via getClipboard() member function.
47 SUPERVGUI_Clipboard( QObject* parent );
48 virtual ~SUPERVGUI_Clipboard();
52 static SUPERVGUI_Clipboard* getClipboard() {
54 myCB = new SUPERVGUI_Clipboard( SUIT_Session::session()->activeApplication()->desktop() );
58 static void setNullClipboard() {
62 bool isCopyPort() const { return ( myCopyPort && !CORBA::is_nil( myCopyPort ) ); }
63 SUPERV::Port_var getCopyPort() const { return myCopyPort; }
64 void setCopyPort( SUPERV::Port_var theObj ) { myCopyPort = theObj; }
66 bool isCopyNode() const { return ( myCopyNode && !CORBA::is_nil( myCopyNode ) ); }
67 SUPERV::CNode_var getCopyNode() const { return myCopyNode; }
68 void setCopyNode( SUPERV::CNode_var theObj ) { myCopyNode = theObj; }
72 void pastePort( SUPERVGUI_CanvasNode* node );
75 static SUPERVGUI_Clipboard* myCB;
77 SUPERV::Port_var myCopyPort;
78 SUPERV::CNode_var myCopyNode;