1*38d50f7bSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*38d50f7bSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*38d50f7bSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*38d50f7bSAndrew Rist * distributed with this work for additional information 6*38d50f7bSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*38d50f7bSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*38d50f7bSAndrew Rist * "License"); you may not use this file except in compliance 9*38d50f7bSAndrew Rist * with the License. You may obtain a copy of the License at 10*38d50f7bSAndrew Rist * 11*38d50f7bSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*38d50f7bSAndrew Rist * 13*38d50f7bSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*38d50f7bSAndrew Rist * software distributed under the License is distributed on an 15*38d50f7bSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*38d50f7bSAndrew Rist * KIND, either express or implied. See the License for the 17*38d50f7bSAndrew Rist * specific language governing permissions and limitations 18*38d50f7bSAndrew Rist * under the License. 19*38d50f7bSAndrew Rist * 20*38d50f7bSAndrew Rist *************************************************************/ 21*38d50f7bSAndrew Rist 22*38d50f7bSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SC_TRANSOBJ_HXX 25cdf0e10cSrcweir #define SC_TRANSOBJ_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <svtools/transfer.hxx> 28cdf0e10cSrcweir #include "global.hxx" 29cdf0e10cSrcweir #include "address.hxx" 30cdf0e10cSrcweir 31cdf0e10cSrcweir class ScDocShell; 32cdf0e10cSrcweir class ScMarkData; 33cdf0e10cSrcweir class SfxObjectShell; 34cdf0e10cSrcweir 35cdf0e10cSrcweir namespace com { namespace sun { namespace star { 36cdf0e10cSrcweir namespace sheet { 37cdf0e10cSrcweir class XSheetCellRanges; 38cdf0e10cSrcweir } 39cdf0e10cSrcweir }}} 40cdf0e10cSrcweir 41cdf0e10cSrcweir #include <sfx2/objsh.hxx> 42cdf0e10cSrcweir 43cdf0e10cSrcweir class ScTransferObj : public TransferableHelper 44cdf0e10cSrcweir { 45cdf0e10cSrcweir private: 46cdf0e10cSrcweir ScDocument* pDoc; 47cdf0e10cSrcweir ScRange aBlock; 48cdf0e10cSrcweir SCROW nNonFiltered; // non-filtered rows 49cdf0e10cSrcweir TransferableDataHelper aOleData; 50cdf0e10cSrcweir TransferableObjectDescriptor aObjDesc; 51cdf0e10cSrcweir //REMOVE SvEmbeddedObjectRef aDocShellRef; 52cdf0e10cSrcweir //REMOVE SvEmbeddedObjectRef aDrawPersistRef; 53cdf0e10cSrcweir SfxObjectShellRef aDocShellRef; 54cdf0e10cSrcweir SfxObjectShellRef aDrawPersistRef; 55cdf0e10cSrcweir com::sun::star::uno::Reference<com::sun::star::sheet::XSheetCellRanges> xDragSourceRanges; 56cdf0e10cSrcweir SCCOL nDragHandleX; 57cdf0e10cSrcweir SCROW nDragHandleY; 58cdf0e10cSrcweir SCTAB nVisibleTab; 59cdf0e10cSrcweir sal_uInt16 nDragSourceFlags; 60cdf0e10cSrcweir sal_Bool bDragWasInternal; 61cdf0e10cSrcweir sal_Bool bUsedForLink; 62cdf0e10cSrcweir bool bHasFiltered; // if has filtered rows 63cdf0e10cSrcweir bool bUseInApi; // to recognize clipboard content copied from API 64cdf0e10cSrcweir 65cdf0e10cSrcweir void InitDocShell(); 66cdf0e10cSrcweir static void StripRefs( ScDocument* pDoc, SCCOL nStartX, SCROW nStartY, 67cdf0e10cSrcweir SCCOL nEndX, SCROW nEndY, 68cdf0e10cSrcweir ScDocument* pDestDoc=0, 69cdf0e10cSrcweir SCCOL nSubX=0, SCROW nSubY=0 ); 70cdf0e10cSrcweir static void PaintToDev( OutputDevice* pDev, ScDocument* pDoc, double nPrintFactor, 71cdf0e10cSrcweir const ScRange& rBlock, sal_Bool bMetaFile ); 72cdf0e10cSrcweir static void GetAreaSize( ScDocument* pDoc, SCTAB nTab1, SCTAB nTab2, SCROW& nRow, SCCOL& nCol ); 73cdf0e10cSrcweir 74cdf0e10cSrcweir public: 75cdf0e10cSrcweir ScTransferObj( ScDocument* pClipDoc, const TransferableObjectDescriptor& rDesc ); 76cdf0e10cSrcweir virtual ~ScTransferObj(); 77cdf0e10cSrcweir 78cdf0e10cSrcweir virtual void AddSupportedFormats(); 79cdf0e10cSrcweir virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); 80cdf0e10cSrcweir virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, 81cdf0e10cSrcweir const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); 82cdf0e10cSrcweir virtual void ObjectReleased(); 83cdf0e10cSrcweir virtual void DragFinished( sal_Int8 nDropAction ); 84cdf0e10cSrcweir 85cdf0e10cSrcweir ScDocument* GetDocument() { return pDoc; } // owned by ScTransferObj 86cdf0e10cSrcweir const ScRange& GetRange() const { return aBlock; } 87cdf0e10cSrcweir SCROW GetNonFilteredRows() const { return nNonFiltered; } 88cdf0e10cSrcweir SCCOL GetDragHandleX() const { return nDragHandleX; } 89cdf0e10cSrcweir SCROW GetDragHandleY() const { return nDragHandleY; } 90cdf0e10cSrcweir SCTAB GetVisibleTab() const { return nVisibleTab; } 91cdf0e10cSrcweir sal_uInt16 GetDragSourceFlags() const { return nDragSourceFlags; } 92cdf0e10cSrcweir bool HasFilteredRows() const { return bHasFiltered; } 93cdf0e10cSrcweir bool GetUseInApi() const { return bUseInApi; } 94cdf0e10cSrcweir ScDocShell* GetSourceDocShell(); 95cdf0e10cSrcweir ScDocument* GetSourceDocument(); 96cdf0e10cSrcweir ScMarkData GetSourceMarkData(); 97cdf0e10cSrcweir 98cdf0e10cSrcweir void SetDrawPersist( const SfxObjectShellRef& rRef ); 99cdf0e10cSrcweir void SetDragHandlePos( SCCOL nX, SCROW nY ); 100cdf0e10cSrcweir void SetVisibleTab( SCTAB nNew ); 101cdf0e10cSrcweir void SetDragSource( ScDocShell* pSourceShell, const ScMarkData& rMark ); 102cdf0e10cSrcweir void SetDragSourceFlags( sal_uInt16 nFlags ); 103cdf0e10cSrcweir void SetDragWasInternal(); 104cdf0e10cSrcweir SC_DLLPUBLIC void SetUseInApi( bool bSet ); 105cdf0e10cSrcweir 106cdf0e10cSrcweir static SC_DLLPUBLIC ScTransferObj* GetOwnClipboard( Window* pUIWin ); 107cdf0e10cSrcweir 108cdf0e10cSrcweir static SfxObjectShell* SetDrawClipDoc( sal_Bool bAnyOle ); // update ScGlobal::pDrawClipDocShellRef 109cdf0e10cSrcweir virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( com::sun::star::uno::RuntimeException ); 110cdf0e10cSrcweir static const com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); 111cdf0e10cSrcweir }; 112cdf0e10cSrcweir 113cdf0e10cSrcweir #endif 114cdf0e10cSrcweir 115