1*24f6443dSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*24f6443dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*24f6443dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*24f6443dSAndrew Rist * distributed with this work for additional information 6*24f6443dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*24f6443dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*24f6443dSAndrew Rist * "License"); you may not use this file except in compliance 9*24f6443dSAndrew Rist * with the License. You may obtain a copy of the License at 10*24f6443dSAndrew Rist * 11*24f6443dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*24f6443dSAndrew Rist * 13*24f6443dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*24f6443dSAndrew Rist * software distributed under the License is distributed on an 15*24f6443dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*24f6443dSAndrew Rist * KIND, either express or implied. See the License for the 17*24f6443dSAndrew Rist * specific language governing permissions and limitations 18*24f6443dSAndrew Rist * under the License. 19*24f6443dSAndrew Rist * 20*24f6443dSAndrew Rist *************************************************************/ 21*24f6443dSAndrew Rist 22*24f6443dSAndrew Rist 23cdf0e10cSrcweir #ifndef _UNO_DISPATCHER_H_ 24cdf0e10cSrcweir #define _UNO_DISPATCHER_H_ 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <sal/types.h> 27cdf0e10cSrcweir #include <rtl/ustring.h> 28cdf0e10cSrcweir #include <uno/any2.h> 29cdf0e10cSrcweir 30cdf0e10cSrcweir #ifdef __cplusplus 31cdf0e10cSrcweir extern "C" 32cdf0e10cSrcweir { 33cdf0e10cSrcweir #endif 34cdf0e10cSrcweir 35cdf0e10cSrcweir struct _typelib_TypeDescription; 36cdf0e10cSrcweir struct _uno_Interface; 37cdf0e10cSrcweir 38cdf0e10cSrcweir /** Function pointer declaration for the binary C uno dispatch function. Any pure out or return 39cdf0e10cSrcweir value will be constructed by the callee, iff no exception is signalled. 40cdf0e10cSrcweir If an exception is signalled, the any *ppException is properly constructed by the callee, 41cdf0e10cSrcweir otherwise the pointer *ppException is set to 0. 42cdf0e10cSrcweir An attribute get call is indicated by a non-null return pointer. 43cdf0e10cSrcweir 44cdf0e10cSrcweir @param pUnoI uno interface the call is performed on 45cdf0e10cSrcweir @param pMemberType member type description of a method or attribute 46cdf0e10cSrcweir @param pReturn pointer to return value memory; 47cdf0e10cSrcweir pointer may be undefined if void method, null if attribute set call. 48cdf0e10cSrcweir @param pArgs an array of pointers to arguments values. 49cdf0e10cSrcweir (remark: the value of an interface reference stores a 50cdf0e10cSrcweir uno_interface *, so you get it by *(uno_Interface **)pArgs[n]) 51cdf0e10cSrcweir @param ppException pointer to pointer to unconstructed any to signal an exception. 52cdf0e10cSrcweir */ 53cdf0e10cSrcweir typedef void (SAL_CALL * uno_DispatchMethod)( 54cdf0e10cSrcweir struct _uno_Interface * pUnoI, 55cdf0e10cSrcweir const struct _typelib_TypeDescription * pMemberType, 56cdf0e10cSrcweir void * pReturn, 57cdf0e10cSrcweir void * pArgs[], 58cdf0e10cSrcweir uno_Any ** ppException ); 59cdf0e10cSrcweir 60cdf0e10cSrcweir #if defined( SAL_W32) 61cdf0e10cSrcweir #pragma pack(push, 8) 62cdf0e10cSrcweir #elif defined(SAL_OS2) 63cdf0e10cSrcweir #pragma pack(push, 8) 64cdf0e10cSrcweir #endif 65cdf0e10cSrcweir 66cdf0e10cSrcweir /** The binary C uno interface description. 67cdf0e10cSrcweir */ 68cdf0e10cSrcweir typedef struct _uno_Interface 69cdf0e10cSrcweir { 70cdf0e10cSrcweir /** Acquires uno interface. 71cdf0e10cSrcweir 72cdf0e10cSrcweir @param pInterface uno interface 73cdf0e10cSrcweir */ 74cdf0e10cSrcweir void (SAL_CALL * acquire)( struct _uno_Interface * pInterface ); 75cdf0e10cSrcweir /** Releases uno interface. 76cdf0e10cSrcweir 77cdf0e10cSrcweir @param pInterface uno interface 78cdf0e10cSrcweir */ 79cdf0e10cSrcweir void (SAL_CALL * release)( struct _uno_Interface * pInterface ); 80cdf0e10cSrcweir /** dispatch function 81cdf0e10cSrcweir */ 82cdf0e10cSrcweir uno_DispatchMethod pDispatcher; 83cdf0e10cSrcweir } uno_Interface; 84cdf0e10cSrcweir 85cdf0e10cSrcweir #if defined( SAL_W32) || defined(SAL_OS2) 86cdf0e10cSrcweir #pragma pack(pop) 87cdf0e10cSrcweir #endif 88cdf0e10cSrcweir 89cdf0e10cSrcweir #ifdef __cplusplus 90cdf0e10cSrcweir } 91cdf0e10cSrcweir #endif 92cdf0e10cSrcweir 93cdf0e10cSrcweir #endif 94