8d45833c176dc5da1408733a7ffb6a0036e3ec7d
[reactos.git] / reactos / include / psdk / imm.h
1 /*
2 * Declarations for IMM32
3 *
4 * Copyright (C) the Wine project
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21 #ifndef __WINE_IMM_H
22 #define __WINE_IMM_H
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 typedef HANDLE HIMC;
29 typedef HANDLE HIMCC;
30
31 typedef struct tagREGISTERWORDA {
32 LPSTR lpReading;
33 LPSTR lpWord;
34 } REGISTERWORDA, *PREGISTERWORDA, *NPREGISTERWORDA, *LPREGISTERWORDA;
35
36 typedef struct tagREGISTERWORDW {
37 LPWSTR lpReading;
38 LPWSTR lpWord;
39 } REGISTERWORDW, *PREGISTERWORDW, *NPREGISTERWORDW, *LPREGISTERWORDW;
40
41 typedef int (CALLBACK *REGISTERWORDENUMPROCA)(LPCSTR, DWORD, LPCSTR, LPVOID);
42 typedef int (CALLBACK *REGISTERWORDENUMPROCW)(LPCWSTR, DWORD, LPCWSTR, LPVOID);
43
44 typedef struct tagCANDIDATEFORM
45 {
46 DWORD dwIndex;
47 DWORD dwStyle;
48 POINT ptCurrentPos;
49 RECT rcArea;
50 } CANDIDATEFORM, *LPCANDIDATEFORM;
51
52 typedef struct tagCANDIDATELIST
53 {
54 DWORD dwSize;
55 DWORD dwStyle;
56 DWORD dwCount;
57 DWORD dwSelection;
58 DWORD dwPageStart;
59 DWORD dwPageSize;
60 DWORD dwOffset[1];
61 } CANDIDATELIST, *LPCANDIDATELIST;
62
63 typedef struct tagSTYLEBUFA
64 {
65 DWORD dwStyle;
66 CHAR szDescription[32];
67 } STYLEBUFA, *LPSTYLEBUFA;
68
69 typedef struct tagSTYLEBUFW
70 {
71 DWORD dwStyle;
72 WCHAR szDescription[32];
73 } STYLEBUFW, *LPSTYLEBUFW;
74
75 DECL_WINELIB_TYPE_AW(STYLEBUF)
76 DECL_WINELIB_TYPE_AW(LPSTYLEBUF)
77
78 typedef struct tagRECONVERTSTRING
79 {
80 DWORD dwSize;
81 DWORD dwVersion;
82 DWORD dwStrLen;
83 DWORD dwStrOffset;
84 DWORD dwCompStrLen;
85 DWORD dwCompStrOffset;
86 DWORD dwTargetStrLen;
87 DWORD dwTargetStrOffset;
88 } RECONVERTSTRING, *LPRECONVERTSTRING;
89
90
91 #define IMEMENUITEM_STRING_SIZE 80
92
93 typedef struct tagIMEMENUITEMINFOA
94 {
95 UINT cbSize;
96 UINT fType;
97 UINT fState;
98 UINT wID;
99 HBITMAP hbmpChecked;
100 HBITMAP hbmpUnchecked;
101 DWORD dwItemData;
102 CHAR szString[IMEMENUITEM_STRING_SIZE];
103 HBITMAP hbmpItem;
104 } IMEMENUITEMINFOA, *LPIMEMENUITEMINFOA;
105
106 typedef struct tagIMEMENUITEMINFOW
107 {
108 UINT cbSize;
109 UINT fType;
110 UINT fState;
111 UINT wID;
112 HBITMAP hbmpChecked;
113 HBITMAP hbmpUnchecked;
114 DWORD dwItemData;
115 WCHAR szString[IMEMENUITEM_STRING_SIZE];
116 HBITMAP hbmpItem;
117 } IMEMENUITEMINFOW, *LPIMEMENUITEMINFOW;
118
119 DECL_WINELIB_TYPE_AW(IMEMENUITEMINFO)
120 DECL_WINELIB_TYPE_AW(LPIMEMENUITEMINFO)
121
122 typedef struct tagIMECHARPOSITION {
123 DWORD dwSize;
124 DWORD dwCharPos;
125 POINT pt;
126 UINT cLineHeight;
127 RECT rcDocument;
128 } IMECHARPOSITION, *PIMECHARPOSITION, *NPIMECHARPOSITION, *LPIMECHARPOSITION;
129
130 typedef BOOL (CALLBACK* IMCENUMPROC)(HIMC, LPARAM);
131
132 typedef struct _tagCOMPOSITIONFORM
133 {
134 DWORD dwStyle;
135 POINT ptCurrentPos;
136 RECT rcArea;
137 } COMPOSITIONFORM, *LPCOMPOSITIONFORM;
138
139 typedef struct _tagIMEINFO {
140 DWORD dwPrivateDataSize;
141 DWORD fdwProperty;
142 DWORD fdwConversionCaps;
143 DWORD fdwSentenceCaps;
144 DWORD fdwUICaps;
145 DWORD fdwSCSCaps;
146 DWORD fdwSelectCaps;
147 } IMEINFO, *LPIMEINFO;
148
149 typedef struct tagCOMPOSITIONSTRING {
150 DWORD dwSize;
151 DWORD dwCompReadAttrLen;
152 DWORD dwCompReadAttrOffset;
153 DWORD dwCompReadClauseLen;
154 DWORD dwCompReadClauseOffset;
155 DWORD dwCompReadStrLen;
156 DWORD dwCompReadStrOffset;
157 DWORD dwCompAttrLen;
158 DWORD dwCompAttrOffset;
159 DWORD dwCompClauseLen;
160 DWORD dwCompClauseOffset;
161 DWORD dwCompStrLen;
162 DWORD dwCompStrOffset;
163 DWORD dwCursorPos;
164 DWORD dwDeltaStart;
165 DWORD dwResultReadClauseLen;
166 DWORD dwResultReadClauseOffset;
167 DWORD dwResultReadStrLen;
168 DWORD dwResultReadStrOffset;
169 DWORD dwResultClauseLen;
170 DWORD dwResultClauseOffset;
171 DWORD dwResultStrLen;
172 DWORD dwResultStrOffset;
173 DWORD dwPrivateSize;
174 DWORD dwPrivateOffset;
175 } COMPOSITIONSTRING, *LPCOMPOSITIONSTRING;
176
177 typedef struct tagGUIDELINE {
178 DWORD dwSize;
179 DWORD dwLevel;
180 DWORD dwIndex;
181 DWORD dwStrLen;
182 DWORD dwStrOffset;
183 DWORD dwPrivateSize;
184 DWORD dwPrivateOffset;
185 } GUIDELINE, *LPGUIDELINE;
186
187 typedef struct tagCANDIDATEINFO {
188 DWORD dwSize;
189 DWORD dwCount;
190 DWORD dwOffset[32];
191 DWORD dwPrivateSize;
192 DWORD dwPrivateOffset;
193 } CANDIDATEINFO, *LPCANDIDATEINFO;
194
195 #define IMMGWL_IMC 0
196 #define IMMGWL_PRIVATE (sizeof(LONG))
197
198 /* IME Property bits */
199 #define IME_PROP_END_UNLOAD 0x0001
200 #define IME_PROP_KBD_CHAR_FIRST 0x0002
201 #define IME_PROP_IGNORE_UPKEYS 0x0004
202 #define IME_PROP_NEED_ALTKEY 0x0008
203 #define IME_PROP_NO_KEYS_ON_CLOSE 0x0010
204
205 /* for NI_CONTEXTUPDATED */
206 #define IMC_SETCONVERSIONMODE 0x0002
207 #define IMC_SETSENTENCEMODE 0x0004
208 #define IMC_SETOPENSTATUS 0x0006
209
210 /* dwAction for ImmNotifyIME */
211 #define NI_CONTEXTUPDATED 0x0003
212 #define NI_OPENCANDIDATE 0x0010
213 #define NI_CLOSECANDIDATE 0x0011
214 #define NI_SELECTCANDIDATESTR 0x0012
215 #define NI_CHANGECANDIDATELIST 0x0013
216 #define NI_FINALIZECONVERSIONRESULT 0x0014
217 #define NI_COMPOSITIONSTR 0x0015
218 #define NI_SETCANDIDATE_PAGESTART 0x0016
219 #define NI_SETCANDIDATE_PAGESIZE 0x0017
220 #define NI_IMEMENUSELECTED 0x0018
221
222 BOOL WINAPI ImmUnlockIMC(HIMC);
223 DWORD WINAPI ImmGetIMCLockCount(HIMC);
224 HIMCC WINAPI ImmCreateIMCC(DWORD);
225 HIMCC WINAPI ImmDestroyIMCC(HIMCC);
226 LPVOID WINAPI ImmLockIMCC(HIMCC);
227 BOOL WINAPI ImmUnlockIMCC(HIMCC);
228 DWORD WINAPI ImmGetIMCCLockCount(HIMCC);
229 HIMCC WINAPI ImmReSizeIMCC(HIMCC, DWORD);
230 DWORD WINAPI ImmGetIMCCSize(HIMCC);
231
232 BOOL WINAPI ImmGenerateMessage(HIMC);
233 LRESULT WINAPI ImmRequestMessageA(HIMC, WPARAM, LPARAM);
234 LRESULT WINAPI ImmRequestMessageW(HIMC, WPARAM, LPARAM);
235 #define ImmRequestMessage WINELIB_NAME_AW(ImmRequestMessage);
236 BOOL WINAPI ImmTranslateMessage(HWND, UINT, WPARAM, LPARAM);
237 HWND WINAPI ImmCreateSoftKeyboard(UINT, UINT, int, int);
238 BOOL WINAPI ImmDestroySoftKeyboard(HWND);
239 BOOL WINAPI ImmShowSoftKeyboard(HWND, int);
240
241 BOOL WINAPI ImeInquire(LPIMEINFO, LPWSTR, LPCWSTR lpszOptions);
242 BOOL WINAPI ImeConfigure (HKL, HWND, DWORD, LPVOID);
243 DWORD WINAPI ImeConversionList(HIMC, LPCWSTR, LPCANDIDATELIST,DWORD,UINT);
244 BOOL WINAPI ImeDestroy(UINT);
245 LRESULT WINAPI ImeEscape(HIMC, UINT, LPVOID);
246 BOOL WINAPI ImeProcessKey(HIMC, UINT, LPARAM, CONST LPBYTE);
247 BOOL WINAPI ImeSelect(HIMC, BOOL);
248 BOOL WINAPI ImeSetActiveContext(HIMC, BOOL);
249 UINT WINAPI ImeToAsciiEx(UINT, UINT, CONST LPBYTE, LPDWORD, UINT, HIMC);
250 BOOL WINAPI NotifyIME(HIMC, DWORD, DWORD, DWORD);
251 BOOL WINAPI ImeRegisterWord(LPCWSTR, DWORD, LPCWSTR);
252 BOOL WINAPI ImeUnregisterWord(LPCWSTR, DWORD, LPCWSTR);
253 UINT WINAPI ImeGetRegisterWordStyle(UINT, LPSTYLEBUFW);
254 UINT WINAPI ImeEnumRegisterWord(REGISTERWORDENUMPROCW, LPCWSTR, DWORD, LPCWSTR, LPVOID);
255 BOOL WINAPI ImeSetCompositionString(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
256 DWORD WINAPI ImeGetImeMenuItems(HIMC, DWORD, DWORD, LPIMEMENUITEMINFOW, LPIMEMENUITEMINFOW, DWORD);
257
258 /* wParam for WM_IME_CONTROL */
259 #define IMC_GETCANDIDATEPOS 0x0007
260 #define IMC_SETCANDIDATEPOS 0x0008
261 #define IMC_GETCOMPOSITIONFONT 0x0009
262 #define IMC_SETCOMPOSITIONFONT 0x000A
263 #define IMC_GETCOMPOSITIONWINDOW 0x000B
264 #define IMC_SETCOMPOSITIONWINDOW 0x000C
265 #define IMC_GETSTATUSWINDOWPOS 0x000F
266 #define IMC_SETSTATUSWINDOWPOS 0x0010
267 #define IMC_CLOSESTATUSWINDOW 0x0021
268 #define IMC_OPENSTATUSWINDOW 0x0022
269
270 /*
271 * wParam for WM_IME_CONTROL to the soft keyboard
272 * dwAction for ImmNotifyIME
273 */
274 #define NI_OPENCANDIDATE 0x0010
275 #define NI_CLOSECANDIDATE 0x0011
276 #define NI_SELECTCANDIDATESTR 0x0012
277 #define NI_CHANGECANDIDATELIST 0x0013
278 #define NI_FINALIZECONVERSIONRESULT 0x0014
279 #define NI_COMPOSITIONSTR 0x0015
280 #define NI_SETCANDIDATE_PAGESTART 0x0016
281 #define NI_SETCANDIDATE_PAGESIZE 0x0017
282 #define NI_IMEMENUSELECTED 0x0018
283
284 /* lParam for WM_IME_SETCONTEXT */
285 #define ISC_SHOWUICANDIDATEWINDOW 0x00000001
286 #define ISC_SHOWUICOMPOSITIONWINDOW 0x80000000
287 #define ISC_SHOWUIGUIDELINE 0x40000000
288 #define ISC_SHOWUIALLCANDIDATEWINDOW 0x0000000F
289 #define ISC_SHOWUIALL 0xC000000F
290
291
292 /* dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR */
293 #define CPS_COMPLETE 0x0001
294 #define CPS_CONVERT 0x0002
295 #define CPS_REVERT 0x0003
296 #define CPS_CANCEL 0x0004
297
298
299 /* the modifiers of hot key */
300 #define MOD_ALT 0x0001
301 #define MOD_CONTROL 0x0002
302 #define MOD_SHIFT 0x0004
303
304 #define MOD_LEFT 0x8000
305 #define MOD_RIGHT 0x4000
306
307 #define MOD_ON_KEYUP 0x0800
308 #define MOD_IGNORE_ALL_MODIFIER 0x0400
309
310
311 /* Windows for Simplified Chinese Edition hot key ID from 0x10 - 0x2F */
312 #define IME_CHOTKEY_IME_NONIME_TOGGLE 0x10
313 #define IME_CHOTKEY_SHAPE_TOGGLE 0x11
314 #define IME_CHOTKEY_SYMBOL_TOGGLE 0x12
315
316 /* Windows for Japanese Edition hot key ID from 0x30 - 0x4F */
317 #define IME_JHOTKEY_CLOSE_OPEN 0x30
318
319 /* Windows for Korean Edition hot key ID from 0x50 - 0x6F */
320 #define IME_KHOTKEY_SHAPE_TOGGLE 0x50
321 #define IME_KHOTKEY_HANJACONVERT 0x51
322 #define IME_KHOTKEY_ENGLISH 0x52
323 /* Windows for Tranditional Chinese Edition hot key ID from 0x70 - 0x8F */
324 #define IME_THOTKEY_IME_NONIME_TOGGLE 0x70
325 #define IME_THOTKEY_SHAPE_TOGGLE 0x71
326 #define IME_THOTKEY_SYMBOL_TOGGLE 0x72
327
328 /* direct switch hot key ID from 0x100 - 0x11F */
329 #define IME_HOTKEY_DSWITCH_FIRST 0x100
330 #define IME_HOTKEY_DSWITCH_LAST 0x11F
331
332 /* IME private hot key from 0x200 - 0x21F */
333 #define IME_HOTKEY_PRIVATE_FIRST 0x200
334 #define IME_ITHOTKEY_RESEND_RESULTSTR 0x200
335 #define IME_ITHOTKEY_PREVIOUS_COMPOSITION 0x201
336 #define IME_ITHOTKEY_UISTYLE_TOGGLE 0x202
337 #define IME_ITHOTKEY_RECONVERTSTRING 0x203
338 #define IME_HOTKEY_PRIVATE_LAST 0x21F
339
340
341 /*
342 * dwSystemInfoFlags bits
343 * parameter of ImmGetCompositionString
344 */
345 #define GCS_COMPREADSTR 0x0001
346 #define GCS_COMPREADATTR 0x0002
347 #define GCS_COMPREADCLAUSE 0x0004
348 #define GCS_COMPSTR 0x0008
349 #define GCS_COMPATTR 0x0010
350 #define GCS_COMPCLAUSE 0x0020
351 #define GCS_CURSORPOS 0x0080
352 #define GCS_DELTASTART 0x0100
353 #define GCS_RESULTREADSTR 0x0200
354 #define GCS_RESULTREADCLAUSE 0x0400
355 #define GCS_RESULTSTR 0x0800
356 #define GCS_RESULTCLAUSE 0x1000
357
358 /* style bit flags for WM_IME_COMPOSITION */
359 #define CS_INSERTCHAR 0x2000
360 #define CS_NOMOVECARET 0x4000
361
362
363 /*
364 * bits of fdwInit of INPUTCONTEXT
365 * IME version constants
366 */
367 #define IMEVER_0310 0x0003000A
368 #define IMEVER_0400 0x00040000
369
370
371 /* IME property bits */
372 #define IME_PROP_AT_CARET 0x00010000
373 #define IME_PROP_SPECIAL_UI 0x00020000
374 #define IME_PROP_CANDLIST_START_FROM_1 0x00040000
375 #define IME_PROP_UNICODE 0x00080000
376 #define IME_PROP_COMPLETE_ON_UNSELECT 0x00100000
377
378
379 /* IME UICapability bits */
380 #define UI_CAP_2700 0x00000001
381 #define UI_CAP_ROT90 0x00000002
382 #define UI_CAP_ROTANY 0x00000004
383 /* ImmSetCompositionString Capability bits */
384 #define SCS_CAP_COMPSTR 0x00000001
385 #define SCS_CAP_MAKEREAD 0x00000002
386 #define SCS_CAP_SETRECONVERTSTRING 0x00000004
387
388
389 /* IME WM_IME_SELECT inheritance Capability bits */
390 #define SELECT_CAP_CONVERSION 0x00000001
391 #define SELECT_CAP_SENTENCE 0x00000002
392
393
394 /* ID for deIndex of ImmGetGuideLine */
395 #define GGL_LEVEL 0x00000001
396 #define GGL_INDEX 0x00000002
397 #define GGL_STRING 0x00000003
398 #define GGL_PRIVATE 0x00000004
399
400 /* ID for dwLevel of GUIDELINE Structure */
401 #define GL_LEVEL_NOGUIDELINE 0x00000000
402 #define GL_LEVEL_FATAL 0x00000001
403 #define GL_LEVEL_ERROR 0x00000002
404 #define GL_LEVEL_WARNING 0x00000003
405 #define GL_LEVEL_INFORMATION 0x00000004
406
407 /* ID for dwIndex of GUIDELINE Structure */
408 #define GL_ID_UNKNOWN 0x00000000
409 #define GL_ID_NOMODULE 0x00000001
410 #define GL_ID_NODICTIONARY 0x00000010
411 #define GL_ID_CANNOTSAVE 0x00000011
412 #define GL_ID_NOCONVERT 0x00000020
413 #define GL_ID_TYPINGERROR 0x00000021
414 #define GL_ID_TOOMANYSTROKE 0x00000022
415 #define GL_ID_READINGCONFLICT 0x00000023
416 #define GL_ID_INPUTREADING 0x00000024
417 #define GL_ID_INPUTRADICAL 0x00000025
418 #define GL_ID_INPUTCODE 0x00000026
419 #define GL_ID_INPUTSYMBOL 0x00000027
420 #define GL_ID_CHOOSECANDIDATE 0x00000028
421 #define GL_ID_REVERSECONVERSION 0x00000029
422 #define GL_ID_PRIVATE_FIRST 0x00008000
423 #define GL_ID_PRIVATE_LAST 0x0000FFFF
424
425 /* ID for dwIndex of ImmGetProperty */
426 #define IGP_GETIMEVERSION (DWORD)(-4)
427 #define IGP_PROPERTY 0x00000004
428 #define IGP_CONVERSION 0x00000008
429 #define IGP_SENTENCE 0x0000000c
430 #define IGP_UI 0x00000010
431 #define IGP_SETCOMPSTR 0x00000014
432 #define IGP_SELECT 0x00000018
433
434
435 /* dwIndex for ImmSetCompositionString API */
436 #define SCS_SETSTR (GCS_COMPREADSTR|GCS_COMPSTR)
437 #define SCS_CHANGEATTR (GCS_COMPREADATTR|GCS_COMPATTR)
438 #define SCS_CHANGECLAUSE (GCS_COMPREADCLAUSE|GCS_COMPCLAUSE)
439 #define SCS_SETRECONVERTSTRING 0x00010000
440 #define SCS_QUERYRECONVERTSTRING 0x00020000
441
442 /* attribute for COMPOSITIONSTRING Structure */
443 #define ATTR_INPUT 0x00
444 #define ATTR_TARGET_CONVERTED 0x01
445 #define ATTR_CONVERTED 0x02
446 #define ATTR_TARGET_NOTCONVERTED 0x03
447 #define ATTR_INPUT_ERROR 0x04
448 #define ATTR_FIXEDCONVERTED 0x05
449
450
451 /* bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW */
452 #define CFS_DEFAULT 0x0000
453 #define CFS_RECT 0x0001
454 #define CFS_POINT 0x0002
455 #define CFS_FORCE_POSITION 0x0020
456 #define CFS_CANDIDATEPOS 0x0040
457 #define CFS_EXCLUDE 0x0080
458
459 /* conversion direction for ImmGetConversionList */
460 #define GCL_CONVERSION 0x0001
461 #define GCL_REVERSECONVERSION 0x0002
462 #define GCL_REVERSE_LENGTH 0x0003
463
464
465 /* bit field for conversion mode */
466 #define IME_CMODE_ALPHANUMERIC 0x0000
467 #define IME_CMODE_NATIVE 0x0001
468 #define IME_CMODE_CHINESE IME_CMODE_NATIVE
469 /* IME_CMODE_HANGEUL is old name of IME_CMODE_HANGUL. It will be gone eventually. */
470 #define IME_CMODE_HANGEUL IME_CMODE_NATIVE
471 #define IME_CMODE_HANGUL IME_CMODE_NATIVE
472 #define IME_CMODE_JAPANESE IME_CMODE_NATIVE
473 #define IME_CMODE_KATAKANA 0x0002 /* only effect under IME_CMODE_NATIVE */
474 #define IME_CMODE_LANGUAGE 0x0003
475 #define IME_CMODE_FULLSHAPE 0x0008
476 #define IME_CMODE_ROMAN 0x0010
477 #define IME_CMODE_CHARCODE 0x0020
478 #define IME_CMODE_HANJACONVERT 0x0040
479 #define IME_CMODE_SOFTKBD 0x0080
480 #define IME_CMODE_NOCONVERSION 0x0100
481 #define IME_CMODE_EUDC 0x0200
482 #define IME_CMODE_SYMBOL 0x0400
483 #define IME_CMODE_FIXED 0x0800
484
485
486 #define IME_SMODE_NONE 0x0000
487 #define IME_SMODE_PLAURALCLAUSE 0x0001
488 #define IME_SMODE_SINGLECONVERT 0x0002
489 #define IME_SMODE_AUTOMATIC 0x0004
490 #define IME_SMODE_PHRASEPREDICT 0x0008
491 #define IME_SMODE_CONVERSATION 0x0010
492
493 /* style of candidate */
494 #define IME_CAND_UNKNOWN 0x0000
495 #define IME_CAND_READ 0x0001
496 #define IME_CAND_CODE 0x0002
497 #define IME_CAND_MEANING 0x0003
498 #define IME_CAND_RADICAL 0x0004
499 #define IME_CAND_STROKE 0x0005
500
501
502 /* wParam of report message WM_IME_NOTIFY */
503 #define IMN_CLOSESTATUSWINDOW 0x0001
504 #define IMN_OPENSTATUSWINDOW 0x0002
505 #define IMN_CHANGECANDIDATE 0x0003
506 #define IMN_CLOSECANDIDATE 0x0004
507 #define IMN_OPENCANDIDATE 0x0005
508 #define IMN_SETCONVERSIONMODE 0x0006
509 #define IMN_SETSENTENCEMODE 0x0007
510 #define IMN_SETOPENSTATUS 0x0008
511 #define IMN_SETCANDIDATEPOS 0x0009
512 #define IMN_SETCOMPOSITIONFONT 0x000A
513 #define IMN_SETCOMPOSITIONWINDOW 0x000B
514 #define IMN_SETSTATUSWINDOWPOS 0x000C
515 #define IMN_GUIDELINE 0x000D
516 #define IMN_PRIVATE 0x000E
517
518
519 /* wParam of report message WM_IME_REQUEST */
520 #define IMR_COMPOSITIONWINDOW 0x0001
521 #define IMR_CANDIDATEWINDOW 0x0002
522 #define IMR_COMPOSITIONFONT 0x0003
523 #define IMR_RECONVERTSTRING 0x0004
524 #define IMR_CONFIRMRECONVERTSTRING 0x0005
525 #define IMR_QUERYCHARPOSITION 0x0006
526 #define IMR_DOCUMENTFEED 0x0007
527
528
529 /* error code of ImmGetCompositionString */
530 #define IMM_ERROR_NODATA (-1)
531 #define IMM_ERROR_GENERAL (-2)
532
533
534 /* dialog mode of ImmConfigureIME */
535 #define IME_CONFIG_GENERAL 1
536 #define IME_CONFIG_REGISTERWORD 2
537 #define IME_CONFIG_SELECTDICTIONARY 3
538
539 /* dialog mode of ImmEscape */
540 #define IME_ESC_QUERY_SUPPORT 0x0003
541 #define IME_ESC_RESERVED_FIRST 0x0004
542 #define IME_ESC_RESERVED_LAST 0x07FF
543 #define IME_ESC_PRIVATE_FIRST 0x0800
544 #define IME_ESC_PRIVATE_LAST 0x0FFF
545 #define IME_ESC_SEQUENCE_TO_INTERNAL 0x1001
546 #define IME_ESC_GET_EUDC_DICTIONARY 0x1003
547 #define IME_ESC_SET_EUDC_DICTIONARY 0x1004
548 #define IME_ESC_MAX_KEY 0x1005
549 #define IME_ESC_IME_NAME 0x1006
550 #define IME_ESC_SYNC_HOTKEY 0x1007
551 #define IME_ESC_HANJA_MODE 0x1008
552 #define IME_ESC_AUTOMATA 0x1009
553 #define IME_ESC_PRIVATE_HOTKEY 0x100a
554 #define IME_ESC_GETHELPFILENAME 0x100b
555
556
557 /* style of word registration */
558 #define IME_REGWORD_STYLE_EUDC 0x00000001
559 #define IME_REGWORD_STYLE_USER_FIRST 0x80000000
560 #define IME_REGWORD_STYLE_USER_LAST 0xFFFFFFFF
561
562
563 /* dwFlags for ImmAssociateContextEx */
564 #define IACE_CHILDREN 0x0001
565 #define IACE_DEFAULT 0x0010
566 #define IACE_IGNORENOCONTEXT 0x0020
567
568 /* dwFlags for ImmGetImeMenuItems */
569 #define IGIMIF_RIGHTMENU 0x0001
570
571 /* dwType for ImmGetImeMenuItems */
572 #define IGIMII_CMODE 0x0001
573 #define IGIMII_SMODE 0x0002
574 #define IGIMII_CONFIGURE 0x0004
575 #define IGIMII_TOOLS 0x0008
576 #define IGIMII_HELP 0x0010
577 #define IGIMII_OTHER 0x0020
578 #define IGIMII_INPUTTOOLS 0x0040
579
580 /* fType of IMEMENUITEMINFO structure */
581 #define IMFT_RADIOCHECK 0x00001
582 #define IMFT_SEPARATOR 0x00002
583 #define IMFT_SUBMENU 0x00004
584
585 /* fState of IMEMENUITEMINFO structure */
586 #define IMFS_GRAYED MFS_GRAYED
587 #define IMFS_DISABLED MFS_DISABLED
588 #define IMFS_CHECKED MFS_CHECKED
589 #define IMFS_HILITE MFS_HILITE
590 #define IMFS_ENABLED MFS_ENABLED
591 #define IMFS_UNCHECKED MFS_UNCHECKED
592 #define IMFS_UNHILITE MFS_UNHILITE
593 #define IMFS_DEFAULT MFS_DEFAULT
594
595
596 /*
597 * type of soft keyboard
598 * for Windows Tranditional Chinese Edition
599 */
600 #define SOFTKEYBOARD_TYPE_T1 0x0001
601 /* for Windows Simplified Chinese Edition */
602 #define SOFTKEYBOARD_TYPE_C1 0x0002
603
604
605 HIMC WINAPI ImmAssociateContext(HWND, HIMC);
606 BOOL WINAPI ImmAssociateContextEx(HWND, HIMC, DWORD);
607 BOOL WINAPI ImmConfigureIMEA(HKL, HWND, DWORD, LPVOID);
608 BOOL WINAPI ImmConfigureIMEW(HKL, HWND, DWORD, LPVOID);
609 #define ImmConfigureIME WINELIB_NAME_AW(ImmConfigureIME)
610 HIMC WINAPI ImmCreateContext(void);
611 BOOL WINAPI ImmDestroyContext(HIMC hIMC);
612 BOOL WINAPI ImmDisableIME(DWORD idThread);
613 BOOL WINAPI ImmEnumInputContext(DWORD, IMCENUMPROC, LPARAM);
614 UINT WINAPI ImmEnumRegisterWordA(HKL, REGISTERWORDENUMPROCA, LPCSTR, DWORD, LPCSTR, LPVOID);
615 UINT WINAPI ImmEnumRegisterWordW(HKL, REGISTERWORDENUMPROCW, LPCWSTR, DWORD, LPCWSTR, LPVOID);
616 #define ImmEnumRegisterWord WINELIB_NAME_AW(ImmEnumRegisterWord)
617 LRESULT WINAPI ImmEscapeA(HKL, HIMC, UINT, LPVOID);
618 LRESULT WINAPI ImmEscapeW(HKL, HIMC, UINT, LPVOID);
619 #define ImmEscape WINELIB_NAME_AW(ImmEscape)
620 DWORD WINAPI ImmGetCandidateListA(HIMC, DWORD, LPCANDIDATELIST, DWORD);
621 DWORD WINAPI ImmGetCandidateListW(HIMC, DWORD, LPCANDIDATELIST, DWORD);
622 #define ImmGetCandidateList WINELIB_NAME_AW(ImmGetCandidateList)
623 DWORD WINAPI ImmGetCandidateListCountA(HIMC, LPDWORD);
624 DWORD WINAPI ImmGetCandidateListCountW(HIMC, LPDWORD);
625 #define ImmGetCandidateListCount WINELIB_NAME_AW(ImmGetCandidateListCount)
626 BOOL WINAPI ImmGetCandidateWindow(HIMC, DWORD, LPCANDIDATEFORM);
627 #if defined(_WINGDI_) && !defined(NOGDI)
628 BOOL WINAPI ImmGetCompositionFontA(HIMC, LPLOGFONTA);
629 BOOL WINAPI ImmGetCompositionFontW(HIMC, LPLOGFONTW);
630 #define ImmGetCompositionFont WINELIB_NAME_AW(ImmGetCompositionFont)
631 BOOL WINAPI ImmSetCompositionFontA(HIMC, LPLOGFONTA);
632 BOOL WINAPI ImmSetCompositionFontW(HIMC, LPLOGFONTW);
633 #define ImmSetCompositionFont WINELIB_NAME_AW(ImmSetCompositionFont)
634 #endif
635 LONG WINAPI ImmGetCompositionStringA(HIMC, DWORD, LPVOID, DWORD);
636 LONG WINAPI ImmGetCompositionStringW(HIMC, DWORD, LPVOID, DWORD);
637 #define ImmGetCompositionString WINELIB_NAME_AW(ImmGetCompositionString)
638 BOOL WINAPI ImmGetCompositionWindow(HIMC, LPCOMPOSITIONFORM);
639 HIMC WINAPI ImmGetContext(HWND);
640 DWORD WINAPI ImmGetConversionListA(HKL, HIMC, LPCSTR, LPCANDIDATELIST, DWORD, UINT);
641 DWORD WINAPI ImmGetConversionListW(HKL, HIMC, LPCWSTR, LPCANDIDATELIST, DWORD, UINT);
642 #define ImmGetConversionList WINELIB_NAME_AW(ImmGetConversionList)
643 BOOL WINAPI ImmGetConversionStatus(HIMC, LPDWORD, LPDWORD);
644 HWND WINAPI ImmGetDefaultIMEWnd(HWND);
645 UINT WINAPI ImmGetDescriptionA(HKL, LPSTR, UINT);
646 UINT WINAPI ImmGetDescriptionW(HKL, LPWSTR, UINT);
647 #define ImmGetDescription WINELIB_NAME_AW(ImmGetDescription)
648 DWORD WINAPI ImmGetGuideLineA(HIMC, DWORD, LPSTR, DWORD);
649 DWORD WINAPI ImmGetGuideLineW(HIMC, DWORD, LPWSTR, DWORD);
650 #define ImmGetGuideLine WINELIB_NAME_AW(ImmGetGuideLine)
651 UINT WINAPI ImmGetIMEFileNameA(HKL, LPSTR, UINT);
652 UINT WINAPI ImmGetIMEFileNameW(HKL, LPWSTR, UINT);
653 #define ImmGetIMEFileName WINELIB_NAME_AW(ImmGetIMEFileName)
654 DWORD WINAPI ImmGetImeMenuItemsA(HIMC, DWORD, DWORD, LPIMEMENUITEMINFOA, LPIMEMENUITEMINFOA, DWORD);
655 DWORD WINAPI ImmGetImeMenuItemsW(HIMC, DWORD, DWORD, LPIMEMENUITEMINFOW, LPIMEMENUITEMINFOW, DWORD);
656 #define ImmGetImeMenuItems WINELIB_NAME_AW(ImmGetImeMenuItems)
657 BOOL WINAPI ImmGetOpenStatus(HIMC);
658 DWORD WINAPI ImmGetProperty(HKL, DWORD);
659 UINT WINAPI ImmGetRegisterWordStyleA(HKL, UINT, LPSTYLEBUFA);
660 UINT WINAPI ImmGetRegisterWordStyleW(HKL, UINT, LPSTYLEBUFW);
661 #define ImmGetRegisterWordStyle WINELIB_NAME_AW(ImmGetRegisterWordStyle)
662 BOOL WINAPI ImmGetStatusWindowPos(HIMC, LPPOINT);
663 UINT WINAPI ImmGetVirtualKey(HWND);
664 HKL WINAPI ImmInstallIMEA(LPCSTR, LPCSTR);
665 HKL WINAPI ImmInstallIMEW(LPCWSTR, LPCWSTR);
666 #define ImmInstallIME WINELIB_NAME_AW(ImmInstallIME)
667 BOOL WINAPI ImmIsIME(HKL);
668 BOOL WINAPI ImmIsUIMessageA(HWND, UINT, WPARAM, LPARAM);
669 BOOL WINAPI ImmIsUIMessageW(HWND, UINT, WPARAM, LPARAM);
670 #define ImmIsUIMessage WINELIB_NAME_AW(ImmIsUIMessage)
671 BOOL WINAPI ImmNotifyIME(HIMC, DWORD, DWORD, DWORD);
672 BOOL WINAPI ImmProcessKey(HWND, HKL, UINT, LPARAM, DWORD);
673 BOOL WINAPI ImmRegisterWordA(HKL, LPCSTR, DWORD, LPCSTR);
674 BOOL WINAPI ImmRegisterWordW(HKL, LPCWSTR, DWORD, LPCWSTR);
675 #define ImmRegisterWord WINELIB_NAME_AW(ImmRegisterWord)
676 BOOL WINAPI ImmReleaseContext(HWND, HIMC);
677 BOOL WINAPI ImmSetCandidateWindow(HIMC, LPCANDIDATEFORM);
678 BOOL WINAPI ImmSetCompositionStringA(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
679 BOOL WINAPI ImmSetCompositionStringW(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
680 #define ImmSetCompositionString WINELIB_NAME_AW(ImmSetCompositionString)
681 BOOL WINAPI ImmSetCompositionWindow(HIMC, LPCOMPOSITIONFORM);
682 BOOL WINAPI ImmSetConversionStatus(HIMC, DWORD, DWORD);
683 BOOL WINAPI ImmSetOpenStatus(HIMC, BOOL);
684 BOOL WINAPI ImmSetStatusWindowPos(HIMC, LPPOINT);
685 BOOL WINAPI ImmSimulateHotKey(HWND, DWORD);
686 BOOL WINAPI ImmUnregisterWordA(HKL, LPCSTR, DWORD, LPCSTR);
687 BOOL WINAPI ImmUnregisterWordW(HKL, LPCWSTR, DWORD, LPCWSTR);
688 #define ImmUnregisterWord WINELIB_NAME_AW(ImmUnregisterWord)
689
690
691 #ifdef __cplusplus
692 }
693 #endif
694
695 #endif /* __WINE_IMM_H */