bump product version to 4.1.6.2
[LibreOffice.git] / dtrans / source / win32 / dtobj / XNotifyingDataObject.hxx
blobc0e172ddc994f75048a2ed1d2a39fac67e42c9df
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
21 #ifndef _XNOTIFYINGDATAOBJECT_HXX_
22 #define _XNOTIFYINGDATAOBJECT_HXX_
24 #include <com/sun/star/datatransfer/XTransferable.hpp>
25 #include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
27 #if defined _MSC_VER
28 #pragma warning(push,1)
29 #endif
30 #include <objidl.h>
31 #include <windows.h>
32 #if defined _MSC_VER
33 #pragma warning(pop)
34 #endif
36 #include <systools/win32/comtools.hxx>
38 /*--------------------------------------------------------------------------
39 To implement the lostOwnership mechanism cleanly we need this wrapper
40 object
41 ----------------------------------------------------------------------------*/
43 // forward
44 class CWinClipbImpl;
46 class CXNotifyingDataObject : public IDataObject
48 public:
49 CXNotifyingDataObject(
50 const IDataObjectPtr& aIDataObject,
51 const com::sun::star::uno::Reference< com::sun::star::datatransfer::XTransferable >& aXTransferable,
52 const com::sun::star::uno::Reference< com::sun::star::datatransfer::clipboard::XClipboardOwner >& aXClipOwner,
53 CWinClipbImpl* theWinClipImpl );
55 virtual ~CXNotifyingDataObject() {}
57 //-----------------------------------------------------------------
58 // ole interface implementation
59 //-----------------------------------------------------------------
61 //IUnknown interface methods
62 STDMETHODIMP QueryInterface(REFIID iid, LPVOID* ppvObject);
63 STDMETHODIMP_( ULONG ) AddRef( );
64 STDMETHODIMP_( ULONG ) Release( );
66 // IDataObject interface methods
67 STDMETHODIMP GetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium );
68 STDMETHODIMP GetDataHere( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium );
69 STDMETHODIMP QueryGetData( LPFORMATETC pFormatetc );
70 STDMETHODIMP GetCanonicalFormatEtc( LPFORMATETC pFormatectIn, LPFORMATETC pFormatetcOut );
71 STDMETHODIMP SetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium, BOOL fRelease );
72 STDMETHODIMP EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** ppenumFormatetc );
73 STDMETHODIMP DAdvise( LPFORMATETC pFormatetc, DWORD advf, LPADVISESINK pAdvSink, DWORD* pdwConnection );
74 STDMETHODIMP DUnadvise( DWORD dwConnection );
75 STDMETHODIMP EnumDAdvise( LPENUMSTATDATA* ppenumAdvise );
77 operator IDataObject*( );
79 private:
80 void SAL_CALL lostOwnership( );
82 private:
83 sal_Int32 m_nRefCnt;
84 IDataObjectPtr m_aIDataObject;
85 const com::sun::star::uno::Reference< com::sun::star::datatransfer::XTransferable > m_XTransferable;
86 const com::sun::star::uno::Reference< com::sun::star::datatransfer::clipboard::XClipboardOwner > m_XClipboardOwner;
87 CWinClipbImpl* m_pWinClipImpl;
89 friend class CWinClipbImpl;
92 #endif
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */