1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <sal/config.h>
28 #include "jni_helper.h"
30 #include <osl/diagnose.h>
32 #include <uno/mapping.h>
33 #include <uno/dispatcher.h>
35 #include <com/sun/star/uno/XInterface.hpp>
44 struct Mapping
: public uno_Mapping
49 // Holds environments and mappings:
52 mutable std::atomic
<std::size_t> m_ref
;
54 uno_ExtEnvironment
* m_uno_env
;
55 uno_Environment
* m_java_env
;
59 bool m_registered_java2uno
;
63 uno_Environment
* java_env
, uno_ExtEnvironment
* uno_env
,
64 bool registered_java2uno
);
71 JNI_context
const & jni
,
72 void * uno_data
, jvalue java_data
,
73 typelib_TypeDescriptionReference
* type
,
74 JNI_type_info
const * info
/* maybe 0 */,
75 bool assign
, bool out_param
,
76 bool special_wrapped_integral_types
= false ) const;
78 JNI_context
const & jni
,
79 jvalue
* java_data
, void const * uno_data
,
80 typelib_TypeDescriptionReference
* type
,
81 JNI_type_info
const * info
/* maybe 0 */,
82 bool in_param
, bool out_param
,
83 bool special_wrapped_integral_types
= false ) const;
87 JNI_context
const & jni
, uno_Any
* uno_exc
) const;
90 typelib_InterfaceTypeDescription
* iface_td
,
91 sal_Int32 local_member_index
, sal_Int32 function_pos_offset
,
92 typelib_TypeDescriptionReference
* return_type
,
93 typelib_MethodParameter
* params
, sal_Int32 nParams
,
94 void * uno_ret
, void * uno_args
[], uno_Any
** uno_exc
) const;
96 JNI_context
const & jni
,
97 uno_Interface
* pUnoI
, JNI_interface_type_info
const * info
) const;
100 void handle_java_exc(
101 JNI_context
const & jni
,
102 JLocalAutoRef
const & jo_exc
, uno_Any
* uno_exc
) const;
104 JNI_context
const & jni
,
105 uno_Interface
* pUnoI
, typelib_TypeDescription
* member_td
,
106 typelib_TypeDescriptionReference
* return_tdref
,
107 sal_Int32 nParams
, typelib_MethodParameter
const * pParams
,
108 jobjectArray jo_args
) const;
109 uno_Interface
* map_to_uno(
110 JNI_context
const & jni
,
111 jobject javaI
, JNI_interface_type_info
const * info
) const;
113 JNI_info
const * getJniInfo() const;
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */