30ce15f9d2b9aa400efaac11c23bc05f7f41c57f
[reactos.git] / reactos / dll / win32 / msimtf / activeimmapp.c
1 /*
2 * ActiveIMMApp Interface
3 *
4 * Copyright 2008 CodeWeavers, Aric Stewart
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 #include "precomp.h"
22
23 typedef struct tagActiveIMMApp {
24 IActiveIMMApp IActiveIMMApp_iface;
25 LONG refCount;
26 } ActiveIMMApp;
27
28 static inline ActiveIMMApp *impl_from_IActiveIMMApp(IActiveIMMApp *iface)
29 {
30 return CONTAINING_RECORD(iface, ActiveIMMApp, IActiveIMMApp_iface);
31 }
32
33 static void ActiveIMMApp_Destructor(ActiveIMMApp* This)
34 {
35 TRACE("\n");
36 HeapFree(GetProcessHeap(),0,This);
37 }
38
39 static HRESULT WINAPI ActiveIMMApp_QueryInterface (IActiveIMMApp* iface,
40 REFIID iid, LPVOID *ppvOut)
41 {
42 ActiveIMMApp *This = impl_from_IActiveIMMApp(iface);
43 *ppvOut = NULL;
44
45 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IActiveIMMApp))
46 {
47 *ppvOut = This;
48 }
49
50 if (*ppvOut)
51 {
52 IUnknown_AddRef(iface);
53 return S_OK;
54 }
55
56 WARN("unsupported interface: %s\n", debugstr_guid(iid));
57 return E_NOINTERFACE;
58 }
59
60 static ULONG WINAPI ActiveIMMApp_AddRef(IActiveIMMApp* iface)
61 {
62 ActiveIMMApp *This = impl_from_IActiveIMMApp(iface);
63 return InterlockedIncrement(&This->refCount);
64 }
65
66 static ULONG WINAPI ActiveIMMApp_Release(IActiveIMMApp* iface)
67 {
68 ActiveIMMApp *This = impl_from_IActiveIMMApp(iface);
69 ULONG ret;
70
71 ret = InterlockedDecrement(&This->refCount);
72 if (ret == 0)
73 ActiveIMMApp_Destructor(This);
74 return ret;
75 }
76
77 static HRESULT WINAPI ActiveIMMApp_AssociateContext(IActiveIMMApp* iface,
78 HWND hWnd, HIMC hIME, HIMC *phPrev)
79 {
80 *phPrev = ImmAssociateContext(hWnd,hIME);
81 return S_OK;
82 }
83
84 static HRESULT WINAPI ActiveIMMApp_ConfigureIMEA(IActiveIMMApp* This,
85 HKL hKL, HWND hwnd, DWORD dwMode, REGISTERWORDA *pData)
86 {
87 BOOL rc;
88
89 rc = ImmConfigureIMEA(hKL, hwnd, dwMode, pData);
90 if (rc)
91 return E_FAIL;
92 else
93 return S_OK;
94 }
95
96 static HRESULT WINAPI ActiveIMMApp_ConfigureIMEW(IActiveIMMApp* This,
97 HKL hKL, HWND hWnd, DWORD dwMode, REGISTERWORDW *pData)
98 {
99 BOOL rc;
100
101 rc = ImmConfigureIMEW(hKL, hWnd, dwMode, pData);
102 if (rc)
103 return E_FAIL;
104 else
105 return S_OK;
106 }
107
108 static HRESULT WINAPI ActiveIMMApp_CreateContext(IActiveIMMApp* This,
109 HIMC *phIMC)
110 {
111 *phIMC = ImmCreateContext();
112 if (*phIMC)
113 return S_OK;
114 else
115 return E_FAIL;
116 }
117
118 static HRESULT WINAPI ActiveIMMApp_DestroyContext(IActiveIMMApp* This,
119 HIMC hIME)
120 {
121 BOOL rc;
122
123 rc = ImmDestroyContext(hIME);
124 if (rc)
125 return S_OK;
126 else
127 return E_FAIL;
128 }
129
130 static HRESULT WINAPI ActiveIMMApp_EnumRegisterWordA(IActiveIMMApp* This,
131 HKL hKL, LPSTR szReading, DWORD dwStyle, LPSTR szRegister,
132 LPVOID pData, IEnumRegisterWordA **pEnum)
133 {
134 FIXME("Stub\n");
135 return E_NOTIMPL;
136 }
137
138 static HRESULT WINAPI ActiveIMMApp_EnumRegisterWordW(IActiveIMMApp* This,
139 HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szRegister,
140 LPVOID pData, IEnumRegisterWordW **pEnum)
141 {
142 FIXME("Stub\n");
143 return E_NOTIMPL;
144 }
145
146 static HRESULT WINAPI ActiveIMMApp_EscapeA(IActiveIMMApp* This,
147 HKL hKL, HIMC hIMC, UINT uEscape, LPVOID pData, LRESULT *plResult)
148 {
149 *plResult = ImmEscapeA(hKL, hIMC, uEscape, pData);
150 return S_OK;
151 }
152
153 static HRESULT WINAPI ActiveIMMApp_EscapeW(IActiveIMMApp* This,
154 HKL hKL, HIMC hIMC, UINT uEscape, LPVOID pData, LRESULT *plResult)
155 {
156 *plResult = ImmEscapeW(hKL, hIMC, uEscape, pData);
157 return S_OK;
158 }
159
160 static HRESULT WINAPI ActiveIMMApp_GetCandidateListA(IActiveIMMApp* This,
161 HIMC hIMC, DWORD dwIndex, UINT uBufLen, CANDIDATELIST *pCandList,
162 UINT *puCopied)
163 {
164 *puCopied = ImmGetCandidateListA(hIMC, dwIndex, pCandList, uBufLen);
165 return S_OK;
166 }
167
168 static HRESULT WINAPI ActiveIMMApp_GetCandidateListW(IActiveIMMApp* This,
169 HIMC hIMC, DWORD dwIndex, UINT uBufLen, CANDIDATELIST *pCandList,
170 UINT *puCopied)
171 {
172 *puCopied = ImmGetCandidateListW(hIMC, dwIndex, pCandList, uBufLen);
173 return S_OK;
174 }
175
176 static HRESULT WINAPI ActiveIMMApp_GetCandidateListCountA(IActiveIMMApp* This,
177 HIMC hIMC, DWORD *pdwListSize, DWORD *pdwBufLen)
178 {
179 *pdwBufLen = ImmGetCandidateListCountA(hIMC, pdwListSize);
180 return S_OK;
181 }
182
183 static HRESULT WINAPI ActiveIMMApp_GetCandidateListCountW(IActiveIMMApp* This,
184 HIMC hIMC, DWORD *pdwListSize, DWORD *pdwBufLen)
185 {
186 *pdwBufLen = ImmGetCandidateListCountA(hIMC, pdwListSize);
187 return S_OK;
188 }
189
190 static HRESULT WINAPI ActiveIMMApp_GetCandidateWindow(IActiveIMMApp* This,
191 HIMC hIMC, DWORD dwIndex, CANDIDATEFORM *pCandidate)
192 {
193 BOOL rc;
194 rc = ImmGetCandidateWindow(hIMC,dwIndex,pCandidate);
195 if (rc)
196 return S_OK;
197 else
198 return E_FAIL;
199 }
200
201 static HRESULT WINAPI ActiveIMMApp_GetCompositionFontA(IActiveIMMApp* This,
202 HIMC hIMC, LOGFONTA *plf)
203 {
204 BOOL rc;
205 rc = ImmGetCompositionFontA(hIMC,plf);
206 if (rc)
207 return S_OK;
208 else
209 return E_FAIL;
210 }
211
212 static HRESULT WINAPI ActiveIMMApp_GetCompositionFontW(IActiveIMMApp* This,
213 HIMC hIMC, LOGFONTW *plf)
214 {
215 BOOL rc;
216 rc = ImmGetCompositionFontW(hIMC,plf);
217 if (rc)
218 return S_OK;
219 else
220 return E_FAIL;
221 }
222
223 static HRESULT WINAPI ActiveIMMApp_GetCompositionStringA(IActiveIMMApp* This,
224 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LONG *plCopied, LPVOID pBuf)
225 {
226 *plCopied = ImmGetCompositionStringA(hIMC, dwIndex, pBuf, dwBufLen);
227 return S_OK;
228 }
229
230 static HRESULT WINAPI ActiveIMMApp_GetCompositionStringW(IActiveIMMApp* This,
231 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LONG *plCopied, LPVOID pBuf)
232 {
233 *plCopied = ImmGetCompositionStringW(hIMC, dwIndex, pBuf, dwBufLen);
234 return S_OK;
235 }
236
237 static HRESULT WINAPI ActiveIMMApp_GetCompositionWindow(IActiveIMMApp* This,
238 HIMC hIMC, COMPOSITIONFORM *pCompForm)
239 {
240 BOOL rc;
241
242 rc = ImmGetCompositionWindow(hIMC,pCompForm);
243
244 if (rc)
245 return S_OK;
246 else
247 return E_FAIL;
248 }
249
250 static HRESULT WINAPI ActiveIMMApp_GetContext(IActiveIMMApp* This,
251 HWND hwnd, HIMC *phIMC)
252 {
253 *phIMC = ImmGetContext(hwnd);
254 return S_OK;
255 }
256
257 static HRESULT WINAPI ActiveIMMApp_GetConversionListA(IActiveIMMApp* This,
258 HKL hKL, HIMC hIMC, LPSTR pSrc, UINT uBufLen, UINT uFlag,
259 CANDIDATELIST *pDst, UINT *puCopied)
260 {
261 *puCopied = ImmGetConversionListA(hKL, hIMC, pSrc, pDst, uBufLen, uFlag);
262 return S_OK;
263 }
264
265 static HRESULT WINAPI ActiveIMMApp_GetConversionListW(IActiveIMMApp* This,
266 HKL hKL, HIMC hIMC, LPWSTR pSrc, UINT uBufLen, UINT uFlag,
267 CANDIDATELIST *pDst, UINT *puCopied)
268 {
269 *puCopied = ImmGetConversionListW(hKL, hIMC, pSrc, pDst, uBufLen, uFlag);
270 return S_OK;
271 }
272
273 static HRESULT WINAPI ActiveIMMApp_GetConversionStatus(IActiveIMMApp* This,
274 HIMC hIMC, DWORD *pfdwConversion, DWORD *pfdwSentence)
275 {
276 BOOL rc;
277
278 rc = ImmGetConversionStatus(hIMC, pfdwConversion, pfdwSentence);
279
280 if (rc)
281 return S_OK;
282 else
283 return E_FAIL;
284 }
285
286 static HRESULT WINAPI ActiveIMMApp_GetDefaultIMEWnd(IActiveIMMApp* This,
287 HWND hWnd, HWND *phDefWnd)
288 {
289 *phDefWnd = ImmGetDefaultIMEWnd(hWnd);
290 return S_OK;
291 }
292
293 static HRESULT WINAPI ActiveIMMApp_GetDescriptionA(IActiveIMMApp* This,
294 HKL hKL, UINT uBufLen, LPSTR szDescription, UINT *puCopied)
295 {
296 *puCopied = ImmGetDescriptionA(hKL, szDescription, uBufLen);
297 return S_OK;
298 }
299
300 static HRESULT WINAPI ActiveIMMApp_GetDescriptionW(IActiveIMMApp* This,
301 HKL hKL, UINT uBufLen, LPWSTR szDescription, UINT *puCopied)
302 {
303 *puCopied = ImmGetDescriptionW(hKL, szDescription, uBufLen);
304 return S_OK;
305 }
306
307 static HRESULT WINAPI ActiveIMMApp_GetGuideLineA(IActiveIMMApp* This,
308 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LPSTR pBuf,
309 DWORD *pdwResult)
310 {
311 *pdwResult = ImmGetGuideLineA(hIMC, dwIndex, pBuf, dwBufLen);
312 return S_OK;
313 }
314
315 static HRESULT WINAPI ActiveIMMApp_GetGuideLineW(IActiveIMMApp* This,
316 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LPWSTR pBuf,
317 DWORD *pdwResult)
318 {
319 *pdwResult = ImmGetGuideLineW(hIMC, dwIndex, pBuf, dwBufLen);
320 return S_OK;
321 }
322
323 static HRESULT WINAPI ActiveIMMApp_GetIMEFileNameA(IActiveIMMApp* This,
324 HKL hKL, UINT uBufLen, LPSTR szFileName, UINT *puCopied)
325 {
326 *puCopied = ImmGetIMEFileNameA(hKL, szFileName, uBufLen);
327 return S_OK;
328 }
329
330 static HRESULT WINAPI ActiveIMMApp_GetIMEFileNameW(IActiveIMMApp* This,
331 HKL hKL, UINT uBufLen, LPWSTR szFileName, UINT *puCopied)
332 {
333 *puCopied = ImmGetIMEFileNameW(hKL, szFileName, uBufLen);
334 return S_OK;
335 }
336
337 static HRESULT WINAPI ActiveIMMApp_GetOpenStatus(IActiveIMMApp* This,
338 HIMC hIMC)
339 {
340 return ImmGetOpenStatus(hIMC);
341 }
342
343 static HRESULT WINAPI ActiveIMMApp_GetProperty(IActiveIMMApp* This,
344 HKL hKL, DWORD fdwIndex, DWORD *pdwProperty)
345 {
346 *pdwProperty = ImmGetProperty(hKL, fdwIndex);
347 return S_OK;
348 }
349
350 static HRESULT WINAPI ActiveIMMApp_GetRegisterWordStyleA(IActiveIMMApp* This,
351 HKL hKL, UINT nItem, STYLEBUFA *pStyleBuf, UINT *puCopied)
352 {
353 *puCopied = ImmGetRegisterWordStyleA(hKL, nItem, pStyleBuf);
354 return S_OK;
355 }
356
357 static HRESULT WINAPI ActiveIMMApp_GetRegisterWordStyleW(IActiveIMMApp* This,
358 HKL hKL, UINT nItem, STYLEBUFW *pStyleBuf, UINT *puCopied)
359 {
360 *puCopied = ImmGetRegisterWordStyleW(hKL, nItem, pStyleBuf);
361 return S_OK;
362 }
363
364 static HRESULT WINAPI ActiveIMMApp_GetStatusWindowPos(IActiveIMMApp* This,
365 HIMC hIMC, POINT *pptPos)
366 {
367 BOOL rc;
368 rc = ImmGetStatusWindowPos(hIMC, pptPos);
369
370 if (rc)
371 return S_OK;
372 else
373 return E_FAIL;
374 }
375
376 static HRESULT WINAPI ActiveIMMApp_GetVirtualKey(IActiveIMMApp* This,
377 HWND hWnd, UINT *puVirtualKey)
378 {
379 *puVirtualKey = ImmGetVirtualKey(hWnd);
380 return S_OK;
381 }
382
383 static HRESULT WINAPI ActiveIMMApp_InstallIMEA(IActiveIMMApp* This,
384 LPSTR szIMEFileName, LPSTR szLayoutText, HKL *phKL)
385 {
386 *phKL = ImmInstallIMEA(szIMEFileName,szLayoutText);
387 return S_OK;
388 }
389
390 static HRESULT WINAPI ActiveIMMApp_InstallIMEW(IActiveIMMApp* This,
391 LPWSTR szIMEFileName, LPWSTR szLayoutText, HKL *phKL)
392 {
393 *phKL = ImmInstallIMEW(szIMEFileName,szLayoutText);
394 return S_OK;
395 }
396
397 static HRESULT WINAPI ActiveIMMApp_IsIME(IActiveIMMApp* This,
398 HKL hKL)
399 {
400 return ImmIsIME(hKL);
401 }
402
403 static HRESULT WINAPI ActiveIMMApp_IsUIMessageA(IActiveIMMApp* This,
404 HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
405 {
406 return ImmIsUIMessageA(hWndIME,msg,wParam,lParam);
407 }
408
409 static HRESULT WINAPI ActiveIMMApp_IsUIMessageW(IActiveIMMApp* This,
410 HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
411 {
412 return ImmIsUIMessageW(hWndIME,msg,wParam,lParam);
413 }
414
415 static HRESULT WINAPI ActiveIMMApp_NotifyIME(IActiveIMMApp* This,
416 HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
417 {
418 BOOL rc;
419
420 rc = ImmNotifyIME(hIMC,dwAction,dwIndex,dwValue);
421
422 if (rc)
423 return S_OK;
424 else
425 return E_FAIL;
426 }
427
428 static HRESULT WINAPI ActiveIMMApp_RegisterWordA(IActiveIMMApp* This,
429 HKL hKL, LPSTR szReading, DWORD dwStyle, LPSTR szRegister)
430 {
431 BOOL rc;
432
433 rc = ImmRegisterWordA(hKL,szReading,dwStyle,szRegister);
434
435 if (rc)
436 return S_OK;
437 else
438 return E_FAIL;
439 }
440
441 static HRESULT WINAPI ActiveIMMApp_RegisterWordW(IActiveIMMApp* This,
442 HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szRegister)
443 {
444 BOOL rc;
445
446 rc = ImmRegisterWordW(hKL,szReading,dwStyle,szRegister);
447
448 if (rc)
449 return S_OK;
450 else
451 return E_FAIL;
452 }
453
454 static HRESULT WINAPI ActiveIMMApp_ReleaseContext(IActiveIMMApp* This,
455 HWND hWnd, HIMC hIMC)
456 {
457 BOOL rc;
458
459 rc = ImmReleaseContext(hWnd,hIMC);
460
461 if (rc)
462 return S_OK;
463 else
464 return E_FAIL;
465 }
466
467 static HRESULT WINAPI ActiveIMMApp_SetCandidateWindow(IActiveIMMApp* This,
468 HIMC hIMC, CANDIDATEFORM *pCandidate)
469 {
470 BOOL rc;
471
472 rc = ImmSetCandidateWindow(hIMC,pCandidate);
473
474 if (rc)
475 return S_OK;
476 else
477 return E_FAIL;
478 }
479
480 static HRESULT WINAPI ActiveIMMApp_SetCompositionFontA(IActiveIMMApp* This,
481 HIMC hIMC, LOGFONTA *plf)
482 {
483 BOOL rc;
484
485 rc = ImmSetCompositionFontA(hIMC,plf);
486
487 if (rc)
488 return S_OK;
489 else
490 return E_FAIL;
491 }
492
493 static HRESULT WINAPI ActiveIMMApp_SetCompositionFontW(IActiveIMMApp* This,
494 HIMC hIMC, LOGFONTW *plf)
495 {
496 BOOL rc;
497
498 rc = ImmSetCompositionFontW(hIMC,plf);
499
500 if (rc)
501 return S_OK;
502 else
503 return E_FAIL;
504 }
505
506 static HRESULT WINAPI ActiveIMMApp_SetCompositionStringA(IActiveIMMApp* This,
507 HIMC hIMC, DWORD dwIndex, LPVOID pComp, DWORD dwCompLen,
508 LPVOID pRead, DWORD dwReadLen)
509 {
510 BOOL rc;
511
512 rc = ImmSetCompositionStringA(hIMC,dwIndex,pComp,dwCompLen,pRead,dwReadLen);
513
514 if (rc)
515 return S_OK;
516 else
517 return E_FAIL;
518 }
519
520 static HRESULT WINAPI ActiveIMMApp_SetCompositionStringW(IActiveIMMApp* This,
521 HIMC hIMC, DWORD dwIndex, LPVOID pComp, DWORD dwCompLen,
522 LPVOID pRead, DWORD dwReadLen)
523 {
524 BOOL rc;
525
526 rc = ImmSetCompositionStringW(hIMC,dwIndex,pComp,dwCompLen,pRead,dwReadLen);
527
528 if (rc)
529 return S_OK;
530 else
531 return E_FAIL;
532 }
533
534 static HRESULT WINAPI ActiveIMMApp_SetCompositionWindow(IActiveIMMApp* This,
535 HIMC hIMC, COMPOSITIONFORM *pCompForm)
536 {
537 BOOL rc;
538
539 rc = ImmSetCompositionWindow(hIMC,pCompForm);
540
541 if (rc)
542 return S_OK;
543 else
544 return E_FAIL;
545 }
546
547 static HRESULT WINAPI ActiveIMMApp_SetConversionStatus(IActiveIMMApp* This,
548 HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
549 {
550 BOOL rc;
551
552 rc = ImmSetConversionStatus(hIMC,fdwConversion,fdwSentence);
553
554 if (rc)
555 return S_OK;
556 else
557 return E_FAIL;
558 }
559
560 static HRESULT WINAPI ActiveIMMApp_SetOpenStatus(IActiveIMMApp* This,
561 HIMC hIMC, BOOL fOpen)
562 {
563 BOOL rc;
564
565 rc = ImmSetOpenStatus(hIMC,fOpen);
566
567 if (rc)
568 return S_OK;
569 else
570 return E_FAIL;
571 }
572
573 static HRESULT WINAPI ActiveIMMApp_SetStatusWindowPos(IActiveIMMApp* This,
574 HIMC hIMC, POINT *pptPos)
575 {
576 BOOL rc;
577
578 rc = ImmSetStatusWindowPos(hIMC,pptPos);
579
580 if (rc)
581 return S_OK;
582 else
583 return E_FAIL;
584 }
585
586 static HRESULT WINAPI ActiveIMMApp_SimulateHotKey(IActiveIMMApp* This,
587 HWND hwnd, DWORD dwHotKeyID)
588 {
589 BOOL rc;
590
591 rc = ImmSimulateHotKey(hwnd,dwHotKeyID);
592
593 if (rc)
594 return S_OK;
595 else
596 return E_FAIL;
597 }
598
599 static HRESULT WINAPI ActiveIMMApp_UnregisterWordA(IActiveIMMApp* This,
600 HKL hKL, LPSTR szReading, DWORD dwStyle, LPSTR szUnregister)
601 {
602 BOOL rc;
603
604 rc = ImmUnregisterWordA(hKL,szReading,dwStyle,szUnregister);
605
606 if (rc)
607 return S_OK;
608 else
609 return E_FAIL;
610
611 }
612
613 static HRESULT WINAPI ActiveIMMApp_UnregisterWordW(IActiveIMMApp* This,
614 HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szUnregister)
615 {
616 BOOL rc;
617
618 rc = ImmUnregisterWordW(hKL,szReading,dwStyle,szUnregister);
619
620 if (rc)
621 return S_OK;
622 else
623 return E_FAIL;
624 }
625
626 static HRESULT WINAPI ActiveIMMApp_Activate(IActiveIMMApp* This,
627 BOOL fRestoreLayout)
628 {
629 FIXME("Stub\n");
630 return S_OK;
631 }
632
633 static HRESULT WINAPI ActiveIMMApp_Deactivate(IActiveIMMApp* This)
634 {
635 FIXME("Stub\n");
636 return S_OK;
637 }
638
639 static HRESULT WINAPI ActiveIMMApp_OnDefWindowProc(IActiveIMMApp* This,
640 HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *plResult)
641 {
642 //FIXME("Stub (%p %x %lx %lx)\n",hWnd,Msg,wParam,lParam);
643 return E_FAIL;
644 }
645
646 static HRESULT WINAPI ActiveIMMApp_FilterClientWindows(IActiveIMMApp* This,
647 ATOM *aaClassList, UINT uSize)
648 {
649 FIXME("Stub\n");
650 return S_OK;
651 }
652
653 static HRESULT WINAPI ActiveIMMApp_GetCodePageA(IActiveIMMApp* This,
654 HKL hKL, UINT *uCodePage)
655 {
656 FIXME("Stub\n");
657 return E_NOTIMPL;
658 }
659
660 static HRESULT WINAPI ActiveIMMApp_GetLangId(IActiveIMMApp* This,
661 HKL hKL, LANGID *plid)
662 {
663 FIXME("Stub\n");
664 return E_NOTIMPL;
665 }
666
667 static HRESULT WINAPI ActiveIMMApp_AssociateContextEx(IActiveIMMApp* This,
668 HWND hWnd, HIMC hIMC, DWORD dwFlags)
669 {
670 BOOL rc;
671
672 rc = ImmAssociateContextEx(hWnd,hIMC,dwFlags);
673
674 if (rc)
675 return S_OK;
676 else
677 return E_FAIL;
678 }
679
680 static HRESULT WINAPI ActiveIMMApp_DisableIME(IActiveIMMApp* This,
681 DWORD idThread)
682 {
683 BOOL rc;
684
685 rc = ImmDisableIME(idThread);
686
687 if (rc)
688 return S_OK;
689 else
690 return E_FAIL;
691 }
692
693 static HRESULT WINAPI ActiveIMMApp_GetImeMenuItemsA(IActiveIMMApp* This,
694 HIMC hIMC, DWORD dwFlags, DWORD dwType,
695 IMEMENUITEMINFOA *pImeParentMenu, IMEMENUITEMINFOA *pImeMenu,
696 DWORD dwSize, DWORD *pdwResult)
697 {
698 *pdwResult = ImmGetImeMenuItemsA(hIMC,dwFlags,dwType,pImeParentMenu,pImeMenu,dwSize);
699 return S_OK;
700 }
701
702 static HRESULT WINAPI ActiveIMMApp_GetImeMenuItemsW(IActiveIMMApp* This,
703 HIMC hIMC, DWORD dwFlags, DWORD dwType,
704 IMEMENUITEMINFOW *pImeParentMenu, IMEMENUITEMINFOW *pImeMenu,
705 DWORD dwSize, DWORD *pdwResult)
706 {
707 *pdwResult = ImmGetImeMenuItemsW(hIMC,dwFlags,dwType,pImeParentMenu,pImeMenu,dwSize);
708 return S_OK;
709 }
710
711 static HRESULT WINAPI ActiveIMMApp_EnumInputContext(IActiveIMMApp* This,
712 DWORD idThread, IEnumInputContext **ppEnum)
713 {
714 FIXME("Stub\n");
715 return E_NOTIMPL;
716 }
717
718 static const IActiveIMMAppVtbl ActiveIMMAppVtbl =
719 {
720 ActiveIMMApp_QueryInterface,
721 ActiveIMMApp_AddRef,
722 ActiveIMMApp_Release,
723
724 ActiveIMMApp_AssociateContext,
725 ActiveIMMApp_ConfigureIMEA,
726 ActiveIMMApp_ConfigureIMEW,
727 ActiveIMMApp_CreateContext,
728 ActiveIMMApp_DestroyContext,
729 ActiveIMMApp_EnumRegisterWordA,
730 ActiveIMMApp_EnumRegisterWordW,
731 ActiveIMMApp_EscapeA,
732 ActiveIMMApp_EscapeW,
733 ActiveIMMApp_GetCandidateListA,
734 ActiveIMMApp_GetCandidateListW,
735 ActiveIMMApp_GetCandidateListCountA,
736 ActiveIMMApp_GetCandidateListCountW,
737 ActiveIMMApp_GetCandidateWindow,
738 ActiveIMMApp_GetCompositionFontA,
739 ActiveIMMApp_GetCompositionFontW,
740 ActiveIMMApp_GetCompositionStringA,
741 ActiveIMMApp_GetCompositionStringW,
742 ActiveIMMApp_GetCompositionWindow,
743 ActiveIMMApp_GetContext,
744 ActiveIMMApp_GetConversionListA,
745 ActiveIMMApp_GetConversionListW,
746 ActiveIMMApp_GetConversionStatus,
747 ActiveIMMApp_GetDefaultIMEWnd,
748 ActiveIMMApp_GetDescriptionA,
749 ActiveIMMApp_GetDescriptionW,
750 ActiveIMMApp_GetGuideLineA,
751 ActiveIMMApp_GetGuideLineW,
752 ActiveIMMApp_GetIMEFileNameA,
753 ActiveIMMApp_GetIMEFileNameW,
754 ActiveIMMApp_GetOpenStatus,
755 ActiveIMMApp_GetProperty,
756 ActiveIMMApp_GetRegisterWordStyleA,
757 ActiveIMMApp_GetRegisterWordStyleW,
758 ActiveIMMApp_GetStatusWindowPos,
759 ActiveIMMApp_GetVirtualKey,
760 ActiveIMMApp_InstallIMEA,
761 ActiveIMMApp_InstallIMEW,
762 ActiveIMMApp_IsIME,
763 ActiveIMMApp_IsUIMessageA,
764 ActiveIMMApp_IsUIMessageW,
765 ActiveIMMApp_NotifyIME,
766 ActiveIMMApp_RegisterWordA,
767 ActiveIMMApp_RegisterWordW,
768 ActiveIMMApp_ReleaseContext,
769 ActiveIMMApp_SetCandidateWindow,
770 ActiveIMMApp_SetCompositionFontA,
771 ActiveIMMApp_SetCompositionFontW,
772 ActiveIMMApp_SetCompositionStringA,
773 ActiveIMMApp_SetCompositionStringW,
774 ActiveIMMApp_SetCompositionWindow,
775 ActiveIMMApp_SetConversionStatus,
776 ActiveIMMApp_SetOpenStatus,
777 ActiveIMMApp_SetStatusWindowPos,
778 ActiveIMMApp_SimulateHotKey,
779 ActiveIMMApp_UnregisterWordA,
780 ActiveIMMApp_UnregisterWordW,
781
782 ActiveIMMApp_Activate,
783 ActiveIMMApp_Deactivate,
784 ActiveIMMApp_OnDefWindowProc,
785 ActiveIMMApp_FilterClientWindows,
786 ActiveIMMApp_GetCodePageA,
787 ActiveIMMApp_GetLangId,
788 ActiveIMMApp_AssociateContextEx,
789 ActiveIMMApp_DisableIME,
790 ActiveIMMApp_GetImeMenuItemsA,
791 ActiveIMMApp_GetImeMenuItemsW,
792 ActiveIMMApp_EnumInputContext
793 };
794
795 DECLSPEC_HIDDEN HRESULT ActiveIMMApp_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
796 {
797 ActiveIMMApp *This;
798 if (pUnkOuter)
799 return CLASS_E_NOAGGREGATION;
800
801 This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ActiveIMMApp));
802 if (This == NULL)
803 return E_OUTOFMEMORY;
804
805 This->IActiveIMMApp_iface.lpVtbl = &ActiveIMMAppVtbl;
806 This->refCount = 1;
807
808 TRACE("returning %p\n",This);
809 *ppOut = (IUnknown *)This;
810 return S_OK;
811 }