Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SD_SDXFER_HXX
30 : : #define _SD_SDXFER_HXX
31 : :
32 : : #include <svtools/transfer.hxx>
33 : : #include <vcl/graph.hxx>
34 : : #include <sfx2/objsh.hxx>
35 : : #include <svl/lstner.hxx>
36 : :
37 : : // ------------------
38 : : // - SdTransferable -
39 : : // ------------------
40 : :
41 : : class SdDrawDocument;
42 : : class SdrObject;
43 : : class INetBookmark;
44 : : class ImageMap;
45 : : class VirtualDevice;
46 : :
47 : : namespace sd {
48 : : class DrawDocShell;
49 : : class View;
50 : : }
51 : :
52 : : class SfxObjectShellRef;
53 : : class SdTransferable : public TransferableHelper, public SfxListener
54 : : {
55 : : public:
56 : :
57 : : SdTransferable( SdDrawDocument* pSrcDoc, ::sd::View* pWorkView, sal_Bool bInitOnGetData );
58 : : ~SdTransferable();
59 : :
60 : 0 : void SetDocShell( const SfxObjectShellRef& rRef ) { maDocShellRef = rRef; }
61 : 0 : const SfxObjectShellRef& GetDocShell() const { return maDocShellRef; }
62 : :
63 : 0 : void SetWorkDocument( const SdDrawDocument* pWorkDoc ) { mpSdDrawDocument = mpSdDrawDocumentIntern = (SdDrawDocument*) pWorkDoc; }
64 : 0 : const SdDrawDocument* GetWorkDocument() const { return mpSdDrawDocument; }
65 : :
66 : 0 : void SetView( const ::sd::View* pView ) { mpSdView = pView; }
67 : 2 : const ::sd::View* GetView() const { return mpSdView; }
68 : :
69 : : void SetObjectDescriptor( const TransferableObjectDescriptor& rObjDesc );
70 : :
71 : 2 : void SetStartPos( const Point& rStartPos ) { maStartPos = rStartPos; }
72 : 0 : const Point& GetStartPos() const { return maStartPos; }
73 : :
74 : 0 : void SetInternalMove( sal_Bool bSet ) { mbInternalMove = bSet; }
75 : 0 : sal_Bool IsInternalMove() const { return mbInternalMove; }
76 : :
77 : 0 : sal_Bool HasSourceDoc( const SdDrawDocument* pDoc ) const { return( mpSourceDoc == pDoc ); }
78 : :
79 : : void SetPageBookmarks( const std::vector<rtl::OUString>& rPageBookmarks, sal_Bool bPersistent );
80 : 0 : sal_Bool IsPageTransferable() const { return mbPageTransferable; }
81 [ # # ][ # # ]: 0 : sal_Bool HasPageBookmarks() const { return( mpPageDocShell && ( !maPageBookmarks.empty() ) ); }
82 : 0 : const std::vector<rtl::OUString>& GetPageBookmarks() const { return maPageBookmarks; }
83 : 0 : ::sd::DrawDocShell* GetPageDocShell() const { return mpPageDocShell; }
84 : :
85 : : sal_Bool SetTableRTF( SdDrawDocument*, const ::com::sun::star::datatransfer::DataFlavor& );
86 : :
87 : : static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
88 : : static SdTransferable* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData ) throw();
89 : :
90 : : // SfxListener
91 : : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
92 : :
93 : : protected:
94 : :
95 : : virtual void AddSupportedFormats();
96 : : virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
97 : : virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
98 : : virtual void DragFinished( sal_Int8 nDropAction );
99 : : virtual void ObjectReleased();
100 : :
101 : : virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException );
102 : :
103 : : private:
104 : :
105 : : SfxObjectShellRef maDocShellRef;
106 : : ::sd::DrawDocShell* mpPageDocShell;
107 : : std::vector<rtl::OUString> maPageBookmarks;
108 : : TransferableDataHelper* mpOLEDataHelper;
109 : : TransferableObjectDescriptor* mpObjDesc;
110 : : const ::sd::View* mpSdView;
111 : : ::sd::View* mpSdViewIntern;
112 : : SdDrawDocument* mpSdDrawDocument;
113 : : SdDrawDocument* mpSdDrawDocumentIntern;
114 : : SdDrawDocument* mpSourceDoc;
115 : : VirtualDevice* mpVDev;
116 : : INetBookmark* mpBookmark;
117 : : Graphic* mpGraphic;
118 : : ImageMap* mpImageMap;
119 : : Rectangle maVisArea;
120 : : Point maStartPos;
121 : : sal_Bool mbInternalMove : 1;
122 : : sal_Bool mbOwnDocument : 1;
123 : : sal_Bool mbOwnView : 1;
124 : : sal_Bool mbLateInit : 1;
125 : : sal_Bool mbPageTransferable : 1;
126 : : sal_Bool mbPageTransferablePersistent : 1;
127 : : bool mbIsUnoObj : 1;
128 : :
129 : : // not available
130 : : SdTransferable();
131 : : SdTransferable( const SdTransferable& );
132 : : SdTransferable& operator=( const SdTransferable& );
133 : :
134 : : void CreateObjectReplacement( SdrObject* pObj );
135 : : void CreateData();
136 : :
137 : : };
138 : :
139 : : #endif // _SD_SDXFER_HXX
140 : :
141 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|