LibreOffice: uno/environment.h Source File

LibreOffice LibreOffice 25.8 SDK C/C++ API Reference

Loading...
Searching...
No Matches
environment.h
Go to the documentation of this file.
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/*
21 * This file is part of LibreOffice published API.
22 */
23#ifndef INCLUDED_UNO_ENVIRONMENT_H
24#define INCLUDED_UNO_ENVIRONMENT_H
25
26#include "cppu/cppudllapi.h"
27#include "rtl/ustring.h"
28
29#include <stdarg.h>
30
31#ifdef __cplusplus
32extern "C"
33{
34#endif
35
36struct _uno_ExtEnvironment;
37struct _typelib_InterfaceTypeDescription;
38
39#if defined( _WIN32)
40#pragma pack(push, 8)
41#endif
42
45 typedef struct SAL_DLLPUBLIC_RTTI _uno_Environment
46{
49 void * pReserved;
50
53 rtl_uString * pTypeName;
54
57 void * pContext;
58
61 struct _uno_ExtEnvironment * pExtEnv;
62
67 void (SAL_CALL * acquire)( struct _uno_Environment * pEnv );
68
74 void (SAL_CALL * release)( struct _uno_Environment * pEnv );
75
81 void (SAL_CALL * acquireWeak)( struct _uno_Environment * pEnv );
82
87 void (SAL_CALL * releaseWeak)( struct _uno_Environment * pEnv );
88
95 void (SAL_CALL * harden)(
96 struct _uno_Environment ** ppHardEnv,
97 struct _uno_Environment * pEnv );
98
104 void (SAL_CALL * dispose)( struct _uno_Environment * pEnv );
105
106 /* ===== the following part will be late initialized by a matching bridge ===== *
107 * ===== and is NOT for public use. ===== */
108
114 void (SAL_CALL * environmentDisposing)( struct _uno_Environment * pEnv );
115} uno_Environment;
116
126 typedef void (SAL_CALL * uno_freeProxyFunc)( struct _uno_ExtEnvironment * pEnv, void * pProxy );
127
133 typedef void * (SAL_CALL * uno_memAlloc)( sal_Size nBytes );
134
137 typedef struct SAL_DLLPUBLIC_RTTI _uno_ExtEnvironment
138{
141 uno_Environment aBase;
142
150 void (SAL_CALL * registerInterface)(
151 struct _uno_ExtEnvironment * pEnv,
152 void ** ppInterface,
153 rtl_uString * pOId,
154 struct _typelib_InterfaceTypeDescription * pTypeDescr );
155
165 void (SAL_CALL * registerProxyInterface)(
166 struct _uno_ExtEnvironment * pEnv,
167 void ** ppProxy,
168 uno_freeProxyFunc freeProxy,
169 rtl_uString * pOId,
170 struct _typelib_InterfaceTypeDescription * pTypeDescr );
171
178 void (SAL_CALL * revokeInterface)(
179 struct _uno_ExtEnvironment * pEnv,
180 void * pInterface );
181
187 void (SAL_CALL * getObjectIdentifier)(
188 struct _uno_ExtEnvironment * pEnv,
189 rtl_uString ** ppOId,
190 void * pInterface );
191
200 void (SAL_CALL * getRegisteredInterface)(
201 struct _uno_ExtEnvironment * pEnv,
202 void ** ppInterface,
203 rtl_uString * pOId,
204 struct _typelib_InterfaceTypeDescription * pTypeDescr );
205
214 void (SAL_CALL * getRegisteredInterfaces)(
215 struct _uno_ExtEnvironment * pEnv,
216 void *** pppInterfaces,
217 sal_Int32 * pnLen,
218 uno_memAlloc memAlloc );
219
220 /* ===== the following part will be late initialized by a matching bridge ===== */
221
228 void (SAL_CALL * computeObjectIdentifier)(
229 struct _uno_ExtEnvironment * pEnv,
230 rtl_uString ** ppOId, void * pInterface );
231
237 void (SAL_CALL * acquireInterface)(
238 struct _uno_ExtEnvironment * pEnv,
239 void * pInterface );
240
246 void (SAL_CALL * releaseInterface)(
247 struct _uno_ExtEnvironment * pEnv,
248 void * pInterface );
249
250} uno_ExtEnvironment;
251
252#if defined( _WIN32)
253#pragma pack(pop)
254#endif
255
261 typedef void (SAL_CALL * uno_initEnvironmentFunc)( uno_Environment * pEnv );
262#define UNO_INIT_ENVIRONMENT "uno_initEnvironment"
263
264#ifdef DISABLE_DYNLOADING
265/* We link statically and have just the C++ environment */
266void SAL_CALL CPPU_ENV_uno_initEnvironment( uno_Environment * Env )
267 SAL_THROW_EXTERN_C();
268
269/* We might also have the Java environment */
270void SAL_CALL java_uno_initEnvironment( uno_Environment * Env )
271 SAL_THROW_EXTERN_C();
272#endif
273
281 CPPU_DLLPUBLIC void SAL_CALL uno_getEnvironment(
282 uno_Environment ** ppEnv, rtl_uString * pEnvDcp, void * pContext )
283 SAL_THROW_EXTERN_C();
284
293 CPPU_DLLPUBLIC void SAL_CALL uno_getRegisteredEnvironments(
294 uno_Environment *** pppEnvs, sal_Int32 * pnLen, uno_memAlloc memAlloc,
295 rtl_uString * pEnvDcp )
296 SAL_THROW_EXTERN_C();
297
304 CPPU_DLLPUBLIC void SAL_CALL uno_createEnvironment(
305 uno_Environment ** ppEnv, rtl_uString * pEnvDcp, void * pContext )
306 SAL_THROW_EXTERN_C();
307
314 CPPU_DLLPUBLIC void SAL_CALL uno_dumpEnvironment(
315 void * stream, uno_Environment * pEnv, const char * pFilter )
316 SAL_THROW_EXTERN_C();
323 CPPU_DLLPUBLIC void SAL_CALL uno_dumpEnvironmentByName(
324 void * stream, rtl_uString * pEnvDcp, const char * pFilter )
325 SAL_THROW_EXTERN_C();
326
327
328
337 CPPU_DLLPUBLIC void SAL_CALL uno_getCurrentEnvironment(uno_Environment ** ppEnv, rtl_uString * pTypeName)
338 SAL_THROW_EXTERN_C();
339
342 typedef void SAL_CALL uno_EnvCallee(va_list * pParam);
343
351 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_invoke_v(uno_Environment * pEnv, uno_EnvCallee * pCallee, va_list * pParam)
352 SAL_THROW_EXTERN_C();
353
361 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_invoke (uno_Environment * pEnv, uno_EnvCallee * pCallee, ...)
362 SAL_THROW_EXTERN_C();
363
369 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_enter(uno_Environment * pEnv)
370 SAL_THROW_EXTERN_C();
371
380 CPPU_DLLPUBLIC int SAL_CALL uno_Environment_isValid(uno_Environment * pEnv, rtl_uString ** pReason)
381 SAL_THROW_EXTERN_C();
382
383#ifdef __cplusplus
384}
385#endif
386
387#endif
388
389/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_THROW_EXTERN_C
#define SAL_THROW_EXTERN_C()
Nothrow specification for C functions.
Definition types.h:352
ustring.h
uno_Environment
struct SAL_DLLPUBLIC_RTTI _uno_Environment uno_Environment
The binary specification of a UNO environment.
uno_getEnvironment
CPPU_DLLPUBLIC void uno_getEnvironment(uno_Environment **ppEnv, rtl_uString *pEnvDcp, void *pContext) SAL_THROW_EXTERN_C()
Gets a specific environment.
uno_Environment_isValid
CPPU_DLLPUBLIC int uno_Environment_isValid(uno_Environment *pEnv, rtl_uString **pReason) SAL_THROW_EXTERN_C()
Check if a particular environment is currently valid, so that objects of that environment might be ca...
uno_Environment_enter
CPPU_DLLPUBLIC void uno_Environment_enter(uno_Environment *pEnv) SAL_THROW_EXTERN_C()
Enter an environment explicitly.
uno_Environment_invoke
CPPU_DLLPUBLIC void uno_Environment_invoke(uno_Environment *pEnv, uno_EnvCallee *pCallee,...) SAL_THROW_EXTERN_C()
Invoke the passed function in the given environment.
uno_Environment_invoke_v
CPPU_DLLPUBLIC void uno_Environment_invoke_v(uno_Environment *pEnv, uno_EnvCallee *pCallee, va_list *pParam) SAL_THROW_EXTERN_C()
Invoke the passed function in the given environment.
uno_freeProxyFunc
void(* uno_freeProxyFunc)(struct _uno_ExtEnvironment *pEnv, void *pProxy)
Generic function pointer declaration to free a proxy object if it is not needed by the environment an...
Definition environment.h:126
uno_dumpEnvironmentByName
CPPU_DLLPUBLIC void uno_dumpEnvironmentByName(void *stream, rtl_uString *pEnvDcp, const char *pFilter) SAL_THROW_EXTERN_C()
Dumps out environment information, i.e.
uno_memAlloc
void *(* uno_memAlloc)(sal_Size nBytes)
Generic function pointer declaration to allocate memory.
Definition environment.h:133
uno_getRegisteredEnvironments
CPPU_DLLPUBLIC void uno_getRegisteredEnvironments(uno_Environment ***pppEnvs, sal_Int32 *pnLen, uno_memAlloc memAlloc, rtl_uString *pEnvDcp) SAL_THROW_EXTERN_C()
Gets all specified environments.
uno_initEnvironmentFunc
void(* uno_initEnvironmentFunc)(uno_Environment *pEnv)
Function exported by some bridge library providing acquireInterface(), releaseInterface(); may set a ...
Definition environment.h:261
uno_ExtEnvironment
struct SAL_DLLPUBLIC_RTTI _uno_ExtEnvironment uno_ExtEnvironment
The binary specification of a UNO environment supporting interface registration.
uno_createEnvironment
CPPU_DLLPUBLIC void uno_createEnvironment(uno_Environment **ppEnv, rtl_uString *pEnvDcp, void *pContext) SAL_THROW_EXTERN_C()
Creates an environment.
uno_EnvCallee
void uno_EnvCallee(va_list *pParam)
Typedef for variable argument function.
Definition environment.h:342
uno_dumpEnvironment
CPPU_DLLPUBLIC void uno_dumpEnvironment(void *stream, uno_Environment *pEnv, const char *pFilter) SAL_THROW_EXTERN_C()
Dumps out environment information, i.e.
uno_getCurrentEnvironment
CPPU_DLLPUBLIC void uno_getCurrentEnvironment(uno_Environment **ppEnv, rtl_uString *pTypeName) SAL_THROW_EXTERN_C()
Returns the current Environment.
cppudllapi.h
CPPU_DLLPUBLIC
#define CPPU_DLLPUBLIC
Definition cppudllapi.h:13
_typelib_InterfaceTypeDescription
Type description of an interface.
Definition typedescription.h:375
_uno_Environment
The binary specification of a UNO environment.
Definition environment.h:46
_uno_Environment::releaseWeak
void(* releaseWeak)(struct _uno_Environment *pEnv)
Releases this environment weakly in correspondence to acquireWeak().
Definition environment.h:87
_uno_Environment::pReserved
void * pReserved
reserved for future use (0 if not used)
Definition environment.h:49
_uno_Environment::pContext
void * pContext
free context pointer to be used for specific classes of environments (e.g., a jvm pointer)
Definition environment.h:57
_uno_Environment::dispose
void(* dispose)(struct _uno_Environment *pEnv)
Call this function to EXPLICITLY dispose this environment (e.g., release all interfaces).
Definition environment.h:104
_uno_Environment::environmentDisposing
void(* environmentDisposing)(struct _uno_Environment *pEnv)
CALLBACK function pointer: Disposing callback function pointer that can be set to get signalled befor...
Definition environment.h:114
_uno_Environment::harden
void(* harden)(struct _uno_Environment **ppHardEnv, struct _uno_Environment *pEnv)
Makes hard reference out of weak referenced environment.
Definition environment.h:95
_uno_Environment::acquire
void(* acquire)(struct _uno_Environment *pEnv)
Acquires this environment.
Definition environment.h:67
_uno_Environment::acquireWeak
void(* acquireWeak)(struct _uno_Environment *pEnv)
Acquires this environment weakly.
Definition environment.h:81
_uno_Environment::pTypeName
rtl_uString * pTypeName
type name of environment
Definition environment.h:53
_uno_Environment::release
void(* release)(struct _uno_Environment *pEnv)
Releases this environment; last release of environment will revoke the environment from runtime.
Definition environment.h:74
_uno_Environment::pExtEnv
struct _uno_ExtEnvironment * pExtEnv
pointer to extended environment (interface registration functionality), if supported
Definition environment.h:61
_uno_ExtEnvironment
The binary specification of a UNO environment supporting interface registration.
Definition environment.h:138
_uno_ExtEnvironment::releaseInterface
void(* releaseInterface)(struct _uno_ExtEnvironment *pEnv, void *pInterface)
Function to release an interface.
Definition environment.h:246
_uno_ExtEnvironment::getRegisteredInterfaces
void(* getRegisteredInterfaces)(struct _uno_ExtEnvironment *pEnv, void ***pppInterfaces, sal_Int32 *pnLen, uno_memAlloc memAlloc)
Returns all currently registered interfaces of this environment.
Definition environment.h:214
_uno_ExtEnvironment::getRegisteredInterface
void(* getRegisteredInterface)(struct _uno_ExtEnvironment *pEnv, void **ppInterface, rtl_uString *pOId, struct _typelib_InterfaceTypeDescription *pTypeDescr)
Retrieves an interface identified by its object id and type from this environment.
Definition environment.h:200
_uno_ExtEnvironment::revokeInterface
void(* revokeInterface)(struct _uno_ExtEnvironment *pEnv, void *pInterface)
Revokes an interface from this environment.
Definition environment.h:178
_uno_ExtEnvironment::acquireInterface
void(* acquireInterface)(struct _uno_ExtEnvironment *pEnv, void *pInterface)
Function to acquire an interface.
Definition environment.h:237
_uno_ExtEnvironment::getObjectIdentifier
void(* getObjectIdentifier)(struct _uno_ExtEnvironment *pEnv, rtl_uString **ppOId, void *pInterface)
Provides the object id of a given interface.
Definition environment.h:187
_uno_ExtEnvironment::registerProxyInterface
void(* registerProxyInterface)(struct _uno_ExtEnvironment *pEnv, void **ppProxy, uno_freeProxyFunc freeProxy, rtl_uString *pOId, struct _typelib_InterfaceTypeDescription *pTypeDescr)
Registers a proxy interface of this environment that can be reanimated and is freed explicitly by thi...
Definition environment.h:165
_uno_ExtEnvironment::computeObjectIdentifier
void(* computeObjectIdentifier)(struct _uno_ExtEnvironment *pEnv, rtl_uString **ppOId, void *pInterface)
Computes an object id of the given interface; is called by the environment implementation.
Definition environment.h:228
_uno_ExtEnvironment::registerInterface
void(* registerInterface)(struct _uno_ExtEnvironment *pEnv, void **ppInterface, rtl_uString *pOId, struct _typelib_InterfaceTypeDescription *pTypeDescr)
Registers an interface of this environment.
Definition environment.h:150
_uno_ExtEnvironment::aBase
uno_Environment aBase
inherits all members of a uno_Environment
Definition environment.h:141