| 1 |
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 |
/* |
| 3 |
* This file is part of the LibreOffice project. |
| 4 |
* |
| 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/. |
| 8 |
* |
| 9 |
* This file incorporates work covered by the following license notice: |
| 10 |
* |
| 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 . |
| 18 |
*/ |
| 19 |
|
| 20 |
#pragma once |
| 21 |
|
| 22 |
#include <osl/interlck.h> |
| 23 |
|
| 24 |
#include <uno/environment.hxx> |
| 25 |
#include <uno/mapping.hxx> |
| 26 |
#include <uno/dispatcher.h> |
| 27 |
|
| 28 |
#include <cppu/helper/purpenv/Mapping.hxx> |
| 29 |
|
| 30 |
|
| 31 |
class Proxy : public uno_Interface |
| 32 |
{ |
| 33 |
oslInterlockedCount m_nRef; |
| 34 |
|
| 35 |
css::uno::Environment m_from; |
| 36 |
css::uno::Environment m_to; |
| 37 |
|
| 38 |
css::uno::Mapping m_from_to; |
| 39 |
css::uno::Mapping m_to_from; |
| 40 |
|
| 41 |
// mapping information |
| 42 |
uno_Interface * m_pUnoI; // wrapped interface |
| 43 |
typelib_InterfaceTypeDescription * m_pTypeDescr; |
| 44 |
OUString m_aOId; |
| 45 |
|
| 46 |
cppu::helper::purpenv::ProbeFun * m_probeFun; |
| 47 |
void * m_pProbeContext; |
| 48 |
|
| 49 |
public: |
| 50 |
explicit Proxy(css::uno::Mapping to_from, |
| 51 |
uno_Environment * pTo, |
| 52 |
uno_Environment * pFrom, |
| 53 |
uno_Interface * pUnoI, |
| 54 |
typelib_InterfaceTypeDescription * pTypeDescr, |
| 55 |
OUString const & rOId, |
| 56 |
cppu::helper::purpenv::ProbeFun * probeFun, |
| 57 |
void * pProbeContext); |
| 58 |
~Proxy(); |
| 59 |
|
| 60 |
void acquire(); |
| 61 |
void release(); |
| 62 |
|
| 63 |
void dispatch( |
| 64 |
typelib_TypeDescriptionReference * pReturnTypeRef, |
| 65 |
typelib_MethodParameter * pParams, |
| 66 |
sal_Int32 nParams, |
| 67 |
typelib_TypeDescription const * pMemberType, |
| 68 |
void * pReturn, |
| 69 |
void * pArgs[], |
| 70 |
uno_Any ** ppException ); |
| 71 |
|
| 72 |
}; |
| 73 |
|
| 74 |
extern "C" void Proxy_free(uno_ExtEnvironment * pEnv, void * pProxy) SAL_THROW_EXTERN_C(); |
| 75 |
|
| 76 |
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |