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.

996 lines
39 KiB

  1. /*----------------------------------------------------------------------------
  2. %%File: MSIME.H
  3. Copyright (c) 1995-1998 Microsoft Corporation
  4. Version 1.0
  5. Japanese specific definitions of IFECommon, IFELanguage, IFEDictionary,
  6. and Per IME Interfaces.
  7. ----------------------------------------------------------------------------*/
  8. #ifndef __MSIME_H__
  9. #define __MSIME_H__
  10. #include <ole2.h>
  11. #include <objbase.h>
  12. #include <imm.h>
  13. #pragma pack(1) /* Assume byte packing throughout */
  14. ///////////////////////////
  15. // HKEY_CLASSES_ROOT values
  16. ///////////////////////////
  17. #define szImeJapan98 "MSIME.Japan.6"
  18. #define szImeJapan "MSIME.Japan"
  19. ////////////////
  20. // CLSID and IID
  21. ////////////////
  22. // Class ID for FE COM interfaces
  23. // {019F7150-E6DB-11d0-83C3-00C04FDDB82E}
  24. DEFINE_GUID(CLSID_MSIME_JAPANESE,
  25. 0x19f7150, 0xe6db, 0x11d0, 0x83, 0xc3, 0x0, 0xc0, 0x4f, 0xdd, 0xb8, 0x2e);
  26. // Interface ID for IFECommon
  27. // {019F7151-E6DB-11d0-83C3-00C04FDDB82E}
  28. DEFINE_GUID(IID_IFECommon,
  29. 0x19f7151, 0xe6db, 0x11d0, 0x83, 0xc3, 0x0, 0xc0, 0x4f, 0xdd, 0xb8, 0x2e);
  30. // Interface ID for IFELanguage
  31. // {019F7152-E6DB-11d0-83C3-00C04FDDB82E}
  32. DEFINE_GUID(IID_IFELanguage,
  33. 0x19f7152, 0xe6db, 0x11d0, 0x83, 0xc3, 0x0, 0xc0, 0x4f, 0xdd, 0xb8, 0x2e);
  34. // Interface ID for IFELanguage2
  35. // {21164102-C24A-11d1-851A-00C04FCC6B14}
  36. DEFINE_GUID(IID_IFELanguage2,
  37. 0x21164102, 0xc24a, 0x11d1, 0x85, 0x1a, 0x0, 0xc0, 0x4f, 0xcc, 0x6b, 0x14);
  38. // Interface ID for IFEDictionary
  39. // {019F7153-E6DB-11d0-83C3-00C04FDDB82E}
  40. DEFINE_GUID(IID_IFEDictionary,
  41. 0x19f7153, 0xe6db, 0x11d0, 0x83, 0xc3, 0x0, 0xc0, 0x4f, 0xdd, 0xb8, 0x2e);
  42. ////////////////////////////
  43. // Definitions for IFECommon
  44. ////////////////////////////
  45. #undef INTERFACE
  46. #define INTERFACE IFEClassFactory
  47. ////////////////////////////////
  48. // The IFEClassFactory Interface
  49. ////////////////////////////////
  50. DECLARE_INTERFACE_(IFEClassFactory, IClassFactory)
  51. {
  52. // IUnknown members
  53. STDMETHOD(QueryInterface) (THIS_ REFIID refiid, VOID **ppv) PURE;
  54. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  55. STDMETHOD_(ULONG,Release) (THIS) PURE;
  56. // IFEClassFactory members
  57. STDMETHOD(CreateInstance) (THIS_ LPUNKNOWN, REFIID, void **) PURE;
  58. STDMETHOD(LockServer) (THIS_ BOOL) PURE;
  59. };
  60. #undef INTERFACE
  61. #define INTERFACE IFECommon
  62. //////////////////////////
  63. // The IFECommon Interface
  64. //////////////////////////
  65. #define IFEC_S_ALREADY_DEFAULT MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x7400)
  66. typedef struct _IMEDLG
  67. {
  68. int cbIMEDLG; //size of this structure
  69. HWND hwnd; //parent window handle
  70. LPWSTR lpwstrWord; //optional string
  71. int nTabId; //specifies a tab in dialog
  72. } IMEDLG;
  73. DECLARE_INTERFACE_(IFECommon, IUnknown)
  74. {
  75. // IUnknown members
  76. STDMETHOD(QueryInterface) (THIS_ REFIID refiid, VOID **ppv) PURE;
  77. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  78. STDMETHOD_(ULONG,Release) (THIS) PURE;
  79. // IFECommon members
  80. STDMETHOD(IsDefaultIME) (THIS_
  81. CHAR *szName, //(out) name of MS-IME
  82. INT cszName //(in) size of szName
  83. ) PURE;
  84. STDMETHOD(SetDefaultIME) (THIS) PURE;
  85. STDMETHOD(InvokeWordRegDialog) (THIS_
  86. IMEDLG *pimedlg //(in) parameters
  87. ) PURE;
  88. STDMETHOD(InvokeDictToolDialog) (THIS_
  89. IMEDLG *pimedlg //(in) parameters
  90. ) PURE;
  91. };
  92. ///////////////////////////
  93. // The IFELanguage interface
  94. ///////////////////////////
  95. // Word Descriptor
  96. typedef struct tagWDD{
  97. WORD wDispPos; // Offset of Output string
  98. union {
  99. WORD wReadPos; // Offset of Reading string
  100. WORD wCompPos;
  101. };
  102. WORD cchDisp; //number of ptchDisp
  103. union {
  104. WORD cchRead; //number of ptchRead
  105. WORD cchComp;
  106. };
  107. DWORD nReserve; //reserved
  108. WORD nPos; //part of speech
  109. // implementation-defined
  110. WORD fPhrase : 1;//start of phrase
  111. WORD fAutoCorrect: 1;//auto-corrected
  112. WORD fNumericPrefix: 1;//kansu-shi expansion(JPN)
  113. WORD fUserRegistered: 1;//from user dictionary
  114. WORD fUnknown: 1;//unknown word (duplicated information with nPos.)
  115. WORD fRecentUsed: 1; //used recently flag
  116. WORD :10; //
  117. VOID *pReserved; //points directly to WORDITEM
  118. } WDD;
  119. #pragma warning(disable:4200) // zero-size array in structure
  120. typedef struct tagMORRSLT {
  121. DWORD dwSize; // total size of this block.
  122. WCHAR *pwchOutput; // conversion result string.
  123. WORD cchOutput; // lengh of result string.
  124. union {
  125. WCHAR *pwchRead; // reading string
  126. WCHAR *pwchComp;
  127. };
  128. union {
  129. WORD cchRead; // length of reading string.
  130. WORD cchComp;
  131. };
  132. WORD *pchInputPos; // index array of reading to input character.
  133. WORD *pchOutputIdxWDD; // index array of output character to WDD
  134. union {
  135. WORD *pchReadIdxWDD; // index array of reading character to WDD
  136. WORD *pchCompIdxWDD;
  137. };
  138. WORD *paMonoRubyPos; // array of position of monoruby
  139. WDD *pWDD; // pointer to array of WDD
  140. INT cWDD; // number of WDD
  141. VOID *pPrivate; // pointer of private data area
  142. WCHAR BLKBuff[]; // area for stored above members.
  143. // WCHAR wchOutput[cchOutput];
  144. // WCHAR wchRead[cchRead];
  145. // CHAR chInputIdx[cwchInput];
  146. // CHAR chOutputIdx[cchOutput];
  147. // CHAR chReadIndx[cchRead];
  148. // ???? Private
  149. // WDD WDDBlk[cWDD];
  150. }MORRSLT;
  151. #pragma warning(default:4200) // zero-size array in structure
  152. // request for conversion (dwRequest)
  153. #define FELANG_REQ_CONV 0x00010000
  154. #define FELANG_REQ_RECONV 0x00020000
  155. #define FELANG_REQ_REV 0x00030000
  156. // Conversion mode (dwCMode)
  157. #define FELANG_CMODE_MONORUBY 0x00000002 //mono-ruby
  158. #define FELANG_CMODE_NOPRUNING 0x00000004 //no pruning
  159. #define FELANG_CMODE_KATAKANAOUT 0x00000008 //katakana output
  160. #define FELANG_CMODE_HIRAGANAOUT 0x00000000 //default output
  161. #define FELANG_CMODE_HALFWIDTHOUT 0x00000010 //half-width output
  162. #define FELANG_CMODE_FULLWIDTHOUT 0x00000020 //full-width output
  163. #define FELANG_CMODE_BOPOMOFO 0x00000040 //
  164. #define FELANG_CMODE_HANGUL 0x00000080 //
  165. #define FELANG_CMODE_PINYIN 0x00000100 //
  166. #define FELANG_CMODE_PRECONV 0x00000200 //do conversion as follows:
  167. // - roma-ji to kana
  168. // - autocorrect before conversion
  169. // - periods, comma, and brackets
  170. #define FELANG_CMODE_RADICAL 0x00000400 //
  171. #define FELANG_CMODE_UNKNOWNREADING 0x00000800 //
  172. #define FELANG_CMODE_MERGECAND 0x00001000 // merge display with same candidate
  173. #define FELANG_CMODE_ROMAN 0x00002000 //
  174. #define FELANG_CMODE_BESTFIRST 0x00004000 // only make 1st best
  175. #define FELANG_CMODE_USENOREVWORDS 0x00008000 // use invalid revword on REV/RECONV.
  176. #define FELANG_CMODE_NONE 0x01000000 // IME_SMODE_NONE
  177. #define FELANG_CMODE_PLAURALCLAUSE 0x02000000 // IME_SMODE_PLAURALCLAUSE
  178. #define FELANG_CMODE_SINGLECONVERT 0x04000000 // IME_SMODE_SINGLECONVERT
  179. #define FELANG_CMODE_AUTOMATIC 0x08000000 // IME_SMODE_AUTOMATIC
  180. #define FELANG_CMODE_PHRASEPREDICT 0x10000000 // IME_SMODE_PHRASEPREDICT
  181. #define FELANG_CMODE_CONVERSATION 0x20000000 // IME_SMODE_CONVERSATION
  182. #define FELANG_CMODE_NAME FELANG_CMODE_PHRASEPREDICT // Name mode (MSKKIME)
  183. #define FELANG_CMODE_NOINVISIBLECHAR 0x40000000 // remove invisible chars (e.g. tone mark)
  184. // Error message
  185. #define E_NOCAND 0x30 //not enough candidates
  186. #define E_NOTENOUGH_BUFFER 0x31 //out of string buffer
  187. #define E_NOTENOUGH_WDD 0x32 //out of WDD buffer
  188. #define E_LARGEINPUT 0x33 //large input string
  189. //Morphology Info
  190. #define FELANG_CLMN_WBREAK 0x01
  191. #define FELANG_CLMN_NOWBREAK 0x02
  192. #define FELANG_CLMN_PBREAK 0x04
  193. #define FELANG_CLMN_NOPBREAK 0x08
  194. #define FELANG_CLMN_FIXR 0x10
  195. #define FELANG_CLMN_FIXD 0x20 // fix display of word
  196. #define FELANG_INVALD_PO 0xFFFF // unmatched position for input string
  197. #undef INTERFACE
  198. #define INTERFACE IFELanguage
  199. //IFELanguage template
  200. DECLARE_INTERFACE_(IFELanguage,IUnknown)
  201. {
  202. // IUnknown members
  203. STDMETHOD(QueryInterface)(THIS_ REFIID refiid, VOID **ppv) PURE;
  204. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  205. STDMETHOD_(ULONG,Release)(THIS) PURE;
  206. // Ijconv members. must be virtual functions
  207. STDMETHOD(Open)(THIS) PURE;
  208. STDMETHOD(Close)(THIS) PURE;
  209. STDMETHOD(GetJMorphResult)(THIS_
  210. DWORD dwRequest, // [in]
  211. DWORD dwCMode, // [in]
  212. INT cwchInput, // [in]
  213. WCHAR *pwchInput, // [in, size_is(cwchInput)]
  214. DWORD *pfCInfo, // [in, size_is(cwchInput)]
  215. MORRSLT **ppResult ) PURE; // [out]
  216. STDMETHOD(GetConversionModeCaps)(THIS_ DWORD *pdwCaps) PURE;
  217. STDMETHOD(GetPhonetic)(THIS_
  218. BSTR string, // [in]
  219. LONG start, // [in]
  220. LONG length, // [in]
  221. BSTR * phonetic ) PURE; // [out, retval]
  222. STDMETHOD(GetConversion)(THIS_
  223. BSTR string, // [in]
  224. LONG start, // [in]
  225. LONG length, // [in]
  226. BSTR * result ) PURE; // [out, retval]
  227. };
  228. ////////////////////////////////
  229. // Definitions for IFEDictionary
  230. ////////////////////////////////
  231. // Part Of Speach
  232. #define IFED_POS_NONE 0x00000000
  233. #define IFED_POS_NOUN 0x00000001
  234. #define IFED_POS_VERB 0x00000002
  235. #define IFED_POS_ADJECTIVE 0x00000004
  236. #define IFED_POS_ADJECTIVE_VERB 0x00000008
  237. #define IFED_POS_ADVERB 0x00000010
  238. #define IFED_POS_ADNOUN 0x00000020
  239. #define IFED_POS_CONJUNCTION 0x00000040
  240. #define IFED_POS_INTERJECTION 0x00000080
  241. #define IFED_POS_INDEPENDENT 0x000000ff
  242. #define IFED_POS_INFLECTIONALSUFFIX 0x00000100
  243. #define IFED_POS_PREFIX 0x00000200
  244. #define IFED_POS_SUFFIX 0x00000400
  245. #define IFED_POS_AFFIX 0x00000600
  246. #define IFED_POS_TANKANJI 0x00000800
  247. #define IFED_POS_IDIOMS 0x00001000
  248. #define IFED_POS_SYMBOLS 0x00002000
  249. #define IFED_POS_PARTICLE 0x00004000
  250. #define IFED_POS_AUXILIARY_VERB 0x00008000
  251. #define IFED_POS_SUB_VERB 0x00010000
  252. #define IFED_POS_DEPENDENT 0x0001c000
  253. #define IFED_POS_ALL 0x0001ffff
  254. // GetWord Selection Type
  255. #define IFED_SELECT_NONE 0x00000000
  256. #define IFED_SELECT_READING 0x00000001
  257. #define IFED_SELECT_DISPLAY 0x00000002
  258. #define IFED_SELECT_POS 0x00000004
  259. #define IFED_SELECT_COMMENT 0x00000008
  260. #define IFED_SELECT_ALL 0x0000000f
  261. // Registered Word Type
  262. #define IFED_REG_NONE 0x00000000
  263. #define IFED_REG_USER 0x00000001
  264. #define IFED_REG_AUTO 0x00000002
  265. #define IFED_REG_GRAMMAR 0x00000004
  266. #define IFED_REG_ALL 0x00000007
  267. // Dictionary Type
  268. #define IFED_TYPE_NONE 0x00000000
  269. #define IFED_TYPE_GENERAL 0x00000001
  270. #define IFED_TYPE_NAMEPLACE 0x00000002
  271. #define IFED_TYPE_SPEECH 0x00000004
  272. #define IFED_TYPE_REVERSE 0x00000008
  273. #define IFED_TYPE_ENGLISH 0x00000010
  274. #define IFED_TYPE_ALL 0x0000001f
  275. // HRESULTS for IFEDictionary interface
  276. //no more entries in the dictionary
  277. #define IFED_S_MORE_ENTRIES MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x7200)
  278. //dictionary is empty, no header information is returned
  279. #define IFED_S_EMPTY_DICTIONARY MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x7201)
  280. //word already exists in dictionary
  281. #define IFED_S_WORD_EXISTS MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x7202)
  282. //dictionary is not found
  283. #define IFED_E_NOT_FOUND MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x7300)
  284. //invalid dictionary format
  285. #define IFED_E_INVALID_FORMAT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x7301)
  286. //failed to open file
  287. #define IFED_E_OPEN_FAILED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x7302)
  288. //failed to write to file
  289. #define IFED_E_WRITE_FAILED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x7303)
  290. //no entry found in dictionary
  291. #define IFED_E_NO_ENTRY MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x7304)
  292. //this routines doesn't support the current dictionary
  293. #define IFED_E_REGISTER_FAILED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x7305)
  294. //not a user dictionary
  295. #define IFED_E_NOT_USER_DIC MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x7306)
  296. //not supported
  297. #define IFED_E_NOT_SUPPORTED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x7307)
  298. //failed to insert user comment
  299. #define IFED_E_USER_COMMENT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x7308)
  300. #define cbCommentMax 256
  301. //Private Unicode Character
  302. #define wchPrivate1 0xE000
  303. // Where to place registring word
  304. typedef enum
  305. {
  306. IFED_REG_HEAD,
  307. IFED_REG_TAIL,
  308. IFED_REG_DEL,
  309. } IMEREG;
  310. // Type of IME dictionary
  311. typedef enum
  312. {
  313. IFED_UNKNOWN,
  314. IFED_MSIME2_BIN_SYSTEM,
  315. IFED_MSIME2_BIN_USER,
  316. IFED_MSIME2_TEXT_USER,
  317. IFED_MSIME95_BIN_SYSTEM,
  318. IFED_MSIME95_BIN_USER,
  319. IFED_MSIME95_TEXT_USER,
  320. IFED_MSIME97_BIN_SYSTEM,
  321. IFED_MSIME97_BIN_USER,
  322. IFED_MSIME97_TEXT_USER,
  323. IFED_MSIME_BIN_SYSTEM,
  324. IFED_MSIME_BIN_USER,
  325. IFED_MSIME_TEXT_USER,
  326. IFED_ACTIVE_DICT,
  327. IFED_ATOK9,
  328. IFED_ATOK10,
  329. IFED_NEC_AI_,
  330. IFED_WX_II,
  331. IFED_WX_III,
  332. IFED_VJE_20,
  333. } IMEFMT;
  334. // Type of User Comment
  335. typedef enum
  336. {
  337. IFED_UCT_NONE,
  338. IFED_UCT_STRING_SJIS,
  339. IFED_UCT_STRING_UNICODE,
  340. IFED_UCT_USER_DEFINED,
  341. IFED_UCT_MAX,
  342. } IMEUCT;
  343. #if _MSC_VER >= 1200
  344. #pragma warning(push)
  345. #pragma warning(disable:4201)
  346. #endif
  347. // WoRD found in a dictionary
  348. typedef struct _IMEWRD
  349. {
  350. WCHAR *pwchReading;
  351. WCHAR *pwchDisplay;
  352. union {
  353. ULONG ulPos;
  354. struct {
  355. WORD nPos1; //hinshi
  356. WORD nPos2; //extended hinshi
  357. } ;
  358. };
  359. ULONG rgulAttrs[2]; //attributes
  360. INT cbComment; //size of user comment
  361. IMEUCT uct; //type of user comment
  362. VOID *pvComment; //user comment
  363. } IMEWRD, *PIMEWRD;
  364. #if _MSC_VER >= 1200
  365. #pragma warning(pop)
  366. #endif
  367. // Shared Header dictionary File
  368. typedef struct _IMESHF
  369. {
  370. WORD cbShf; //size of this struct
  371. WORD verDic; //dictionary version
  372. CHAR szTitle[48]; //dictionary title
  373. CHAR szDescription[256]; //dictionary description
  374. CHAR szCopyright[128]; //dictionary copyright info
  375. } IMESHF;
  376. #define POS_UNDEFINED 0
  377. #define JPOS_UNDEFINED POS_UNDEFINED
  378. #define JPOS_MEISHI_FUTSU 100 //����
  379. #define JPOS_MEISHI_SAHEN 101 //���ϖ���
  380. #define JPOS_MEISHI_ZAHEN 102 //���ϖ���
  381. #define JPOS_MEISHI_KEIYOUDOUSHI 103 //�`������
  382. #define JPOS_HUKUSIMEISHI 104 //�����I����
  383. #define JPOS_MEISA_KEIDOU 105 //���ό`��
  384. #define JPOS_JINMEI 106 //�l��
  385. #define JPOS_JINMEI_SEI 107 //��
  386. #define JPOS_JINMEI_MEI 108 //��
  387. #define JPOS_CHIMEI 109 //�n��
  388. #define JPOS_CHIMEI_KUNI 110 //��
  389. #define JPOS_CHIMEI_KEN 111 //��
  390. #define JPOS_CHIMEI_GUN 112 //�S
  391. #define JPOS_CHIMEI_KU 113 //��
  392. #define JPOS_CHIMEI_SHI 114 //�s
  393. #define JPOS_CHIMEI_MACHI 115 //��
  394. #define JPOS_CHIMEI_MURA 116 //��
  395. #define JPOS_CHIMEI_EKI 117 //�w
  396. #define JPOS_SONOTA 118 //�ŗL����
  397. #define JPOS_SHAMEI 119 //�Ж�
  398. #define JPOS_SOSHIKI 120 //�g�D
  399. #define JPOS_KENCHIKU 121 //���z��
  400. #define JPOS_BUPPIN 122 //���i
  401. #define JPOS_DAIMEISHI 123 //�㖼��
  402. #define JPOS_DAIMEISHI_NINSHOU 124 //�l�̑㖼��
  403. #define JPOS_DAIMEISHI_SHIJI 125 //�w���㖼��
  404. #define JPOS_KAZU 126 //��
  405. #define JPOS_KAZU_SURYOU 127 //����
  406. #define JPOS_KAZU_SUSHI 128 //����
  407. #define JPOS_5DAN_AWA 200 //�����s
  408. #define JPOS_5DAN_KA 201 //���s
  409. #define JPOS_5DAN_GA 202 //���s
  410. #define JPOS_5DAN_SA 203 //���s
  411. #define JPOS_5DAN_TA 204 //���s
  412. #define JPOS_5DAN_NA 205 //�ȍs
  413. #define JPOS_5DAN_BA 206 //�΍s
  414. #define JPOS_5DAN_MA 207 //�܍s
  415. #define JPOS_5DAN_RA 208 //���s
  416. #define JPOS_5DAN_AWAUON 209 //�����s������
  417. #define JPOS_5DAN_KASOKUON 210 //���s������
  418. #define JPOS_5DAN_RAHEN 211 //���s�ϊi
  419. #define JPOS_4DAN_HA 212 //�͍s�l�i
  420. #define JPOS_1DAN 213 //���i����
  421. #define JPOS_TOKUSHU_KAHEN 214 //���ϓ���
  422. #define JPOS_TOKUSHU_SAHENSURU 215 //���ϓ���
  423. #define JPOS_TOKUSHU_SAHEN 216 //���s�ϊi
  424. #define JPOS_TOKUSHU_ZAHEN 217 //���s�ϊi
  425. #define JPOS_TOKUSHU_NAHEN 218 //�ȍs�ϊi
  426. #define JPOS_KURU_KI 219 //��
  427. #define JPOS_KURU_KITA 220 //����
  428. #define JPOS_KURU_KITARA 221 //������
  429. #define JPOS_KURU_KITARI 222 //������
  430. #define JPOS_KURU_KITAROU 223 //�����낤
  431. #define JPOS_KURU_KITE 224 //����
  432. #define JPOS_KURU_KUREBA 225 //������
  433. #define JPOS_KURU_KO 226 //���i�Ȃ��j
  434. #define JPOS_KURU_KOI 227 //����
  435. #define JPOS_KURU_KOYOU 228 //���悤
  436. #define JPOS_SURU_SA 229 //��
  437. #define JPOS_SURU_SI 230 //��
  438. #define JPOS_SURU_SITA 231 //����
  439. #define JPOS_SURU_SITARA 232 //������
  440. #define JPOS_SURU_SIATRI 233 //������
  441. #define JPOS_SURU_SITAROU 234 //�����낤
  442. #define JPOS_SURU_SITE 235 //����
  443. #define JPOS_SURU_SIYOU 236 //���悤
  444. #define JPOS_SURU_SUREBA 237 //������
  445. #define JPOS_SURU_SE 238 //��
  446. #define JPOS_SURU_SEYO 239 //�����^����
  447. #define JPOS_KEIYOU 300 //�`�e��
  448. #define JPOS_KEIYOU_GARU 301 //�`�e�����
  449. #define JPOS_KEIYOU_GE 302 //�`�e����
  450. #define JPOS_KEIYOU_ME 303 //�`�e���
  451. #define JPOS_KEIYOU_YUU 304 //�`�e����
  452. #define JPOS_KEIYOU_U 305 //�`�e���
  453. #define JPOS_KEIDOU 400 //�`�e����
  454. #define JPOS_KEIDOU_NO 401 //�`�e�����
  455. #define JPOS_KEIDOU_TARU 402 //�`�e������
  456. #define JPOS_KEIDOU_GARU 403 //�`�e�������
  457. #define JPOS_FUKUSHI 500 //����
  458. #define JPOS_FUKUSHI_SAHEN 501 //���ϕ���
  459. #define JPOS_FUKUSHI_NI 502 //�����
  460. #define JPOS_FUKUSHI_NANO 503 //�����
  461. #define JPOS_FUKUSHI_DA 504 //������
  462. #define JPOS_FUKUSHI_TO 505 //�����
  463. #define JPOS_FUKUSHI_TOSURU 506 //�������
  464. #define JPOS_RENTAISHI 600 //�A�̎�
  465. #define JPOS_RENTAISHI_SHIJI 601 //�w���A�̎�
  466. #define JPOS_SETSUZOKUSHI 650 //�ڑ���
  467. #define JPOS_KANDOUSHI 670 //������
  468. #define JPOS_SETTOU 700 //�ړ���
  469. #define JPOS_SETTOU_KAKU 701 //�����P�ړ���
  470. #define JPOS_SETTOU_SAI 702 //�����Q�ړ���
  471. #define JPOS_SETTOU_FUKU 703 //�����R�ړ���
  472. #define JPOS_SETTOU_MI 704 //�����S�ړ���
  473. #define JPOS_SETTOU_DAISHOU 705 //�����T�ړ���
  474. #define JPOS_SETTOU_KOUTEI 706 //�����U�ړ���
  475. #define JPOS_SETTOU_CHOUTAN 707 //�����V�ړ���
  476. #define JPOS_SETTOU_SHINKYU 708 //�����W�ړ���
  477. #define JPOS_SETTOU_JINMEI 709 //�l���ړ���
  478. #define JPOS_SETTOU_CHIMEI 710 //�n���ړ���
  479. #define JPOS_SETTOU_SONOTA 711 //�ŗL�ړ���
  480. #define JPOS_SETTOU_JOSUSHI 712 //�O�u������
  481. #define JPOS_SETTOU_TEINEI_O 713 //���J�P�ړ���
  482. #define JPOS_SETTOU_TEINEI_GO 714 //���J�Q�ړ���
  483. #define JPOS_SETTOU_TEINEI_ON 715 //���J�R�ړ���
  484. #define JPOS_SETSUBI 800 //�ڔ���
  485. #define JPOS_SETSUBI_TEKI 801 //�����P�ڔ���
  486. #define JPOS_SETSUBI_SEI 802 //�����Q�ڔ���
  487. #define JPOS_SETSUBI_KA 803 //�����R�ڔ���
  488. #define JPOS_SETSUBI_CHU 804 //�����S�ڔ���
  489. #define JPOS_SETSUBI_FU 805 //�����T�ڔ���
  490. #define JPOS_SETSUBI_RYU 806 //�����U�ڔ���
  491. #define JPOS_SETSUBI_YOU 807 //�����V�ڔ���
  492. #define JPOS_SETSUBI_KATA 808 //�����W�ڔ���
  493. #define JPOS_SETSUBI_MEISHIRENDAKU 809 //�����A��
  494. #define JPOS_SETSUBI_JINMEI 810 //�l���ڔ���
  495. #define JPOS_SETSUBI_CHIMEI 811 //�n���ڔ���
  496. #define JPOS_SETSUBI_KUNI 812 //���ڔ���
  497. #define JPOS_SETSUBI_KEN 813 //���ڔ���
  498. #define JPOS_SETSUBI_GUN 814 //�S�ڔ���
  499. #define JPOS_SETSUBI_KU 815 //���ڔ���
  500. #define JPOS_SETSUBI_SHI 816 //�s�ڔ���
  501. #define JPOS_SETSUBI_MACHI 817 //���P�ڔ���
  502. #define JPOS_SETSUBI_CHOU 818 //���Q�ڔ���
  503. #define JPOS_SETSUBI_MURA 819 //���P�ڔ���
  504. #define JPOS_SETSUBI_SON 820 //���Q�ڔ���
  505. #define JPOS_SETSUBI_EKI 821 //�w�ڔ���
  506. #define JPOS_SETSUBI_SONOTA 822 //�ŗL�ڔ���
  507. #define JPOS_SETSUBI_SHAMEI 823 //�Ж��ڔ���
  508. #define JPOS_SETSUBI_SOSHIKI 824 //�g�D�ڔ���
  509. #define JPOS_SETSUBI_KENCHIKU 825 //���z���ڔ���
  510. #define JPOS_RENYOU_SETSUBI 826 //�A�p�ڔ���
  511. #define JPOS_SETSUBI_JOSUSHI 827 //���u������
  512. #define JPOS_SETSUBI_JOSUSHIPLUS 828 //���u�������{
  513. #define JPOS_SETSUBI_JIKAN 829 //���ԏ�����
  514. #define JPOS_SETSUBI_JIKANPLUS 830 //���ԏ������{
  515. #define JPOS_SETSUBI_TEINEI 831 //���J�ڔ���
  516. #define JPOS_SETSUBI_SAN 832 //���J�P�ڔ���
  517. #define JPOS_SETSUBI_KUN 833 //���J�Q�ڔ���
  518. #define JPOS_SETSUBI_SAMA 834 //���J�R�ڔ���
  519. #define JPOS_SETSUBI_DONO 835 //���J�S�ڔ���
  520. #define JPOS_SETSUBI_FUKUSU 836 //�����ڔ���
  521. #define JPOS_SETSUBI_TACHI 837 //�����P�ڔ���
  522. #define JPOS_SETSUBI_RA 838 //�����Q�ڔ���
  523. #define JPOS_TANKANJI 900 //�P����
  524. #define JPOS_TANKANJI_KAO 901 //��
  525. #define JPOS_KANYOUKU 902 //���p��
  526. #define JPOS_DOKURITSUGO 903 //�Ɨ���
  527. #define JPOS_FUTEIGO 904 //�s����
  528. #define JPOS_KIGOU 905 //�L��
  529. #define JPOS_EIJI 906 //�p��
  530. #define JPOS_KUTEN 907 //���_
  531. #define JPOS_TOUTEN 908 //�Ǔ_
  532. #define JPOS_KANJI 909 //���͕s�\����
  533. #define JPOS_OPENBRACE 910 //�J������
  534. #define JPOS_CLOSEBRACE 911 //�‚�����
  535. //POS table data structure
  536. typedef struct _POSTBL
  537. {
  538. WORD nPos; //pos number
  539. BYTE *szName; //name of pos
  540. } POSTBL;
  541. //////////////////////////////
  542. // The IFEDictionary interface
  543. //////////////////////////////
  544. #undef INTERFACE
  545. #define INTERFACE IFEDictionary
  546. DECLARE_INTERFACE_(IFEDictionary, IUnknown)
  547. {
  548. // IUnknown members
  549. STDMETHOD(QueryInterface)(THIS_ REFIID refiid, VOID **ppv) PURE;
  550. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  551. STDMETHOD_(ULONG,Release)(THIS) PURE;
  552. // IFEDictionary members
  553. STDMETHOD(Open) (THIS_
  554. CHAR *pchDictPath, //(in) dictionary path
  555. IMESHF *pshf //(out) dictionary header
  556. ) PURE;
  557. STDMETHOD(Close) (THIS) PURE;
  558. STDMETHOD(GetHeader) (THIS_
  559. CHAR *pchDictPath, //(in) dictionary path
  560. IMESHF *pshf, //(out) dictionary header
  561. IMEFMT *pjfmt, //(out) dictionary format
  562. ULONG *pulType //(out) dictionary type
  563. ) PURE;
  564. STDMETHOD(Reserve1) (THIS) PURE;
  565. STDMETHOD(GetPosTable) (THIS_
  566. POSTBL **prgPosTbl, //(out) pos table pointer
  567. int *pcPosTbl //(out) pos table count pointer
  568. ) PURE;
  569. STDMETHOD(GetWords) (THIS_
  570. WCHAR *pwchFirst, //(in) starting range of reading
  571. WCHAR *pwchLast, //(in) ending range of reading
  572. WCHAR *pwchDisplay, //(in) display
  573. ULONG ulPos, //(in) part of speech (IFED_POS_...)
  574. ULONG ulSelect, //(in) output selection
  575. ULONG ulWordSrc, //(in) user or auto registered word?
  576. UCHAR *pchBuffer, //(in/out) buffer for storing array of IMEWRD
  577. ULONG cbBuffer, //(in) size of buffer in bytes
  578. ULONG *pcWrd //(out) count of IMEWRD's returned
  579. ) PURE;
  580. STDMETHOD(NextWords) (THIS_
  581. UCHAR *pchBuffer, //(in/out) buffer for storing array of IMEWRD
  582. ULONG cbBuffer, //(in) size of buffer in bytes
  583. ULONG *pcWrd //(out) count of IMEWRD's returned
  584. ) PURE;
  585. STDMETHOD(Create) (THIS_
  586. CHAR *pchDictPath, //(in) path for the new dictionary
  587. IMESHF *pshf //(in) dictionary header
  588. ) PURE;
  589. STDMETHOD(SetHeader) (THIS_
  590. IMESHF *pshf //(in) dictionary header
  591. ) PURE;
  592. STDMETHOD(ExistWord) (THIS_
  593. IMEWRD *pwrd //(in) word to check
  594. ) PURE;
  595. STDMETHOD(Reserve2) (THIS) PURE;
  596. STDMETHOD(RegisterWord) (THIS_
  597. IMEREG reg, //(in) type of operation to perform on IMEWRD
  598. IMEWRD *pwrd //(in) word to be registered or deleted
  599. ) PURE;
  600. };
  601. ///////////////////////////////////
  602. // Definitions for PerIME Interface
  603. ///////////////////////////////////
  604. /***********************************************************************
  605. IME Version IDs
  606. ***********************************************************************/
  607. #define VERSION_ID_JAPANESE 0x01000000
  608. #define VERSION_ID_KOREAN 0x02000000
  609. #define VERSION_ID_CHINESE_TRADITIONAL 0x04000000
  610. #define VERSION_ID_CHINESE_SIMPLIFIED 0x08000000
  611. #define VERSION_ID_IMEJP98 (VERSION_ID_JAPANESE | 0x980)
  612. #define VERSION_ID_IMEJP2000 (VERSION_ID_JAPANESE | 0x98a)
  613. /***********************************************************************
  614. Msg: WM_MSIME_SERVICE
  615. Desc: service functions
  616. Dir: Apps to IME
  617. wParam: reserved
  618. lParam: reserved
  619. ***********************************************************************/
  620. // Label for RegisterWindowMessage
  621. #define RWM_SERVICE TEXT("MSIMEService")
  622. //getting version number (wParam)
  623. #define FID_MSIME_VERSION 0
  624. /***********************************************************************
  625. Msg: WM_MSIME_UIREADY
  626. Desc: service functions
  627. Dir: IME to Apps
  628. wParam: Version ID
  629. lParam: reserved
  630. ***********************************************************************/
  631. // Label for RegisterWindowMessage
  632. #define RWM_UIREADY TEXT("MSIMEUIReady")
  633. /***********************************************************************
  634. Msg: WM_MSIME_MOUSE
  635. Desc: mouse operation definition
  636. Dir: Apps to IME
  637. ***********************************************************************/
  638. // Label for RegisterWindowMessage
  639. #define RWM_MOUSE TEXT("MSIMEMouseOperation")
  640. // Mouse Operation Version (return value of IMEMOUSE_VERSION)
  641. #define VERSION_MOUSE_OPERATION 1
  642. // Mouse operation result
  643. #define IMEMOUSERET_NOTHANDLED (-1)
  644. //WParam definition for WM_IME_MOUSE.
  645. #define IMEMOUSE_VERSION 0xff // mouse supported?
  646. #define IMEMOUSE_NONE 0x00 // no mouse button was pushed
  647. #define IMEMOUSE_LDOWN 0x01
  648. #define IMEMOUSE_RDOWN 0x02
  649. #define IMEMOUSE_MDOWN 0x04
  650. #define IMEMOUSE_WUP 0x10 // wheel up
  651. #define IMEMOUSE_WDOWN 0x20 // wheel down
  652. /***********************************************************************
  653. Msg: WM_MSIME_RECONVERT
  654. Desc: reconversion
  655. Dir: IME to Apps
  656. ***********************************************************************/
  657. // Label for RegisterWindowMessage
  658. #define RWM_RECONVERT TEXT("MSIMEReconvert")
  659. /***********************************************************************
  660. Msg: WM_MSIME_RECONVERTREQUEST
  661. Desc: reconversion
  662. Dir: Apps to IME
  663. ***********************************************************************/
  664. // wParam of WM_MSIME_RECONVERTREQUEST
  665. #define FID_RECONVERT_VERSION 0x10000000
  666. // Private reconversion Version
  667. #define VERSION_RECONVERSION 1
  668. // Label for RegisterWindowMessage
  669. #define RWM_RECONVERTREQUEST TEXT("MSIMEReconvertRequest")
  670. /***********************************************************************
  671. Msg: WM_MSIME_DOCUMENTFEED
  672. Desc: Document feeding
  673. Dir: IME to Apps
  674. Usage: SendMessage( hwndApp, WM_MSIME_DOCUMENTFEED, VERSION_DOCUMENTFEED,
  675. (RECONVERTSTRING*)pReconv );
  676. wParam: VERSION_DOCUMENTFEED
  677. lParam: Pointer of RECONVERTSTRING structure
  678. return: size of RECONVERTSTRING structure
  679. ***********************************************************************/
  680. // wParam of WM_MSIME_DOCUMENTFEED (set current docfeed version)
  681. #define VERSION_DOCUMENTFEED 1
  682. // lParam is pointer of RECONVERTSTRING structure
  683. // Label for RegisterWindowMessage
  684. #define RWM_DOCUMENTFEED TEXT("MSIMEDocumentFeed")
  685. /***********************************************************************
  686. Msg: WM_MSIME_QUERYPOSITION
  687. Desc: composition UI
  688. Dir: IME to Apps
  689. Usage: SendMessage( hwndApp, WM_MSIME_QUERYPOSITION, VERSION_QUERYPOSITION, (IMEPOSITION*)pPs );
  690. wParam: reserved. must be 0.
  691. lParam: pointer of IMEPOSITION structure
  692. return: Non-zero = success. Zero = error.
  693. ***********************************************************************/
  694. // wParam of WM_MSIME_QUERYPOSITION
  695. #define VERSION_QUERYPOSITION 1
  696. // Label for RegisterWindowMessage
  697. #define RWM_QUERYPOSITION TEXT("MSIMEQueryPosition")
  698. /***********************************************************************
  699. Msg: WM_MSIME_MODEBIAS
  700. Desc: input mode bias
  701. Dir: Apps to IME
  702. Usage: SendMessage( hwndDefUI, WM_MSIME_MODEBIAS, MODEBIAS_xxxx, MODEBIASMODE_xxxx );
  703. wParam: operation of bias
  704. lParam: bias mode
  705. return: If wParam is MODEBIAS_GETVERSION,returns version number of interface.
  706. If wParam is MODEBIAS_SETVALUE : return non-zero value if succeeded. Returns 0 if fail.
  707. If wParam is MODEBIAS_GETVALUE : returns current bias mode.
  708. ***********************************************************************/
  709. // Label for RegisterWindowMessage
  710. #define RWM_MODEBIAS TEXT("MSIMEModeBias")
  711. // Current version
  712. #define VERSION_MODEBIAS 1
  713. // Set or Get (wParam)
  714. #define MODEBIAS_GETVERSION 0
  715. #define MODEBIAS_SETVALUE 1
  716. #define MODEBIAS_GETVALUE 2
  717. // Bias (lParam)
  718. #define MODEBIASMODE_DEFAULT 0x00000000 // reset all of bias setting
  719. #define MODEBIASMODE_FILENAME 0x00000001 // filename
  720. /***********************************************************************
  721. Msg: WM_MSIME_SHOWIMEPAD
  722. Desc: show ImePad
  723. Usage: SendMessage( hwndDefUI, WM_MSIME_SHOWIMEPAD, wParam, lParam );
  724. wParam: Applet selection option
  725. lParam: Applet selection parameter
  726. (Category defined in imepad.h or a pointer to GUID for Applet)
  727. return: Non-zero = accepted. Zero = not accepted.
  728. ***********************************************************************/
  729. // Label for RegisterWindowMessage
  730. #define RWM_SHOWIMEPAD TEXT("MSIMEShowImePad")
  731. // Applet selection option
  732. #define SHOWIMEPAD_DEFAULT 0x00000000 // default applet
  733. #define SHOWIMEPAD_CATEGORY 0x00000001 // selection by applet category
  734. #define SHOWIMEPAD_GUID 0x00000002 // selection by applet GUID
  735. /***********************************************************************
  736. Msg: WM_MSIME_KEYMAP
  737. Desc: key map sharing with apps
  738. ***********************************************************************/
  739. // Label for RegisterWindowMessage
  740. #define RWM_KEYMAP TEXT("MSIMEKeyMap")
  741. #define RWM_CHGKEYMAP TEXT("MSIMEChangeKeyMap")
  742. #define RWM_NTFYKEYMAP TEXT("MSIMENotifyKeyMap")
  743. #define FID_MSIME_KMS_VERSION 1
  744. #define FID_MSIME_KMS_INIT 2
  745. #define FID_MSIME_KMS_TERM 3
  746. #define FID_MSIME_KMS_DEL_KEYLIST 4
  747. #define FID_MSIME_KMS_NOTIFY 5
  748. #define FID_MSIME_KMS_GETMAP 6
  749. #define FID_MSIME_KMS_INVOKE 7
  750. #define FID_MSIME_KMS_SETMAP 8
  751. #define IMEKMS_NOCOMPOSITION 0
  752. #define IMEKMS_COMPOSITION 1
  753. #define IMEKMS_SELECTION 2
  754. #define IMEKMS_IMEOFF 3
  755. #define IMEKMS_2NDLEVEL 4 // Reserved
  756. #define IMEKMS_INPTGL 5 // Reserved
  757. #define IMEKMS_CANDIDATE 6 // Reserved
  758. typedef struct tagIMEKMSINIT {
  759. INT cbSize;
  760. HWND hWnd; // Window which receives notification from IME.
  761. // If hWnd is NULL, no notification is posted
  762. // to Input context.
  763. } IMEKMSINIT;
  764. typedef struct tagIMEKMSKEY {
  765. DWORD dwStatus; //Shift-Control combination status.
  766. //Any combination of constants below
  767. //(defined in IMM.H)
  768. // 0x0000 (default)
  769. // MOD_CONTROL 0x0002
  770. // MOD_SHIFT 0x0004
  771. // Alt key and Win key is not processed by IME.
  772. DWORD dwCompStatus; //Composition string status
  773. //One of the constants below
  774. // IMEKMS_NOCOMPOSITION No composition string
  775. // IMEKMS_COMPOSITION Some composition string
  776. // IMEKMS_SELECTION Selection exists in apps
  777. // IMEKMS_IMEOFF IME Off state
  778. DWORD dwVKEY; // VKEY code defined in IMM.H
  779. union {
  780. DWORD dwControl;// IME Functionality ID
  781. DWORD dwNotUsed;
  782. };
  783. union {
  784. WCHAR pwszDscr[31];// The pointer to string of description of this functionalify
  785. WCHAR pwszNoUse[31];
  786. };
  787. } IMEKMSKEY;
  788. typedef struct tagIMEKMS {
  789. INT cbSize;
  790. HIMC hIMC;
  791. DWORD cKeyList;
  792. IMEKMSKEY *pKeyList;
  793. } IMEKMS;
  794. typedef struct tagIMEKMSNTFY {
  795. INT cbSize;
  796. HIMC hIMC;
  797. BOOL fSelect;
  798. } IMEKMSNTFY;
  799. typedef struct tagIMEKMSKMP {
  800. INT cbSize; //[in] size of this structure
  801. HIMC hIMC; //[in] Input context
  802. LANGID idLang; //[in] Language ID
  803. WORD wVKStart; //[in] VKEY start
  804. WORD wVKEnd; //[in] VKEY end
  805. INT cKeyList; //[out] number of IMEKMSKEY
  806. IMEKMSKEY *pKeyList; //[out] retrieve buffer of IMEKMSKEY
  807. // Must be GlobalMemFree by clients
  808. } IMEKMSKMP;
  809. typedef struct tagIMEKMSINVK {
  810. INT cbSize;
  811. HIMC hIMC;
  812. DWORD dwControl;
  813. } IMEKMSINVK;
  814. /***********************************************************************
  815. Msg: WM_MSIME_RECONVERTOPTIONS
  816. Desc: Set reconversion options
  817. Usage: SendMessage( hwndDefUI, WM_MSIME_RECONVERTOPTIONS, dwOpt, (LPARAM)(HIMC)hIMC );
  818. wParam: options
  819. lParam: Input context handle
  820. return: Non-zero = accepted. Zero = not accepted.
  821. ***********************************************************************/
  822. // Label for RegisterWindowMessage
  823. #define RWM_RECONVERTOPTIONS TEXT("MSIMEReconvertOptions")
  824. //WParam definition for WM_IME_RECONVERTOPTIONS.
  825. #define RECONVOPT_NONE 0x00000000 // default
  826. #define RECONVOPT_USECANCELNOTIFY 0x00000001 // cancel notify
  827. // parameter of ImmGetCompositionString
  828. #define GCSEX_CANCELRECONVERT 0x10000000
  829. #pragma pack()
  830. #ifdef __cplusplus
  831. extern "C" {
  832. #endif
  833. // The following API replaces CoCreateInstance(), when CLSID is not used.
  834. HRESULT WINAPI CreateIFECommonInstance(VOID **ppvObj);
  835. typedef HRESULT (WINAPI *fpCreateIFECommonInstanceType)(VOID **ppvObj);
  836. // The IFELanguage global export function
  837. HRESULT WINAPI CreateIFELanguageInstance(REFCLSID clsid, VOID **ppvObj);
  838. typedef HRESULT (WINAPI *fpCreateIFELanguageInstanceType)(REFCLSID clsid, VOID **ppvObj);
  839. // The following API replaces CoCreateInstance(), when CLSID is not used.
  840. HRESULT WINAPI CreateIFEDictionaryInstance(VOID **ppvObj);
  841. typedef HRESULT (WINAPI *fpCreateIFEDictionaryInstanceType)(VOID **ppvObj);
  842. #ifdef __cplusplus
  843. } /* end of 'extern "C" {' */
  844. #endif
  845. #endif //__MSIME_H__