LibreOffice: uno/environment.h Source File

LibreOffice LibreOffice 5.1 SDK C/C++ API Reference

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

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 #ifndef INCLUDED_UNO_ENVIRONMENT_H
20 #define INCLUDED_UNO_ENVIRONMENT_H
21
22 #include <cppu/cppudllapi.h>
23 #include <rtl/ustring.h>
24
25 #include <stdarg.h>
26
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31
32 struct _uno_ExtEnvironment;
33 struct _typelib_InterfaceTypeDescription;
34
35 #if defined( SAL_W32)
36 #pragma pack(push, 8)
37 #endif
38
41 typedef struct SAL_DLLPUBLIC_RTTI _uno_Environment
42 {
45 void * pReserved;
46
49 rtl_uString * pTypeName;
50
53 void * pContext;
54
57 struct _uno_ExtEnvironment * pExtEnv;
58
63 void (SAL_CALL * acquire)( struct _uno_Environment * pEnv );
64
70 void (SAL_CALL * release)( struct _uno_Environment * pEnv );
71
77 void (SAL_CALL * acquireWeak)( struct _uno_Environment * pEnv );
78
83 void (SAL_CALL * releaseWeak)( struct _uno_Environment * pEnv );
84
91 void (SAL_CALL * harden)(
92 struct _uno_Environment ** ppHardEnv,
93 struct _uno_Environment * pEnv );
94
100 void (SAL_CALL * dispose)( struct _uno_Environment * pEnv );
101
102 /* ===== the following part will be late initialized by a matching bridge ===== *
103 * ===== and is NOT for public use. ===== */
104
110 void (SAL_CALL * environmentDisposing)( struct _uno_Environment * pEnv );
111 } uno_Environment;
112
122 typedef void (SAL_CALL * uno_freeProxyFunc)( struct _uno_ExtEnvironment * pEnv, void * pProxy );
123
129 typedef void * (SAL_CALL * uno_memAlloc)( sal_Size nBytes );
130
133 typedef struct SAL_DLLPUBLIC_RTTI _uno_ExtEnvironment
134 {
137 uno_Environment aBase;
138
146 void (SAL_CALL * registerInterface)(
147 struct _uno_ExtEnvironment * pEnv,
148 void ** ppInterface,
149 rtl_uString * pOId,
150 struct _typelib_InterfaceTypeDescription * pTypeDescr );
151
161 void (SAL_CALL * registerProxyInterface)(
162 struct _uno_ExtEnvironment * pEnv,
163 void ** ppProxy,
164 uno_freeProxyFunc freeProxy,
165 rtl_uString * pOId,
166 struct _typelib_InterfaceTypeDescription * pTypeDescr );
167
174 void (SAL_CALL * revokeInterface)(
175 struct _uno_ExtEnvironment * pEnv,
176 void * pInterface );
177
183 void (SAL_CALL * getObjectIdentifier)(
184 struct _uno_ExtEnvironment * pEnv,
185 rtl_uString ** ppOId,
186 void * pInterface );
187
196 void (SAL_CALL * getRegisteredInterface)(
197 struct _uno_ExtEnvironment * pEnv,
198 void ** ppInterface,
199 rtl_uString * pOId,
200 struct _typelib_InterfaceTypeDescription * pTypeDescr );
201
210 void (SAL_CALL * getRegisteredInterfaces)(
211 struct _uno_ExtEnvironment * pEnv,
212 void *** pppInterfaces,
213 sal_Int32 * pnLen,
214 uno_memAlloc memAlloc );
215
216 /* ===== the following part will be late initialized by a matching bridge ===== */
217
224 void (SAL_CALL * computeObjectIdentifier)(
225 struct _uno_ExtEnvironment * pEnv,
226 rtl_uString ** ppOId, void * pInterface );
227
233 void (SAL_CALL * acquireInterface)(
234 struct _uno_ExtEnvironment * pEnv,
235 void * pInterface );
236
242 void (SAL_CALL * releaseInterface)(
243 struct _uno_ExtEnvironment * pEnv,
244 void * pInterface );
245
246 } uno_ExtEnvironment;
247
248 #if defined( SAL_W32)
249 #pragma pack(pop)
250 #endif
251
257 typedef void (SAL_CALL * uno_initEnvironmentFunc)( uno_Environment * pEnv );
258 #define UNO_INIT_ENVIRONMENT "uno_initEnvironment"
259
260 #ifdef DISABLE_DYNLOADING
261 /* We link statically and have just the C++ environment */
262 void SAL_CALL CPPU_ENV_uno_initEnvironment( uno_Environment * Env )
263 SAL_THROW_EXTERN_C();
264
265 /* We might also have the Java environment */
266 void SAL_CALL java_uno_initEnvironment( uno_Environment * Env )
267 SAL_THROW_EXTERN_C();
268 #endif
269
277 CPPU_DLLPUBLIC void SAL_CALL uno_getEnvironment(
278 uno_Environment ** ppEnv, rtl_uString * pEnvDcp, void * pContext )
279 SAL_THROW_EXTERN_C();
280
289 CPPU_DLLPUBLIC void SAL_CALL uno_getRegisteredEnvironments(
290 uno_Environment *** pppEnvs, sal_Int32 * pnLen, uno_memAlloc memAlloc,
291 rtl_uString * pEnvDcp )
292 SAL_THROW_EXTERN_C();
293
300 CPPU_DLLPUBLIC void SAL_CALL uno_createEnvironment(
301 uno_Environment ** ppEnv, rtl_uString * pEnvDcp, void * pContext )
302 SAL_THROW_EXTERN_C();
303
310 CPPU_DLLPUBLIC void SAL_CALL uno_dumpEnvironment(
311 void * stream, uno_Environment * pEnv, const sal_Char * pFilter )
312 SAL_THROW_EXTERN_C();
319 CPPU_DLLPUBLIC void SAL_CALL uno_dumpEnvironmentByName(
320 void * stream, rtl_uString * pEnvDcp, const sal_Char * pFilter )
321 SAL_THROW_EXTERN_C();
322
323
324
333 CPPU_DLLPUBLIC void SAL_CALL uno_getCurrentEnvironment(uno_Environment ** ppEnv, rtl_uString * pTypeName)
334 SAL_THROW_EXTERN_C();
335
338 typedef void SAL_CALL uno_EnvCallee(va_list * pParam);
339
347 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_invoke_v(uno_Environment * pEnv, uno_EnvCallee * pCallee, va_list * pParam)
348 SAL_THROW_EXTERN_C();
349
357 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_invoke (uno_Environment * pEnv, uno_EnvCallee * pCallee, ...)
358 SAL_THROW_EXTERN_C();
359
365 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_enter(uno_Environment * pEnv)
366 SAL_THROW_EXTERN_C();
367
376 CPPU_DLLPUBLIC int SAL_CALL uno_Environment_isValid(uno_Environment * pEnv, rtl_uString ** pReason)
377 SAL_THROW_EXTERN_C();
378
379 #ifdef __cplusplus
380 }
381 #endif
382
383 #endif
384
385 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
uno_createEnvironment
CPPU_DLLPUBLIC void uno_createEnvironment(uno_Environment **ppEnv, rtl_uString *pEnvDcp, void *pContext) SAL_THROW_EXTERN_C()
Creates an environment.
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.
sal_Char
char sal_Char
A legacy synonym for char.
Definition: types.h:130
_uno_Environment
The binary specification of an UNO environment.
Definition: environment.h:41
uno_ExtEnvironment
struct SAL_DLLPUBLIC_RTTI _uno_ExtEnvironment uno_ExtEnvironment
The binary specification of an UNO environment supporting interface registration. ...
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:122
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::pTypeName
rtl_uString * pTypeName
type name of environment
Definition: environment.h:49
CPPU_DLLPUBLIC
#define CPPU_DLLPUBLIC
Definition: cppudllapi.h:10
_uno_ExtEnvironment::releaseInterface
void(* releaseInterface)(struct _uno_ExtEnvironment *pEnv, void *pInterface)
Function to release an interface.
Definition: environment.h:242
uno_EnvCallee
void uno_EnvCallee(va_list *pParam)
Typedef for variable argument function.
Definition: environment.h:338
_typelib_InterfaceTypeDescription
Type description of an interface.
Definition: typedescription.h:370
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_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_Environment::acquireWeak
void(* acquireWeak)(struct _uno_Environment *pEnv)
Acquires this environment weakly.
Definition: environment.h:77
_uno_ExtEnvironment::aBase
uno_Environment aBase
inherits all members of an uno_Environment
Definition: environment.h:137
_uno_Environment::pContext
void * pContext
free context pointer to be used for specific classes of environments (e.g., a jvm pointer) ...
Definition: environment.h:53
_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:224
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::pExtEnv
struct _uno_ExtEnvironment * pExtEnv
pointer to extended environment (interface registration functionality), if supported ...
Definition: environment.h:57
uno_dumpEnvironment
CPPU_DLLPUBLIC void uno_dumpEnvironment(void *stream, uno_Environment *pEnv, const sal_Char *pFilter) SAL_THROW_EXTERN_C()
Dumps out environment information, i.e.
uno_initEnvironmentFunc
void(* uno_initEnvironmentFunc)(uno_Environment *pEnv)
Function exported by some bridge library providing acquireInterface(), releaseInterface(); may set a ...
Definition: environment.h:257
_uno_Environment::releaseWeak
void(* releaseWeak)(struct _uno_Environment *pEnv)
Releases this environment weakly in correspondence to acquireWeak().
Definition: environment.h:83
_uno_Environment::pReserved
void * pReserved
reserved for future use (0 if not used)
Definition: environment.h:45
_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:70
_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:196
_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:110
uno_memAlloc
void *(* uno_memAlloc)(sal_Size nBytes)
Generic function pointer declaration to allocate memory.
Definition: environment.h:129
cppudllapi.h
_uno_ExtEnvironment
The binary specification of an UNO environment supporting interface registration. ...
Definition: environment.h:133
_uno_Environment::harden
void(* harden)(struct _uno_Environment **ppHardEnv, struct _uno_Environment *pEnv)
Makes hard reference out of weak referenced environment.
Definition: environment.h:91
_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:100
_uno_ExtEnvironment::acquireInterface
void(* acquireInterface)(struct _uno_ExtEnvironment *pEnv, void *pInterface)
Function to acquire an interface.
Definition: environment.h:233
SAL_THROW_EXTERN_C
#define SAL_THROW_EXTERN_C()
Nothrow specification for C functions.
Definition: types.h:368
uno_dumpEnvironmentByName
CPPU_DLLPUBLIC void uno_dumpEnvironmentByName(void *stream, rtl_uString *pEnvDcp, const sal_Char *pFilter) SAL_THROW_EXTERN_C()
Dumps out environment information, i.e.
uno_Environment
struct SAL_DLLPUBLIC_RTTI _uno_Environment uno_Environment
The binary specification of an UNO environment.
_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:183
ustring.h
uno_getCurrentEnvironment
CPPU_DLLPUBLIC void uno_getCurrentEnvironment(uno_Environment **ppEnv, rtl_uString *pTypeName) SAL_THROW_EXTERN_C()
Returns the current Environment.