xref: /aoo42x/main/sc/source/ui/inc/drwtrans.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_DRWTRANS_HXX
25 #define SC_DRWTRANS_HXX
26 
27 #include <com/sun/star/uno/Reference.hxx>
28 #include <com/sun/star/embed/XEmbeddedObject.hpp>
29 #include <svtools/transfer.hxx>
30 
31 #include <sfx2/objsh.hxx>
32 #include "global.hxx"
33 #include "charthelper.hxx"
34 #include "rangelst.hxx"
35 
36 
37 class SdrModel;
38 class ScDocShell;
39 class INetBookmark;
40 class SdrObject;
41 class SdrView;
42 class ScDrawView;
43 class SdrOle2Obj;
44 
45 class ScDrawTransferObj : public TransferableHelper
46 {
47 private:
48 	SdrModel*						pModel;
49 	TransferableDataHelper			aOleData;
50 	TransferableObjectDescriptor	aObjDesc;
51 //REMOVE		SvEmbeddedObjectRef				aDocShellRef;
52 //REMOVE		SvEmbeddedObjectRef				aDrawPersistRef;
53 	SfxObjectShellRef				aDocShellRef;
54 	SfxObjectShellRef				aDrawPersistRef;
55 
56 									// extracted from model in ctor:
57 	Size							aSrcSize;
58 	INetBookmark*					pBookmark;
59 	sal_Bool							bGraphic;
60 	sal_Bool							bGrIsBit;
61 	sal_Bool							bOleObj;
62 									// source information for drag&drop:
63 									// (view is needed to handle drawing obejcts)
64 	SdrView*						pDragSourceView;
65 	sal_uInt16							nDragSourceFlags;
66 	sal_Bool							bDragWasInternal;
67 
68     sal_uInt32                      nSourceDocID;
69 
70     ScRangeListVector               m_aProtectedChartRangesVector;
71 
72 
73 	void				InitDocShell();
74 //REMOVE		SvInPlaceObjectRef	GetSingleObject();
75 	SdrOle2Obj* GetSingleObject();
76 
77 public:
78 			ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContainerShell,
79 								const TransferableObjectDescriptor& rDesc );
80 	virtual ~ScDrawTransferObj();
81 
82 	virtual void		AddSupportedFormats();
83 	virtual sal_Bool	GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
84 	virtual sal_Bool	WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
85 										const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
86 	virtual void		ObjectReleased();
87 	virtual void		DragFinished( sal_Int8 nDropAction );
88 
GetModel()89 	SdrModel*			GetModel()	{ return pModel; }
90 
91 	void				SetDrawPersist( const SfxObjectShellRef& rRef );
92 	void				SetDragSource( ScDrawView* pView );
93 	void				SetDragSourceObj( SdrObject* pObj, SCTAB nTab );
94 	void				SetDragSourceFlags( sal_uInt16 nFlags );
95 	void				SetDragWasInternal();
96 
GetDragSourceView()97 	SdrView*			GetDragSourceView()				{ return pDragSourceView; }
GetDragSourceFlags() const98 	sal_uInt16				GetDragSourceFlags() const		{ return nDragSourceFlags; }
99 
SetSourceDocID(sal_uInt32 nVal)100     void                SetSourceDocID( sal_uInt32 nVal )
101                             { nSourceDocID = nVal; }
GetSourceDocID() const102     sal_uInt32          GetSourceDocID() const      { return nSourceDocID; }
103 
104 	static ScDrawTransferObj* GetOwnClipboard( Window* pUIWin );
105     virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( com::sun::star::uno::RuntimeException );
106     static const com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
107 
GetProtectedChartRangesVector() const108     const ScRangeListVector& GetProtectedChartRangesVector() const { return m_aProtectedChartRangesVector; }
109 };
110 
111 #endif
112 
113