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.

326 lines
14 KiB

  1. /*++ BUILD Version: 0004 // Increment this if a change has global effects ;both
  2. ;both
  3. Copyright (c) Microsoft Corporation. All rights reserved. ;both
  4. ;both
  5. Module Name: ;both
  6. ;both
  7. ime.h
  8. imep.h ;internal
  9. ;both
  10. Abstract: ;both
  11. ;both
  12. Private ;internal
  13. Procedure declarations, constant definitions and macros for the IME ;both
  14. component. ;both
  15. ;both
  16. --*/ ;both
  17. #ifndef _IME_
  18. #define _IME_
  19. #ifndef _IMEP_ ;internal
  20. #define _IMEP_ ;internal
  21. ;internal
  22. #ifdef __cplusplus ;both
  23. extern "C" { ;both
  24. #endif /* __cplusplus */ ;both
  25. ;both
  26. #ifndef _WINDEF_
  27. typedef unsigned int UINT;
  28. #endif // _WINDEF_
  29. #define IME_MAXPROCESS 32
  30. LRESULT WINAPI SendIMEMessageEx%( IN HWND, IN LPARAM);
  31. //
  32. // IMESTRUCT structure for SendIMEMessageEx
  33. // IMESTRUCT structure for SendIMEMessage(Ex) ;internal
  34. //
  35. typedef struct tagIMESTRUCT {
  36. UINT fnc; // function code
  37. WPARAM wParam; // word parameter
  38. UINT wCount; // word counter
  39. UINT dchSource; // offset to Source from top of memory object
  40. UINT dchDest; // offset to Desrination from top of memory object
  41. LPARAM lParam1;
  42. LPARAM lParam2;
  43. LPARAM lParam3;
  44. } IMESTRUCT,*PIMESTRUCT,NEAR *NPIMESTRUCT,FAR *LPIMESTRUCT;
  45. #define CP_HWND 0
  46. #define CP_OPEN 1
  47. #define CP_DIRECT 2
  48. #define CP_LEVEL 3
  49. //
  50. // Virtual Keys
  51. //
  52. #if !defined(VK_DBE_ALPHANUMERIC)
  53. #define VK_DBE_ALPHANUMERIC 0x0f0
  54. #define VK_DBE_KATAKANA 0x0f1
  55. #define VK_DBE_HIRAGANA 0x0f2
  56. #define VK_DBE_SBCSCHAR 0x0f3
  57. #define VK_DBE_DBCSCHAR 0x0f4
  58. #define VK_DBE_ROMAN 0x0f5
  59. #define VK_DBE_NOROMAN 0x0f6
  60. #define VK_DBE_ENTERWORDREGISTERMODE 0x0f7
  61. #define VK_DBE_ENTERIMECONFIGMODE 0x0f8
  62. #define VK_DBE_FLUSHSTRING 0x0f9
  63. #define VK_DBE_CODEINPUT 0x0fa
  64. #define VK_DBE_NOCODEINPUT 0x0fb
  65. #define VK_DBE_DETERMINESTRING 0x0fc
  66. #define VK_DBE_ENTERDLGCONVERSIONMODE 0x0fd
  67. #endif
  68. ;begin_internal
  69. #if !defined(VK_DBE_IME_WORDREGISTER)
  70. #define VK_DBE_IME_WORDREGISTER VK_DBE_ENTERWORDREGISTERMODE ;internal
  71. #define VK_DBE_IME_DIALOG VK_DBE_ENTERIMECONFIGMODE ;internal
  72. #define VK_DBE_FLUSH VK_DBE_FLUSHSTRING ;internal
  73. #endif
  74. ;end_internal
  75. #define VK_OEM_SEMICLN 0x0ba // ; ** : ;internal
  76. #define VK_OEM_EQUAL 0x0bb // = ** + ;internal
  77. #define VK_OEM_SLASH 0x0bf // / ** ? ;internal
  78. #define VK_OEM_LBRACKET 0x0db // [ ** { ;internal
  79. #define VK_OEM_BSLASH 0x0dc // \ ** | ;internal
  80. #define VK_OEM_RBRACKET 0x0dd // ] ** | ;internal
  81. #define VK_OEM_QUOTE 0x0de // ' ** " ;internal
  82. //
  83. // switch for wParam of IME_SETCONVERSIONWINDOW
  84. // switch for wParam of IME_MOVECONVERTWINDOW ;internal
  85. //
  86. #define MCW_DEFAULT 0x00
  87. #define MCW_RECT 0x01
  88. #define MCW_WINDOW 0x02
  89. #define MCW_SCREEN 0x04
  90. #define MCW_VERTICAL 0x08
  91. #define MCW_HIDDEN 0x10
  92. #define MCW_CMD 0x16 // command mask ;internal
  93. #define MCW_CONSOLE_IME 0x8000 ;internal
  94. //
  95. // switch for wParam of IME_SETCONVERSIONMODE
  96. // and IME_GETCONVERSIONMODE
  97. // switch for wParam of IME_SET_MODE(IME_SETCONVERSIONMODE) ;internal
  98. // and IME_GET_MODE(IME_GETCONVERSIONMODE) ;internal
  99. //
  100. #define IME_MODE_ALPHANUMERIC 0x0001
  101. #ifdef KOREA // BeomOh - 9/29/92
  102. #define IME_MODE_SBCSCHAR 0x0002
  103. #else
  104. #define IME_MODE_SBCSCHAR 0x0008
  105. #endif
  106. #define KOREA_IME_MODE_SBCSCHAR 0x0002 ;internal
  107. #define JAPAN_IME_MODE_SBCSCHAR 0x0008 ;internal
  108. #define IME_MODE_KATAKANA 0x0002
  109. #define IME_MODE_HIRAGANA 0x0004
  110. #define IME_MODE_HANJACONVERT 0x0004
  111. #define IME_MODE_DBCSCHAR 0x0010
  112. #define IME_MODE_ROMAN 0x0020
  113. #define IME_MODE_NOROMAN 0x0040
  114. #define IME_MODE_CODEINPUT 0x0080
  115. #define IME_MODE_NOCODEINPUT 0x0100
  116. //
  117. // ;internal is added by JAPAN, CWIN user should ignore it ;Internal
  118. // 0x1, 0x2, 0x4, 0x20, 0x40, 0x80, 0x100 is not for CWIN ;Internal
  119. // 0x8, 0x10, and below IME_MODE_??? will be use by CWIN ;Internal
  120. //
  121. #define IME_MODE_LHS 0x00200 ;internal
  122. #define IME_MODE_NOLHS 0x00400 ;internal
  123. #define IME_MODE_SK 0x00800 ;internal
  124. #define IME_MODE_NOSK 0x01000 ;internal
  125. #define IME_MODE_XSPACE 0x02000 ;internal
  126. #define IME_MODE_NOXSPACE 0x04000 ;internal
  127. //
  128. // IME APIs
  129. // Subfunctions for WM_CONVERTREQUEST or WM_CONVERTREQUESTEX ;internal
  130. //
  131. #define IME_GETIMECAPS 0x03
  132. #define IME_QUERY IME_GETIMECAPS ;internal
  133. #define IME_SETOPEN 0x04
  134. #define IME_GETOPEN 0x05
  135. #define IME_ENABLEDOSIME 0x06 ;internal
  136. #define IME_ENABLE IME_ENABLEDOSIME ;internal
  137. #define IME_GETVERSION 0x07
  138. #define IME_SETCONVERSIONWINDOW 0x08
  139. #define IME_MOVEIMEWINDOW IME_SETCONVERSIONWINDOW // KOREA only
  140. #define IME_MOVECONVERTWINDOW IME_SETCONVERSIONWINDOW ;internal
  141. #define IME_SETCONVERSIONMODE 0x10
  142. #define IME_GETCONVERSIONMODE 0x11
  143. #define IME_GET_MODE IME_GETCONVERSIONMODE ;internal
  144. #define IME_SET_MODE 0x12 // KOREA only
  145. #define IME_SETCONVERSIONFONT 0x12 ;internal
  146. #define IME_SETFONT IME_SETCONVERSIONFONT ;internal
  147. #define IME_SENDVKEY 0x13
  148. #define IME_SENDKEY IME_SENDVKEY ;internal
  149. #define IME_DESTROYIME 0x14 ;internal
  150. #define IME_DESTROY IME_DESTROYIME ;internal
  151. #define IME_PRIVATE 0x15 ;internal
  152. #define IME_WINDOWUPDATE 0x16 ;internal
  153. #define IME_SELECT 0x17 ;internal
  154. #define IME_ENTERWORDREGISTERMODE 0x18
  155. #define IME_WORDREGISTER IME_ENTERWORDREGISTERMODE ;internal
  156. #define IME_SETCONVERSIONFONTEX 0x19
  157. #define IME_DBCSNAME 0x1A ;internal
  158. #define IME_MAXKEY 0x1B ;internal
  159. #define IME_WINNLS_SK 0x1C ;internal
  160. #define IME_CODECONVERT 0x20 ;internal
  161. #define IME_SETUSRFONT 0x20 ;internal
  162. #define IME_CONVERTLIST 0x21 ;internal
  163. #define IME_QUERYUSRFONT 0x21 ;internal
  164. #define IME_INPUTKEYTOSEQUENCE 0x22 ;internal
  165. #define IME_SEQUENCETOINTERNAL 0x23 ;internal
  166. #define IME_QUERYIMEINFO 0x24 ;internal
  167. #define IME_DIALOG 0x25 ;internal
  168. #define IME_AUTOMATA 0x30 ;internal
  169. #define IME_HANJAMODE 0x31 ;internal
  170. #define IME_GETLEVEL 0x40 ;internal
  171. #define IME_SETLEVEL 0x41 ;internal
  172. #define IME_GETMNTABLE 0x42 // reserved for HWIN ;Internal
  173. //#ifdef PEN ;Internal
  174. #define IME_SETUNDETERMINESTRING 0x50 ;internal
  175. #define IME_SETCAPTURE 0x51 ;internal
  176. //#endif ;Internal
  177. #define IME_CONSOLE_GET_PROCESSID 0x80 // Win32 ;internal
  178. #define IME_CONSOLE_CREATE 0x81 // Win32 ;internal
  179. #define IME_CONSOLE_DESTROY 0x82 // Win32 ;internal
  180. #define IME_CONSOLE_SETFOCUS 0x83 // Win32 ;internal
  181. #define IME_CONSOLE_KILLFOCUS 0x84 // Win32 ;internal
  182. #define IME_CONSOLE_BUFFER_SIZE 0x85 // Win32 ;internal
  183. #define IME_CONSOLE_WINDOW_SIZE 0x86 // Win32 ;internal
  184. #define IME_CONSOLE_SET_IME_ON_WINDOW 0x87 // Win32 ;internal
  185. #define IME_CONSOLE_MODEINFO 0x88 ;internal
  186. #define IME_PRIVATEFIRST 0x0100 ;internal
  187. #define IME_PRIVATELAST 0x04FF ;internal
  188. //
  189. // IME_CODECONVERT subfunctions
  190. //
  191. #define IME_BANJAtoJUNJA 0x13 // KOREA only
  192. #define IME_JUNJAtoBANJA 0x14 // KOREA only
  193. #define IME_JOHABtoKS 0x15 // KOREA only
  194. #define IME_KStoJOHAB 0x16 // KOREA only
  195. //
  196. // IME_AUTOMATA subfunctions
  197. //
  198. #define IMEA_INIT 0x01 // KOREA only
  199. #define IMEA_NEXT 0x02 // KOREA only
  200. #define IMEA_PREV 0x03 // KOREA only
  201. //
  202. // IME_HANJAMODE subfunctions
  203. //
  204. #define IME_REQUEST_CONVERT 0x01 // KOREA only
  205. #define IME_ENABLE_CONVERT 0x02 // KOREA only
  206. //
  207. // IME_MOVEIMEWINDOW subfunctions
  208. //
  209. #define INTERIM_WINDOW 0x00 // KOREA only
  210. #define MODE_WINDOW 0x01 // KOREA only
  211. #define HANJA_WINDOW 0x02 // KOREA only
  212. //
  213. // error code
  214. //
  215. #define IME_RS_ERROR 0x01 // genetal error
  216. #define IME_RS_NOIME 0x02 // IME is not installed
  217. #define IME_RS_TOOLONG 0x05 // given string is too long
  218. #define IME_RS_ILLEGAL 0x06 // illegal charactor(s) is string
  219. #define IME_RS_NOTFOUND 0x07 // no (more) candidate
  220. #define IME_RS_NOROOM 0x0a // no disk/memory space
  221. #define IME_RS_DISKERROR 0x0e // disk I/O error
  222. #define IME_RS_CAPTURED 0x10 // IME is captured ;internal
  223. #define IME_RS_INVALID 0x11 // Win3.1/NT
  224. #define IME_RS_NEST 0x12 // called nested
  225. #define IME_RS_SYSTEMMODAL 0x13 // called when system mode
  226. //
  227. // report messge from IME to WinApps
  228. //
  229. #define WM_IME_REPORT 0x0280
  230. //
  231. // report message parameter for WM_IME_REPORT
  232. //
  233. #define IR_STRINGSTART 0x100
  234. #define IR_STRINGEND 0x101
  235. #define IR_MOREROOM 0x110 ;internal
  236. #define IR_OPENCONVERT 0x120
  237. #define IR_CHANGECONVERT 0x121
  238. #define IR_CLOSECONVERT 0x122
  239. #define IR_FULLCONVERT 0x123
  240. #define IR_IMESELECT 0x130
  241. #define IR_STRING 0x140
  242. #define IR_IMERELEASED 0x150 ;internal
  243. #define IR_DBCSCHAR 0x160
  244. #define IR_UNDETERMINE 0x170
  245. #define IR_STRINGEX 0x180 // New for 3.1
  246. #define IR_MODEINFO 0x190
  247. //#define WM_CONVERTREQUESTEX 0x0109
  248. #define WM_WNT_CONVERTREQUESTEX 0x0109 /* WM_CONVERTREQUESTEX: 109 for NT, 108 for OT */
  249. #define WM_CONVERTREQUEST 0x010A
  250. #define WM_CONVERTRESULT 0x010B
  251. #define WM_INTERIM 0x010C
  252. #define WM_IMEKEYDOWN 0x290
  253. #define WM_IMEKEYUP 0x291
  254. #define IMEVER_31 0x0a03 ;internal
  255. //
  256. // UNDETERMINESTRING structure for IR_UNDETERMINE
  257. //
  258. typedef struct tagUNDETERMINESTRUCT {
  259. DWORD dwSize;
  260. UINT uDefIMESize;
  261. UINT uDefIMEPos;
  262. UINT uUndetTextLen;
  263. UINT uUndetTextPos;
  264. UINT uUndetAttrPos;
  265. UINT uCursorPos;
  266. UINT uDeltaStart;
  267. UINT uDetermineTextLen;
  268. UINT uDetermineTextPos;
  269. UINT uDetermineDelimPos;
  270. UINT uYomiTextLen;
  271. UINT uYomiTextPos;
  272. UINT uYomiDelimPos;
  273. } UNDETERMINESTRUCT,*PUNDETERMINESTRUCT,NEAR *NPUNDETERMINESTRUCT,FAR *LPUNDETERMINESTRUCT;
  274. typedef struct tagSTRINGEXSTRUCT {
  275. DWORD dwSize;
  276. UINT uDeterminePos;
  277. UINT uDetermineDelimPos;
  278. UINT uYomiPos;
  279. UINT uYomiDelimPos;
  280. } STRINGEXSTRUCT,NEAR *NPSTRINGEXSTRUCT,FAR *LPSTRINGEXSTRUCT;
  281. ;begin_both
  282. #ifdef __cplusplus
  283. }
  284. #endif /* __cplusplus */
  285. ;end_both
  286. #endif /* !_IMEP_ */ ;internal
  287. #endif // _IME_