1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: drwtrans.hxx,v $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef SC_DRWTRANS_HXX
33 #define SC_DRWTRANS_HXX
35 #include <com/sun/star/uno/Reference.hxx>
36 #include <com/sun/star/embed/XEmbeddedObject.hpp>
37 #include <svtools/transfer.hxx>
39 #include <sfx2/objsh.hxx>
51 class ScDrawTransferObj
: public TransferableHelper
55 TransferableDataHelper aOleData
;
56 TransferableObjectDescriptor aObjDesc
;
57 //REMOVE SvEmbeddedObjectRef aDocShellRef;
58 //REMOVE SvEmbeddedObjectRef aDrawPersistRef;
59 SfxObjectShellRef aDocShellRef
;
60 SfxObjectShellRef aDrawPersistRef
;
62 // extracted from model in ctor:
64 INetBookmark
* pBookmark
;
68 // source information for drag&drop:
69 // (view is needed to handle drawing obejcts)
70 SdrView
* pDragSourceView
;
71 USHORT nDragSourceFlags
;
72 BOOL bDragWasInternal
;
74 sal_uInt32 nSourceDocID
;
78 //REMOVE SvInPlaceObjectRef GetSingleObject();
79 SdrOle2Obj
* GetSingleObject();
82 ScDrawTransferObj( SdrModel
* pClipModel
, ScDocShell
* pContainerShell
,
83 const TransferableObjectDescriptor
& rDesc
);
84 virtual ~ScDrawTransferObj();
86 virtual void AddSupportedFormats();
87 virtual sal_Bool
GetData( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
88 virtual sal_Bool
WriteObject( SotStorageStreamRef
& rxOStm
, void* pUserObject
, sal_uInt32 nUserObjectId
,
89 const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
90 virtual void ObjectReleased();
91 virtual void DragFinished( sal_Int8 nDropAction
);
93 SdrModel
* GetModel() { return pModel
; }
95 void SetDrawPersist( const SfxObjectShellRef
& rRef
);
96 void SetDragSource( ScDrawView
* pView
);
97 void SetDragSourceObj( SdrObject
* pObj
, SCTAB nTab
);
98 void SetDragSourceFlags( USHORT nFlags
);
99 void SetDragWasInternal();
101 SdrView
* GetDragSourceView() { return pDragSourceView
; }
102 USHORT
GetDragSourceFlags() const { return nDragSourceFlags
; }
104 void SetSourceDocID( sal_uInt32 nVal
)
105 { nSourceDocID
= nVal
; }
106 sal_uInt32
GetSourceDocID() const { return nSourceDocID
; }
108 static ScDrawTransferObj
* GetOwnClipboard( Window
* pUIWin
);
109 virtual sal_Int64 SAL_CALL
getSomething( const com::sun::star::uno::Sequence
< sal_Int8
>& rId
) throw( com::sun::star::uno::RuntimeException
);
110 static const com::sun::star::uno::Sequence
< sal_Int8
>& getUnoTunnelId();