LibreOffice LibreOffice 4.1 SDK C/C++ API Reference

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

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 _UNO_ENVIRONMENT_H_
20 #define _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 _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 _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 #ifdef SOLAR_JAVA
265 /* We also have the Java environment */
266 void SAL_CALL java_uno_initEnvironment( uno_Environment * Env )
267 SAL_THROW_EXTERN_C();
268 #endif
269 #endif
270
278 CPPU_DLLPUBLIC void SAL_CALL uno_getEnvironment(
279 uno_Environment ** ppEnv, rtl_uString * pEnvDcp, void * pContext )
280 SAL_THROW_EXTERN_C();
281
290 CPPU_DLLPUBLIC void SAL_CALL uno_getRegisteredEnvironments(
291 uno_Environment *** pppEnvs, sal_Int32 * pnLen, uno_memAlloc memAlloc,
292 rtl_uString * pEnvDcp )
293 SAL_THROW_EXTERN_C();
294
301 CPPU_DLLPUBLIC void SAL_CALL uno_createEnvironment(
302 uno_Environment ** ppEnv, rtl_uString * pEnvDcp, void * pContext )
303 SAL_THROW_EXTERN_C();
304
311 CPPU_DLLPUBLIC void SAL_CALL uno_dumpEnvironment(
312 void * stream, uno_Environment * pEnv, const sal_Char * pFilter )
313 SAL_THROW_EXTERN_C();
320 CPPU_DLLPUBLIC void SAL_CALL uno_dumpEnvironmentByName(
321 void * stream, rtl_uString * pEnvDcp, const sal_Char * pFilter )
322 SAL_THROW_EXTERN_C();
323
324
325
334 CPPU_DLLPUBLIC void SAL_CALL uno_getCurrentEnvironment(uno_Environment ** ppEnv, rtl_uString * pTypeName)
335 SAL_THROW_EXTERN_C();
336
339 typedef void SAL_CALL uno_EnvCallee(va_list * pParam);
340
348 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_invoke_v(uno_Environment * pEnv, uno_EnvCallee * pCallee, va_list * pParam)
349 SAL_THROW_EXTERN_C();
350
358 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_invoke (uno_Environment * pEnv, uno_EnvCallee * pCallee, ...)
359 SAL_THROW_EXTERN_C();
360
366 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_enter(uno_Environment * pEnv)
367 SAL_THROW_EXTERN_C();
368
377 CPPU_DLLPUBLIC int SAL_CALL uno_Environment_isValid(uno_Environment * pEnv, rtl_uString ** pReason)
378 SAL_THROW_EXTERN_C();
379
380 #ifdef __cplusplus
381 }
382 #endif
383
384 #endif
385
386 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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_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_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
sal_Char
char sal_Char
Definition: types.h:122
_uno_Environment::pExtEnv
struct _uno_ExtEnvironment * pExtEnv
pointer to extended environment (interface registration functionality), if supported ...
Definition: environment.h:57
_uno_Environment::acquire
void(* acquire)(struct _uno_Environment *pEnv)
Acquires this environment.
Definition: environment.h:63
SAL_THROW_EXTERN_C
#define SAL_THROW_EXTERN_C()
Definition: types.h:358
_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_ExtEnvironment::revokeInterface
void(* revokeInterface)(struct _uno_ExtEnvironment *pEnv, void *pInterface)
Revokes an interface from this environment.
Definition: environment.h:174
_uno_ExtEnvironment::releaseInterface
void(* releaseInterface)(struct _uno_ExtEnvironment *pEnv, void *pInterface)
Function to release an interface.
Definition: environment.h:242
_typelib_InterfaceTypeDescription
Type description of an interface.
Definition: typedescription.h:424
_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_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::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_initEnvironmentFunc
void(* uno_initEnvironmentFunc)(uno_Environment *pEnv)
Function exported by some bridge library providing acquireInterface(), releaseInterface(); may set a ...
Definition: environment.h:257
_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:146
_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:210
uno_Environment_enter
CPPU_DLLPUBLIC void uno_Environment_enter(uno_Environment *pEnv) SAL_THROW_EXTERN_C()
Enter an environment explicitly.
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_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_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_EnvCallee
void uno_EnvCallee(va_list *pParam)
Typedef for variable argument function.
Definition: environment.h:339
_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
uno_getCurrentEnvironment
CPPU_DLLPUBLIC void uno_getCurrentEnvironment(uno_Environment **ppEnv, rtl_uString *pTypeName) SAL_THROW_EXTERN_C()
Returns the current Environment.
uno_memAlloc
void *(* uno_memAlloc)(sal_Size nBytes)
Generic function pointer declaration to allocate memory.
Definition: environment.h:129
CPPU_DLLPUBLIC
#define CPPU_DLLPUBLIC
Definition: cppudllapi.h:10
_uno_Environment::acquireWeak
void(* acquireWeak)(struct _uno_Environment *pEnv)
Acquires this environment weakly.
Definition: environment.h:77
_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:161
_uno_Environment
The binary specification of an UNO environment.
Definition: environment.h:41
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::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_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_createEnvironment
CPPU_DLLPUBLIC void uno_createEnvironment(uno_Environment **ppEnv, rtl_uString *pEnvDcp, void *pContext) SAL_THROW_EXTERN_C()
Creates an environment.
_uno_Environment::pTypeName
rtl_uString * pTypeName
type name of environment
Definition: environment.h:49
_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::pReserved
void * pReserved
reserved for future use (0 if not used)
Definition: environment.h:45
_uno_Environment::releaseWeak
void(* releaseWeak)(struct _uno_Environment *pEnv)
Releases this environment weakly in correspondence to acquireWeak().
Definition: environment.h:83
cppudllapi.h
uno_Environment
struct _uno_Environment uno_Environment
The binary specification of an UNO environment.
_uno_ExtEnvironment::aBase
uno_Environment aBase
inherits all members of an uno_Environment
Definition: environment.h:137
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_ExtEnvironment::acquireInterface
void(* acquireInterface)(struct _uno_ExtEnvironment *pEnv, void *pInterface)
Function to acquire an interface.
Definition: environment.h:233
uno_ExtEnvironment
struct _uno_ExtEnvironment uno_ExtEnvironment
The binary specification of an UNO environment supporting interface registration. ...
ustring.h