LibreOffice
LibreOffice 24.2 SDK C/C++ API Reference
Classes | Macros | Typedefs | Functions
environment.h File Reference
#include "cppu/cppudllapi.h"
#include "rtl/ustring.h"
#include <stdarg.h>

Go to the source code of this file.

Classes

struct  _uno_Environment
 The binary specification of a UNO environment. More...
 
struct  _uno_ExtEnvironment
 The binary specification of a UNO environment supporting interface registration. More...
 

Macros

#define UNO_INIT_ENVIRONMENT   "uno_initEnvironment"
 

Typedefs

typedef struct SAL_DLLPUBLIC_RTTI _uno_Environment uno_Environment
 The binary specification of a UNO environment. More...
 
typedef 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 anymore. More...
 
typedef void *(* uno_memAlloc) (sal_Size nBytes)
 Generic function pointer declaration to allocate memory. More...
 
typedef struct SAL_DLLPUBLIC_RTTI _uno_ExtEnvironment uno_ExtEnvironment
 The binary specification of a UNO environment supporting interface registration. More...
 
typedef void(* uno_initEnvironmentFunc) (uno_Environment *pEnv)
 Function exported by some bridge library providing acquireInterface(), releaseInterface(); may set a disposing callback. More...
 
typedef void uno_EnvCallee(va_list *pParam)
 Typedef for variable argument function. More...
 

Functions

CPPU_DLLPUBLIC void uno_getEnvironment (uno_Environment **ppEnv, rtl_uString *pEnvDcp, void *pContext) SAL_THROW_EXTERN_C()
 Gets a specific environment. More...
 
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. More...
 
CPPU_DLLPUBLIC void uno_createEnvironment (uno_Environment **ppEnv, rtl_uString *pEnvDcp, void *pContext) SAL_THROW_EXTERN_C()
 Creates an environment. More...
 
CPPU_DLLPUBLIC void uno_dumpEnvironment (void *stream, uno_Environment *pEnv, const char *pFilter) SAL_THROW_EXTERN_C()
 Dumps out environment information, i.e. More...
 
CPPU_DLLPUBLIC void uno_dumpEnvironmentByName (void *stream, rtl_uString *pEnvDcp, const char *pFilter) SAL_THROW_EXTERN_C()
 Dumps out environment information, i.e. More...
 
CPPU_DLLPUBLIC void uno_getCurrentEnvironment (uno_Environment **ppEnv, rtl_uString *pTypeName) SAL_THROW_EXTERN_C()
 Returns the current Environment. More...
 
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. More...
 
CPPU_DLLPUBLIC void uno_Environment_invoke (uno_Environment *pEnv, uno_EnvCallee *pCallee,...) SAL_THROW_EXTERN_C()
 Invoke the passed function in the given environment. More...
 
CPPU_DLLPUBLIC void uno_Environment_enter (uno_Environment *pEnv) SAL_THROW_EXTERN_C()
 Enter an environment explicitly. More...
 
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 called. More...
 

Macro Definition Documentation

◆ UNO_INIT_ENVIRONMENT

#define UNO_INIT_ENVIRONMENT   "uno_initEnvironment"

Typedef Documentation

◆ uno_EnvCallee

typedef void uno_EnvCallee(va_list *pParam)

Typedef for variable argument function.

◆ uno_Environment

typedef struct SAL_DLLPUBLIC_RTTI _uno_Environment uno_Environment

The binary specification of a UNO environment.

◆ uno_ExtEnvironment

typedef struct SAL_DLLPUBLIC_RTTI _uno_ExtEnvironment uno_ExtEnvironment

The binary specification of a UNO environment supporting interface registration.

◆ uno_freeProxyFunc

typedef 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 anymore.

Any proxy object must register itself on first acquire() call and revoke itself on last release() call. This can happen several times because the environment caches proxy objects until the environment explicitly frees the proxy object calling this function.

Parameters
pEnvenvironment
pProxyproxy pointer

◆ uno_initEnvironmentFunc

typedef void( * uno_initEnvironmentFunc) (uno_Environment *pEnv)

Function exported by some bridge library providing acquireInterface(), releaseInterface(); may set a disposing callback.

Parameters
pEnvenvironment to be initialized

◆ uno_memAlloc

typedef void*( * uno_memAlloc) (sal_Size nBytes)

Generic function pointer declaration to allocate memory.

