1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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
22 // SUPERV SUPERVGUI : GUI for Supervisor component
23 // File : SUPERVGUI_Clipboard.h
24 // Author : Alexander SLADKOV
27 #ifndef SUPERVGUI_Clipboard_H
28 #define SUPERVGUI_Clipboard_H
32 #include "utilities.h"
33 #include "SALOME_LifeCycleCORBA.hxx"
34 #include "SUIT_Session.h"
35 #include "SUIT_Desktop.h"
36 #include CORBA_CLIENT_HEADER(SUPERV)
38 class SUPERVGUI_CanvasNode;
40 class SUPERVGUI_Clipboard : public QObject {
45 // constructor made protected. Access via getClipboard() member function.
46 SUPERVGUI_Clipboard( QObject* parent );
47 virtual ~SUPERVGUI_Clipboard();
51 static SUPERVGUI_Clipboard* getClipboard() {
53 myCB = new SUPERVGUI_Clipboard( SUIT_Session::session()->activeApplication()->desktop() );
57 static void setNullClipboard() {
61 bool isCopyPort() const { return ( myCopyPort && !CORBA::is_nil( myCopyPort ) ); }
62 SUPERV::Port_var getCopyPort() const { return myCopyPort; }
63 void setCopyPort( SUPERV::Port_var theObj ) { myCopyPort = theObj; }
65 bool isCopyNode() const { return ( myCopyNode && !CORBA::is_nil( myCopyNode ) ); }
66 SUPERV::CNode_var getCopyNode() const { return myCopyNode; }
67 void setCopyNode( SUPERV::CNode_var theObj ) { myCopyNode = theObj; }
71 void pastePort( SUPERVGUI_CanvasNode* node );
74 static SUPERVGUI_Clipboard* myCB;
76 SUPERV::Port_var myCopyPort;
77 SUPERV::CNode_var myCopyNode;