1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_DTRANS_SOURCE_WIN32_DTOBJ_XNOTIFYINGDATAOBJECT_HXX
21 #define INCLUDED_DTRANS_SOURCE_WIN32_DTOBJ_XNOTIFYINGDATAOBJECT_HXX
23 #include <com/sun/star/datatransfer/XTransferable.hpp>
24 #include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
27 #pragma warning(push,1)
35 #include <systools/win32/comtools.hxx>
37 /*--------------------------------------------------------------------------
38 To implement the lostOwnership mechanism cleanly we need this wrapper
40 ----------------------------------------------------------------------------*/
45 class CXNotifyingDataObject
: public IDataObject
48 CXNotifyingDataObject(
49 const IDataObjectPtr
& aIDataObject
,
50 const com::sun::star::uno::Reference
< com::sun::star::datatransfer::XTransferable
>& aXTransferable
,
51 const com::sun::star::uno::Reference
< com::sun::star::datatransfer::clipboard::XClipboardOwner
>& aXClipOwner
,
52 CWinClipbImpl
* theWinClipImpl
);
54 virtual ~CXNotifyingDataObject() {}
56 // ole interface implementation
58 //IUnknown interface methods
59 STDMETHODIMP
QueryInterface(REFIID iid
, LPVOID
* ppvObject
);
60 STDMETHODIMP_( ULONG
) AddRef( );
61 STDMETHODIMP_( ULONG
) Release( );
63 // IDataObject interface methods
64 STDMETHODIMP
GetData( LPFORMATETC pFormatetc
, LPSTGMEDIUM pmedium
);
65 STDMETHODIMP
GetDataHere( LPFORMATETC pFormatetc
, LPSTGMEDIUM pmedium
);
66 STDMETHODIMP
QueryGetData( LPFORMATETC pFormatetc
);
67 STDMETHODIMP
GetCanonicalFormatEtc( LPFORMATETC pFormatectIn
, LPFORMATETC pFormatetcOut
);
68 STDMETHODIMP
SetData( LPFORMATETC pFormatetc
, LPSTGMEDIUM pmedium
, BOOL fRelease
);
69 STDMETHODIMP
EnumFormatEtc( DWORD dwDirection
, IEnumFORMATETC
** ppenumFormatetc
);
70 STDMETHODIMP
DAdvise( LPFORMATETC pFormatetc
, DWORD advf
, LPADVISESINK pAdvSink
, DWORD
* pdwConnection
);
71 STDMETHODIMP
DUnadvise( DWORD dwConnection
);
72 STDMETHODIMP
EnumDAdvise( LPENUMSTATDATA
* ppenumAdvise
);
74 operator IDataObject
*( );
77 void SAL_CALL
lostOwnership( );
81 IDataObjectPtr m_aIDataObject
;
82 const com::sun::star::uno::Reference
< com::sun::star::datatransfer::XTransferable
> m_XTransferable
;
83 const com::sun::star::uno::Reference
< com::sun::star::datatransfer::clipboard::XClipboardOwner
> m_XClipboardOwner
;
84 CWinClipbImpl
* m_pWinClipImpl
;
86 friend class CWinClipbImpl
;
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */