Source code of Windows XP (NT5)
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.

82 lines
3.1 KiB

  1. /*******************************************************************************
  2. * LTSLx.h
  3. * This is the header file for the CLTSLexicon class that implements
  4. * the Letter-To-Sound (LTS) lexicon
  5. *
  6. * Owner: yunusm Date: 06/18/99
  7. * Copyright (C) 1998 Microsoft Corporation. All Rights Reserved.
  8. *******************************************************************************/
  9. #pragma once
  10. //--- Includes -----------------------------------------------------------------
  11. #include "LTSCart.h"
  12. #include "resource.h"
  13. #include "spcommon.h"
  14. //--- Constants ---------------------------------------------------------------
  15. static const DWORD g_dwMaxWordsInCombo = 10;
  16. //--- Class, Struct and Union Definitions -------------------------------------
  17. /*******************************************************************************
  18. *
  19. * CLTSLexicon
  20. *
  21. ****************************************************************** YUNUSM *****/
  22. class ATL_NO_VTABLE CLTSLexicon :
  23. public CComObjectRootEx<CComMultiThreadModel>,
  24. public CComCoClass<CLTSLexicon, &CLSID_SpLTSLexicon>,
  25. public ISpLexicon,
  26. public ISpObjectWithToken
  27. {
  28. //=== ATL Setup ===
  29. public:
  30. DECLARE_REGISTRY_RESOURCEID(IDR_LTSLX)
  31. DECLARE_PROTECT_FINAL_CONSTRUCT()
  32. BEGIN_COM_MAP(CLTSLexicon)
  33. COM_INTERFACE_ENTRY(ISpLexicon)
  34. COM_INTERFACE_ENTRY(ISpObjectWithToken)
  35. END_COM_MAP()
  36. //=== Methods ===
  37. public:
  38. //--- Ctor, dtor, etc
  39. CLTSLexicon();
  40. ~CLTSLexicon();
  41. HRESULT FinalConstruct(void);
  42. //--- ISpObjectWithToken members
  43. public:
  44. //--- ISpLexicon
  45. STDMETHODIMP GetPronunciations(const WCHAR * pwWord, LANGID LangID, DWORD dwFlags, SPWORDPRONUNCIATIONLIST * pWordPronunciationList);
  46. STDMETHODIMP AddPronunciation(const WCHAR * pwWord, LANGID LangID, SPPARTOFSPEECH ePartOfSpeech, const SPPHONEID * pszPronunciations);
  47. STDMETHODIMP RemovePronunciation(const WCHAR * pszWord, LANGID LangID, SPPARTOFSPEECH ePartOfSpeech, const SPPHONEID * pszPronunciation);
  48. STDMETHODIMP GetGeneration(DWORD *pdwGeneration);
  49. STDMETHODIMP GetGenerationChange(DWORD dwFlags, DWORD *pdwGeneration, SPWORDLIST *pWordList);
  50. STDMETHODIMP GetWords(DWORD dwFlags, DWORD *pdwGeneration, DWORD *pdwCookie, SPWORDLIST *pWordList);
  51. //--- ISpObjectWithToken
  52. STDMETHODIMP SetObjectToken(ISpObjectToken * pToken);
  53. STDMETHODIMP GetObjectToken(ISpObjectToken ** ppToken);
  54. //=== Private methods ===
  55. private:
  56. void CleanUp(void);
  57. void NullMembers(void);
  58. //=== Private data ===
  59. private:
  60. bool m_fInit; // true if successfully inited
  61. CComPtr<ISpObjectToken> m_cpObjectToken; // Token object
  62. LTSLEXINFO *m_pLtsLexInfo; // LTS lexicon header
  63. BYTE *m_pLtsData; // lts file in memory
  64. HANDLE m_hLtsMap; // phone map
  65. HANDLE m_hLtsFile; // lts data file
  66. LTS_FOREST *m_pLTSForest; // lts rules
  67. CComPtr<ISpPhoneConverter> m_cpPhoneConv; // phone convertor
  68. };
  69. //--- End of File -------------------------------------------------------------