merged tag ooo/DEV300_m102
[LibreOffice.git] / cppu / source / helper / purpenv / Proxy.hxx
blob570d7291b1777f3b5b7470d253d10608fdb4d9cd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef INCLUDED_Proxy_hxx
29 #define INCLUDED_Proxy_hxx
31 #include "osl/interlck.h"
33 #include "uno/environment.hxx"
34 #include "uno/mapping.hxx"
35 #include "uno/dispatcher.h"
37 #include "cppu/helper/purpenv/Mapping.hxx"
40 namespace cssu = com::sun::star::uno;
43 class SAL_DLLPRIVATE Proxy : public uno_Interface
45 oslInterlockedCount m_nRef;
47 cssu::Environment m_from;
48 cssu::Environment m_to;
50 cssu::Mapping m_from_to;
51 cssu::Mapping m_to_from;
53 // mapping information
54 uno_Interface * m_pUnoI; // wrapped interface
55 typelib_InterfaceTypeDescription * m_pTypeDescr;
56 rtl::OUString m_aOId;
58 cppu::helper::purpenv::ProbeFun * m_probeFun;
59 void * m_pProbeContext;
61 public:
62 explicit Proxy(cssu::Mapping const & to_from,
63 uno_Environment * pTo,
64 uno_Environment * pFrom,
65 uno_Interface * pUnoI,
66 typelib_InterfaceTypeDescription * pTypeDescr,
67 rtl::OUString const & rOId,
68 cppu::helper::purpenv::ProbeFun * probeFun,
69 void * pProbeContext)
70 SAL_THROW( () );
71 ~Proxy(void);
73 void acquire(void);
74 void release(void);
76 void dispatch(
77 typelib_TypeDescriptionReference * pReturnTypeRef,
78 typelib_MethodParameter * pParams,
79 sal_Int32 nParams,
80 typelib_TypeDescription const * pMemberType,
81 void * pReturn,
82 void * pArgs[],
83 uno_Any ** ppException );
87 extern "C" SAL_DLLPRIVATE void SAL_CALL Proxy_free(uno_ExtEnvironment * pEnv, void * pProxy) SAL_THROW_EXTERN_C();
89 #endif