1 /*---------------------------------------------------------------------------* 2 * ESR_SessionTypeListener.h * 3 * * 4 * Copyright 2007, 2008 Nuance Communciations, Inc. * 5 * * 6 * Licensed under the Apache License, Version 2.0 (the 'License'); * 7 * you may not use this file except in compliance with the License. * 8 * * 9 * You may obtain a copy of the License at * 10 * http://www.apache.org/licenses/LICENSE-2.0 * 11 * * 12 * Unless required by applicable law or agreed to in writing, software * 13 * distributed under the License is distributed on an 'AS IS' BASIS, * 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 15 * See the License for the specific language governing permissions and * 16 * limitations under the License. * 17 * * 18 *---------------------------------------------------------------------------*/ 19 20 #ifndef __ESR_SESSIONTYPELISTENER_H 21 #define __ESR_SESSIONTYPELISTENER_H 22 23 24 25 #include "ESR_ReturnCode.h" 26 #include "ESR_SharedPrefix.h" 27 #include "ESR_VariableTypes.h" 28 #include "pstdio.h" 29 #include "ptypes.h" 30 31 /** 32 * @addtogroup ESR_SessionTypeListenerModule ESR_SessionTypeListener API functions 33 * ESR_Session event-listener interface functions. 34 * 35 * @{ 36 */ 37 38 /** 39 * Listens for changes in ESR_SessionType. 40 */ 41 typedef struct ESR_SessionTypeListener_t 42 { 43 /** 44 * A property value has changed. 45 * 46 * @param self ESR_SessionTypeListener handle 47 * @param name Name of property that changed 48 * @param oldValue Old property value 49 * @param newValue New property value 50 * @param variableType Type of property 51 * @param data User-data passed to listener. 52 */ 53 ESR_ReturnCode(*propertyChanged)(struct ESR_SessionTypeListener_t* self, const LCHAR* name, 54 const void* oldValue, const void* newValue, VariableTypes variableType, void* data); 55 56 } 57 ESR_SessionTypeListener; 58 59 /** 60 * Associates a ESR_SessionTypeListener with user-data. 61 */ 62 typedef struct ESR_SessionTypeListenerPair_t 63 { 64 /** 65 * Event-listener. 66 */ 67 ESR_SessionTypeListener* listener; 68 /** 69 * User-data to pass to listener. 70 */ 71 void* data; 72 } 73 ESR_SessionTypeListenerPair; 74 75 /** 76 * @} 77 */ 78 79 80 #endif /* __ESR_SESSIONTYPELISTENER_H */ 81