AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 #ifndef INCLUDED_UNO_ENVIRONMENT_H
4 #define INCLUDED_UNO_ENVIRONMENT_H
5 
6 #include "cppu/cppudllapi.h"
7 #include "rtl/ustring.h"
8 
9 #include <stdarg.h>
10 
11 #ifdef __cplusplus
12 extern "C"
13 {
14 #endif
15 
16 struct _uno_ExtEnvironment;
18 
19 #if defined( _WIN32)
20 #pragma pack(push, 8)
21 #endif
22 
25 typedef struct SAL_DLLPUBLIC_RTTI _uno_Environment
26 {
29  void * pReserved;
30 
33  rtl_uString * pTypeName;
34 
37  void * pContext;
38 
42 
47  void (SAL_CALL * acquire)( struct _uno_Environment * pEnv );
48 
54  void (SAL_CALL * release)( struct _uno_Environment * pEnv );
55 
61  void (SAL_CALL * acquireWeak)( struct _uno_Environment * pEnv );
62 
67  void (SAL_CALL * releaseWeak)( struct _uno_Environment * pEnv );
68 
75  void (SAL_CALL * harden)(
76  struct _uno_Environment ** ppHardEnv,
77  struct _uno_Environment * pEnv );
78 
84  void (SAL_CALL * dispose)( struct _uno_Environment * pEnv );
85 
86  /* ===== the following part will be late initialized by a matching bridge ===== *
87  * ===== and is NOT for public use. ===== */
88 
94  void (SAL_CALL * environmentDisposing)( struct _uno_Environment * pEnv );
96 
106 typedef void (SAL_CALL * uno_freeProxyFunc)( struct _uno_ExtEnvironment * pEnv, void * pProxy );
107 
113 typedef void * (SAL_CALL * uno_memAlloc)( sal_Size nBytes );
114 
117 typedef struct SAL_DLLPUBLIC_RTTI _uno_ExtEnvironment
118 {
122 
130  void (SAL_CALL * registerInterface)(
131  struct _uno_ExtEnvironment * pEnv,
132  void ** ppInterface,
133  rtl_uString * pOId,
134  struct _typelib_InterfaceTypeDescription * pTypeDescr );
135 
145  void (SAL_CALL * registerProxyInterface)(
146  struct _uno_ExtEnvironment * pEnv,
147  void ** ppProxy,
148  uno_freeProxyFunc freeProxy,
149  rtl_uString * pOId,
150  struct _typelib_InterfaceTypeDescription * pTypeDescr );
151 
158  void (SAL_CALL * revokeInterface)(
159  struct _uno_ExtEnvironment * pEnv,
160  void * pInterface );
161 
167  void (SAL_CALL * getObjectIdentifier)(
168  struct _uno_ExtEnvironment * pEnv,
169  rtl_uString ** ppOId,
170  void * pInterface );
171 
180  void (SAL_CALL * getRegisteredInterface)(
181  struct _uno_ExtEnvironment * pEnv,
182  void ** ppInterface,
183  rtl_uString * pOId,
184  struct _typelib_InterfaceTypeDescription * pTypeDescr );
185 
194  void (SAL_CALL * getRegisteredInterfaces)(
195  struct _uno_ExtEnvironment * pEnv,
196  void *** pppInterfaces,
197  sal_Int32 * pnLen,
198  uno_memAlloc memAlloc );
199 
200  /* ===== the following part will be late initialized by a matching bridge ===== */
201 
208  void (SAL_CALL * computeObjectIdentifier)(
209  struct _uno_ExtEnvironment * pEnv,
210  rtl_uString ** ppOId, void * pInterface );
211 
217  void (SAL_CALL * acquireInterface)(
218  struct _uno_ExtEnvironment * pEnv,
219  void * pInterface );
220 
226  void (SAL_CALL * releaseInterface)(
227  struct _uno_ExtEnvironment * pEnv,
228  void * pInterface );
229 
231 
232 #if defined( _WIN32)
233 #pragma pack(pop)
234 #endif
235 
241 typedef void (SAL_CALL * uno_initEnvironmentFunc)( uno_Environment * pEnv );
242 #define UNO_INIT_ENVIRONMENT "uno_initEnvironment"
243 
244 #ifdef DISABLE_DYNLOADING
245 /* We link statically and have just the C++ environment */
246 void SAL_CALL CPPU_ENV_uno_initEnvironment( uno_Environment * Env )
248 
249 /* We might also have the Java environment */
250 void SAL_CALL java_uno_initEnvironment( uno_Environment * Env )
252 #endif
253 
261 CPPU_DLLPUBLIC void SAL_CALL uno_getEnvironment(
262  uno_Environment ** ppEnv, rtl_uString * pEnvDcp, void * pContext )
264 
274  uno_Environment *** pppEnvs, sal_Int32 * pnLen, uno_memAlloc memAlloc,
275  rtl_uString * pEnvDcp )
277 
285  uno_Environment ** ppEnv, rtl_uString * pEnvDcp, void * pContext )
287 
294 CPPU_DLLPUBLIC void SAL_CALL uno_dumpEnvironment(
295  void * stream, uno_Environment * pEnv, const char * pFilter )
304  void * stream, rtl_uString * pEnvDcp, const char * pFilter )
306 
307 
308 
317 CPPU_DLLPUBLIC void SAL_CALL uno_getCurrentEnvironment(uno_Environment ** ppEnv, rtl_uString * pTypeName)
319 
322 typedef void SAL_CALL uno_EnvCallee(va_list * pParam);
323 
331 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_invoke_v(uno_Environment * pEnv, uno_EnvCallee * pCallee, va_list * pParam)
333 
341 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_invoke (uno_Environment * pEnv, uno_EnvCallee * pCallee, ...)
343 
351 
360 CPPU_DLLPUBLIC int SAL_CALL uno_Environment_isValid(uno_Environment * pEnv, rtl_uString ** pReason)
361  SAL_THROW_EXTERN_C();
362 
363 #ifdef __cplusplus
364 }
365 #endif
366 
367 #endif
368 
369 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void *(* uno_memAlloc)(sal_Size nBytes)
Generic function pointer declaration to allocate memory.
Definition: environment.h:113
void(* releaseInterface)(struct _uno_ExtEnvironment *pEnv, void *pInterface)
Function to release an interface.
Definition: environment.h:226
void(* uno_initEnvironmentFunc)(uno_Environment *pEnv)
Function exported by some bridge library providing acquireInterface(), releaseInterface(); may set a ...
Definition: environment.h:241
void(* getObjectIdentifier)(struct _uno_ExtEnvironment *pEnv, rtl_uString **ppOId, void *pInterface)
Provides the object id of a given interface.
Definition: environment.h:167
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.
void(* acquireWeak)(struct _uno_Environment *pEnv)
Acquires this environment weakly.
Definition: environment.h:61
void(* release)(struct _uno_Environment *pEnv)
Releases this environment; last release of environment will revoke the environment from runtime...
Definition: environment.h:54
void(* acquireInterface)(struct _uno_ExtEnvironment *pEnv, void *pInterface)
Function to acquire an interface.
Definition: environment.h:217
The binary specification of a UNO environment.
Definition: environment.h:25
CPPU_DLLPUBLIC void uno_dumpEnvironment(void *stream, uno_Environment *pEnv, const char *pFilter) SAL_THROW_EXTERN_C()
Dumps out environment information, i.e.
CPPU_DLLPUBLIC void uno_Environment_invoke(uno_Environment *pEnv, uno_EnvCallee *pCallee,...) SAL_THROW_EXTERN_C()
Invoke the passed function in the given environment.
rtl_uString * pTypeName
type name of environment
Definition: environment.h:33
Type description of an interface.
Definition: typedescription.h:354
struct SAL_DLLPUBLIC_RTTI _uno_ExtEnvironment uno_ExtEnvironment
The binary specification of a UNO environment supporting interface registration.
void(* harden)(struct _uno_Environment **ppHardEnv, struct _uno_Environment *pEnv)
Makes hard reference out of weak referenced environment.
Definition: environment.h:75
CPPU_DLLPUBLIC void uno_getEnvironment(uno_Environment **ppEnv, rtl_uString *pEnvDcp, void *pContext) SAL_THROW_EXTERN_C()
Gets a specific environment.
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:180
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:208
void(* releaseWeak)(struct _uno_Environment *pEnv)
Releases this environment weakly in correspondence to acquireWeak().
Definition: environment.h:67
CPPU_DLLPUBLIC void SAL_THROW_EXTERN_C()
This method is called to wait for a reply of a previously sent request.
CPPU_DLLPUBLIC void uno_dumpEnvironmentByName(void *stream, rtl_uString *pEnvDcp, const char *pFilter) SAL_THROW_EXTERN_C()
Dumps out environment information, i.e.
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 aBase
inherits all members of a uno_Environment
Definition: environment.h:121
void * pContext
free context pointer to be used for specific classes of environments (e.g., a jvm pointer) ...
Definition: environment.h:37
void(* environmentDisposing)(struct _uno_Environment *pEnv)
CALLBACK function pointer: Disposing callback function pointer that can be set to get signalled befor...
Definition: environment.h:94
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:106
struct _uno_ExtEnvironment * pExtEnv
pointer to extended environment (interface registration functionality), if supported ...
Definition: environment.h:41
void * pReserved
reserved for future use (0 if not used)
Definition: environment.h:29
CPPU_DLLPUBLIC void uno_Environment_enter(uno_Environment *pEnv) SAL_THROW_EXTERN_C()
Enter an environment explicitly.
struct SAL_DLLPUBLIC_RTTI _uno_Environment uno_Environment
The binary specification of a UNO environment.
void(* dispose)(struct _uno_Environment *pEnv)
Call this function to EXPLICITLY dispose this environment (e.g., release all interfaces).
Definition: environment.h:84
The binary specification of a UNO environment supporting interface registration.
Definition: environment.h:117
CPPU_DLLPUBLIC void uno_getCurrentEnvironment(uno_Environment **ppEnv, rtl_uString *pTypeName) SAL_THROW_EXTERN_C()
Returns the current Environment.
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...
CPPU_DLLPUBLIC void uno_createEnvironment(uno_Environment **ppEnv, rtl_uString *pEnvDcp, void *pContext) SAL_THROW_EXTERN_C()
Creates an environment.
#define CPPU_DLLPUBLIC
Definition: cppudllapi.h:11
void uno_EnvCallee(va_list *pParam)
Typedef for variable argument function.
Definition: environment.h:322