Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / drwtrans.hxx
blob81b7b9060e7737bddd7bafb45d130e3929eda82c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
28 #include "global.hxx"
29 #include "charthelper.hxx"
30 #include "rangelst.hxx"
33 class SdrModel;
34 class ScDocShell;
35 class INetBookmark;
36 class SdrObject;
37 class SdrView;
38 class ScDrawView;
39 class SdrOle2Obj;
41 class ScDrawTransferObj : public TransferableHelper
43 private:
44 SdrModel* pModel;
45 TransferableDataHelper aOleData;
46 TransferableObjectDescriptor aObjDesc;
47 SfxObjectShellRef aDocShellRef;
48 SfxObjectShellRef aDrawPersistRef;
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;
62 sal_uInt32 nSourceDocID;
64 ScRangeListVector m_aProtectedChartRangesVector;
67 void InitDocShell();
68 SdrOle2Obj* GetSingleObject();
70 public:
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; }
104 #endif
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */