xref: /trunk/main/sc/source/ui/inc/drwtrans.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_DRWTRANS_HXX
29 #define SC_DRWTRANS_HXX
30 
31 #include <com/sun/star/uno/Reference.hxx>
32 #include <com/sun/star/embed/XEmbeddedObject.hpp>
33 #include <svtools/transfer.hxx>
34 
35 #include <sfx2/objsh.hxx>
36 #include "global.hxx"
37 #include "charthelper.hxx"
38 #include "rangelst.hxx"
39 
40 
41 class SdrModel;
42 class ScDocShell;
43 class INetBookmark;
44 class SdrObject;
45 class SdrView;
46 class ScDrawView;
47 class SdrOle2Obj;
48 
49 class ScDrawTransferObj : public TransferableHelper
50 {
51 private:
52     SdrModel*                       pModel;
53     TransferableDataHelper          aOleData;
54     TransferableObjectDescriptor    aObjDesc;
55 //REMOVE        SvEmbeddedObjectRef             aDocShellRef;
56 //REMOVE        SvEmbeddedObjectRef             aDrawPersistRef;
57     SfxObjectShellRef               aDocShellRef;
58     SfxObjectShellRef               aDrawPersistRef;
59 
60                                     // extracted from model in ctor:
61     Size                            aSrcSize;
62     INetBookmark*                   pBookmark;
63     sal_Bool                            bGraphic;
64     sal_Bool                            bGrIsBit;
65     sal_Bool                            bOleObj;
66                                     // source information for drag&drop:
67                                     // (view is needed to handle drawing obejcts)
68     SdrView*                        pDragSourceView;
69     sal_uInt16                          nDragSourceFlags;
70     sal_Bool                            bDragWasInternal;
71 
72     sal_uInt32                      nSourceDocID;
73 
74     ScRangeListVector               m_aProtectedChartRangesVector;
75 
76 
77     void                InitDocShell();
78 //REMOVE        SvInPlaceObjectRef  GetSingleObject();
79     SdrOle2Obj* GetSingleObject();
80 
81 public:
82             ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContainerShell,
83                                 const TransferableObjectDescriptor& rDesc );
84     virtual ~ScDrawTransferObj();
85 
86     virtual void        AddSupportedFormats();
87     virtual sal_Bool    GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
88     virtual sal_Bool    WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
89                                         const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
90     virtual void        ObjectReleased();
91     virtual void        DragFinished( sal_Int8 nDropAction );
92 
93     SdrModel*           GetModel()  { return pModel; }
94 
95     void                SetDrawPersist( const SfxObjectShellRef& rRef );
96     void                SetDragSource( ScDrawView* pView );
97     void                SetDragSourceObj( SdrObject* pObj, SCTAB nTab );
98     void                SetDragSourceFlags( sal_uInt16 nFlags );
99     void                SetDragWasInternal();
100 
101     SdrView*            GetDragSourceView()             { return pDragSourceView; }
102     sal_uInt16              GetDragSourceFlags() const      { return nDragSourceFlags; }
103 
104     void                SetSourceDocID( sal_uInt32 nVal )
105                             { nSourceDocID = nVal; }
106     sal_uInt32          GetSourceDocID() const      { return nSourceDocID; }
107 
108     static ScDrawTransferObj* GetOwnClipboard( Window* pUIWin );
109     virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( com::sun::star::uno::RuntimeException );
110     static const com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
111 
112     const ScRangeListVector& GetProtectedChartRangesVector() const { return m_aProtectedChartRangesVector; }
113 };
114 
115 #endif
116 
117