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.

137 lines
3.7 KiB

  1. /*----------------------------------------------------------------------------
  2. %%File: ACTDICT.H
  3. %%Unit: ACTDICT
  4. %%Contact: seijia@microsoft.com
  5. Header file for the program dictionary interface.
  6. ----------------------------------------------------------------------------*/
  7. #ifndef __PRGDIC__
  8. #define __PRGDIC__
  9. #include "outpos.h"
  10. #define DLLExport __declspec( dllexport )
  11. //HRESULT values
  12. #define IPRG_S_LONGER_WORD MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x7400)
  13. #define IPRG_S_NO_ENTRY MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x7401)
  14. //Dictionary Category
  15. typedef DWORD IMEDICAT;
  16. #define dicatNone 0x00000000
  17. #define dicatGeneral 0x00000001
  18. #define dicatNamePlace 0x00000002
  19. #define dicatSpeech 0x00000004
  20. #define dicatReverse 0x00000008
  21. #define dicatEnglish 0x00000010
  22. #define dicatALL 0x0000001f
  23. //Index Type
  24. typedef DWORD IMEIDXTP;
  25. #define idxtpHiraKanji 0x0001
  26. #define idxtpKanjiHira 0x0002
  27. #define idxtpMix (idxtpHiraKanji | idxtpKanjiHira)
  28. //IImeActiveDict Interface Version
  29. #define verIImeActiveDict 0x0100
  30. //Dictionary Data Disclosure
  31. typedef enum _IMEDDISC
  32. {
  33. ddiscNone, //do not disclose data
  34. ddiscAll, //show all contents
  35. ddiscPartial //show partial data
  36. } IMEDDISC;
  37. // Shared Header dictionary File
  38. typedef struct _IMESHF
  39. {
  40. WORD cbShf; //size of this struct
  41. WORD verDic; //dictionary version
  42. CHAR szTitle[48]; //dictionary title
  43. CHAR szDescription[256]; //dictionary description
  44. CHAR szCopyright[128]; //dictionary copyright info
  45. } IMESHF;
  46. //Dictionary Info
  47. typedef struct _IMEDINFO
  48. {
  49. IMESHF shf; //header
  50. DWORD ver; //IImeActiveDict version number
  51. IMEDDISC ddisc; //disclosure permission type
  52. FILETIME filestamp; //file stamp at creation
  53. IMEDICAT dicat; //dictionary category
  54. IMEIDXTP idxtp; //index type
  55. BOOL fLearn; //support word learning
  56. } IMEDINFO;
  57. #define cwchWordMax 64
  58. typedef DWORD IMESTMP; //word stamp
  59. //Program Dictionary Tango
  60. typedef struct _IMEPDT
  61. {
  62. IMEIDXTP idxtp; //index type
  63. int cwchInput; //input string length
  64. int cwchOutput; //output string length
  65. WCHAR wszInput[cwchWordMax]; //input string
  66. WCHAR wszOutput[cwchWordMax]; //output string
  67. DWORD nPos; //part of speech
  68. IMESTMP stmp; //word time stamp
  69. } IMEPDT;
  70. ///////////////////////////////
  71. // The IImeActiveDict interface
  72. ///////////////////////////////
  73. #undef INTERFACE
  74. #define INTERFACE IImeActiveDict
  75. DECLARE_INTERFACE_(IImeActiveDict, IUnknown)
  76. {
  77. // IUnknown members
  78. STDMETHOD(QueryInterface)(THIS_ REFIID refiid, VOID **ppv) PURE;
  79. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  80. STDMETHOD_(ULONG,Release)(THIS) PURE;
  81. // IImeActiveDict members
  82. STDMETHOD(DicInquire) (THIS_
  83. IMEDINFO *pdinfo //(out) dictionary info
  84. ) PURE;
  85. STDMETHOD(DicOpen) (THIS_
  86. IMEDINFO *pdinfo //(out) dictionary info
  87. ) PURE;
  88. STDMETHOD(DicClose) (THIS) PURE;
  89. STDMETHOD(DicSearchWord)(THIS_
  90. IMEPDT *ppdt, //(in/out) tango
  91. BOOL fFirst, //(in) first time flag
  92. BOOL fWildCard, //(in) wildcard flag
  93. BOOL fPartial //(in) disclosure flag
  94. ) PURE;
  95. STDMETHOD(DicLearnWord) (THIS_
  96. IMEPDT *ppdt, //(in/out) tango
  97. BOOL fUserLearn , //(in) user learning option
  98. int nLevel //(in) learning level
  99. ) PURE;
  100. STDMETHOD(DicProperty) (THIS_
  101. HWND hwnd //(in) parent window handle
  102. ) PURE;
  103. };
  104. #ifdef __cplusplus
  105. extern "C" {
  106. #endif
  107. // The following API replaces CoCreateInstance() since we don't support class ID at this time.
  108. typedef HRESULT (WINAPI *PFNCREATE)(VOID **, int);
  109. DLLExport HRESULT WINAPI CreateIImeActiveDictInstance(VOID **ppvObj, int nid);
  110. #ifdef __cplusplus
  111. } /* end of 'extern "C" {' */
  112. #endif
  113. #endif //__PRGDIC__