1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: transobj.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_TRANSOBJ_HXX
32 #define SC_TRANSOBJ_HXX
34 #include <svtools/transfer.hxx>
36 #include "address.hxx"
42 namespace com
{ namespace sun
{ namespace star
{
44 class XSheetCellRanges
;
48 #include <sfx2/objsh.hxx>
50 class ScTransferObj
: public TransferableHelper
55 SCROW nNonFiltered
; // non-filtered rows
56 TransferableDataHelper aOleData
;
57 TransferableObjectDescriptor aObjDesc
;
58 //REMOVE SvEmbeddedObjectRef aDocShellRef;
59 //REMOVE SvEmbeddedObjectRef aDrawPersistRef;
60 SfxObjectShellRef aDocShellRef
;
61 SfxObjectShellRef aDrawPersistRef
;
62 com::sun::star::uno::Reference
<com::sun::star::sheet::XSheetCellRanges
> xDragSourceRanges
;
66 USHORT nDragSourceFlags
;
67 BOOL bDragWasInternal
;
69 bool bHasFiltered
; // if has filtered rows
72 static void StripRefs( ScDocument
* pDoc
, SCCOL nStartX
, SCROW nStartY
,
73 SCCOL nEndX
, SCROW nEndY
,
74 ScDocument
* pDestDoc
=0,
75 SCCOL nSubX
=0, SCROW nSubY
=0 );
76 static void PaintToDev( OutputDevice
* pDev
, ScDocument
* pDoc
, double nPrintFactor
,
77 const ScRange
& rBlock
, BOOL bMetaFile
);
78 static void GetAreaSize( ScDocument
* pDoc
, SCTAB nTab1
, SCTAB nTab2
, SCROW
& nRow
, SCCOL
& nCol
);
81 ScTransferObj( ScDocument
* pClipDoc
, const TransferableObjectDescriptor
& rDesc
);
82 virtual ~ScTransferObj();
84 virtual void AddSupportedFormats();
85 virtual sal_Bool
GetData( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
86 virtual sal_Bool
WriteObject( SotStorageStreamRef
& rxOStm
, void* pUserObject
, sal_uInt32 nUserObjectId
,
87 const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
88 virtual void ObjectReleased();
89 virtual void DragFinished( sal_Int8 nDropAction
);
91 ScDocument
* GetDocument() { return pDoc
; } // owned by ScTransferObj
92 const ScRange
& GetRange() const { return aBlock
; }
93 SCROW
GetNonFilteredRows() const { return nNonFiltered
; }
94 SCCOL
GetDragHandleX() const { return nDragHandleX
; }
95 SCROW
GetDragHandleY() const { return nDragHandleY
; }
96 SCTAB
GetVisibleTab() const { return nVisibleTab
; }
97 USHORT
GetDragSourceFlags() const { return nDragSourceFlags
; }
98 bool HasFilteredRows() const { return bHasFiltered
; }
99 ScDocShell
* GetSourceDocShell();
100 ScDocument
* GetSourceDocument();
101 ScMarkData
GetSourceMarkData();
103 void SetDrawPersist( const SfxObjectShellRef
& rRef
);
104 void SetDragHandlePos( SCCOL nX
, SCROW nY
);
105 void SetVisibleTab( SCTAB nNew
);
106 void SetDragSource( ScDocShell
* pSourceShell
, const ScMarkData
& rMark
);
107 void SetDragSourceFlags( USHORT nFlags
);
108 void SetDragWasInternal();
110 static SC_DLLPUBLIC ScTransferObj
* GetOwnClipboard( Window
* pUIWin
);
112 static SfxObjectShell
* SetDrawClipDoc( 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();