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_TRANSOBJ_HXX 29 #define SC_TRANSOBJ_HXX 30 31 #include <svtools/transfer.hxx> 32 #include "global.hxx" 33 #include "address.hxx" 34 35 class ScDocShell; 36 class ScMarkData; 37 class SfxObjectShell; 38 39 namespace com { namespace sun { namespace star { 40 namespace sheet { 41 class XSheetCellRanges; 42 } 43 }}} 44 45 #include <sfx2/objsh.hxx> 46 47 class ScTransferObj : public TransferableHelper 48 { 49 private: 50 ScDocument* pDoc; 51 ScRange aBlock; 52 SCROW nNonFiltered; // non-filtered rows 53 TransferableDataHelper aOleData; 54 TransferableObjectDescriptor aObjDesc; 55 //REMOVE SvEmbeddedObjectRef aDocShellRef; 56 //REMOVE SvEmbeddedObjectRef aDrawPersistRef; 57 SfxObjectShellRef aDocShellRef; 58 SfxObjectShellRef aDrawPersistRef; 59 com::sun::star::uno::Reference<com::sun::star::sheet::XSheetCellRanges> xDragSourceRanges; 60 SCCOL nDragHandleX; 61 SCROW nDragHandleY; 62 SCTAB nVisibleTab; 63 sal_uInt16 nDragSourceFlags; 64 sal_Bool bDragWasInternal; 65 sal_Bool bUsedForLink; 66 bool bHasFiltered; // if has filtered rows 67 bool bUseInApi; // to recognize clipboard content copied from API 68 69 void InitDocShell(); 70 static void StripRefs( ScDocument* pDoc, SCCOL nStartX, SCROW nStartY, 71 SCCOL nEndX, SCROW nEndY, 72 ScDocument* pDestDoc=0, 73 SCCOL nSubX=0, SCROW nSubY=0 ); 74 static void PaintToDev( OutputDevice* pDev, ScDocument* pDoc, double nPrintFactor, 75 const ScRange& rBlock, sal_Bool bMetaFile ); 76 static void GetAreaSize( ScDocument* pDoc, SCTAB nTab1, SCTAB nTab2, SCROW& nRow, SCCOL& nCol ); 77 78 public: 79 ScTransferObj( ScDocument* pClipDoc, const TransferableObjectDescriptor& rDesc ); 80 virtual ~ScTransferObj(); 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 89 ScDocument* GetDocument() { return pDoc; } // owned by ScTransferObj 90 const ScRange& GetRange() const { return aBlock; } 91 SCROW GetNonFilteredRows() const { return nNonFiltered; } 92 SCCOL GetDragHandleX() const { return nDragHandleX; } 93 SCROW GetDragHandleY() const { return nDragHandleY; } 94 SCTAB GetVisibleTab() const { return nVisibleTab; } 95 sal_uInt16 GetDragSourceFlags() const { return nDragSourceFlags; } 96 bool HasFilteredRows() const { return bHasFiltered; } 97 bool GetUseInApi() const { return bUseInApi; } 98 ScDocShell* GetSourceDocShell(); 99 ScDocument* GetSourceDocument(); 100 ScMarkData GetSourceMarkData(); 101 102 void SetDrawPersist( const SfxObjectShellRef& rRef ); 103 void SetDragHandlePos( SCCOL nX, SCROW nY ); 104 void SetVisibleTab( SCTAB nNew ); 105 void SetDragSource( ScDocShell* pSourceShell, const ScMarkData& rMark ); 106 void SetDragSourceFlags( sal_uInt16 nFlags ); 107 void SetDragWasInternal(); 108 SC_DLLPUBLIC void SetUseInApi( bool bSet ); 109 110 static SC_DLLPUBLIC ScTransferObj* GetOwnClipboard( Window* pUIWin ); 111 112 static SfxObjectShell* SetDrawClipDoc( sal_Bool bAnyOle ); // update ScGlobal::pDrawClipDocShellRef 113 virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( com::sun::star::uno::RuntimeException ); 114 static const com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); 115 }; 116 117 #endif 118 119