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.

81 lines
2.3 KiB

  1. //
  2. // Audio playback function obj class definition
  3. //
  4. //
  5. #ifndef _PLAYBACK_H
  6. #define _PLAYBACK_H
  7. #include "fnrecon.h"
  8. class CSapiIMX;
  9. class CBestPropRange;
  10. class CDictRange : public CBestPropRange
  11. {
  12. public:
  13. CDictRange( );
  14. ~CDictRange( );
  15. HRESULT Initialize(TfEditCookie ec, ITfContext *pic, ITfRange *pRange);
  16. BOOL IsDictRangeFound( ) { return m_fFoundDictRange; }
  17. BOOL GetStartElem( ) { return m_ulStart; }
  18. BOOL GetNumElem( ) { return m_ulcElem; }
  19. ITfProperty *GetProp( );
  20. ITfRange *GetDictRange( );
  21. private:
  22. HRESULT _GetOverlapRange(TfEditCookie ec, ITfRange *pRange1, ITfRange *pRange2, ITfRange **ppOverlapRange);
  23. BOOL m_fFoundDictRange;
  24. ITfProperty *m_pProp;
  25. ITfRange *m_pDictatRange;
  26. ULONG m_ulStart;
  27. ULONG m_ulcElem;
  28. };
  29. class CSapiPlayBack : public ITfFnPlayBack
  30. {
  31. public:
  32. CSapiPlayBack(CSapiIMX *psi);
  33. ~CSapiPlayBack();
  34. // iunknown
  35. //
  36. STDMETHODIMP QueryInterface(REFGUID riid, LPVOID *ppobj);
  37. STDMETHODIMP_(ULONG) AddRef(void);
  38. STDMETHODIMP_(ULONG) Release(void);
  39. // ITfFunction
  40. //
  41. STDMETHODIMP GetDisplayName(BSTR *pbstrCand);
  42. STDMETHODIMP IsEnabled(BOOL *pfEnable);
  43. // ITfFnPlayBack
  44. //
  45. STDMETHODIMP QueryRange(ITfRange *pRange, ITfRange **ppNewRange, BOOL *pfPlayable);
  46. STDMETHODIMP Play(ITfRange *pRange);
  47. HRESULT _PlaySound(TfEditCookie ec, ITfRange *pRange);
  48. HRESULT _PlaySoundSelection(TfEditCookie ec, ITfContext *pic);
  49. private:
  50. HRESULT EnsureIXMLDoc(void);
  51. HRESULT GetDataID(BSTR bstrCAndXml, int nId, GUID *pguidData);
  52. HRESULT FindSoundRange(TfEditCookie ec, ITfRange *pRange, ITfProperty **ppProp, ITfRange **ppPropRange, ITfRange **ppSndRange);
  53. HRESULT PlayTextData(TfEditCookie ec, ITfRange *pRangeText);
  54. HRESULT PlayAudioData(TfEditCookie ec, ITfRange *pRangeAudio, ITfProperty *pProp, ULONG ulStart, ULONG ulcElem);
  55. HRESULT GetInkObjectText(TfEditCookie ec, ITfRange *pRange, BSTR *pbstrWord,UINT *pcchWord);
  56. IXMLDOMDocument *m_pIXMLDoc;
  57. CSapiIMX *m_psi;
  58. ITfContext *m_pIC;
  59. LONG m_cRef;
  60. };
  61. #endif // ndef _PLAYBACK_H