Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

457 lines
9.6 KiB

  1. /*
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. termevnt.cpp
  5. Abstract:
  6. This module contains declarations for terminal event classes
  7. */
  8. #ifndef _TERMEVNT_DOT_H_
  9. #define _TERMEVNT_DOT_H_
  10. //
  11. // ASR Terminal Event class
  12. //
  13. class CASRTerminalEvent :
  14. public CTAPIComObjectRoot<CASRTerminalEvent>,
  15. public CComDualImpl<ITASRTerminalEvent, &IID_ITASRTerminalEvent, &LIBID_TAPI3Lib>,
  16. public CObjectSafeImpl
  17. {
  18. public:
  19. DECLARE_MARSHALQI(CASRTerminalEvent)
  20. DECLARE_TRACELOG_CLASS(CASRTerminalEvent)
  21. BEGIN_COM_MAP(CASRTerminalEvent)
  22. COM_INTERFACE_ENTRY(IDispatch)
  23. COM_INTERFACE_ENTRY(ITASRTerminalEvent)
  24. COM_INTERFACE_ENTRY(IObjectSafety)
  25. COM_INTERFACE_ENTRY_FUNC(IID_IMarshal, 0, IMarshalQI)
  26. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  27. END_COM_MAP()
  28. static HRESULT FireEvent(
  29. CTAPI * pTapi,
  30. ITCallInfo *pCall,
  31. ITTerminal * pTerminal,
  32. HRESULT hr
  33. );
  34. CASRTerminalEvent();
  35. virtual ~CASRTerminalEvent();
  36. //
  37. // ITASRTerminalEvent methods
  38. //
  39. virtual HRESULT STDMETHODCALLTYPE get_Terminal(
  40. OUT ITTerminal **ppTerminal
  41. );
  42. virtual HRESULT STDMETHODCALLTYPE get_Call(
  43. OUT ITCallInfo **ppCallInfo
  44. );
  45. virtual HRESULT STDMETHODCALLTYPE get_Error(
  46. OUT HRESULT *phrErrorCode
  47. );
  48. //
  49. // methods for setting data members
  50. //
  51. virtual HRESULT STDMETHODCALLTYPE put_Terminal(
  52. IN ITTerminal *pTerminal
  53. );
  54. virtual HRESULT STDMETHODCALLTYPE put_Call(
  55. IN ITCallInfo *pCallInfo
  56. );
  57. virtual HRESULT STDMETHODCALLTYPE put_ErrorCode(
  58. IN HRESULT hrErrorCode
  59. );
  60. private:
  61. //
  62. // the call on which the event was generated
  63. //
  64. ITCallInfo *m_pCallInfo;
  65. //
  66. // the terminal that caused the event (or whose tracks cause the event)
  67. //
  68. ITTerminal *m_pTerminal;
  69. //
  70. // HRESULT of the last error
  71. //
  72. HRESULT m_hr;
  73. };
  74. //
  75. // File Terminal Event class
  76. //
  77. class CFileTerminalEvent :
  78. public CTAPIComObjectRoot<CFileTerminalEvent, CComMultiThreadModelNoCS>,
  79. public CComDualImpl<ITFileTerminalEvent, &IID_ITFileTerminalEvent, &LIBID_TAPI3Lib>,
  80. public CObjectSafeImpl
  81. {
  82. public:
  83. DECLARE_MARSHALQI(CFileTerminalEvent)
  84. DECLARE_TRACELOG_CLASS(CFileTerminalEvent)
  85. BEGIN_COM_MAP(CFileTerminalEvent)
  86. COM_INTERFACE_ENTRY(IDispatch)
  87. COM_INTERFACE_ENTRY(ITFileTerminalEvent)
  88. COM_INTERFACE_ENTRY(IObjectSafety)
  89. COM_INTERFACE_ENTRY_FUNC(IID_IMarshal, 0, IMarshalQI)
  90. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  91. END_COM_MAP()
  92. static HRESULT FireEvent(
  93. CAddress *pCAddress,
  94. CTAPI * pTapi,
  95. ITCallInfo *pCall,
  96. TERMINAL_MEDIA_STATE tmsMediaState,
  97. FT_STATE_EVENT_CAUSE ftecEventCause,
  98. ITTerminal * pTerminal,
  99. ITFileTrack * pFileTrack,
  100. HRESULT hr
  101. );
  102. CFileTerminalEvent ();
  103. virtual ~CFileTerminalEvent();
  104. //
  105. // ITFileTerminalEvent methods
  106. //
  107. virtual HRESULT STDMETHODCALLTYPE get_Terminal(
  108. OUT ITTerminal **ppTerminal
  109. );
  110. virtual HRESULT STDMETHODCALLTYPE get_Track(
  111. OUT ITFileTrack **ppFileTrack
  112. );
  113. virtual HRESULT STDMETHODCALLTYPE get_Call(
  114. OUT ITCallInfo **ppCallInfo
  115. );
  116. virtual HRESULT STDMETHODCALLTYPE get_State(
  117. OUT TERMINAL_MEDIA_STATE *pMediaState
  118. );
  119. virtual HRESULT STDMETHODCALLTYPE get_Cause(
  120. OUT FT_STATE_EVENT_CAUSE *pCause
  121. );
  122. virtual HRESULT STDMETHODCALLTYPE get_Error(
  123. OUT HRESULT *phrErrorCode
  124. );
  125. //
  126. // methods for setting data members
  127. //
  128. virtual HRESULT STDMETHODCALLTYPE put_Terminal(
  129. IN ITTerminal *pTerminal
  130. );
  131. virtual HRESULT STDMETHODCALLTYPE put_Track(
  132. IN ITFileTrack *pFileTrack
  133. );
  134. virtual HRESULT STDMETHODCALLTYPE put_Call(
  135. IN ITCallInfo *pCallInfo
  136. );
  137. virtual HRESULT STDMETHODCALLTYPE put_State(
  138. IN TERMINAL_MEDIA_STATE tmsTerminalMediaState
  139. );
  140. virtual HRESULT STDMETHODCALLTYPE put_Cause(
  141. IN FT_STATE_EVENT_CAUSE Cause
  142. );
  143. virtual HRESULT STDMETHODCALLTYPE put_ErrorCode(
  144. IN HRESULT hrErrorCode
  145. );
  146. private:
  147. //
  148. // the call on which the event was generated
  149. //
  150. ITCallInfo *m_pCallInfo;
  151. //
  152. // the state to which the terminal transitioned in the result of the action that caused the event
  153. //
  154. TERMINAL_MEDIA_STATE m_tmsTerminalState;
  155. //
  156. // the cause of the event
  157. //
  158. FT_STATE_EVENT_CAUSE m_ftecEventCause;
  159. //
  160. // the controlling parent terminal that caused the event (or whose tracks cause the event)
  161. //
  162. ITTerminal *m_pParentFileTerminal;
  163. //
  164. // the track involved in the event
  165. //
  166. ITFileTrack *m_pFileTrack;
  167. //
  168. // HRESULT of the last error
  169. //
  170. HRESULT m_hr;
  171. };
  172. //
  173. // Tone Terminal Event class
  174. //
  175. class CToneTerminalEvent :
  176. public CTAPIComObjectRoot<CToneTerminalEvent>,
  177. public CComDualImpl<ITToneTerminalEvent, &IID_ITToneTerminalEvent, &LIBID_TAPI3Lib>,
  178. public CObjectSafeImpl
  179. {
  180. public:
  181. DECLARE_MARSHALQI(CToneTerminalEvent)
  182. DECLARE_TRACELOG_CLASS(CToneTerminalEvent)
  183. BEGIN_COM_MAP(CToneTerminalEvent)
  184. COM_INTERFACE_ENTRY(IDispatch)
  185. COM_INTERFACE_ENTRY(ITToneTerminalEvent)
  186. COM_INTERFACE_ENTRY(IObjectSafety)
  187. COM_INTERFACE_ENTRY_FUNC(IID_IMarshal, 0, IMarshalQI)
  188. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  189. END_COM_MAP()
  190. static HRESULT FireEvent(
  191. CTAPI * pTapi,
  192. ITCallInfo *pCall,
  193. ITTerminal * pTerminal,
  194. HRESULT hr
  195. );
  196. CToneTerminalEvent();
  197. virtual ~CToneTerminalEvent();
  198. //
  199. // ITToneTerminalEvent methods
  200. //
  201. virtual HRESULT STDMETHODCALLTYPE get_Terminal(
  202. OUT ITTerminal **ppTerminal
  203. );
  204. virtual HRESULT STDMETHODCALLTYPE get_Call(
  205. OUT ITCallInfo **ppCallInfo
  206. );
  207. virtual HRESULT STDMETHODCALLTYPE get_Error(
  208. OUT HRESULT *phrErrorCode
  209. );
  210. //
  211. // methods for setting data members
  212. //
  213. virtual HRESULT STDMETHODCALLTYPE put_Terminal(
  214. IN ITTerminal *pTerminal
  215. );
  216. virtual HRESULT STDMETHODCALLTYPE put_Call(
  217. IN ITCallInfo *pCallInfo
  218. );
  219. virtual HRESULT STDMETHODCALLTYPE put_ErrorCode(
  220. IN HRESULT hrErrorCode
  221. );
  222. private:
  223. //
  224. // the call on which the event was generated
  225. //
  226. ITCallInfo *m_pCallInfo;
  227. //
  228. // the terminal that caused the event (or whose tracks cause the event)
  229. //
  230. ITTerminal *m_pTerminal;
  231. //
  232. // HRESULT of the last error
  233. //
  234. HRESULT m_hr;
  235. };
  236. //
  237. // text to speech terminal event class
  238. //
  239. class CTTSTerminalEvent :
  240. public CTAPIComObjectRoot<CTTSTerminalEvent>,
  241. public CComDualImpl<ITTTSTerminalEvent, &IID_ITTTSTerminalEvent, &LIBID_TAPI3Lib>,
  242. public CObjectSafeImpl
  243. {
  244. public:
  245. DECLARE_MARSHALQI(CTTSTerminalEvent)
  246. DECLARE_TRACELOG_CLASS(CTTSTerminalEvent)
  247. BEGIN_COM_MAP(CTTSTerminalEvent)
  248. COM_INTERFACE_ENTRY(IDispatch)
  249. COM_INTERFACE_ENTRY(ITTTSTerminalEvent)
  250. COM_INTERFACE_ENTRY(IObjectSafety)
  251. COM_INTERFACE_ENTRY_FUNC(IID_IMarshal, 0, IMarshalQI)
  252. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pFTM)
  253. END_COM_MAP()
  254. static HRESULT FireEvent(
  255. CTAPI * pTapi,
  256. ITCallInfo *pCall,
  257. ITTerminal * pTerminal,
  258. HRESULT hr
  259. );
  260. CTTSTerminalEvent();
  261. virtual ~CTTSTerminalEvent();
  262. //
  263. // ITTTSTerminalEvent methods
  264. //
  265. virtual HRESULT STDMETHODCALLTYPE get_Terminal(
  266. OUT ITTerminal **ppTerminal
  267. );
  268. virtual HRESULT STDMETHODCALLTYPE get_Call(
  269. OUT ITCallInfo **ppCallInfo
  270. );
  271. virtual HRESULT STDMETHODCALLTYPE get_Error(
  272. OUT HRESULT *phrErrorCode
  273. );
  274. //
  275. // methods for setting data members
  276. //
  277. virtual HRESULT STDMETHODCALLTYPE put_Terminal(
  278. IN ITTerminal *pTerminal
  279. );
  280. virtual HRESULT STDMETHODCALLTYPE put_Call(
  281. IN ITCallInfo *pCallInfo
  282. );
  283. virtual HRESULT STDMETHODCALLTYPE put_ErrorCode(
  284. IN HRESULT hrErrorCode
  285. );
  286. private:
  287. //
  288. // the call on which the event was generated
  289. //
  290. ITCallInfo *m_pCallInfo;
  291. //
  292. // the terminal that caused the event (or whose tracks cause the event)
  293. //
  294. ITTerminal *m_pTerminal;
  295. //
  296. // HRESULT of the last error
  297. //
  298. HRESULT m_hr;
  299. };
  300. #endif // _TTS_TERMIAL_EVENT_DOT_H_