Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #ifndef SC_DRWTRANS_HXX
21 : : #define SC_DRWTRANS_HXX
22 : :
23 : : #include <com/sun/star/uno/Reference.hxx>
24 : : #include <com/sun/star/embed/XEmbeddedObject.hpp>
25 : : #include <svtools/transfer.hxx>
26 : :
27 : : #include <sfx2/objsh.hxx>
28 : : #include "global.hxx"
29 : : #include "charthelper.hxx"
30 : : #include "rangelst.hxx"
31 : :
32 : :
33 : : class SdrModel;
34 : : class ScDocShell;
35 : : class INetBookmark;
36 : : class SdrObject;
37 : : class SdrView;
38 : : class ScDrawView;
39 : : class SdrOle2Obj;
40 : :
41 : : class ScDrawTransferObj : public TransferableHelper
42 : : {
43 : : private:
44 : : SdrModel* pModel;
45 : : TransferableDataHelper aOleData;
46 : : TransferableObjectDescriptor aObjDesc;
47 : : SfxObjectShellRef aDocShellRef;
48 : : SfxObjectShellRef aDrawPersistRef;
49 : :
50 : : // extracted from model in ctor:
51 : : Size aSrcSize;
52 : : INetBookmark* pBookmark;
53 : : sal_Bool bGraphic;
54 : : sal_Bool bGrIsBit;
55 : : sal_Bool bOleObj;
56 : : // source information for drag&drop:
57 : : // (view is needed to handle drawing obejcts)
58 : : SdrView* pDragSourceView;
59 : : sal_uInt16 nDragSourceFlags;
60 : : sal_Bool bDragWasInternal;
61 : :
62 : : sal_uInt32 nSourceDocID;
63 : :
64 : : ScRangeListVector m_aProtectedChartRangesVector;
65 : :
66 : :
67 : : void InitDocShell();
68 : : SdrOle2Obj* GetSingleObject();
69 : :
70 : : public:
71 : : ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContainerShell,
72 : : const TransferableObjectDescriptor& rDesc );
73 : : virtual ~ScDrawTransferObj();
74 : :
75 : : virtual void AddSupportedFormats();
76 : : virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
77 : : virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
78 : : const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
79 : : virtual void ObjectReleased();
80 : : virtual void DragFinished( sal_Int8 nDropAction );
81 : :
82 : 0 : SdrModel* GetModel() { return pModel; }
83 : :
84 : : void SetDrawPersist( const SfxObjectShellRef& rRef );
85 : : void SetDragSource( ScDrawView* pView );
86 : : void SetDragSourceObj( SdrObject* pObj, SCTAB nTab );
87 : : void SetDragSourceFlags( sal_uInt16 nFlags );
88 : : void SetDragWasInternal();
89 : :
90 : 0 : SdrView* GetDragSourceView() { return pDragSourceView; }
91 : 0 : sal_uInt16 GetDragSourceFlags() const { return nDragSourceFlags; }
92 : :
93 : : void SetSourceDocID( sal_uInt32 nVal )
94 : : { nSourceDocID = nVal; }
95 : 0 : sal_uInt32 GetSourceDocID() const { return nSourceDocID; }
96 : :
97 : : static ScDrawTransferObj* GetOwnClipboard( Window* pUIWin );
98 : : virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( com::sun::star::uno::RuntimeException );
99 : : static const com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
100 : :
101 : 0 : const ScRangeListVector& GetProtectedChartRangesVector() const { return m_aProtectedChartRangesVector; }
102 : : };
103 : :
104 : : #endif
105 : :
106 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|