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: XTDataObject.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 ************************************************************************/
32 #ifndef _XTDATAOBJECT_HXX_
33 #define _XTDATAOBJECT_HXX_
36 //------------------------------------------------------------------------
38 //------------------------------------------------------------------------
41 #include <com/sun/star/datatransfer/XTransferable.hpp>
42 #include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
43 #include "WinClipboard.hxx"
51 //------------------------------------------------------------------------
53 //------------------------------------------------------------------------
57 class CXTDataObject
: public IDataObject
60 CXTDataObject( LONG nRefCntInitVal
= 0);
63 //-----------------------------------------------------------------
64 // ole interface implementation
65 //-----------------------------------------------------------------
68 STDMETHODIMP
QueryInterface(REFIID iid
, LPVOID
* ppvObject
);
69 STDMETHODIMP_( ULONG
) AddRef( );
70 STDMETHODIMP_( ULONG
) Release( );
73 STDMETHODIMP
GetData( LPFORMATETC pFormatetc
, LPSTGMEDIUM pmedium
);
74 STDMETHODIMP
GetDataHere( LPFORMATETC pFormatetc
, LPSTGMEDIUM pmedium
);
75 STDMETHODIMP
QueryGetData( LPFORMATETC pFormatetc
);
76 STDMETHODIMP
GetCanonicalFormatEtc( LPFORMATETC pFormatectIn
, LPFORMATETC pFormatetcOut
);
77 STDMETHODIMP
SetData( LPFORMATETC pFormatetc
, LPSTGMEDIUM pmedium
, BOOL fRelease
);
78 STDMETHODIMP
EnumFormatEtc( DWORD dwDirection
, IEnumFORMATETC
** ppenumFormatetc
);
79 STDMETHODIMP
DAdvise( LPFORMATETC pFormatetc
, DWORD advf
, LPADVISESINK pAdvSink
, DWORD
* pdwConnection
);
80 STDMETHODIMP
DUnadvise( DWORD dwConnection
);
81 STDMETHODIMP
EnumDAdvise( LPENUMSTATDATA
* ppenumAdvise
);
83 operator IDataObject
*( );
85 // notification handler
86 //void SAL_CALL LostOwnership( );
88 //sal_Int64 SAL_CALL QueryDataSize( );
90 // retrieve the data from the source
92 //void SAL_CALL GetAllDataFromSource( );
96 //CWinClipboard& m_rCWinClipboard;
97 //const const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& m_rXClipboardOwner;
98 //const const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& m_rXTDataSource;
100 //friend class CWinClipboard;
101 friend class CEnumFormatEtc
;
104 //------------------------------------------------------------------------
106 //------------------------------------------------------------------------
108 class CEnumFormatEtc
: public IEnumFORMATETC
111 CEnumFormatEtc( LPUNKNOWN pUnkDataObj
);
115 STDMETHODIMP
QueryInterface( REFIID iid
, LPVOID
* ppvObject
);
116 STDMETHODIMP_( ULONG
) AddRef( );
117 STDMETHODIMP_( ULONG
) Release( );
120 STDMETHODIMP
Next( ULONG celt
, LPFORMATETC rgelt
, ULONG
* pceltFetched
);
121 STDMETHODIMP
Skip( ULONG celt
);
122 STDMETHODIMP
Reset( );
123 STDMETHODIMP
Clone( IEnumFORMATETC
** ppenum
);
127 LPUNKNOWN m_pUnkDataObj
;
129 CLIPFORMAT m_cfFormats
[2];
133 typedef CEnumFormatEtc
*PCEnumFormatEtc
;