[IMM32] Rewrite ImmAssociateContextEx (#3961)
[reactos.git] / sdk / 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 #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 BOOL WINAPI ImmUnlockIMC(HIMC);
241 DWORD WINAPI ImmGetIMCLockCount(HIMC);
242 HIMCC WINAPI ImmCreateIMCC(DWORD);
243 HIMCC WINAPI ImmDestroyIMCC(HIMCC);
244 LPVOID WINAPI ImmLockIMCC(HIMCC);
245 BOOL WINAPI ImmUnlockIMCC(HIMCC);
246 DWORD WINAPI ImmGetIMCCLockCount(HIMCC);
247 HIMCC WINAPI ImmReSizeIMCC(HIMCC, DWORD);
248 DWORD WINAPI ImmGetIMCCSize(HIMCC);
249
250 BOOL WINAPI ImmGenerateMessage(HIMC);
251 LRESULT WINAPI ImmRequestMessageA(HIMC, WPARAM, LPARAM);
252 LRESULT WINAPI ImmRequestMessageW(HIMC, WPARAM, LPARAM);
253 #define ImmRequestMessage WINELIB_NAME_AW(ImmRequestMessage);
254 BOOL WINAPI ImmTranslateMessage(HWND, UINT, WPARAM, LPARAM);
255 HWND WINAPI ImmCreateSoftKeyboard(UINT, UINT, int, int);
256 BOOL WINAPI ImmDestroySoftKeyboard(HWND);
257 BOOL WINAPI ImmShowSoftKeyboard(HWND, int);
258
259 BOOL WINAPI ImeInquire(LPIMEINFO, LPWSTR, LPCWSTR lpszOptions);
260 BOOL WINAPI ImeConfigure (HKL, HWND, DWORD, LPVOID);
261 DWORD WINAPI ImeConversionList(HIMC, LPCWSTR, LPCANDIDATELIST,DWORD,UINT);
262 BOOL WINAPI ImeDestroy(UINT);
263 LRESULT WINAPI ImeEscape(HIMC, UINT, LPVOID);
264 BOOL WINAPI ImeProcessKey(HIMC, UINT, LPARAM, CONST LPBYTE);
265 BOOL WINAPI ImeSelect(HIMC, BOOL);
266 BOOL WINAPI ImeSetActiveContext(HIMC, BOOL);
267 UINT WINAPI ImeToAsciiEx(UINT, UINT, CONST LPBYTE, LPDWORD, UINT, HIMC);
268 BOOL WINAPI NotifyIME(HIMC, DWORD, DWORD, DWORD);
269 BOOL WINAPI ImeRegisterWord(LPCWSTR, DWORD, LPCWSTR);
270 BOOL WINAPI ImeUnregisterWord(LPCWSTR, DWORD, LPCWSTR);
271 UINT WINAPI ImeGetRegisterWordStyle(UINT, LPSTYLEBUFW);
272 UINT WINAPI ImeEnumRegisterWord(REGISTERWORDENUMPROCW, LPCWSTR, DWORD, LPCWSTR, LPVOID);
273 BOOL WINAPI ImeSetCompositionString(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
274 DWORD WINAPI ImeGetImeMenuItems(HIMC, DWORD, DWORD, LPIMEMENUITEMINFOW, LPIMEMENUITEMINFOW, DWORD);
275
276 /* wParam for WM_IME_CONTROL */
277 #define IMC_GETCANDIDATEPOS 0x0007
278 #define IMC_SETCANDIDATEPOS 0x0008
279 #define IMC_GETCOMPOSITIONFONT 0x0009
280 #define IMC_SETCOMPOSITIONFONT 0x000A
281 #define IMC_GETCOMPOSITIONWINDOW 0x000B
282 #define IMC_SETCOMPOSITIONWINDOW 0x000C
283 #define IMC_GETSTATUSWINDOWPOS 0x000F
284 #define IMC_SETSTATUSWINDOWPOS 0x0010
285 #define IMC_CLOSESTATUSWINDOW 0x0021
286 #define IMC_OPENSTATUSWINDOW 0x0022
287
288 /*
289 * wParam for WM_IME_CONTROL to the soft keyboard
290 * dwAction for ImmNotifyIME
291 */
292 #define NI_OPENCANDIDATE 0x0010
293 #define NI_CLOSECANDIDATE 0x0011
294 #define NI_SELECTCANDIDATESTR 0x0012
295 #define NI_CHANGECANDIDATELIST 0x0013
296 #define NI_FINALIZECONVERSIONRESULT 0x0014
297 #define NI_COMPOSITIONSTR 0x0015
298 #define NI_SETCANDIDATE_PAGESTART 0x0016
299 #define NI_SETCANDIDATE_PAGESIZE 0x0017
300 #define NI_IMEMENUSELECTED 0x0018
301
302 /* lParam for WM_IME_SETCONTEXT */
303 #define ISC_SHOWUICANDIDATEWINDOW 0x00000001
304 #define ISC_SHOWUICOMPOSITIONWINDOW 0x80000000
305 #define ISC_SHOWUIGUIDELINE 0x40000000
306 #define ISC_SHOWUIALLCANDIDATEWINDOW 0x0000000F
307 #define ISC_SHOWUIALL 0xC000000F
308
309
310 /* dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR */
311 #define CPS_COMPLETE 0x0001
312 #define CPS_CONVERT 0x0002
313 #define CPS_REVERT 0x0003
314 #define CPS_CANCEL 0x0004
315
316
317 /* the modifiers of hot key */
318 #define MOD_ALT 0x0001
319 #define MOD_CONTROL 0x0002
320 #define MOD_SHIFT 0x0004
321
322 #define MOD_LEFT 0x8000
323 #define MOD_RIGHT 0x4000
324
325 #define MOD_ON_KEYUP 0x0800
326 #define MOD_IGNORE_ALL_MODIFIER 0x0400
327
328
329 /* Windows for Simplified Chinese Edition hot key ID from 0x10 - 0x2F */
330 #define IME_CHOTKEY_IME_NONIME_TOGGLE 0x10
331 #define IME_CHOTKEY_SHAPE_TOGGLE 0x11
332 #define IME_CHOTKEY_SYMBOL_TOGGLE 0x12
333
334 /* Windows for Japanese Edition hot key ID from 0x30 - 0x4F */
335 #define IME_JHOTKEY_CLOSE_OPEN 0x30
336
337 /* Windows for Korean Edition hot key ID from 0x50 - 0x6F */
338 #define IME_KHOTKEY_SHAPE_TOGGLE 0x50
339 #define IME_KHOTKEY_HANJACONVERT 0x51
340 #define IME_KHOTKEY_ENGLISH 0x52
341 /* Windows for Tranditional Chinese Edition hot key ID from 0x70 - 0x8F */
342 #define IME_THOTKEY_IME_NONIME_TOGGLE 0x70
343 #define IME_THOTKEY_SHAPE_TOGGLE 0x71
344 #define IME_THOTKEY_SYMBOL_TOGGLE 0x72
345
346 /* direct switch hot key ID from 0x100 - 0x11F */
347 #define IME_HOTKEY_DSWITCH_FIRST 0x100
348 #define IME_HOTKEY_DSWITCH_LAST 0x11F
349
350 /* IME private hot key from 0x200 - 0x21F */
351 #define IME_HOTKEY_PRIVATE_FIRST 0x200
352 #define IME_ITHOTKEY_RESEND_RESULTSTR 0x200
353 #define IME_ITHOTKEY_PREVIOUS_COMPOSITION 0x201
354 #define IME_ITHOTKEY_UISTYLE_TOGGLE 0x202
355 #define IME_ITHOTKEY_RECONVERTSTRING 0x203
356 #define IME_HOTKEY_PRIVATE_LAST 0x21F
357
358
359 /*
360 * dwSystemInfoFlags bits
361 * parameter of ImmGetCompositionString
362 */
363 #define GCS_COMPREADSTR 0x0001
364 #define GCS_COMPREADATTR 0x0002
365 #define GCS_COMPREADCLAUSE 0x0004
366 #define GCS_COMPSTR 0x0008
367 #define GCS_COMPATTR 0x0010
368 #define GCS_COMPCLAUSE 0x0020
369 #define GCS_CURSORPOS 0x0080
370 #define GCS_DELTASTART 0x0100
371 #define GCS_RESULTREADSTR 0x0200
372 #define GCS_RESULTREADCLAUSE 0x0400
373 #define GCS_RESULTSTR 0x0800
374 #define GCS_RESULTCLAUSE 0x1000
375
376 /* style bit flags for WM_IME_COMPOSITION */
377 #define CS_INSERTCHAR 0x2000
378 #define CS_NOMOVECARET 0x4000
379
380
381 /*
382 * bits of fdwInit of INPUTCONTEXT
383 * IME version constants
384 */
385 #define IMEVER_0310 0x0003000A
386 #define IMEVER_0400 0x00040000
387
388 /* IME property bits */
389 #define IME_PROP_AT_CARET 0x00010000
390 #define IME_PROP_SPECIAL_UI 0x00020000
391 #define IME_PROP_CANDLIST_START_FROM_1 0x00040000
392 #define IME_PROP_UNICODE 0x00080000
393 #define IME_PROP_COMPLETE_ON_UNSELECT 0x00100000
394
395 /* IME UICapability bits */
396 #define UI_CAP_2700 0x00000001
397 #define UI_CAP_ROT90 0x00000002
398 #define UI_CAP_ROTANY 0x00000004
399 #define UI_CAP_SOFTKBD 0x00010000
400
401 /* ImmSetCompositionString Capability bits */
402 #define SCS_CAP_COMPSTR 0x00000001
403 #define SCS_CAP_MAKEREAD 0x00000002
404 #define SCS_CAP_SETRECONVERTSTRING 0x00000004
405
406 /* IME WM_IME_SELECT inheritance Capability bits */
407 #define SELECT_CAP_CONVERSION 0x00000001
408 #define SELECT_CAP_SENTENCE 0x00000002
409
410
411 /* ID for deIndex of ImmGetGuideLine */
412 #define GGL_LEVEL 0x00000001
413 #define GGL_INDEX 0x00000002
414 #define GGL_STRING 0x00000003
415 #define GGL_PRIVATE 0x00000004
416
417 /* ID for dwLevel of GUIDELINE Structure */
418 #define GL_LEVEL_NOGUIDELINE 0x00000000
419 #define GL_LEVEL_FATAL 0x00000001
420 #define GL_LEVEL_ERROR 0x00000002
421 #define GL_LEVEL_WARNING 0x00000003
422 #define GL_LEVEL_INFORMATION 0x00000004
423
424 /* ID for dwIndex of GUIDELINE Structure */
425 #define GL_ID_UNKNOWN 0x00000000
426 #define GL_ID_NOMODULE 0x00000001
427 #define GL_ID_NODICTIONARY 0x00000010
428 #define GL_ID_CANNOTSAVE 0x00000011
429 #define GL_ID_NOCONVERT 0x00000020
430 #define GL_ID_TYPINGERROR 0x00000021
431 #define GL_ID_TOOMANYSTROKE 0x00000022
432 #define GL_ID_READINGCONFLICT 0x00000023
433 #define GL_ID_INPUTREADING 0x00000024
434 #define GL_ID_INPUTRADICAL 0x00000025
435 #define GL_ID_INPUTCODE 0x00000026
436 #define GL_ID_INPUTSYMBOL 0x00000027
437 #define GL_ID_CHOOSECANDIDATE 0x00000028
438 #define GL_ID_REVERSECONVERSION 0x00000029
439 #define GL_ID_PRIVATE_FIRST 0x00008000
440 #define GL_ID_PRIVATE_LAST 0x0000FFFF
441
442 /* ID for dwIndex of ImmGetProperty */
443 #define IGP_GETIMEVERSION (DWORD)(-4)
444 #define IGP_PROPERTY 0x00000004
445 #define IGP_CONVERSION 0x00000008
446 #define IGP_SENTENCE 0x0000000c
447 #define IGP_UI 0x00000010
448 #define IGP_SETCOMPSTR 0x00000014
449 #define IGP_SELECT 0x00000018
450
451
452 /* dwIndex for ImmSetCompositionString API */
453 #define SCS_SETSTR (GCS_COMPREADSTR|GCS_COMPSTR)
454 #define SCS_CHANGEATTR (GCS_COMPREADATTR|GCS_COMPATTR)
455 #define SCS_CHANGECLAUSE (GCS_COMPREADCLAUSE|GCS_COMPCLAUSE)
456 #define SCS_SETRECONVERTSTRING 0x00010000
457 #define SCS_QUERYRECONVERTSTRING 0x00020000
458
459 /* attribute for COMPOSITIONSTRING Structure */
460 #define ATTR_INPUT 0x00
461 #define ATTR_TARGET_CONVERTED 0x01
462 #define ATTR_CONVERTED 0x02
463 #define ATTR_TARGET_NOTCONVERTED 0x03
464 #define ATTR_INPUT_ERROR 0x04
465 #define ATTR_FIXEDCONVERTED 0x05
466
467
468 /* bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW */
469 #define CFS_DEFAULT 0x0000
470 #define CFS_RECT 0x0001
471 #define CFS_POINT 0x0002
472 #define CFS_FORCE_POSITION 0x0020
473 #define CFS_CANDIDATEPOS 0x0040
474 #define CFS_EXCLUDE 0x0080
475
476 /* conversion direction for ImmGetConversionList */
477 #define GCL_CONVERSION 0x0001
478 #define GCL_REVERSECONVERSION 0x0002
479 #define GCL_REVERSE_LENGTH 0x0003
480
481
482 /* bit field for conversion mode */
483 #define IME_CMODE_ALPHANUMERIC 0x0000
484 #define IME_CMODE_NATIVE 0x0001
485 #define IME_CMODE_CHINESE IME_CMODE_NATIVE
486 /* IME_CMODE_HANGEUL is old name of IME_CMODE_HANGUL. It will be gone eventually. */
487 #define IME_CMODE_HANGEUL IME_CMODE_NATIVE
488 #define IME_CMODE_HANGUL IME_CMODE_NATIVE
489 #define IME_CMODE_JAPANESE IME_CMODE_NATIVE
490 #define IME_CMODE_KATAKANA 0x0002 /* only effect under IME_CMODE_NATIVE */
491 #define IME_CMODE_LANGUAGE 0x0003
492 #define IME_CMODE_FULLSHAPE 0x0008
493 #define IME_CMODE_ROMAN 0x0010
494 #define IME_CMODE_CHARCODE 0x0020
495 #define IME_CMODE_HANJACONVERT 0x0040
496 #define IME_CMODE_SOFTKBD 0x0080
497 #define IME_CMODE_NOCONVERSION 0x0100
498 #define IME_CMODE_EUDC 0x0200
499 #define IME_CMODE_SYMBOL 0x0400
500 #define IME_CMODE_FIXED 0x0800
501
502
503 #define IME_SMODE_NONE 0x0000
504 #define IME_SMODE_PLAURALCLAUSE 0x0001
505 #define IME_SMODE_SINGLECONVERT 0x0002
506 #define IME_SMODE_AUTOMATIC 0x0004
507 #define IME_SMODE_PHRASEPREDICT 0x0008
508 #define IME_SMODE_CONVERSATION 0x0010
509
510 /* style of candidate */
511 #define IME_CAND_UNKNOWN 0x0000
512 #define IME_CAND_READ 0x0001
513 #define IME_CAND_CODE 0x0002
514 #define IME_CAND_MEANING 0x0003
515 #define IME_CAND_RADICAL 0x0004
516 #define IME_CAND_STROKE 0x0005
517
518
519 /* wParam of report message WM_IME_NOTIFY */
520 #define IMN_CLOSESTATUSWINDOW 0x0001
521 #define IMN_OPENSTATUSWINDOW 0x0002
522 #define IMN_CHANGECANDIDATE 0x0003
523 #define IMN_CLOSECANDIDATE 0x0004
524 #define IMN_OPENCANDIDATE 0x0005
525 #define IMN_SETCONVERSIONMODE 0x0006
526 #define IMN_SETSENTENCEMODE 0x0007
527 #define IMN_SETOPENSTATUS 0x0008
528 #define IMN_SETCANDIDATEPOS 0x0009
529 #define IMN_SETCOMPOSITIONFONT 0x000A
530 #define IMN_SETCOMPOSITIONWINDOW 0x000B
531 #define IMN_SETSTATUSWINDOWPOS 0x000C
532 #define IMN_GUIDELINE 0x000D
533 #define IMN_PRIVATE 0x000E
534
535
536 /* wParam of report message WM_IME_REQUEST */
537 #define IMR_COMPOSITIONWINDOW 0x0001
538 #define IMR_CANDIDATEWINDOW 0x0002
539 #define IMR_COMPOSITIONFONT 0x0003
540 #define IMR_RECONVERTSTRING 0x0004
541 #define IMR_CONFIRMRECONVERTSTRING 0x0005
542 #define IMR_QUERYCHARPOSITION 0x0006
543 #define IMR_DOCUMENTFEED 0x0007
544
545
546 /* error code of ImmGetCompositionString */
547 #define IMM_ERROR_NODATA (-1)
548 #define IMM_ERROR_GENERAL (-2)
549
550
551 /* dialog mode of ImmConfigureIME */
552 #define IME_CONFIG_GENERAL 1
553 #define IME_CONFIG_REGISTERWORD 2
554 #define IME_CONFIG_SELECTDICTIONARY 3
555
556 /* dialog mode of ImmEscape */
557 #define IME_ESC_QUERY_SUPPORT 0x0003
558 #define IME_ESC_RESERVED_FIRST 0x0004
559 #define IME_ESC_RESERVED_LAST 0x07FF
560 #define IME_ESC_PRIVATE_FIRST 0x0800
561 #define IME_ESC_PRIVATE_LAST 0x0FFF
562 #define IME_ESC_SEQUENCE_TO_INTERNAL 0x1001
563 #define IME_ESC_GET_EUDC_DICTIONARY 0x1003
564 #define IME_ESC_SET_EUDC_DICTIONARY 0x1004
565 #define IME_ESC_MAX_KEY 0x1005
566 #define IME_ESC_IME_NAME 0x1006
567 #define IME_ESC_SYNC_HOTKEY 0x1007
568 #define IME_ESC_HANJA_MODE 0x1008
569 #define IME_ESC_AUTOMATA 0x1009
570 #define IME_ESC_PRIVATE_HOTKEY 0x100a
571 #define IME_ESC_GETHELPFILENAME 0x100b
572
573
574 /* style of word registration */
575 #define IME_REGWORD_STYLE_EUDC 0x00000001
576 #define IME_REGWORD_STYLE_USER_FIRST 0x80000000
577 #define IME_REGWORD_STYLE_USER_LAST 0xFFFFFFFF
578
579
580 /* dwFlags for ImmAssociateContextEx */
581 #define IACE_CHILDREN 0x0001
582 #define IACE_DEFAULT 0x0010
583 #define IACE_IGNORENOCONTEXT 0x0020
584
585 /* dwFlags for ImmGetImeMenuItems */
586 #define IGIMIF_RIGHTMENU 0x0001
587
588 /* dwType for ImmGetImeMenuItems */
589 #define IGIMII_CMODE 0x0001
590 #define IGIMII_SMODE 0x0002
591 #define IGIMII_CONFIGURE 0x0004
592 #define IGIMII_TOOLS 0x0008
593 #define IGIMII_HELP 0x0010
594 #define IGIMII_OTHER 0x0020
595 #define IGIMII_INPUTTOOLS 0x0040
596
597 /* fType of IMEMENUITEMINFO structure */
598 #define IMFT_RADIOCHECK 0x00001
599 #define IMFT_SEPARATOR 0x00002
600 #define IMFT_SUBMENU 0x00004
601
602 /* fState of IMEMENUITEMINFO structure */
603 #define IMFS_GRAYED MFS_GRAYED
604 #define IMFS_DISABLED MFS_DISABLED
605 #define IMFS_CHECKED MFS_CHECKED
606 #define IMFS_HILITE MFS_HILITE
607 #define IMFS_ENABLED MFS_ENABLED
608 #define IMFS_UNCHECKED MFS_UNCHECKED
609 #define IMFS_UNHILITE MFS_UNHILITE
610 #define IMFS_DEFAULT MFS_DEFAULT
611
612
613 /*
614 * type of soft keyboard
615 * for Windows Tranditional Chinese Edition
616 */
617 #define SOFTKEYBOARD_TYPE_T1 0x0001
618 /* for Windows Simplified Chinese Edition */
619 #define SOFTKEYBOARD_TYPE_C1 0x0002
620
621
622 HIMC WINAPI ImmAssociateContext(_In_ HWND, _In_ HIMC);
623 BOOL WINAPI ImmAssociateContextEx(_In_ HWND, _In_ HIMC, _In_ DWORD);
624
625 BOOL WINAPI ImmConfigureIMEA(_In_ HKL, _In_ HWND, _In_ DWORD, _In_ LPVOID);
626 BOOL WINAPI ImmConfigureIMEW(_In_ HKL, _In_ HWND, _In_ DWORD, _In_ LPVOID);
627 #define ImmConfigureIME WINELIB_NAME_AW(ImmConfigureIME)
628
629 HIMC WINAPI ImmCreateContext(void);
630 BOOL WINAPI ImmSetActiveContext(HWND hwnd, HIMC hIMC, BOOL fFlag);
631 BOOL WINAPI ImmDestroyContext(_In_ HIMC hIMC);
632 BOOL WINAPI ImmDisableIME(_In_ DWORD idThread);
633 BOOL WINAPI ImmEnumInputContext(_In_ DWORD, _In_ IMCENUMPROC, _In_ LPARAM);
634
635 UINT
636 WINAPI
637 ImmEnumRegisterWordA(
638 _In_ HKL,
639 _In_ REGISTERWORDENUMPROCA,
640 _In_opt_ LPCSTR lpszReading,
641 _In_ DWORD,
642 _In_opt_ LPCSTR lpszRegister,
643 _In_ LPVOID);
644
645 UINT
646 WINAPI
647 ImmEnumRegisterWordW(
648 _In_ HKL,
649 _In_ REGISTERWORDENUMPROCW,
650 _In_opt_ LPCWSTR lpszReading,
651 _In_ DWORD,
652 _In_opt_ LPCWSTR lpszRegister,
653 _In_ LPVOID);
654
655 #define ImmEnumRegisterWord WINELIB_NAME_AW(ImmEnumRegisterWord)
656
657 LRESULT WINAPI ImmEscapeA(_In_ HKL, _In_ HIMC, _In_ UINT, _In_ LPVOID);
658 LRESULT WINAPI ImmEscapeW(_In_ HKL, _In_ HIMC, _In_ UINT, _In_ LPVOID);
659 #define ImmEscape WINELIB_NAME_AW(ImmEscape)
660
661 DWORD
662 WINAPI
663 ImmGetCandidateListA(
664 _In_ HIMC,
665 _In_ DWORD deIndex,
666 _Out_writes_bytes_opt_(dwBufLen) LPCANDIDATELIST lpCandList,
667 _In_ DWORD dwBufLen);
668
669 DWORD
670 WINAPI
671 ImmGetCandidateListW(
672 _In_ HIMC,
673 _In_ DWORD deIndex,
674 _Out_writes_bytes_opt_(dwBufLen) LPCANDIDATELIST lpCandList,
675 _In_ DWORD dwBufLen);
676
677 #define ImmGetCandidateList WINELIB_NAME_AW(ImmGetCandidateList)
678
679 DWORD WINAPI ImmGetCandidateListCountA(_In_ HIMC, _Out_ LPDWORD);
680 DWORD WINAPI ImmGetCandidateListCountW(_In_ HIMC, _Out_ LPDWORD);
681 #define ImmGetCandidateListCount WINELIB_NAME_AW(ImmGetCandidateListCount)
682
683 BOOL
684 WINAPI
685 ImmGetCandidateWindow(
686 _In_ HIMC,
687 _In_ DWORD,
688 _Out_ LPCANDIDATEFORM lpCandidate);
689
690 #if defined(_WINGDI_) && !defined(NOGDI)
691
692 BOOL WINAPI ImmGetCompositionFontA(_In_ HIMC, _Out_ LPLOGFONTA);
693 BOOL WINAPI ImmGetCompositionFontW(_In_ HIMC, _Out_ LPLOGFONTW);
694 #define ImmGetCompositionFont WINELIB_NAME_AW(ImmGetCompositionFont)
695
696 BOOL WINAPI ImmSetCompositionFontA(_In_ HIMC, _In_ LPLOGFONTA);
697 BOOL WINAPI ImmSetCompositionFontW(_In_ HIMC, _In_ LPLOGFONTW);
698 #define ImmSetCompositionFont WINELIB_NAME_AW(ImmSetCompositionFont)
699
700 #endif
701
702 LONG
703 WINAPI
704 ImmGetCompositionStringA(
705 _In_ HIMC,
706 _In_ DWORD,
707 _Out_writes_bytes_opt_(dwBufLen) LPVOID lpBuf,
708 _In_ DWORD dwBufLen);
709
710 LONG
711 WINAPI
712 ImmGetCompositionStringW(
713 _In_ HIMC,
714 _In_ DWORD,
715 _Out_writes_bytes_opt_(dwBufLen) LPVOID lpBuf,
716 _In_ DWORD dwBufLen);
717
718 #define ImmGetCompositionString WINELIB_NAME_AW(ImmGetCompositionString)
719
720 BOOL WINAPI ImmGetCompositionWindow(_In_ HIMC, _Out_ LPCOMPOSITIONFORM);
721 HIMC WINAPI ImmGetContext(_In_ HWND);
722
723 DWORD
724 WINAPI
725 ImmGetConversionListA(
726 _In_ HKL,
727 _In_ HIMC,
728 _In_ LPCSTR lpSrc,
729 _Out_writes_bytes_(dwBufLen) LPCANDIDATELIST lpDst,
730 _In_ DWORD dwBufLen,
731 _In_ UINT uFlag);
732
733 DWORD
734 WINAPI
735 ImmGetConversionListW(
736 _In_ HKL,
737 _In_ HIMC,
738 _In_ LPCWSTR lpSrc,
739 _Out_writes_bytes_(dwBufLen) LPCANDIDATELIST lpDst,
740 _In_ DWORD dwBufLen,
741 _In_ UINT uFlag);
742
743 #define ImmGetConversionList WINELIB_NAME_AW(ImmGetConversionList)
744
745 BOOL
746 WINAPI
747 ImmGetConversionStatus(
748 _In_ HIMC,
749 _Out_opt_ LPDWORD lpfdwConversion,
750 _Out_opt_ LPDWORD lpfdwSentence);
751
752 HWND WINAPI ImmGetDefaultIMEWnd(_In_ HWND);
753
754 UINT
755 WINAPI
756 ImmGetDescriptionA(
757 _In_ HKL,
758 _Out_writes_opt_(uBufLen) LPSTR lpszDescription,
759 _In_ UINT uBufLen);
760
761 UINT
762 WINAPI
763 ImmGetDescriptionW(
764 _In_ HKL,
765 _Out_writes_opt_(uBufLen) LPWSTR lpszDescription,
766 _In_ UINT uBufLen);
767
768 #define ImmGetDescription WINELIB_NAME_AW(ImmGetDescription)
769
770 DWORD
771 WINAPI
772 ImmGetGuideLineA(
773 _In_ HIMC,
774 _In_ DWORD dwIndex,
775 _Out_writes_bytes_opt_(dwBufLen) LPSTR lpBuf,
776 _In_ DWORD dwBufLen);
777
778 DWORD
779 WINAPI
780 ImmGetGuideLineW(
781 _In_ HIMC,
782 _In_ DWORD dwIndex,
783 _Out_writes_bytes_opt_(dwBufLen) LPWSTR lpBuf,
784 _In_ DWORD dwBufLen);
785
786 #define ImmGetGuideLine WINELIB_NAME_AW(ImmGetGuideLine)
787
788 UINT
789 WINAPI
790 ImmGetIMEFileNameA(
791 _In_ HKL,
792 _Out_writes_opt_(uBufLen) LPSTR lpszFileName,
793 _In_ UINT uBufLen);
794
795 UINT
796 WINAPI
797 ImmGetIMEFileNameW(
798 _In_ HKL,
799 _Out_writes_opt_(uBufLen) LPWSTR lpszFileName,
800 _In_ UINT uBufLen);
801
802 #define ImmGetIMEFileName WINELIB_NAME_AW(ImmGetIMEFileName)
803
804 DWORD
805 WINAPI
806 ImmGetImeMenuItemsA(
807 _In_ HIMC,
808 _In_ DWORD,
809 _In_ DWORD,
810 _Out_opt_ LPIMEMENUITEMINFOA lpImeParentMenu,
811 _Out_writes_bytes_opt_(dwSize) LPIMEMENUITEMINFOA lpImeMenu,
812 _In_ DWORD dwSize);
813
814 DWORD
815 WINAPI
816 ImmGetImeMenuItemsW(
817 _In_ HIMC,
818 _In_ DWORD,
819 _In_ DWORD,
820 _Out_opt_ LPIMEMENUITEMINFOW lpImeParentMenu,
821 _Out_writes_bytes_opt_(dwSize) LPIMEMENUITEMINFOW lpImeMenu,
822 _In_ DWORD dwSize);
823
824 #define ImmGetImeMenuItems WINELIB_NAME_AW(ImmGetImeMenuItems)
825
826 BOOL WINAPI ImmGetOpenStatus(_In_ HIMC);
827 DWORD WINAPI ImmGetProperty(_In_ HKL, _In_ DWORD);
828
829 UINT
830 WINAPI
831 ImmGetRegisterWordStyleA(
832 _In_ HKL,
833 _In_ UINT nItem,
834 _Out_writes_(nItem) LPSTYLEBUFA lpStyleBuf);
835
836 UINT
837 WINAPI
838 ImmGetRegisterWordStyleW(
839 _In_ HKL,
840 _In_ UINT nItem,
841 _Out_writes_(nItem) LPSTYLEBUFW lpStyleBuf);
842
843 #define ImmGetRegisterWordStyle WINELIB_NAME_AW(ImmGetRegisterWordStyle)
844
845 BOOL WINAPI ImmGetStatusWindowPos(_In_ HIMC, _Out_ LPPOINT);
846 UINT WINAPI ImmGetVirtualKey(_In_ HWND);
847
848 HKL WINAPI ImmInstallIMEA(_In_ LPCSTR, _In_ LPCSTR);
849 HKL WINAPI ImmInstallIMEW(_In_ LPCWSTR, _In_ LPCWSTR);
850 #define ImmInstallIME WINELIB_NAME_AW(ImmInstallIME)
851
852 BOOL WINAPI ImmIsIME(_In_ HKL);
853
854 BOOL WINAPI ImmIsUIMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM);
855 BOOL WINAPI ImmIsUIMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM);
856 #define ImmIsUIMessage WINELIB_NAME_AW(ImmIsUIMessage)
857
858 BOOL WINAPI ImmNotifyIME(_In_ HIMC, _In_ DWORD, _In_ DWORD, _In_ DWORD);
859
860 DWORD WINAPI ImmProcessKey(HWND, HKL, UINT, LPARAM, DWORD);
861
862 BOOL
863 WINAPI
864 ImmRegisterWordA(
865 _In_ HKL,
866 _In_ LPCSTR lpszReading,
867 _In_ DWORD,
868 _In_ LPCSTR lpszRegister);
869
870 BOOL
871 WINAPI
872 ImmRegisterWordW(
873 _In_ HKL,
874 _In_ LPCWSTR lpszReading,
875 _In_ DWORD,
876 _In_ LPCWSTR lpszRegister);
877
878 #define ImmRegisterWord WINELIB_NAME_AW(ImmRegisterWord)
879
880 BOOL WINAPI ImmReleaseContext(_In_ HWND, _In_ HIMC);
881 BOOL WINAPI ImmSetCandidateWindow(_In_ HIMC, _In_ LPCANDIDATEFORM);
882
883 BOOL
884 WINAPI
885 ImmSetCompositionStringA(
886 _In_ HIMC,
887 _In_ DWORD dwIndex,
888 _In_reads_bytes_opt_(dwCompLen) LPCVOID lpComp,
889 _In_ DWORD dwCompLen,
890 _In_reads_bytes_opt_(dwReadLen) LPCVOID lpRead,
891 _In_ DWORD dwReadLen);
892
893 BOOL
894 WINAPI
895 ImmSetCompositionStringW(
896 _In_ HIMC,
897 _In_ DWORD dwIndex,
898 _In_reads_bytes_opt_(dwCompLen) LPCVOID lpComp,
899 _In_ DWORD dwCompLen,
900 _In_reads_bytes_opt_(dwReadLen) LPCVOID lpRead,
901 _In_ DWORD dwReadLen);
902
903 #define ImmSetCompositionString WINELIB_NAME_AW(ImmSetCompositionString)
904
905 BOOL WINAPI ImmSetCompositionWindow(_In_ HIMC, _In_ LPCOMPOSITIONFORM);
906 BOOL WINAPI ImmSetConversionStatus(_In_ HIMC, _In_ DWORD, _In_ DWORD);
907 BOOL WINAPI ImmSetOpenStatus(_In_ HIMC, _In_ BOOL);
908 BOOL WINAPI ImmSetStatusWindowPos(_In_ HIMC, _In_ LPPOINT);
909 BOOL WINAPI ImmSimulateHotKey(_In_ HWND, _In_ DWORD);
910
911 BOOL
912 WINAPI
913 ImmUnregisterWordA(
914 _In_ HKL,
915 _In_ LPCSTR lpszReading,
916 _In_ DWORD,
917 _In_ LPCSTR lpszUnregister);
918
919 BOOL
920 WINAPI
921 ImmUnregisterWordW(
922 _In_ HKL,
923 _In_ LPCWSTR lpszReading,
924 _In_ DWORD,
925 _In_ LPCWSTR lpszUnregister);
926
927 #define ImmUnregisterWord WINELIB_NAME_AW(ImmUnregisterWord)
928
929
930 #ifdef __cplusplus
931 }
932 #endif
933
934 #endif /* __WINE_IMM_H */