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