merge the formfield patch from ooo-build
[ooovba.git] / sd / source / ui / inc / sdxfer.hxx
blobf3d8e7b9d2d91e731d7520ec1950c02b704c179f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sdxfer.hxx,v $
10 * $Revision: 1.19 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SD_SDXFER_HXX
32 #define _SD_SDXFER_HXX
34 #include <svtools/transfer.hxx>
35 #include <vcl/graph.hxx>
36 #include <sfx2/objsh.hxx>
37 #include <svtools/lstner.hxx>
39 // ------------------
40 // - SdTransferable -
41 // ------------------
43 class SdDrawDocument;
44 class SdrObject;
45 class INetBookmark;
46 class ImageMap;
47 class VirtualDevice;
49 namespace sd {
50 class DrawDocShell;
51 class View;
54 class SfxObjectShellRef;
55 class SdTransferable : public TransferableHelper, public SfxListener
57 public:
59 SdTransferable( SdDrawDocument* pSrcDoc, ::sd::View* pWorkView, BOOL bInitOnGetData );
60 ~SdTransferable();
62 void SetDocShell( const SfxObjectShellRef& rRef ) { maDocShellRef = rRef; }
63 const SfxObjectShellRef& GetDocShell() const { return maDocShellRef; }
65 void SetWorkDocument( const SdDrawDocument* pWorkDoc ) { mpSdDrawDocument = mpSdDrawDocumentIntern = (SdDrawDocument*) pWorkDoc; }
66 const SdDrawDocument* GetWorkDocument() const { return mpSdDrawDocument; }
68 void SetView( const ::sd::View* pView ) { mpSdView = pView; }
69 const ::sd::View* GetView() const { return mpSdView; }
71 void SetObjectDescriptor( const TransferableObjectDescriptor& rObjDesc );
73 void SetStartPos( const Point& rStartPos ) { maStartPos = rStartPos; }
74 const Point& GetStartPos() const { return maStartPos; }
76 void SetInternalMove( BOOL bSet ) { mbInternalMove = bSet; }
77 BOOL IsInternalMove() const { return mbInternalMove; }
79 BOOL HasSourceDoc( const SdDrawDocument* pDoc ) const { return( mpSourceDoc == pDoc ); }
81 void SetPageBookmarks( const List& rPageBookmarks, BOOL bPersistent );
82 BOOL IsPageTransferable() const { return mbPageTransferable; }
83 BOOL HasPageBookmarks() const { return( mpPageDocShell && ( maPageBookmarks.Count() > 0 ) ); }
84 const List& GetPageBookmarks() const { return maPageBookmarks; }
85 ::sd::DrawDocShell* GetPageDocShell() const { return mpPageDocShell; }
87 sal_Bool SetTableRTF( SdDrawDocument*, const ::com::sun::star::datatransfer::DataFlavor& );
89 static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
90 static SdTransferable* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData ) throw();
92 // SfxListener
93 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
95 protected:
97 virtual void AddSupportedFormats();
98 virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
99 virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
100 virtual void DragFinished( sal_Int8 nDropAction );
101 virtual void ObjectReleased();
103 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException );
105 private:
107 SfxObjectShellRef maDocShellRef;
108 ::sd::DrawDocShell* mpPageDocShell;
109 List maPageBookmarks;
110 TransferableDataHelper* mpOLEDataHelper;
111 TransferableObjectDescriptor* mpObjDesc;
112 const ::sd::View* mpSdView;
113 ::sd::View* mpSdViewIntern;
114 SdDrawDocument* mpSdDrawDocument;
115 SdDrawDocument* mpSdDrawDocumentIntern;
116 SdDrawDocument* mpSourceDoc;
117 VirtualDevice* mpVDev;
118 INetBookmark* mpBookmark;
119 Graphic* mpGraphic;
120 ImageMap* mpImageMap;
121 Rectangle maVisArea;
122 Point maStartPos;
123 BOOL mbInternalMove : 1;
124 BOOL mbOwnDocument : 1;
125 BOOL mbOwnView : 1;
126 BOOL mbLateInit : 1;
127 BOOL mbPageTransferable : 1;
128 BOOL mbPageTransferablePersistent : 1;
129 bool mbIsUnoObj : 1;
131 // not available
132 SdTransferable();
133 SdTransferable( const SdTransferable& );
134 SdTransferable& operator=( const SdTransferable& );
136 void CreateObjectReplacement( SdrObject* pObj );
137 void CreateData();
141 #endif // _SD_SDXFER_HXX