Fixed SearchPathA return value.
[wine] / include / imm.h
1 /*
2  *      imm.h   -       Declarations for IMM32
3  */
4
5 #ifndef __WINE_IMM_H
6 #define __WINE_IMM_H
7
8 #include "windef.h"
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 typedef HANDLE HIMC;
15 typedef HANDLE HIMCC;
16
17
18 typedef int (CALLBACK *REGISTERWORDENUMPROCA)(LPCSTR, DWORD, LPCSTR, LPVOID);
19 typedef int (CALLBACK *REGISTERWORDENUMPROCW)(LPCWSTR, DWORD, LPCWSTR, LPVOID);
20
21 typedef struct tagCANDIDATEFORM
22 {
23                                 DWORD   dwIndex;
24                                 DWORD   dwStyle;
25                                 POINT ptCurrentPos;
26                                 RECT  rcArea;
27 } CANDIDATEFORM, *LPCANDIDATEFORM;
28
29 typedef struct tagCANDIDATELIST
30 {
31                                 DWORD dwSize;
32                                 DWORD dwStyle;
33                                 DWORD dwCount;
34                                 DWORD dwSelection;
35                                 DWORD dwPageStart;
36                                 DWORD dwPageSize;
37                                 DWORD dwOffset[1];
38 } CANDIDATELIST, *LPCANDIDATELIST;
39
40 typedef struct tagSTYLEBUFA
41 {
42                                 DWORD dwStyle;
43                                 CHAR  szDescription[32];
44 } STYLEBUFA, *LPSTYLEBUFA;
45
46 typedef struct tagSTYLEBUFW
47 {
48                                 DWORD dwStyle;
49                                 WCHAR  szDescription[32];
50 } STYLEBUFW, *LPSTYLEBUFW;
51
52 DECL_WINELIB_TYPE_AW(STYLEBUF)
53 DECL_WINELIB_TYPE_AW(LPSTYLEBUF)
54
55 typedef struct _tagCOMPOSITIONFORM
56 {
57                                 DWORD   dwStyle;
58                                 POINT ptCurrentPos;
59                                 RECT  rcArea;
60 } COMPOSITIONFORM, *LPCOMPOSITIONFORM;
61
62 // wParam for WM_IME_CONTROL
63 #define IMC_GETCANDIDATEPOS             0x0007
64 #define IMC_SETCANDIDATEPOS             0x0008
65 #define IMC_GETCOMPOSITIONFONT          0x0009
66 #define IMC_SETCOMPOSITIONFONT          0x000A
67 #define IMC_GETCOMPOSITIONWINDOW        0x000B
68 #define IMC_SETCOMPOSITIONWINDOW        0x000C
69 #define IMC_GETSTATUSWINDOWPOS          0x000F
70 #define IMC_SETSTATUSWINDOWPOS          0x0010
71 #define IMC_CLOSESTATUSWINDOW           0x0021
72 #define IMC_OPENSTATUSWINDOW            0x0022
73
74 // wParam for WM_IME_CONTROL to the soft keyboard
75 // dwAction for ImmNotifyIME
76 #define NI_OPENCANDIDATE                0x0010
77 #define NI_CLOSECANDIDATE               0x0011
78 #define NI_SELECTCANDIDATESTR           0x0012
79 #define NI_CHANGECANDIDATELIST          0x0013
80 #define NI_FINALIZECONVERSIONRESULT     0x0014
81 #define NI_COMPOSITIONSTR               0x0015
82 #define NI_SETCANDIDATE_PAGESTART       0x0016
83 #define NI_SETCANDIDATE_PAGESIZE        0x0017
84
85 // lParam for WM_IME_SETCONTEXT
86 #define ISC_SHOWUICANDIDATEWINDOW       0x00000001
87 #define ISC_SHOWUICOMPOSITIONWINDOW     0x80000000
88 #define ISC_SHOWUIGUIDELINE             0x40000000
89 #define ISC_SHOWUIALLCANDIDATEWINDOW    0x0000000F
90 #define ISC_SHOWUIALL                   0xC000000F
91
92
93 // dwIndex for ImmNotifyIME/NI_COMPOSITIONSTR
94 #define CPS_COMPLETE                    0x0001
95 #define CPS_CONVERT                     0x0002
96 #define CPS_REVERT                      0x0003
97 #define CPS_CANCEL                      0x0004
98
99
100 // the modifiers of hot key
101 #define MOD_ALT                         0x0001
102 #define MOD_CONTROL                     0x0002
103 #define MOD_SHIFT                       0x0004
104
105 #define MOD_LEFT                        0x8000
106 #define MOD_RIGHT                       0x4000
107
108 #define MOD_ON_KEYUP                    0x0800
109 #define MOD_IGNORE_ALL_MODIFIER         0x0400
110
111
112 // Windows for Simplified Chinese Edition hot key ID from 0x10 - 0x2F
113 #define IME_CHOTKEY_IME_NONIME_TOGGLE           0x10
114 #define IME_CHOTKEY_SHAPE_TOGGLE                0x11
115 #define IME_CHOTKEY_SYMBOL_TOGGLE               0x12
116
117 // Windows for Japanese Edition hot key ID from 0x30 - 0x4F
118 #define IME_JHOTKEY_CLOSE_OPEN                  0x30
119
120 // Windows for Korean Edition hot key ID from 0x50 - 0x6F
121 #define IME_KHOTKEY_SHAPE_TOGGLE                0x50
122 #define IME_KHOTKEY_HANJACONVERT                0x51
123 #define IME_KHOTKEY_ENGLISH                     0x52
124 // Windows for Tranditional Chinese Edition hot key ID from 0x70 - 0x8F
125 #define IME_THOTKEY_IME_NONIME_TOGGLE           0x70
126 #define IME_THOTKEY_SHAPE_TOGGLE                0x71
127 #define IME_THOTKEY_SYMBOL_TOGGLE               0x72
128
129 // direct switch hot key ID from 0x100 - 0x11F
130 #define IME_HOTKEY_DSWITCH_FIRST                0x100
131 #define IME_HOTKEY_DSWITCH_LAST                 0x11F
132
133 // IME private hot key from 0x200 - 0x21F
134 #define IME_HOTKEY_PRIVATE_FIRST                0x200
135 #define IME_ITHOTKEY_RESEND_RESULTSTR           0x200
136 #define IME_ITHOTKEY_PREVIOUS_COMPOSITION       0x201
137 #define IME_ITHOTKEY_UISTYLE_TOGGLE             0x202
138 #define IME_HOTKEY_PRIVATE_LAST                 0x21F
139
140
141 // dwSystemInfoFlags bits
142 // parameter of ImmGetCompositionString
143 #define GCS_COMPREADSTR                 0x0001
144 #define GCS_COMPREADATTR                0x0002
145 #define GCS_COMPREADCLAUSE              0x0004
146 #define GCS_COMPSTR                     0x0008
147 #define GCS_COMPATTR                    0x0010
148 #define GCS_COMPCLAUSE                  0x0020
149 #define GCS_CURSORPOS                   0x0080
150 #define GCS_DELTASTART                  0x0100
151 #define GCS_RESULTREADSTR               0x0200
152 #define GCS_RESULTREADCLAUSE            0x0400
153 #define GCS_RESULTSTR                   0x0800
154 #define GCS_RESULTCLAUSE                0x1000
155
156 // style bit flags for WM_IME_COMPOSITION
157 #define CS_INSERTCHAR                   0x2000
158 #define CS_NOMOVECARET                  0x4000
159
160
161 // bits of fdwInit of INPUTCONTEXT
162 // IME version constants
163 #define IMEVER_0310                     0x0003000A
164 #define IMEVER_0400                     0x00040000
165
166
167 // IME property bits
168 #define IME_PROP_AT_CARET               0x00010000
169 #define IME_PROP_SPECIAL_UI             0x00020000
170 #define IME_PROP_CANDLIST_START_FROM_1  0x00040000
171 #define IME_PROP_UNICODE                0x00080000
172
173
174 // IME UICapability bits
175 #define UI_CAP_2700                     0x00000001
176 #define UI_CAP_ROT90                    0x00000002
177 #define UI_CAP_ROTANY                   0x00000004
178 // ImmSetCompositionString Capability bits
179 #define SCS_CAP_COMPSTR                 0x00000001
180 #define SCS_CAP_MAKEREAD                0x00000002
181
182
183 // IME WM_IME_SELECT inheritance Capability bits
184 #define SELECT_CAP_CONVERSION           0x00000001
185 #define SELECT_CAP_SENTENCE             0x00000002
186
187
188 // ID for deIndex of ImmGetGuideLine
189 #define GGL_LEVEL                       0x00000001
190 #define GGL_INDEX                       0x00000002
191 #define GGL_STRING                      0x00000003
192 #define GGL_PRIVATE                     0x00000004
193
194 // ID for dwLevel of GUIDELINE Structure
195 #define GL_LEVEL_NOGUIDELINE            0x00000000
196 #define GL_LEVEL_FATAL                  0x00000001
197 #define GL_LEVEL_ERROR                  0x00000002
198 #define GL_LEVEL_WARNING                0x00000003
199 #define GL_LEVEL_INFORMATION            0x00000004
200
201 // ID for dwIndex of GUIDELINE Structure
202 #define GL_ID_UNKNOWN                   0x00000000
203 #define GL_ID_NOMODULE                  0x00000001
204 #define GL_ID_NODICTIONARY              0x00000010
205 #define GL_ID_CANNOTSAVE                0x00000011
206 #define GL_ID_NOCONVERT                 0x00000020
207 #define GL_ID_TYPINGERROR               0x00000021
208 #define GL_ID_TOOMANYSTROKE             0x00000022
209 #define GL_ID_READINGCONFLICT           0x00000023
210 #define GL_ID_INPUTREADING              0x00000024
211 #define GL_ID_INPUTRADICAL              0x00000025
212 #define GL_ID_INPUTCODE                 0x00000026
213 #define GL_ID_INPUTSYMBOL               0x00000027
214 #define GL_ID_CHOOSECANDIDATE           0x00000028
215 #define GL_ID_REVERSECONVERSION         0x00000029
216 #define GL_ID_PRIVATE_FIRST             0x00008000
217 #define GL_ID_PRIVATE_LAST              0x0000FFFF
218
219 // ID for dwIndex of ImmGetProperty
220 #define IGP_GETIMEVERSION               (DWORD)(-4)
221 #define IGP_PROPERTY                    0x00000004
222 #define IGP_CONVERSION                  0x00000008
223 #define IGP_SENTENCE                    0x0000000c
224 #define IGP_UI                          0x00000010
225 #define IGP_SETCOMPSTR                  0x00000014
226 #define IGP_SELECT                      0x00000018
227
228
229 // dwIndex for ImmSetCompositionString API
230 #define SCS_SETSTR          (GCS_COMPREADSTR|GCS_COMPSTR)
231 #define SCS_CHANGEATTR      (GCS_COMPREADATTR|GCS_COMPATTR)
232 #define SCS_CHANGECLAUSE    (GCS_COMPREADCLAUSE|GCS_COMPCLAUSE)
233 // attribute for COMPOSITIONSTRING Structure
234 #define ATTR_INPUT                      0x00
235 #define ATTR_TARGET_CONVERTED           0x01
236 #define ATTR_CONVERTED                  0x02
237 #define ATTR_TARGET_NOTCONVERTED        0x03
238 #define ATTR_INPUT_ERROR                0x04
239
240
241 // bit field for IMC_SETCOMPOSITIONWINDOW, IMC_SETCANDIDATEWINDOW
242 #define CFS_DEFAULT                     0x0000
243 #define CFS_RECT                        0x0001
244 #define CFS_POINT                       0x0002
245 #define CFS_FORCE_POSITION              0x0020
246 #define CFS_CANDIDATEPOS                0x0040
247 #define CFS_EXCLUDE                     0x0080
248
249 // conversion direction for ImmGetConversionList
250 #define GCL_CONVERSION                  0x0001
251 #define GCL_REVERSECONVERSION           0x0002
252 #define GCL_REVERSE_LENGTH              0x0003
253
254
255 // bit field for conversion mode
256 #define IME_CMODE_ALPHANUMERIC          0x0000
257 #define IME_CMODE_NATIVE                0x0001
258 #define IME_CMODE_CHINESE               IME_CMODE_NATIVE
259 // IME_CMODE_HANGEUL is old name of IME_CMODE_HANGUL. It will be gone eventually.
260 #define IME_CMODE_HANGEUL               IME_CMODE_NATIVE
261 #define IME_CMODE_HANGUL                IME_CMODE_NATIVE
262 #define IME_CMODE_JAPANESE              IME_CMODE_NATIVE
263 #define IME_CMODE_KATAKANA              0x0002  // only effect under IME_CMODE_NATIVE
264 #define IME_CMODE_LANGUAGE              0x0003
265 #define IME_CMODE_FULLSHAPE             0x0008
266 #define IME_CMODE_ROMAN                 0x0010
267 #define IME_CMODE_CHARCODE              0x0020
268 #define IME_CMODE_HANJACONVERT          0x0040
269 #define IME_CMODE_SOFTKBD               0x0080
270 #define IME_CMODE_NOCONVERSION          0x0100
271 #define IME_CMODE_EUDC                  0x0200
272 #define IME_CMODE_SYMBOL                0x0400
273
274
275 #define IME_SMODE_NONE                  0x0000
276 #define IME_SMODE_PLAURALCLAUSE         0x0001
277 #define IME_SMODE_SINGLECONVERT         0x0002
278 #define IME_SMODE_AUTOMATIC             0x0004
279 #define IME_SMODE_PHRASEPREDICT         0x0008
280
281 // style of candidate
282 #define IME_CAND_UNKNOWN                0x0000
283 #define IME_CAND_READ                   0x0001
284 #define IME_CAND_CODE                   0x0002
285 #define IME_CAND_MEANING                0x0003
286 #define IME_CAND_RADICAL                0x0004
287 #define IME_CAND_STROKE                 0x0005
288
289
290 // wParam of report message WM_IME_NOTIFY
291 #define IMN_CLOSESTATUSWINDOW           0x0001
292 #define IMN_OPENSTATUSWINDOW            0x0002
293 #define IMN_CHANGECANDIDATE             0x0003
294 #define IMN_CLOSECANDIDATE              0x0004
295 #define IMN_OPENCANDIDATE               0x0005
296 #define IMN_SETCONVERSIONMODE           0x0006
297 #define IMN_SETSENTENCEMODE             0x0007
298 #define IMN_SETOPENSTATUS               0x0008
299 #define IMN_SETCANDIDATEPOS             0x0009
300 #define IMN_SETCOMPOSITIONFONT          0x000A
301 #define IMN_SETCOMPOSITIONWINDOW        0x000B
302 #define IMN_SETSTATUSWINDOWPOS          0x000C
303 #define IMN_GUIDELINE                   0x000D
304 #define IMN_PRIVATE                     0x000E
305
306
307 // error code of ImmGetCompositionString
308 #define IMM_ERROR_NODATA                (-1)
309 #define IMM_ERROR_GENERAL               (-2)
310
311
312 // dialog mode of ImmConfigureIME
313 #define IME_CONFIG_GENERAL              1
314 #define IME_CONFIG_REGISTERWORD         2
315 #define IME_CONFIG_SELECTDICTIONARY     3
316
317 // dialog mode of ImmEscape
318 #define IME_ESC_QUERY_SUPPORT           0x0003
319 #define IME_ESC_RESERVED_FIRST          0x0004
320 #define IME_ESC_RESERVED_LAST           0x07FF
321 #define IME_ESC_PRIVATE_FIRST           0x0800
322 #define IME_ESC_PRIVATE_LAST            0x0FFF
323 #define IME_ESC_SEQUENCE_TO_INTERNAL    0x1001
324 #define IME_ESC_GET_EUDC_DICTIONARY     0x1003
325 #define IME_ESC_SET_EUDC_DICTIONARY     0x1004
326 #define IME_ESC_MAX_KEY                 0x1005
327 #define IME_ESC_IME_NAME                0x1006
328 #define IME_ESC_SYNC_HOTKEY             0x1007
329 #define IME_ESC_HANJA_MODE              0x1008
330 #define IME_ESC_AUTOMATA                0x1009
331 #define IME_ESC_PRIVATE_HOTKEY          0x100a
332
333
334 // style of word registration
335 #define IME_REGWORD_STYLE_EUDC          0x00000001
336 #define IME_REGWORD_STYLE_USER_FIRST    0x80000000
337 #define IME_REGWORD_STYLE_USER_LAST     0xFFFFFFFF
338
339 // type of soft keyboard
340 // for Windows Tranditional Chinese Edition
341 #define SOFTKEYBOARD_TYPE_T1            0x0001
342 // for Windows Simplified Chinese Edition
343 #define SOFTKEYBOARD_TYPE_C1            0x0002
344
345
346 HIMC   WINAPI ImmAssociateContext(HWND, HIMC);
347 BOOL   WINAPI ImmConfigureIMEA(HKL, HWND, DWORD, LPVOID);
348 BOOL   WINAPI ImmConfigureIMEW(HKL, HWND, DWORD, LPVOID);
349 #define  ImmConfigureIME WINELIB_NAME_AW(ImmConfigureIME)
350 HIMC   WINAPI ImmCreateContext();
351 BOOL   WINAPI ImmDestroyContext(HIMC hIMC);
352 UINT   WINAPI ImmEnumRegisterWordA(HKL, REGISTERWORDENUMPROCA, LPCSTR, DWORD, LPCSTR, LPVOID);
353 UINT   WINAPI ImmEnumRegisterWordW(HKL, REGISTERWORDENUMPROCW, LPCWSTR, DWORD, LPCWSTR, LPVOID);
354 #define  ImmEnumRegisterWord WINELIB_NAME_AW(ImmEnumRegisterWord)
355 LRESULT  WINAPI ImmEscapeA(HKL, HIMC, UINT, LPVOID);
356 LRESULT  WINAPI ImmEscapeW(HKL, HIMC, UINT, LPVOID);
357 #define  ImmEscape WINELIB_NAME_AW(ImmEscape)
358 DWORD    WINAPI ImmGetCandidateListA(HIMC, DWORD, LPCANDIDATELIST, DWORD);
359 DWORD    WINAPI ImmGetCandidateListW(HIMC, DWORD, LPCANDIDATELIST, DWORD);
360 #define  ImmGetCandidateList WINELIB_NAME_AW(ImmGetCandidateList)
361 DWORD    WINAPI ImmGetCandidateListCountA(HIMC, LPDWORD);
362 DWORD    WINAPI ImmGetCandidateListCountW(HIMC, LPDWORD);
363 #define  ImmGetCandidateListCount WINELIB_NAME_AW(ImmGetCandidateListCount)
364 BOOL   WINAPI ImmGetCandidateWindow(HIMC, DWORD, LPCANDIDATEFORM);
365 BOOL   WINAPI ImmGetCompositionFontA(HIMC, LPLOGFONTA);
366 BOOL   WINAPI ImmGetCompositionFontW(HIMC, LPLOGFONTW);
367 #define  ImmGetCompositionFont WINELIB_NAME_AW(ImmGetCompositionFont)
368 LONG     WINAPI ImmGetCompositionStringA(HIMC, DWORD, LPVOID, DWORD);
369 LONG     WINAPI ImmGetCompositionStringW(HIMC, DWORD, LPVOID, DWORD);
370 #define  ImmGetCompositionString WINELIB_NAME_AW(ImmGetCompositionString)
371 BOOL   WINAPI ImmGetCompositionWindow(HIMC, LPCOMPOSITIONFORM);
372 HIMC   WINAPI ImmGetContext(HWND);
373 DWORD    WINAPI ImmGetConversionListA(HKL, HIMC, LPCSTR, LPCANDIDATELIST, DWORD, UINT);
374 DWORD    WINAPI ImmGetConversionListW(HKL, HIMC, LPCWSTR, LPCANDIDATELIST, DWORD, UINT);
375 #define  ImmGetConversionList WINELIB_NAME_AW(ImmGetConversionList)
376 BOOL   WINAPI ImmGetConversionStatus(HIMC, LPDWORD, LPDWORD);
377 HWND   WINAPI ImmGetDefaultIMEWnd(HWND);
378 UINT   WINAPI ImmGetDescriptionA(HKL, LPSTR, UINT);
379 UINT   WINAPI ImmGetDescriptionW(HKL, LPWSTR, UINT);
380 #define  ImmGetDescription WINELIB_NAME_AW(ImmGetDescription)
381 DWORD    WINAPI ImmGetGuideLineA(HIMC, DWORD, LPSTR, DWORD);
382 DWORD    WINAPI ImmGetGuideLineW(HIMC, DWORD, LPWSTR, DWORD);
383 #define  ImmGetGuideLine WINELIB_NAME_AW(ImmGetGuideLine)
384 UINT   WINAPI ImmGetIMEFileNameA(HKL, LPSTR, UINT);
385 UINT   WINAPI ImmGetIMEFileNameW(HKL, LPWSTR, UINT);
386 #define  ImmGetIMEFileName WINELIB_NAME_AW(ImmGetIMEFileName)
387 BOOL   WINAPI ImmGetOpenStatus(HIMC);
388 DWORD    WINAPI ImmGetProperty(HKL, DWORD);
389 UINT   WINAPI ImmGetRegisterWordStyleA(HKL, UINT, LPSTYLEBUFA);
390 UINT   WINAPI ImmGetRegisterWordStyleW(HKL, UINT, LPSTYLEBUFW);
391 #define  ImmGetRegisterWordStyle WINELIB_NAME_AW(ImmGetRegisterWordStyle)
392 BOOL   WINAPI ImmGetStatusWindowPos(HIMC, LPPOINT);
393 UINT   WINAPI ImmGetVirtualKey(HWND);
394 HKL    WINAPI ImmInstallIMEA(LPCSTR, LPCSTR);
395 HKL    WINAPI ImmInstallIMEW(LPCWSTR, LPCWSTR);
396 #define  ImmInstallIME WINELIB_NAME_AW(ImmInstallIME)
397 BOOL   WINAPI ImmIsIME(HKL);
398 BOOL   WINAPI ImmIsUIMessageA(HWND, UINT, WPARAM, LPARAM);
399 BOOL   WINAPI ImmIsUIMessageW(HWND, UINT, WPARAM, LPARAM);
400 #define  ImmIsUIMessage WINELIB_NAME_AW(ImmIsUIMessage)
401 BOOL   WINAPI ImmNotifyIME(HIMC, DWORD, DWORD, DWORD);
402 BOOL   WINAPI ImmRegisterWordA(HKL, LPCSTR, DWORD, LPCSTR);
403 BOOL   WINAPI ImmRegisterWordW(HKL, LPCWSTR, DWORD, LPCWSTR);
404 #define  ImmRegisterWord WINELIB_NAME_AW(ImmRegisterWord)
405 BOOL   WINAPI ImmReleaseContext(HWND, HIMC);
406 BOOL   WINAPI ImmSetCandidateWindow(HIMC, LPCANDIDATEFORM);
407 BOOL   WINAPI ImmSetCompositionFontA(HIMC, LPLOGFONTA);
408 BOOL   WINAPI ImmSetCompositionFontW(HIMC, LPLOGFONTW);
409 #define  ImmSetCompositionFont WINELIB_NAME_AW(ImmSetCompositionFont)
410 BOOL   WINAPI ImmSetCompositionStringA(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
411 BOOL   WINAPI ImmSetCompositionStringW(HIMC, DWORD, LPCVOID, DWORD, LPCVOID, DWORD);
412 #define  ImmSetCompositionString WINELIB_NAME_AW(ImmSetCompositionString)
413 BOOL   WINAPI ImmSetCompositionWindow(HIMC, LPCOMPOSITIONFORM);
414 BOOL   WINAPI ImmSetConversionStatus(HIMC, DWORD, DWORD);
415 BOOL   WINAPI ImmSetOpenStatus(HIMC, BOOL);
416 BOOL   WINAPI ImmSetStatusWindowPos(HIMC, LPPOINT);
417 BOOL   WINAPI ImmSimulateHotKey(HWND, DWORD);
418 BOOL   WINAPI ImmUnregisterWordA(HKL, LPCSTR, DWORD, LPCSTR);
419 BOOL   WINAPI ImmUnregisterWordW(HKL, LPCWSTR, DWORD, LPCWSTR);
420 #define  ImmUnregisterWord WINELIB_NAME_AW(ImmUnregisterWord)
421
422 #ifdef __cplusplus
423 }
424 #endif
425
426 #endif  /* __WINE_IMM_H */