1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef SC_DRWTRANS_HXX
21 #define SC_DRWTRANS_HXX
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <com/sun/star/embed/XEmbeddedObject.hpp>
25 #include <svtools/transfer.hxx>
27 #include <sfx2/objsh.hxx>
29 #include "charthelper.hxx"
30 #include "rangelst.hxx"
41 class ScDrawTransferObj
: public TransferableHelper
45 TransferableDataHelper aOleData
;
46 TransferableObjectDescriptor aObjDesc
;
47 SfxObjectShellRef aDocShellRef
;
48 SfxObjectShellRef aDrawPersistRef
;
50 // extracted from model in ctor:
52 INetBookmark
* pBookmark
;
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
;
62 sal_uInt32 nSourceDocID
;
64 ScRangeListVector m_aProtectedChartRangesVector
;
68 SdrOle2Obj
* GetSingleObject();
71 ScDrawTransferObj( SdrModel
* pClipModel
, ScDocShell
* pContainerShell
,
72 const TransferableObjectDescriptor
& rDesc
);
73 virtual ~ScDrawTransferObj();
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
);
82 SdrModel
* GetModel() { return pModel
; }
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();
90 SdrView
* GetDragSourceView() { return pDragSourceView
; }
91 sal_uInt16
GetDragSourceFlags() const { return nDragSourceFlags
; }
93 void SetSourceDocID( sal_uInt32 nVal
)
94 { nSourceDocID
= nVal
; }
95 sal_uInt32
GetSourceDocID() const { return nSourceDocID
; }
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();
101 const ScRangeListVector
& GetProtectedChartRangesVector() const { return m_aProtectedChartRangesVector
; }
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */