xref: /reactos/sdk/include/psdk/imm.h (revision 9be382ec)
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 #ifdef __REACTOS__
31 typedef HKL *LPHKL;
32 #endif
33 
34 typedef struct tagREGISTERWORDA {
35     LPSTR lpReading;
36     LPSTR lpWord;
37 } REGISTERWORDA, *PREGISTERWORDA, *NPREGISTERWORDA, *LPREGISTERWORDA;
38 
39 typedef struct tagREGISTERWORDW {
40     LPWSTR lpReading;
41     LPWSTR lpWord;
42 } REGISTERWORDW, *PREGISTERWORDW, *NPREGISTERWORDW, *LPREGISTERWORDW;
43 
44 typedef int
45 (CALLBACK *REGISTERWORDENUMPROCA)(
46   _In_ LPCSTR,
47   _In_ DWORD,
48   _In_ LPCSTR,
49   _In_ LPVOID);
50 
51 typedef int
52 (CALLBACK *REGISTERWORDENUMPROCW)(
53   _In_ LPCWSTR,
54   _In_ DWORD,
55   _In_ LPCWSTR,
56   _In_ LPVOID);
57 
58 typedef struct tagCANDIDATEFORM
59 {
60 				DWORD   dwIndex;
61 				DWORD   dwStyle;
62 				POINT ptCurrentPos;
63 				RECT  rcArea;
64 } CANDIDATEFORM, *LPCANDIDATEFORM;
65 
66 typedef struct tagCANDIDATELIST
67 {
68 				DWORD dwSize;
69 				DWORD dwStyle;
70 				DWORD dwCount;
71 				DWORD dwSelection;
72 				DWORD dwPageStart;
73 				DWORD dwPageSize;
74 				DWORD dwOffset[1];
75 } CANDIDATELIST, *LPCANDIDATELIST;
76 
77 typedef struct tagSTYLEBUFA
78 {
79 				DWORD dwStyle;
80 				CHAR  szDescription[32];
81 } STYLEBUFA, *LPSTYLEBUFA;
82 
83 typedef struct tagSTYLEBUFW
84 {
85 				DWORD dwStyle;
86 				WCHAR  szDescription[32];
87 } STYLEBUFW, *LPSTYLEBUFW;
88 
89 DECL_WINELIB_TYPE_AW(STYLEBUF)
90 DECL_WINELIB_TYPE_AW(LPSTYLEBUF)
91 
92 typedef struct tagRECONVERTSTRING
93 {
94 	DWORD	dwSize;
95 	DWORD	dwVersion;
96 	DWORD	dwStrLen;
97 	DWORD	dwStrOffset;
98 	DWORD	dwCompStrLen;
99 	DWORD	dwCompStrOffset;
100 	DWORD	dwTargetStrLen;
101 	DWORD	dwTargetStrOffset;
102 } RECONVERTSTRING, *LPRECONVERTSTRING;
103 
104 
105 #define IMEMENUITEM_STRING_SIZE 80
106 
107 typedef struct tagIMEMENUITEMINFOA
108 {
109 	UINT		cbSize;
110 	UINT		fType;
111 	UINT		fState;
112 	UINT		wID;
113 	HBITMAP		hbmpChecked;
114 	HBITMAP		hbmpUnchecked;
115 	DWORD		dwItemData;
116 	CHAR		szString[IMEMENUITEM_STRING_SIZE];
117 	HBITMAP		hbmpItem;
118 } IMEMENUITEMINFOA, *LPIMEMENUITEMINFOA;
119 
120 typedef struct tagIMEMENUITEMINFOW
121 {
122 	UINT		cbSize;
123 	UINT		fType;
124 	UINT		fState;
125 	UINT		wID;
126 	HBITMAP		hbmpChecked;
127 	HBITMAP		hbmpUnchecked;
128 	DWORD		dwItemData;
129 	WCHAR		szString[IMEMENUITEM_STRING_SIZE];
130 	HBITMAP		hbmpItem;
131 } IMEMENUITEMINFOW, *LPIMEMENUITEMINFOW;
132 
133 DECL_WINELIB_TYPE_AW(IMEMENUITEMINFO)
134 DECL_WINELIB_TYPE_AW(LPIMEMENUITEMINFO)
135 
136 typedef struct tagIMECHARPOSITION {
137     DWORD       dwSize;
138     DWORD       dwCharPos;
139     POINT       pt;
140     UINT        cLineHeight;
141     RECT        rcDocument;
142 } IMECHARPOSITION, *PIMECHARPOSITION, *NPIMECHARPOSITION, *LPIMECHARPOSITION;
143 
144 typedef BOOL    (CALLBACK* IMCENUMPROC)(HIMC, LPARAM);
145 
146 typedef struct _tagCOMPOSITIONFORM
147 {
148 				DWORD   dwStyle;
149 				POINT ptCurrentPos;
150 				RECT  rcArea;
151 } COMPOSITIONFORM, *LPCOMPOSITIONFORM;
152 
153 typedef struct _tagIMEINFO {
154     DWORD       dwPrivateDataSize;
155     DWORD       fdwProperty;
156     DWORD       fdwConversionCaps;
157     DWORD       fdwSentenceCaps;
158     DWORD       fdwUICaps;
159     DWORD       fdwSCSCaps;
160     DWORD       fdwSelectCaps;
161 } IMEINFO, *LPIMEINFO;
162 
163 typedef struct tagCOMPOSITIONSTRING {
164     DWORD dwSize;
165     DWORD dwCompReadAttrLen;
166     DWORD dwCompReadAttrOffset;
167     DWORD dwCompReadClauseLen;
168     DWORD dwCompReadClauseOffset;
169     DWORD dwCompReadStrLen;
170     DWORD dwCompReadStrOffset;
171     DWORD dwCompAttrLen;
172     DWORD dwCompAttrOffset;
173     DWORD dwCompClauseLen;
174     DWORD dwCompClauseOffset;
175     DWORD dwCompStrLen;
176     DWORD dwCompStrOffset;
177     DWORD dwCursorPos;
178     DWORD dwDeltaStart;
179     DWORD dwResultReadClauseLen;
180     DWORD dwResultReadClauseOffset;
181     DWORD dwResultReadStrLen;
182     DWORD dwResultReadStrOffset;
183     DWORD dwResultClauseLen;
184     DWORD dwResultClauseOffset;
185     DWORD dwResultStrLen;
186     DWORD dwResultStrOffset;
187     DWORD dwPrivateSize;
188     DWORD dwPrivateOffset;
189 } COMPOSITIONSTRING, *LPCOMPOSITIONSTRING;
190 
191 typedef struct tagGUIDELINE {
192     DWORD dwSize;
193     DWORD dwLevel;
194     DWORD dwIndex;
195     DWORD dwStrLen;
196     DWORD dwStrOffset;
197     DWORD dwPrivateSize;
198     DWORD dwPrivateOffset;
199 } GUIDELINE, *LPGUIDELINE;
200 
201 typedef struct tagCANDIDATEINFO {
202     DWORD               dwSize;
203     DWORD               dwCount;
204     DWORD               dwOffset[32];
205     DWORD               dwPrivateSize;
206     DWORD               dwPrivateOffset;
207 } CANDIDATEINFO, *LPCANDIDATEINFO;
208 
209 #define IMMGWL_IMC                      0
210 #define IMMGWL_PRIVATE                  (sizeof(LONG))
211 
212 /* IME Property bits */
213 #define IME_PROP_END_UNLOAD             0x0001
214 #define IME_PROP_KBD_CHAR_FIRST         0x0002
215 #define IME_PROP_IGNORE_UPKEYS          0x0004
216 #define IME_PROP_NEED_ALTKEY            0x0008
217 #define IME_PROP_NO_KEYS_ON_CLOSE       0x0010
218 #define IME_PROP_ACCEPT_WIDE_VKEY       0x0020
219 
220 /* for NI_CONTEXTUPDATED */
221 #define IMC_SETCONVERSIONMODE           0x0002
222 #define IMC_SETSENTENCEMODE             0x0004
223 #define IMC_SETOPENSTATUS               0x0006
224 
225 /* dwAction for ImmNotifyIME */
226 #define NI_CONTEXTUPDATED               0x0003
227 #define NI_OPENCANDIDATE                0x0010
228 #define NI_CLOSECANDIDATE               0x0011
229 #define NI_SELECTCANDIDATESTR           0x0012
230 #define NI_CHANGECANDIDATELIST          0x0013
231 #define NI_FINALIZECONVERSIONRESULT     0x0014
232 #define NI_COMPOSITIONSTR               0x0015
233 #define NI_SETCANDIDATE_PAGESTART       0x0016
234 #define NI_SETCANDIDATE_PAGESIZE        0x0017
235 #define NI_IMEMENUSELECTED              0x0018
236 
237 BOOL  WINAPI ImmUnlockIMC(HIMC);
238 DWORD WINAPI ImmGetIMCLockCount(HIMC);
239 HIMCC  WINAPI ImmCreateIMCC(DWORD);
240 HIMCC  WINAPI ImmDestroyIMCC(HIMCC);
241 LPVOID WINAPI ImmLockIMCC(HIMCC);
242 BOOL   WINAPI ImmUnlockIMCC(HIMCC);
243 DWORD  WINAPI ImmGetIMCCLockCount(HIMCC);
244 HIMCC  WINAPI ImmReSizeIMCC(HIMCC, DWORD);
245 DWORD  WINAPI ImmGetIMCCSize(HIMCC);
246 
247 BOOL WINAPI ImmGenerateMessage(HIMC);
248 LRESULT WINAPI ImmRequestMessageA(HIMC, WPARAM, LPARAM);
249 LRESULT WINAPI ImmRequestMessageW(HIMC, WPARAM, LPARAM);
250 #define ImmRequestMessage WINELIB_NAME_AW(ImmRequestMessage);
251 BOOL WINAPI ImmTranslateMessage(HWND, UINT, WPARAM, LPARAM);
252 HWND WINAPI ImmCreateSoftKeyboard(UINT, UINT, int, int);
253 BOOL WINAPI ImmDestroySoftKeyboard(HWND);
254 BOOL WINAPI ImmShowSoftKeyboard(HWND, int);
255 
256 BOOL WINAPI ImeInquire(LPIMEINFO, LPWSTR, LPCWSTR lpszOptions);
257 BOOL WINAPI ImeConfigure (HKL, HWND, DWORD, LPVOID);
258 DWORD WINAPI ImeConversionList(HIMC, LPCWSTR, LPCANDIDATELIST,DWORD,UINT);
259 BOOL WINAPI ImeDestroy(UINT);
260 LRESULT WINAPI ImeEscape(HIMC, UINT, LPVOID);
261 BOOL WINAPI ImeProcessKey(HIMC, UINT, LPARAM, CONST LPBYTE);
262 BOOL WINAPI ImeSelect(HIMC, BOOL);
263 BOOL WINAPI ImeSetActiveContext(HIMC, BOOL);
264 UINT WINAPI ImeToAsciiEx(UINT, UINT, CONST LPBYTE, LPDWORD, UINT, HIMC);
265 BOOL WINAPI NotifyIME(HIMC, DWORD, DWORD, DWORD);
266 BOOL WINAPI ImeRegisterWord(LPCWSTR, DWORD, LPCWSTR);
267 BOOL WINAPI ImeUnregisterWord(LPCWSTR, DWORD, LPCWSTR);
268 UINT WINAPI ImeGetRegisterWordStyle(UINT, LPSTYLEBUFW);
269 UINT WINAPI ImeEnumRegisterWord(REGISTERWORDENUMPROCW, LPCWSTR, DWORD, LPCWSTR, LPVOID);
270 BOOL WINAPI ImeSetCompositionString(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
271 DWORD WINAPI ImeGetImeMenuItems(HIMC, DWORD, DWORD, LPIMEMENUITEMINFOW, LPIMEMENUITEMINFOW, DWORD);
272 
273 /* wParam for WM_IME_CONTROL */
274 #define IMC_GETCANDIDATEPOS             0x0007
275 #define IMC_SETCANDIDATEPOS             0x0008
276 #define IMC_GETCOMPOSITIONFONT          0x0009
277 #define IMC_SETCOMPOSITIONFONT          0x000A
278 #define IMC_GETCOMPOSITIONWINDOW        0x000B
279 #define IMC_SETCOMPOSITIONWINDOW        0x000C
280 #define IMC_GETSTATUSWINDOWPOS          0x000F
281 #define IMC_SETSTATUSWINDOWPOS          0x0010
282 #define IMC_CLOSESTATUSWINDOW           0x0021
283 #define IMC_OPENSTATUSWINDOW            0x0022
284 
285 /*
286  * wParam for WM_IME_CONTROL to the soft keyboard
287  * dwAction for ImmNotifyIME
288  */
289 #define NI_OPENCANDIDATE                0x0010
290 #define NI_CLOSECANDIDATE               0x0011
291 #define NI_SELECTCANDIDATESTR           0x0012
292 #define NI_CHANGECANDIDATELIST          0x0013
293 #define NI_FINALIZECONVERSIONRESULT     0x0014
294 #define NI_COMPOSITIONSTR               0x0015
295 #define NI_SETCANDIDATE_PAGESTART       0x0016
296 #define NI_SETCANDIDATE_PAGESIZE        0x0017
297 #define NI_IMEMENUSELECTED		0x0018
298 
299 /* lParam for WM_IME_SETCONTEXT */
300 #define ISC_SHOWUICANDIDATEWINDOW       0x00000001
301 #define ISC_SHOWUICOMPOSITIONWINDOW     0x80000000
302 #define ISC_SHOWUIGUIDELINE             0x40000000
303 #define ISC_SHOWUIALLCANDIDATEWINDOW    0x0000000F
304 #define ISC_SHOWUIALL                   0xC000000F
305 
306 
307 /* dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR */
308 #define CPS_COMPLETE                    0x0001
309 #define CPS_CONVERT                     0x0002
310 #define CPS_REVERT                      0x0003
311 #define CPS_CANCEL                      0x0004
312 
313 
314 /* the modifiers of hot key */
315 #define MOD_ALT                         0x0001
316 #define MOD_CONTROL                     0x0002
317 #define MOD_SHIFT                       0x0004
318 
319 #define MOD_LEFT                        0x8000
320 #define MOD_RIGHT                       0x4000
321 
322 #define MOD_ON_KEYUP                    0x0800
323 #define MOD_IGNORE_ALL_MODIFIER         0x0400
324 
325 
326 /* Windows for Simplified Chinese Edition hot key ID from 0x10 - 0x2F */
327 #define IME_CHOTKEY_IME_NONIME_TOGGLE           0x10
328 #define IME_CHOTKEY_SHAPE_TOGGLE                0x11
329 #define IME_CHOTKEY_SYMBOL_TOGGLE               0x12
330 
331 /* Windows for Japanese Edition hot key ID from 0x30 - 0x4F */
332 #define IME_JHOTKEY_CLOSE_OPEN                  0x30
333 
334 /* Windows for Korean Edition hot key ID from 0x50 - 0x6F */
335 #define IME_KHOTKEY_SHAPE_TOGGLE                0x50
336 #define IME_KHOTKEY_HANJACONVERT                0x51
337 #define IME_KHOTKEY_ENGLISH                     0x52
338 /* Windows for Tranditional Chinese Edition hot key ID from 0x70 - 0x8F */
339 #define IME_THOTKEY_IME_NONIME_TOGGLE           0x70
340 #define IME_THOTKEY_SHAPE_TOGGLE                0x71
341 #define IME_THOTKEY_SYMBOL_TOGGLE               0x72
342 
343 /* direct switch hot key ID from 0x100 - 0x11F */
344 #define IME_HOTKEY_DSWITCH_FIRST                0x100
345 #define IME_HOTKEY_DSWITCH_LAST                 0x11F
346 
347 /* IME private hot key from 0x200 - 0x21F */
348 #define IME_HOTKEY_PRIVATE_FIRST                0x200
349 #define IME_ITHOTKEY_RESEND_RESULTSTR           0x200
350 #define IME_ITHOTKEY_PREVIOUS_COMPOSITION       0x201
351 #define IME_ITHOTKEY_UISTYLE_TOGGLE             0x202
352 #define IME_ITHOTKEY_RECONVERTSTRING		0x203
353 #define IME_HOTKEY_PRIVATE_LAST                 0x21F
354 
355 
356 /*
357  * dwSystemInfoFlags bits
358  * parameter of ImmGetCompositionString
359  */
360 #define GCS_COMPREADSTR                 0x0001
361 #define GCS_COMPREADATTR                0x0002
362 #define GCS_COMPREADCLAUSE              0x0004
363 #define GCS_COMPSTR                     0x0008
364 #define GCS_COMPATTR                    0x0010
365 #define GCS_COMPCLAUSE                  0x0020
366 #define GCS_CURSORPOS                   0x0080
367 #define GCS_DELTASTART                  0x0100
368 #define GCS_RESULTREADSTR               0x0200
369 #define GCS_RESULTREADCLAUSE            0x0400
370 #define GCS_RESULTSTR                   0x0800
371 #define GCS_RESULTCLAUSE                0x1000
372 
373 /* style bit flags for WM_IME_COMPOSITION */
374 #define CS_INSERTCHAR                   0x2000
375 #define CS_NOMOVECARET                  0x4000
376 
377 
378 /*
379  * bits of fdwInit of INPUTCONTEXT
380  * IME version constants
381  */
382 #define IMEVER_0310                     0x0003000A
383 #define IMEVER_0400                     0x00040000
384 
385 /* IME property bits */
386 #define IME_PROP_AT_CARET               0x00010000
387 #define IME_PROP_SPECIAL_UI             0x00020000
388 #define IME_PROP_CANDLIST_START_FROM_1  0x00040000
389 #define IME_PROP_UNICODE                0x00080000
390 #define IME_PROP_COMPLETE_ON_UNSELECT	0x00100000
391 
392 /* IME UICapability bits */
393 #define UI_CAP_2700                     0x00000001
394 #define UI_CAP_ROT90                    0x00000002
395 #define UI_CAP_ROTANY                   0x00000004
396 #define UI_CAP_SOFTKBD                  0x00010000
397 
398 /* ImmSetCompositionString Capability bits */
399 #define SCS_CAP_COMPSTR                 0x00000001
400 #define SCS_CAP_MAKEREAD                0x00000002
401 #define SCS_CAP_SETRECONVERTSTRING	0x00000004
402 
403 /* IME WM_IME_SELECT inheritance Capability bits */
404 #define SELECT_CAP_CONVERSION           0x00000001
405 #define SELECT_CAP_SENTENCE             0x00000002
406 
407 
408 /* ID for deIndex of ImmGetGuideLine */
409 #define GGL_LEVEL                       0x00000001
410 #define GGL_INDEX                       0x00000002
411 #define GGL_STRING                      0x00000003
412 #define GGL_PRIVATE                     0x00000004
413 
414 /* ID for dwLevel of GUIDELINE Structure */
415 #define GL_LEVEL_NOGUIDELINE            0x00000000
416 #define GL_LEVEL_FATAL                  0x00000001
417 #define GL_LEVEL_ERROR                  0x00000002
418 #define GL_LEVEL_WARNING                0x00000003
419 #define GL_LEVEL_INFORMATION            0x00000004
420 
421 /* ID for dwIndex of GUIDELINE Structure */
422 #define GL_ID_UNKNOWN                   0x00000000
423 #define GL_ID_NOMODULE                  0x00000001
424 #define GL_ID_NODICTIONARY              0x00000010
425 #define GL_ID_CANNOTSAVE                0x00000011
426 #define GL_ID_NOCONVERT                 0x00000020
427 #define GL_ID_TYPINGERROR               0x00000021
428 #define GL_ID_TOOMANYSTROKE             0x00000022
429 #define GL_ID_READINGCONFLICT           0x00000023
430 #define GL_ID_INPUTREADING              0x00000024
431 #define GL_ID_INPUTRADICAL              0x00000025
432 #define GL_ID_INPUTCODE                 0x00000026
433 #define GL_ID_INPUTSYMBOL               0x00000027
434 #define GL_ID_CHOOSECANDIDATE           0x00000028
435 #define GL_ID_REVERSECONVERSION         0x00000029
436 #define GL_ID_PRIVATE_FIRST             0x00008000
437 #define GL_ID_PRIVATE_LAST              0x0000FFFF
438 
439 /* ID for dwIndex of ImmGetProperty */
440 #define IGP_GETIMEVERSION               (DWORD)(-4)
441 #define IGP_PROPERTY                    0x00000004
442 #define IGP_CONVERSION                  0x00000008
443 #define IGP_SENTENCE                    0x0000000c
444 #define IGP_UI                          0x00000010
445 #define IGP_SETCOMPSTR                  0x00000014
446 #define IGP_SELECT                      0x00000018
447 
448 
449 /* dwIndex for ImmSetCompositionString API */
450 #define SCS_SETSTR          (GCS_COMPREADSTR|GCS_COMPSTR)
451 #define SCS_CHANGEATTR      (GCS_COMPREADATTR|GCS_COMPATTR)
452 #define SCS_CHANGECLAUSE    (GCS_COMPREADCLAUSE|GCS_COMPCLAUSE)
453 #define SCS_SETRECONVERTSTRING		0x00010000
454 #define SCS_QUERYRECONVERTSTRING	0x00020000
455 
456 /* attribute for COMPOSITIONSTRING Structure */
457 #define ATTR_INPUT                      0x00
458 #define ATTR_TARGET_CONVERTED           0x01
459 #define ATTR_CONVERTED                  0x02
460 #define ATTR_TARGET_NOTCONVERTED        0x03
461 #define ATTR_INPUT_ERROR                0x04
462 #define ATTR_FIXEDCONVERTED		0x05
463 
464 
465 /* bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW */
466 #define CFS_DEFAULT                     0x0000
467 #define CFS_RECT                        0x0001
468 #define CFS_POINT                       0x0002
469 #define CFS_FORCE_POSITION              0x0020
470 #define CFS_CANDIDATEPOS                0x0040
471 #define CFS_EXCLUDE                     0x0080
472 
473 /* conversion direction for ImmGetConversionList */
474 #define GCL_CONVERSION                  0x0001
475 #define GCL_REVERSECONVERSION           0x0002
476 #define GCL_REVERSE_LENGTH              0x0003
477 
478 
479 /* bit field for conversion mode */
480 #define IME_CMODE_ALPHANUMERIC          0x0000
481 #define IME_CMODE_NATIVE                0x0001
482 #define IME_CMODE_CHINESE               IME_CMODE_NATIVE
483 /* IME_CMODE_HANGEUL is old name of IME_CMODE_HANGUL. It will be gone eventually. */
484 #define IME_CMODE_HANGEUL               IME_CMODE_NATIVE
485 #define IME_CMODE_HANGUL                IME_CMODE_NATIVE
486 #define IME_CMODE_JAPANESE              IME_CMODE_NATIVE
487 #define IME_CMODE_KATAKANA              0x0002  /* only effect under IME_CMODE_NATIVE */
488 #define IME_CMODE_LANGUAGE              0x0003
489 #define IME_CMODE_FULLSHAPE             0x0008
490 #define IME_CMODE_ROMAN                 0x0010
491 #define IME_CMODE_CHARCODE              0x0020
492 #define IME_CMODE_HANJACONVERT          0x0040
493 #define IME_CMODE_SOFTKBD               0x0080
494 #define IME_CMODE_NOCONVERSION          0x0100
495 #define IME_CMODE_EUDC                  0x0200
496 #define IME_CMODE_SYMBOL                0x0400
497 #define IME_CMODE_FIXED			0x0800
498 
499 
500 #define IME_SMODE_NONE                  0x0000
501 #define IME_SMODE_PLAURALCLAUSE         0x0001
502 #define IME_SMODE_SINGLECONVERT         0x0002
503 #define IME_SMODE_AUTOMATIC             0x0004
504 #define IME_SMODE_PHRASEPREDICT         0x0008
505 #define IME_SMODE_CONVERSATION		0x0010
506 
507 /* style of candidate */
508 #define IME_CAND_UNKNOWN                0x0000
509 #define IME_CAND_READ                   0x0001
510 #define IME_CAND_CODE                   0x0002
511 #define IME_CAND_MEANING                0x0003
512 #define IME_CAND_RADICAL                0x0004
513 #define IME_CAND_STROKE                 0x0005
514 
515 
516 /* wParam of report message WM_IME_NOTIFY */
517 #define IMN_CLOSESTATUSWINDOW           0x0001
518 #define IMN_OPENSTATUSWINDOW            0x0002
519 #define IMN_CHANGECANDIDATE             0x0003
520 #define IMN_CLOSECANDIDATE              0x0004
521 #define IMN_OPENCANDIDATE               0x0005
522 #define IMN_SETCONVERSIONMODE           0x0006
523 #define IMN_SETSENTENCEMODE             0x0007
524 #define IMN_SETOPENSTATUS               0x0008
525 #define IMN_SETCANDIDATEPOS             0x0009
526 #define IMN_SETCOMPOSITIONFONT          0x000A
527 #define IMN_SETCOMPOSITIONWINDOW        0x000B
528 #define IMN_SETSTATUSWINDOWPOS          0x000C
529 #define IMN_GUIDELINE                   0x000D
530 #define IMN_PRIVATE                     0x000E
531 
532 
533 /* wParam of report message WM_IME_REQUEST */
534 #define IMR_COMPOSITIONWINDOW		0x0001
535 #define IMR_CANDIDATEWINDOW		0x0002
536 #define IMR_COMPOSITIONFONT		0x0003
537 #define IMR_RECONVERTSTRING		0x0004
538 #define IMR_CONFIRMRECONVERTSTRING	0x0005
539 #define IMR_QUERYCHARPOSITION		0x0006
540 #define IMR_DOCUMENTFEED		0x0007
541 
542 
543 /* error code of ImmGetCompositionString */
544 #define IMM_ERROR_NODATA                (-1)
545 #define IMM_ERROR_GENERAL               (-2)
546 
547 
548 /* dialog mode of ImmConfigureIME */
549 #define IME_CONFIG_GENERAL              1
550 #define IME_CONFIG_REGISTERWORD         2
551 #define IME_CONFIG_SELECTDICTIONARY     3
552 
553 /* dialog mode of ImmEscape */
554 #define IME_ESC_QUERY_SUPPORT           0x0003
555 #define IME_ESC_RESERVED_FIRST          0x0004
556 #define IME_ESC_RESERVED_LAST           0x07FF
557 #define IME_ESC_PRIVATE_FIRST           0x0800
558 #define IME_ESC_PRIVATE_LAST            0x0FFF
559 #define IME_ESC_SEQUENCE_TO_INTERNAL    0x1001
560 #define IME_ESC_GET_EUDC_DICTIONARY     0x1003
561 #define IME_ESC_SET_EUDC_DICTIONARY     0x1004
562 #define IME_ESC_MAX_KEY                 0x1005
563 #define IME_ESC_IME_NAME                0x1006
564 #define IME_ESC_SYNC_HOTKEY             0x1007
565 #define IME_ESC_HANJA_MODE              0x1008
566 #define IME_ESC_AUTOMATA                0x1009
567 #define IME_ESC_PRIVATE_HOTKEY          0x100a
568 #define IME_ESC_GETHELPFILENAME		0x100b
569 
570 
571 /* style of word registration */
572 #define IME_REGWORD_STYLE_EUDC          0x00000001
573 #define IME_REGWORD_STYLE_USER_FIRST    0x80000000
574 #define IME_REGWORD_STYLE_USER_LAST     0xFFFFFFFF
575 
576 
577 /* dwFlags for ImmAssociateContextEx */
578 #define IACE_CHILDREN			0x0001
579 #define IACE_DEFAULT			0x0010
580 #define IACE_IGNORENOCONTEXT		0x0020
581 
582 /* dwFlags for ImmGetImeMenuItems */
583 #define IGIMIF_RIGHTMENU		0x0001
584 
585 /* dwType for ImmGetImeMenuItems */
586 #define IGIMII_CMODE			0x0001
587 #define IGIMII_SMODE			0x0002
588 #define IGIMII_CONFIGURE		0x0004
589 #define IGIMII_TOOLS			0x0008
590 #define IGIMII_HELP			0x0010
591 #define IGIMII_OTHER			0x0020
592 #define IGIMII_INPUTTOOLS		0x0040
593 
594 /* fType of IMEMENUITEMINFO structure */
595 #define IMFT_RADIOCHECK			0x00001
596 #define IMFT_SEPARATOR			0x00002
597 #define IMFT_SUBMENU			0x00004
598 
599 /* fState of IMEMENUITEMINFO structure */
600 #define IMFS_GRAYED			MFS_GRAYED
601 #define IMFS_DISABLED			MFS_DISABLED
602 #define IMFS_CHECKED			MFS_CHECKED
603 #define IMFS_HILITE			MFS_HILITE
604 #define IMFS_ENABLED			MFS_ENABLED
605 #define IMFS_UNCHECKED			MFS_UNCHECKED
606 #define IMFS_UNHILITE			MFS_UNHILITE
607 #define IMFS_DEFAULT			MFS_DEFAULT
608 
609 
610 /*
611  * type of soft keyboard
612  * for Windows Tranditional Chinese Edition
613  */
614 #define SOFTKEYBOARD_TYPE_T1            0x0001
615 /* for Windows Simplified Chinese Edition */
616 #define SOFTKEYBOARD_TYPE_C1            0x0002
617 
618 
619 HIMC WINAPI ImmAssociateContext(_In_ HWND, _In_ HIMC);
620 BOOL WINAPI ImmAssociateContextEx(_In_ HWND, _In_ HIMC, _In_ DWORD);
621 
622 BOOL WINAPI ImmConfigureIMEA(_In_ HKL, _In_ HWND, _In_ DWORD, _In_ LPVOID);
623 BOOL WINAPI ImmConfigureIMEW(_In_ HKL, _In_ HWND, _In_ DWORD, _In_ LPVOID);
624 #define ImmConfigureIME WINELIB_NAME_AW(ImmConfigureIME)
625 
626 HIMC WINAPI ImmCreateContext(void);
627 BOOL WINAPI ImmDestroyContext(_In_ HIMC hIMC);
628 BOOL WINAPI ImmDisableIME(_In_ DWORD idThread);
629 BOOL WINAPI ImmEnumInputContext(_In_ DWORD, _In_ IMCENUMPROC, _In_ LPARAM);
630 
631 UINT
632 WINAPI
633 ImmEnumRegisterWordA(
634   _In_ HKL,
635   _In_ REGISTERWORDENUMPROCA,
636   _In_opt_ LPCSTR lpszReading,
637   _In_ DWORD,
638   _In_opt_ LPCSTR lpszRegister,
639   _In_ LPVOID);
640 
641 UINT
642 WINAPI
643 ImmEnumRegisterWordW(
644   _In_ HKL,
645   _In_ REGISTERWORDENUMPROCW,
646   _In_opt_ LPCWSTR lpszReading,
647   _In_ DWORD,
648   _In_opt_ LPCWSTR lpszRegister,
649   _In_ LPVOID);
650 
651 #define ImmEnumRegisterWord WINELIB_NAME_AW(ImmEnumRegisterWord)
652 
653 LRESULT WINAPI ImmEscapeA(_In_ HKL, _In_ HIMC, _In_ UINT, _In_ LPVOID);
654 LRESULT WINAPI ImmEscapeW(_In_ HKL, _In_ HIMC, _In_ UINT, _In_ LPVOID);
655 #define ImmEscape WINELIB_NAME_AW(ImmEscape)
656 
657 DWORD
658 WINAPI
659 ImmGetCandidateListA(
660   _In_ HIMC,
661   _In_ DWORD deIndex,
662   _Out_writes_bytes_opt_(dwBufLen) LPCANDIDATELIST lpCandList,
663   _In_ DWORD dwBufLen);
664 
665 DWORD
666 WINAPI
667 ImmGetCandidateListW(
668   _In_ HIMC,
669   _In_ DWORD deIndex,
670   _Out_writes_bytes_opt_(dwBufLen) LPCANDIDATELIST lpCandList,
671   _In_ DWORD dwBufLen);
672 
673 #define ImmGetCandidateList WINELIB_NAME_AW(ImmGetCandidateList)
674 
675 DWORD WINAPI ImmGetCandidateListCountA(_In_ HIMC, _Out_ LPDWORD);
676 DWORD WINAPI ImmGetCandidateListCountW(_In_ HIMC, _Out_ LPDWORD);
677 #define ImmGetCandidateListCount WINELIB_NAME_AW(ImmGetCandidateListCount)
678 
679 BOOL
680 WINAPI
681 ImmGetCandidateWindow(
682   _In_ HIMC,
683   _In_ DWORD,
684   _Out_ LPCANDIDATEFORM lpCandidate);
685 
686 #if defined(_WINGDI_) && !defined(NOGDI)
687 
688 BOOL WINAPI ImmGetCompositionFontA(_In_ HIMC, _Out_ LPLOGFONTA);
689 BOOL WINAPI ImmGetCompositionFontW(_In_ HIMC, _Out_ LPLOGFONTW);
690 #define ImmGetCompositionFont WINELIB_NAME_AW(ImmGetCompositionFont)
691 
692 BOOL WINAPI ImmSetCompositionFontA(_In_ HIMC, _In_ LPLOGFONTA);
693 BOOL WINAPI ImmSetCompositionFontW(_In_ HIMC, _In_ LPLOGFONTW);
694 #define ImmSetCompositionFont WINELIB_NAME_AW(ImmSetCompositionFont)
695 
696 #endif
697 
698 LONG
699 WINAPI
700 ImmGetCompositionStringA(
701   _In_ HIMC,
702   _In_ DWORD,
703   _Out_writes_bytes_opt_(dwBufLen) LPVOID lpBuf,
704   _In_ DWORD dwBufLen);
705 
706 LONG
707 WINAPI
708 ImmGetCompositionStringW(
709   _In_ HIMC,
710   _In_ DWORD,
711   _Out_writes_bytes_opt_(dwBufLen) LPVOID lpBuf,
712   _In_ DWORD dwBufLen);
713 
714 #define ImmGetCompositionString WINELIB_NAME_AW(ImmGetCompositionString)
715 
716 BOOL WINAPI ImmGetCompositionWindow(_In_ HIMC, _Out_ LPCOMPOSITIONFORM);
717 HIMC WINAPI ImmGetContext(_In_ HWND);
718 
719 DWORD
720 WINAPI
721 ImmGetConversionListA(
722   _In_ HKL,
723   _In_ HIMC,
724   _In_ LPCSTR lpSrc,
725   _Out_writes_bytes_(dwBufLen) LPCANDIDATELIST lpDst,
726   _In_ DWORD dwBufLen,
727   _In_ UINT uFlag);
728 
729 DWORD
730 WINAPI
731 ImmGetConversionListW(
732   _In_ HKL,
733   _In_ HIMC,
734   _In_ LPCWSTR lpSrc,
735   _Out_writes_bytes_(dwBufLen) LPCANDIDATELIST lpDst,
736   _In_ DWORD dwBufLen,
737   _In_ UINT uFlag);
738 
739 #define ImmGetConversionList WINELIB_NAME_AW(ImmGetConversionList)
740 
741 BOOL
742 WINAPI
743 ImmGetConversionStatus(
744   _In_ HIMC,
745   _Out_opt_ LPDWORD lpfdwConversion,
746   _Out_opt_ LPDWORD lpfdwSentence);
747 
748 HWND WINAPI ImmGetDefaultIMEWnd(_In_ HWND);
749 
750 UINT
751 WINAPI
752 ImmGetDescriptionA(
753   _In_ HKL,
754   _Out_writes_opt_(uBufLen) LPSTR lpszDescription,
755   _In_ UINT uBufLen);
756 
757 UINT
758 WINAPI
759 ImmGetDescriptionW(
760   _In_ HKL,
761   _Out_writes_opt_(uBufLen) LPWSTR lpszDescription,
762   _In_ UINT uBufLen);
763 
764 #define ImmGetDescription WINELIB_NAME_AW(ImmGetDescription)
765 
766 DWORD
767 WINAPI
768 ImmGetGuideLineA(
769   _In_ HIMC,
770   _In_ DWORD dwIndex,
771   _Out_writes_bytes_opt_(dwBufLen) LPSTR lpBuf,
772   _In_ DWORD dwBufLen);
773 
774 DWORD
775 WINAPI
776 ImmGetGuideLineW(
777   _In_ HIMC,
778   _In_ DWORD dwIndex,
779   _Out_writes_bytes_opt_(dwBufLen) LPWSTR lpBuf,
780   _In_ DWORD dwBufLen);
781 
782 #define ImmGetGuideLine WINELIB_NAME_AW(ImmGetGuideLine)
783 
784 UINT
785 WINAPI
786 ImmGetIMEFileNameA(
787   _In_ HKL,
788   _Out_writes_opt_(uBufLen) LPSTR lpszFileName,
789   _In_ UINT uBufLen);
790 
791 UINT
792 WINAPI
793 ImmGetIMEFileNameW(
794   _In_ HKL,
795   _Out_writes_opt_(uBufLen) LPWSTR lpszFileName,
796   _In_ UINT uBufLen);
797 
798 #define ImmGetIMEFileName WINELIB_NAME_AW(ImmGetIMEFileName)
799 
800 DWORD
801 WINAPI
802 ImmGetImeMenuItemsA(
803   _In_ HIMC,
804   _In_ DWORD,
805   _In_ DWORD,
806   _Out_opt_ LPIMEMENUITEMINFOA lpImeParentMenu,
807   _Out_writes_bytes_opt_(dwSize) LPIMEMENUITEMINFOA lpImeMenu,
808   _In_ DWORD dwSize);
809 
810 DWORD
811 WINAPI
812 ImmGetImeMenuItemsW(
813   _In_ HIMC,
814   _In_ DWORD,
815   _In_ DWORD,
816   _Out_opt_ LPIMEMENUITEMINFOW lpImeParentMenu,
817   _Out_writes_bytes_opt_(dwSize) LPIMEMENUITEMINFOW lpImeMenu,
818   _In_ DWORD dwSize);
819 
820 #define ImmGetImeMenuItems WINELIB_NAME_AW(ImmGetImeMenuItems)
821 
822 BOOL WINAPI ImmGetOpenStatus(_In_ HIMC);
823 DWORD WINAPI ImmGetProperty(_In_ HKL, _In_ DWORD);
824 
825 UINT
826 WINAPI
827 ImmGetRegisterWordStyleA(
828   _In_ HKL,
829   _In_ UINT nItem,
830   _Out_writes_(nItem) LPSTYLEBUFA lpStyleBuf);
831 
832 UINT
833 WINAPI
834 ImmGetRegisterWordStyleW(
835   _In_ HKL,
836   _In_ UINT nItem,
837   _Out_writes_(nItem) LPSTYLEBUFW lpStyleBuf);
838 
839 #define ImmGetRegisterWordStyle WINELIB_NAME_AW(ImmGetRegisterWordStyle)
840 
841 BOOL WINAPI ImmGetStatusWindowPos(_In_ HIMC, _Out_ LPPOINT);
842 UINT WINAPI ImmGetVirtualKey(_In_ HWND);
843 
844 HKL WINAPI ImmInstallIMEA(_In_ LPCSTR, _In_ LPCSTR);
845 HKL WINAPI ImmInstallIMEW(_In_ LPCWSTR, _In_ LPCWSTR);
846 #define ImmInstallIME WINELIB_NAME_AW(ImmInstallIME)
847 
848 BOOL WINAPI ImmIsIME(_In_ HKL);
849 
850 BOOL WINAPI ImmIsUIMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM);
851 BOOL WINAPI ImmIsUIMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM);
852 #define ImmIsUIMessage WINELIB_NAME_AW(ImmIsUIMessage)
853 
854 BOOL WINAPI ImmNotifyIME(_In_ HIMC, _In_ DWORD, _In_ DWORD, _In_ DWORD);
855 
856 BOOL   WINAPI ImmProcessKey(HWND, HKL, UINT, LPARAM, DWORD);
857 
858 BOOL
859 WINAPI
860 ImmRegisterWordA(
861   _In_ HKL,
862   _In_ LPCSTR lpszReading,
863   _In_ DWORD,
864   _In_ LPCSTR lpszRegister);
865 
866 BOOL
867 WINAPI
868 ImmRegisterWordW(
869   _In_ HKL,
870   _In_ LPCWSTR lpszReading,
871   _In_ DWORD,
872   _In_ LPCWSTR lpszRegister);
873 
874 #define ImmRegisterWord WINELIB_NAME_AW(ImmRegisterWord)
875 
876 BOOL WINAPI ImmReleaseContext(_In_ HWND, _In_ HIMC);
877 BOOL WINAPI ImmSetCandidateWindow(_In_ HIMC, _In_ LPCANDIDATEFORM);
878 
879 BOOL
880 WINAPI
881 ImmSetCompositionStringA(
882   _In_ HIMC,
883   _In_ DWORD dwIndex,
884   _In_reads_bytes_opt_(dwCompLen) LPCVOID lpComp,
885   _In_ DWORD dwCompLen,
886   _In_reads_bytes_opt_(dwReadLen) LPCVOID lpRead,
887   _In_ DWORD dwReadLen);
888 
889 BOOL
890 WINAPI
891 ImmSetCompositionStringW(
892   _In_ HIMC,
893   _In_ DWORD dwIndex,
894   _In_reads_bytes_opt_(dwCompLen) LPCVOID lpComp,
895   _In_ DWORD dwCompLen,
896   _In_reads_bytes_opt_(dwReadLen) LPCVOID lpRead,
897   _In_ DWORD dwReadLen);
898 
899 #define ImmSetCompositionString WINELIB_NAME_AW(ImmSetCompositionString)
900 
901 BOOL WINAPI ImmSetCompositionWindow(_In_ HIMC, _In_ LPCOMPOSITIONFORM);
902 BOOL WINAPI ImmSetConversionStatus(_In_ HIMC, _In_ DWORD, _In_ DWORD);
903 BOOL WINAPI ImmSetOpenStatus(_In_ HIMC, _In_ BOOL);
904 BOOL WINAPI ImmSetStatusWindowPos(_In_ HIMC, _In_ LPPOINT);
905 BOOL WINAPI ImmSimulateHotKey(_In_ HWND, _In_ DWORD);
906 
907 BOOL
908 WINAPI
909 ImmUnregisterWordA(
910   _In_ HKL,
911   _In_ LPCSTR lpszReading,
912   _In_ DWORD,
913   _In_ LPCSTR lpszUnregister);
914 
915 BOOL
916 WINAPI
917 ImmUnregisterWordW(
918   _In_ HKL,
919   _In_ LPCWSTR lpszReading,
920   _In_ DWORD,
921   _In_ LPCWSTR lpszUnregister);
922 
923 #define ImmUnregisterWord WINELIB_NAME_AW(ImmUnregisterWord)
924 
925 
926 #ifdef __cplusplus
927 }
928 #endif
929 
930 #endif  /* __WINE_IMM_H */
931