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.

117 lines
2.4 KiB

  1. //
  2. // lmobj.h
  3. //
  4. // LMOBJ class definition
  5. #ifndef LMOBJ_H
  6. #define LMOBJ_H
  7. #include "private.h"
  8. #include "sapilayr.h"
  9. #include "candlist.h"
  10. #include "ptrary.h"
  11. #include "initguid.h"
  12. //#include "msime.h"
  13. #include "fnrecon.h"
  14. #if 0
  15. class CSapiAlternativeList;
  16. class CLMObject
  17. {
  18. public:
  19. CLMObject() { m_pFELang = 0; }
  20. ~CLMObject();
  21. HRESULT InitLM();
  22. HRESULT AddHomonymsToAlternates(CSapiAlternativeList *pAlternates);
  23. #ifdef LATER
  24. HRESULT FilterAlternates(CSapiAlternativeList *pAlternates);
  25. #endif
  26. BOOL InitOK (void) { return m_fInitOK; }
  27. private:
  28. IFELanguage *m_pFELang;
  29. BOOL m_fInitOK;
  30. };
  31. #endif // if 0
  32. //
  33. // LMAlternates
  34. //
  35. // right now this is nothing more than a wrapper object of
  36. // a single unicode string, but this may need to accomodate
  37. // SRPHRASE objects in the future.
  38. //
  39. class CLMAlternates
  40. {
  41. public:
  42. ~CLMAlternates()
  43. {
  44. if (m_szAlternates)
  45. {
  46. delete[] m_szAlternates;
  47. }
  48. }
  49. HRESULT SetString(WCHAR *psz, int cch)
  50. {
  51. if (psz)
  52. {
  53. if (m_szAlternates)
  54. {
  55. delete[] m_szAlternates;
  56. }
  57. m_szAlternates = new WCHAR[cch+1];
  58. if (m_szAlternates)
  59. {
  60. wcsncpy(m_szAlternates, psz, cch);
  61. m_szAlternates[cch] = L'\0';
  62. m_cch = min(cch, (int)wcslen(m_szAlternates));
  63. return S_OK;
  64. }
  65. }
  66. return E_INVALIDARG;
  67. }
  68. HRESULT GetString(WCHAR *psz, int cch)
  69. {
  70. if (m_szAlternates && psz)
  71. {
  72. wcsncpy(psz, m_szAlternates, cch);
  73. return S_OK;
  74. }
  75. return E_FAIL;
  76. }
  77. int GetLen() {return m_cch;}
  78. private:
  79. WCHAR *m_szAlternates;
  80. int m_cch;
  81. };
  82. class CSapiIMX;
  83. class CMasterLMWrap
  84. {
  85. public:
  86. CMasterLMWrap(CSapiIMX *psi)
  87. {
  88. m_langidMasterLM = (LANGID)-1;
  89. m_fLMInited = FALSE;
  90. m_psi = psi;
  91. }
  92. void _EnsureMasterLM(LANGID langidRequested);
  93. protected:
  94. LANGID m_langidMasterLM;
  95. CComPtr<ITfFnLMProcessor> m_cpMasterLM;
  96. BOOL m_fLMInited;
  97. CSapiIMX *m_psi;
  98. };
  99. #endif // LMOBJ_H