Used with getRegisteredInterfaces().

Parameters
nBytesamount of memory in bytes
Returns
pointer to allocated memory

Function Documentation

◆ uno_createEnvironment()

CPPU_DLLPUBLIC void uno_createEnvironment ( uno_Environment **  ppEnv,
rtl_uString *  pEnvDcp,
void *  pContext 
)

Creates an environment.

The new environment is anonymous (NOT publicly registered/ accessible).

Parameters
ppEnvout parameter of environment; given environment will be released
pEnvDcpdescriptor of environment
pContextcontext pointer (e.g., to distinguish java vm); set 0 if not needed

◆ uno_dumpEnvironment()

CPPU_DLLPUBLIC void uno_dumpEnvironment ( void *  stream,
uno_Environment pEnv,
const char *  pFilter 
)

Dumps out environment information, i.e.

registered interfaces.

Parameters
streamoutput stream (FILE *)
pEnvenvironment to be dumped
pFilterif not null, filters output

◆ uno_dumpEnvironmentByName()

CPPU_DLLPUBLIC void uno_dumpEnvironmentByName ( void *  stream,
rtl_uString *  pEnvDcp,
const char *  pFilter 
)

Dumps out environment information, i.e.

registered interfaces.

Parameters
streamoutput stream (FILE *)
pEnvDcpdescriptor of environment to be dumped
pFilterif not null, filters output

◆ uno_Environment_enter()

CPPU_DLLPUBLIC void uno_Environment_enter ( uno_Environment pEnv)

Enter an environment explicitly.

Parameters
pEnvthe environment to enter; NULL leaves all environments
Since
UDK 3.2.7

◆ uno_Environment_invoke()

CPPU_DLLPUBLIC void uno_Environment_invoke ( uno_Environment pEnv,
uno_EnvCallee pCallee,
  ... 
)

Invoke the passed function in the given environment.

Parameters
pEnvthe target environment
pCalleethe function to call
...the parameters passed to the function
Since
UDK 3.2.7

◆ uno_Environment_invoke_v()

CPPU_DLLPUBLIC void uno_Environment_invoke_v ( uno_Environment pEnv,
uno_EnvCallee pCallee,
va_list *  pParam 
)

Invoke the passed function in the given environment.

Parameters
pEnvthe target environment
pCalleethe function to call
pParamthe parameter pointer passed to the function
Since
UDK 3.2.7

◆ uno_Environment_isValid()

CPPU_DLLPUBLIC int uno_Environment_isValid ( uno_Environment pEnv,
rtl_uString **  pReason 
)

Check if a particular environment is currently valid, so that objects of that environment might be called.

Parameters
pEnvthe environment
pReasonthe reason, if it is not valid
Returns
1 == valid, 0 == invalid
Since
UDK 3.2.7

◆ uno_getCurrentEnvironment()

CPPU_DLLPUBLIC void uno_getCurrentEnvironment ( uno_Environment **  ppEnv,
rtl_uString *  pTypeName 
)

Returns the current Environment.

In case no Environment has explicitly been entered, a purpose free default environment gets returned (e.g. the "uno" or "gcc3" Environment).

Parameters
ppEnvinout parameter; a given environment will be released
pTypeNamethe optional type of the environment, falls back to "uno"
Since
UDK 3.2.7

◆ uno_getEnvironment()

CPPU_DLLPUBLIC void uno_getEnvironment ( uno_Environment **  ppEnv,
rtl_uString *  pEnvDcp,
void *  pContext 
)

Gets a specific environment.

If the specified environment does not exist, then a default one is created and registered. The environment revokes itself on last release() call.

Parameters
ppEnvinout parameter of environment; given environment will be released
pEnvDcpdescriptor of environment
pContextsome context pointer (e.g., to distinguish java vm; set 0 if not needed)

◆ uno_getRegisteredEnvironments()

CPPU_DLLPUBLIC void uno_getRegisteredEnvironments ( uno_Environment ***  pppEnvs,
sal_Int32 *  pnLen,
uno_memAlloc  memAlloc,
rtl_uString *  pEnvDcp 
)

Gets all specified environments.

Caller has to release returned environments and free allocated memory.

Parameters
pppEnvsout param; pointer to array of environments
pnLenout param; length of array
memAllocfunction for allocating memory that is passed back
pEnvDcpdescriptor of environments; 0 defaults to all