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 #ifndef SC_DRWTRANS_HXX 23 #define SC_DRWTRANS_HXX 24 25 #include <com/sun/star/uno/Reference.hxx> 26 #include <com/sun/star/embed/XEmbeddedObject.hpp> 27 #include <svtools/transfer.hxx> 28 29 #include <sfx2/objsh.hxx> 30 #include "global.hxx" 31 #include "charthelper.hxx" 32 #include "rangelst.hxx" 33 34 class SdrModel; 35 class ScDocShell; 36 class INetBookmark; 37 class SdrObject; 38 class SdrView; 39 class ScDrawView; 40 class SdrOle2Obj; 41 42 class ScDrawTransferObj : public TransferableHelper 43 { 44 private: 45 SdrModel* pModel; 46 TransferableDataHelper aOleData; 47 TransferableObjectDescriptor aObjDesc; 48 //REMOVE SvEmbeddedObjectRef aDocShellRef; 49 //REMOVE SvEmbeddedObjectRef aDrawPersistRef; 50 SfxObjectShellRef aDocShellRef; 51 SfxObjectShellRef aDrawPersistRef; 52 53 // extracted from model in ctor: 54 Size aSrcSize; 55 INetBookmark* pBookmark; 56 sal_Bool bGraphic; 57 sal_Bool bGrIsBit; 58 sal_Bool bOleObj; 59 // source information for drag&drop: 60 // (view is needed to handle drawing objects) 61 SdrView* pDragSourceView; 62 sal_uInt16 nDragSourceFlags; 63 sal_Bool bDragWasInternal; 64 65 sal_uInt32 nSourceDocID; 66 67 ScRangeListVector m_aProtectedChartRangesVector; 68 69 70 void InitDocShell(); 71 //REMOVE SvInPlaceObjectRef GetSingleObject(); 72 SdrOle2Obj* GetSingleObject(); 73 74 public: 75 ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContainerShell, 76 const TransferableObjectDescriptor& rDesc ); 77 virtual ~ScDrawTransferObj(); 78 79 virtual void AddSupportedFormats(); 80 virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); 81 virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, 82 const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); 83 virtual void ObjectReleased(); 84 virtual void DragFinished( sal_Int8 nDropAction ); 85 GetModel()86 SdrModel* GetModel() { return pModel; } 87 88 void SetDrawPersist( const SfxObjectShellRef& rRef ); 89 void SetDragSource( ScDrawView* pView ); 90 void SetDragSourceObj( SdrObject* pObj, SCTAB nTab ); 91 void SetDragSourceFlags( sal_uInt16 nFlags ); 92 void SetDragWasInternal(); 93 GetDragSourceView()94 SdrView* GetDragSourceView() { return pDragSourceView; } GetDragSourceFlags() const95 sal_uInt16 GetDragSourceFlags() const { return nDragSourceFlags; } 96 SetSourceDocID(sal_uInt32 nVal)97 void SetSourceDocID( sal_uInt32 nVal ) 98 { nSourceDocID = nVal; } GetSourceDocID() const99 sal_uInt32 GetSourceDocID() const { return nSourceDocID; } 100 101 static ScDrawTransferObj* GetOwnClipboard( Window* pUIWin ); 102 virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( com::sun::star::uno::RuntimeException ); 103 static const com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); 104 GetProtectedChartRangesVector() const105 const ScRangeListVector& GetProtectedChartRangesVector() const { return m_aProtectedChartRangesVector; } 106 }; 107 108 #endif 109 110 /* vim: set noet sw=4 ts=4: */ 111