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.

73 lines
2.4 KiB

  1. #ifndef __LEXMGR_H_
  2. #define __LEXMGR_H_
  3. #define WORD_NUM_TO_BUILD_SIGNATURE 0
  4. #define IME_REGWORD_STYLE_USER_PHRASE (IME_REGWORD_STYLE_USER_FIRST + 0)
  5. #define EUDP_GROW_NUMBER 30
  6. class CProperNoun;
  7. // note if use sizeof(), struct must be 8 bytes alignment.
  8. typedef struct tagSWordInfo {
  9. LPWSTR lpwWordString;
  10. PWORD pwUnicount;
  11. PBYTE pbAttribute;
  12. PBYTE pbTerminalCode;
  13. PBYTE pbFirstCharSignature;
  14. PBYTE pbLastCharSignature;
  15. } SWordInfo, *PSWordInfo;
  16. // note if use sizeof(), struct must be 8 bytes alignment.
  17. typedef struct tagSWordData {
  18. LPWSTR lpwszWordStr;
  19. WORD wAttrib;
  20. WORD wLen;
  21. } SWordData, *PSWordData;
  22. typedef struct tagSAddInLexicon {
  23. DWORD dwWordNumber;
  24. DWORD dwMaxWordNumber;
  25. PSWordData psWordData;
  26. WORD wWordBeginIndex[MAX_CHAR_PER_WORD + 1];
  27. } SAddInLexicon, *PSAddInLexicon;
  28. typedef struct tagSAltWordInfo {
  29. LPWSTR lpwWordString;
  30. PDWORD pdwGroupID;
  31. } SAltWordInfo, *PSAltWordInfo;
  32. class CCHTLexicon {
  33. public:
  34. CCHTLexicon();
  35. ~CCHTLexicon();
  36. BOOL InitData(HINSTANCE hInstance);
  37. BOOL GetWordInfo(LPCWSTR lpcwString, DWORD dwLength, PWORD pwUnicount,
  38. PWORD pwAttrib, PBYTE pbTerminalCode);
  39. BOOL AddInLexiconInsert(LPCWSTR lpcwEUDPStr, WORD wAttrib);
  40. DWORD GetAltWord(LPCWSTR lpcwString, DWORD dwLength, LPWSTR* lppwAltWordBuf);
  41. private:
  42. void LoadEUDP(void);
  43. void BuildSignatureData(void);
  44. BOOL GetMainLexiconWordInfo(LPCWSTR lpcwString, DWORD dwLength, PWORD pwUnicount, PBYTE pbAttrib, PBYTE pbTerminalCode);
  45. BOOL GetAddInWordInfo(LPCWSTR lpcwString, DWORD dwLength, PWORD pwUnicount, PWORD pwAttrib, PBYTE pbTerminalCode);
  46. INT GetAddInWordInfoIndex(LPCWSTR lpcwString, DWORD dwLength);
  47. BOOL GetAPLexiconWordInfo(LPCWSTR lpcwString, DWORD dwLength, PWORD pwUnicount, PWORD pwAttrib, PBYTE pbTerminalCode, PSAddInLexicon psAPLexicon);
  48. private:
  49. PSLexFileHeader m_psLexiconHeader;
  50. PBYTE m_pbLexiconBase;
  51. #ifdef CHINESE_PROP_NAME
  52. CProperNoun* m_pcPropName;
  53. #endif
  54. SWordInfo m_sWordInfo[MAX_CHAR_PER_WORD];
  55. // special: for EUDP and AP's word
  56. SAddInLexicon m_sAddInLexicon;
  57. // Alternative word
  58. PBYTE m_pbAltWordBase;
  59. PSAltLexFileHeader m_psAltWordHeader;
  60. SAltWordInfo m_sAltWordInfo[MAX_CHAR_PER_WORD];
  61. };
  62. typedef CCHTLexicon *PCCHTLexicon;
  63. #else
  64. #endif //__LEXMGR_H_