UDK 3.2.7 C/C++ API Reference

uno/environment.h

Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /*
00003  * This file is part of the LibreOffice project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * This file incorporates work covered by the following license notice:
00010  *
00011  *   Licensed to the Apache Software Foundation (ASF) under one or more
00012  *   contributor license agreements. See the NOTICE file distributed
00013  *   with this work for additional information regarding copyright
00014  *   ownership. The ASF licenses this file to you under the Apache
00015  *   License, Version 2.0 (the "License"); you may not use this file
00016  *   except in compliance with the License. You may obtain a copy of
00017  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
00018  */
00019 #ifndef _UNO_ENVIRONMENT_H_
00020 #define _UNO_ENVIRONMENT_H_
00021 
00022 #include <cppu/cppudllapi.h>
00023 #include <rtl/ustring.h>
00024 
00025 #include <stdarg.h>
00026 
00027 #ifdef __cplusplus
00028 extern "C"
00029 {
00030 #endif
00031 
00032 struct _uno_ExtEnvironment;
00033 struct _typelib_InterfaceTypeDescription;
00034 
00035 #if defined( SAL_W32)
00036 #pragma pack(push, 8)
00037 #endif
00038 
00041 typedef struct _uno_Environment
00042 {
00045     void *              pReserved;
00046 
00049     rtl_uString *       pTypeName;
00050 
00053     void *              pContext;
00054 
00057     struct _uno_ExtEnvironment * pExtEnv;
00058 
00063     void (SAL_CALL * acquire)( struct _uno_Environment * pEnv );
00064 
00070     void (SAL_CALL * release)( struct _uno_Environment * pEnv );
00071 
00077     void (SAL_CALL * acquireWeak)( struct _uno_Environment * pEnv );
00078 
00083     void (SAL_CALL * releaseWeak)( struct _uno_Environment * pEnv );
00084 
00091     void (SAL_CALL * harden)(
00092         struct _uno_Environment ** ppHardEnv,
00093         struct _uno_Environment * pEnv );
00094 
00100     void (SAL_CALL * dispose)( struct _uno_Environment * pEnv );
00101 
00102     /* ===== the following part will be late initialized by a matching bridge ===== *
00103      * ===== and is NOT for public use.                                       ===== */
00104 
00110     void (SAL_CALL * environmentDisposing)( struct _uno_Environment * pEnv );
00111 } uno_Environment;
00112 
00122 typedef void (SAL_CALL * uno_freeProxyFunc)( struct _uno_ExtEnvironment * pEnv, void * pProxy );
00123 
00129 typedef void * (SAL_CALL * uno_memAlloc)( sal_Size nBytes );
00130 
00133 typedef struct _uno_ExtEnvironment
00134 {
00137     uno_Environment aBase;
00138 
00146     void (SAL_CALL * registerInterface)(
00147         struct _uno_ExtEnvironment * pEnv,
00148         void ** ppInterface,
00149         rtl_uString * pOId,
00150         struct _typelib_InterfaceTypeDescription * pTypeDescr );
00151 
00161     void (SAL_CALL * registerProxyInterface)(
00162         struct _uno_ExtEnvironment * pEnv,
00163         void ** ppProxy,
00164         uno_freeProxyFunc freeProxy,
00165         rtl_uString * pOId,
00166         struct _typelib_InterfaceTypeDescription * pTypeDescr );
00167 
00174     void (SAL_CALL * revokeInterface)(
00175         struct _uno_ExtEnvironment * pEnv,
00176         void * pInterface );
00177 
00183     void (SAL_CALL * getObjectIdentifier)(
00184         struct _uno_ExtEnvironment * pEnv,
00185         rtl_uString ** ppOId,
00186         void * pInterface );
00187 
00196     void (SAL_CALL * getRegisteredInterface)(
00197         struct _uno_ExtEnvironment * pEnv,
00198         void ** ppInterface,
00199         rtl_uString * pOId,
00200         struct _typelib_InterfaceTypeDescription * pTypeDescr );
00201 
00210     void (SAL_CALL * getRegisteredInterfaces)(
00211         struct _uno_ExtEnvironment * pEnv,
00212         void *** pppInterfaces,
00213         sal_Int32 * pnLen,
00214         uno_memAlloc memAlloc );
00215 
00216     /* ===== the following part will be late initialized by a matching bridge ===== */
00217 
00224     void (SAL_CALL * computeObjectIdentifier)(
00225         struct _uno_ExtEnvironment * pEnv,
00226         rtl_uString ** ppOId, void * pInterface );
00227 
00233     void (SAL_CALL * acquireInterface)(
00234         struct _uno_ExtEnvironment * pEnv,
00235         void * pInterface );
00236 
00242     void (SAL_CALL * releaseInterface)(
00243         struct _uno_ExtEnvironment * pEnv,
00244         void * pInterface );
00245 
00246 } uno_ExtEnvironment;
00247 
00248 #if defined( SAL_W32)
00249 #pragma pack(pop)
00250 #endif
00251 
00257 typedef void (SAL_CALL * uno_initEnvironmentFunc)( uno_Environment * pEnv );
00258 #define UNO_INIT_ENVIRONMENT "uno_initEnvironment"
00259 
00260 #ifdef DISABLE_DYNLOADING
00261 /* We link statically and have just the C++ environment */
00262 void SAL_CALL CPPU_ENV_uno_initEnvironment( uno_Environment * Env )
00263      SAL_THROW_EXTERN_C();
00264 #ifdef SOLAR_JAVA
00265 /* We also have the Java environment */
00266 void SAL_CALL java_uno_initEnvironment( uno_Environment * Env )
00267      SAL_THROW_EXTERN_C();
00268 #endif
00269 #endif
00270 
00278 CPPU_DLLPUBLIC void SAL_CALL uno_getEnvironment(
00279     uno_Environment ** ppEnv, rtl_uString * pEnvDcp, void * pContext )
00280     SAL_THROW_EXTERN_C();
00281 
00290 CPPU_DLLPUBLIC void SAL_CALL uno_getRegisteredEnvironments(
00291     uno_Environment *** pppEnvs, sal_Int32 * pnLen, uno_memAlloc memAlloc,
00292     rtl_uString * pEnvDcp )
00293     SAL_THROW_EXTERN_C();
00294 
00301 CPPU_DLLPUBLIC void SAL_CALL uno_createEnvironment(
00302     uno_Environment ** ppEnv, rtl_uString * pEnvDcp, void * pContext )
00303     SAL_THROW_EXTERN_C();
00304 
00311 CPPU_DLLPUBLIC void SAL_CALL uno_dumpEnvironment(
00312     void * stream, uno_Environment * pEnv, const sal_Char * pFilter )
00313     SAL_THROW_EXTERN_C();
00320 CPPU_DLLPUBLIC void SAL_CALL uno_dumpEnvironmentByName(
00321     void * stream, rtl_uString * pEnvDcp, const sal_Char * pFilter )
00322     SAL_THROW_EXTERN_C();
00323 
00324 
00325 
00334 CPPU_DLLPUBLIC void SAL_CALL uno_getCurrentEnvironment(uno_Environment ** ppEnv, rtl_uString * pTypeName)
00335     SAL_THROW_EXTERN_C();
00336 
00339 typedef void SAL_CALL uno_EnvCallee(va_list * pParam);
00340 
00348 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_invoke_v(uno_Environment * pEnv, uno_EnvCallee * pCallee, va_list * pParam)
00349     SAL_THROW_EXTERN_C();
00350 
00358 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_invoke (uno_Environment * pEnv, uno_EnvCallee * pCallee, ...)
00359     SAL_THROW_EXTERN_C();
00360 
00366 CPPU_DLLPUBLIC void SAL_CALL uno_Environment_enter(uno_Environment * pEnv)
00367     SAL_THROW_EXTERN_C();
00368 
00377 CPPU_DLLPUBLIC int SAL_CALL uno_Environment_isValid(uno_Environment * pEnv, rtl_uString ** pReason)
00378     SAL_THROW_EXTERN_C();
00379 
00380 #ifdef __cplusplus
00381 }
00382 #endif
00383 
00384 #endif
00385 
00386 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines