update credits
[LibreOffice.git] / dtrans / source / win32 / clipb / APNDataObject.hxx
blob279cd832b1dcdd7a7ea61c00dd539dae8532cde3
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_
25 an APartment Neutral dataobject wrapper; this wrapper of a IDataObject
26 pointer can be used from any apartment without RPC_E_WRONG_THREAD
27 which normally occurs if an apartment tries to use an interface
28 pointer of another apartment; we use containment to hold the original
29 DataObject
31 class CAPNDataObject : public IDataObject
33 public:
34 CAPNDataObject( IDataObjectPtr rIDataObject );
35 ~CAPNDataObject( );
37 //-----------------------------------------------------------------
38 //IUnknown interface methods
39 //-----------------------------------------------------------------
41 STDMETHODIMP QueryInterface(REFIID iid, LPVOID* ppvObject);
42 STDMETHODIMP_( ULONG ) AddRef( );
43 STDMETHODIMP_( ULONG ) Release( );
45 //-----------------------------------------------------------------
46 // IDataObject interface methods
47 //-----------------------------------------------------------------
49 STDMETHODIMP GetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium );
50 STDMETHODIMP GetDataHere( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium );
51 STDMETHODIMP QueryGetData( LPFORMATETC pFormatetc );
52 STDMETHODIMP GetCanonicalFormatEtc( LPFORMATETC pFormatectIn, LPFORMATETC pFormatetcOut );
53 STDMETHODIMP SetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium, BOOL fRelease );
54 STDMETHODIMP EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** ppenumFormatetc );
55 STDMETHODIMP DAdvise( LPFORMATETC pFormatetc, DWORD advf, LPADVISESINK pAdvSink, DWORD* pdwConnection );
56 STDMETHODIMP DUnadvise( DWORD dwConnection );
57 STDMETHODIMP EnumDAdvise( LPENUMSTATDATA* ppenumAdvise );
59 operator IDataObject*( );
61 private:
62 HRESULT MarshalIDataObjectIntoCurrentApartment( IDataObject** ppIDataObj );
64 private:
65 IDataObjectPtr m_rIDataObjectOrg;
66 HGLOBAL m_hGlobal;
67 LONG m_nRefCnt;
69 // prevent copy and assignment
70 private:
71 CAPNDataObject( const CAPNDataObject& theOther );
72 CAPNDataObject& operator=( const CAPNDataObject& theOther );
75 #endif
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */