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: XNotifyingDataObject.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 _XNOTIFYINGDATAOBJECT_HXX_
33 #define _XNOTIFYINGDATAOBJECT_HXX_
36 //------------------------------------------------------------------------
38 //------------------------------------------------------------------------
40 #include <com/sun/star/datatransfer/XTransferable.hpp>
41 #include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
44 #pragma warning(push,1)
52 #include <systools/win32/comtools.hxx>
54 /*--------------------------------------------------------------------------
55 To implement the lostOwnership mechanism cleanly we need this wrapper
57 ----------------------------------------------------------------------------*/
62 class CXNotifyingDataObject
: public IDataObject
65 CXNotifyingDataObject(
66 const IDataObjectPtr
& aIDataObject
,
67 const com::sun::star::uno::Reference
< com::sun::star::datatransfer::XTransferable
>& aXTransferable
,
68 const com::sun::star::uno::Reference
< com::sun::star::datatransfer::clipboard::XClipboardOwner
>& aXClipOwner
,
69 CWinClipbImpl
* theWinClipImpl
);
71 virtual ~CXNotifyingDataObject() {}
73 //-----------------------------------------------------------------
74 // ole interface implementation
75 //-----------------------------------------------------------------
77 //IUnknown interface methods
78 STDMETHODIMP
QueryInterface(REFIID iid
, LPVOID
* ppvObject
);
79 STDMETHODIMP_( ULONG
) AddRef( );
80 STDMETHODIMP_( ULONG
) Release( );
82 // IDataObject interface methods
83 STDMETHODIMP
GetData( LPFORMATETC pFormatetc
, LPSTGMEDIUM pmedium
);
84 STDMETHODIMP
GetDataHere( LPFORMATETC pFormatetc
, LPSTGMEDIUM pmedium
);
85 STDMETHODIMP
QueryGetData( LPFORMATETC pFormatetc
);
86 STDMETHODIMP
GetCanonicalFormatEtc( LPFORMATETC pFormatectIn
, LPFORMATETC pFormatetcOut
);
87 STDMETHODIMP
SetData( LPFORMATETC pFormatetc
, LPSTGMEDIUM pmedium
, BOOL fRelease
);
88 STDMETHODIMP
EnumFormatEtc( DWORD dwDirection
, IEnumFORMATETC
** ppenumFormatetc
);
89 STDMETHODIMP
DAdvise( LPFORMATETC pFormatetc
, DWORD advf
, LPADVISESINK pAdvSink
, DWORD
* pdwConnection
);
90 STDMETHODIMP
DUnadvise( DWORD dwConnection
);
91 STDMETHODIMP
EnumDAdvise( LPENUMSTATDATA
* ppenumAdvise
);
93 operator IDataObject
*( );
96 void SAL_CALL
lostOwnership( );
100 IDataObjectPtr m_aIDataObject
;
101 const com::sun::star::uno::Reference
< com::sun::star::datatransfer::XTransferable
> m_XTransferable
;
102 const com::sun::star::uno::Reference
< com::sun::star::datatransfer::clipboard::XClipboardOwner
> m_XClipboardOwner
;
103 CWinClipbImpl
* m_pWinClipImpl
;
105 friend class CWinClipbImpl
;