Bump version to 4.1-6
[LibreOffice.git] / dtrans / source / win32 / dtobj / APNDataObject.hxx
blob6ef90e16f068575a04cd40b1d59dad33901e69ab
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 _APNDATAOBJECT_HXX_
22 #define _APNDATAOBJECT_HXX_
24 #include <systools/win32/comtools.hxx>
27 an APartment Neutral dataobject wrapper; this wrapper of a IDataObject
28 pointer can be used from any apartment without RPC_E_WRONG_THREAD
29 which normally occurs if an apartment tries to use an interface
30 pointer of another apartment; we use containment to hold the original
31 DataObject
33 class CAPNDataObject : public IDataObject
35 public:
36 CAPNDataObject( IDataObjectPtr rIDataObject );
37 virtual ~CAPNDataObject( );
39 //-----------------------------------------------------------------
40 //IUnknown interface methods
41 //-----------------------------------------------------------------
43 STDMETHODIMP QueryInterface(REFIID iid, LPVOID* ppvObject);
44 STDMETHODIMP_( ULONG ) AddRef( );
45 STDMETHODIMP_( ULONG ) Release( );
47 //-----------------------------------------------------------------
48 // IDataObject interface methods
49 //-----------------------------------------------------------------
51 STDMETHODIMP GetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium );
52 STDMETHODIMP GetDataHere( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium );
53 STDMETHODIMP QueryGetData( LPFORMATETC pFormatetc );
54 STDMETHODIMP GetCanonicalFormatEtc( LPFORMATETC pFormatectIn, LPFORMATETC pFormatetcOut );
55 STDMETHODIMP SetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium, BOOL fRelease );
56 STDMETHODIMP EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** ppenumFormatetc );
57 STDMETHODIMP DAdvise( LPFORMATETC pFormatetc, DWORD advf, LPADVISESINK pAdvSink, DWORD* pdwConnection );
58 STDMETHODIMP DUnadvise( DWORD dwConnection );
59 STDMETHODIMP EnumDAdvise( LPENUMSTATDATA* ppenumAdvise );
61 operator IDataObject*( );
63 private:
64 HRESULT MarshalIDataObjectIntoCurrentApartment( IDataObject** ppIDataObj );
66 private:
67 IDataObjectPtr m_rIDataObjectOrg;
68 HGLOBAL m_hGlobal;
69 LONG m_nRefCnt;
71 // prevent copy and assignment
72 private:
73 CAPNDataObject( const CAPNDataObject& theOther );
74 CAPNDataObject& operator=( const CAPNDataObject& theOther );
77 #endif
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */