2 * ITfInputProcessorProfiles implementation
4 * Copyright 2009 Aric Stewart, CodeWeavers
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.
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.
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
27 #include "wine/debug.h"
36 #include "wine/unicode.h"
39 #include "msctf_internal.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(msctf);
43 typedef struct tagInputProcessorProfiles {
44 const ITfInputProcessorProfilesVtbl *InputProcessorProfilesVtbl;
47 LANGID currentLanguage;
48 } InputProcessorProfiles;
50 static void InputProcessorProfiles_Destructor(InputProcessorProfiles *This)
52 TRACE("destroying %p\n", This);
53 HeapFree(GetProcessHeap(),0,This);
56 static HRESULT WINAPI InputProcessorProfiles_QueryInterface(ITfInputProcessorProfiles *iface, REFIID iid, LPVOID *ppvOut)
58 InputProcessorProfiles *This = (InputProcessorProfiles *)iface;
61 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfInputProcessorProfiles))
68 IUnknown_AddRef(iface);
72 WARN("unsupported interface: %s\n", debugstr_guid(iid));
76 static ULONG WINAPI InputProcessorProfiles_AddRef(ITfInputProcessorProfiles *iface)
78 InputProcessorProfiles *This = (InputProcessorProfiles *)iface;
79 return InterlockedIncrement(&This->refCount);
82 static ULONG WINAPI InputProcessorProfiles_Release(ITfInputProcessorProfiles *iface)
84 InputProcessorProfiles *This = (InputProcessorProfiles *)iface;
87 ret = InterlockedDecrement(&This->refCount);
89 InputProcessorProfiles_Destructor(This);
93 /*****************************************************
94 * ITfInputProcessorProfiles functions
95 *****************************************************/
96 static HRESULT WINAPI InputProcessorProfiles_Register(
97 ITfInputProcessorProfiles *iface, REFCLSID rclsid)
99 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
100 FIXME("STUB:(%p)\n",This);
104 static HRESULT WINAPI InputProcessorProfiles_Unregister(
105 ITfInputProcessorProfiles *iface, REFCLSID rclsid)
107 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
108 FIXME("STUB:(%p)\n",This);
112 static HRESULT WINAPI InputProcessorProfiles_AddLanguageProfile(
113 ITfInputProcessorProfiles *iface, REFCLSID rclsid,
114 LANGID langid, REFGUID guidProfile, const WCHAR *pchDesc,
115 ULONG cchDesc, const WCHAR *pchIconFile, ULONG cchFile,
118 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
119 FIXME("STUB:(%p)\n",This);
123 static HRESULT WINAPI InputProcessorProfiles_RemoveLanguageProfile(
124 ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
127 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
128 FIXME("STUB:(%p)\n",This);
132 static HRESULT WINAPI InputProcessorProfiles_EnumInputProcessorInfo(
133 ITfInputProcessorProfiles *iface, IEnumGUID **ppEnum)
135 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
136 FIXME("STUB:(%p)\n",This);
140 static HRESULT WINAPI InputProcessorProfiles_GetDefaultLanguageProfile(
141 ITfInputProcessorProfiles *iface, LANGID langid, REFGUID catid,
142 CLSID *pclsid, GUID *pguidProfile)
144 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
145 FIXME("STUB:(%p)\n",This);
149 static HRESULT WINAPI InputProcessorProfiles_SetDefaultLanguageProfile(
150 ITfInputProcessorProfiles *iface, LANGID langid, REFCLSID rclsid,
151 REFGUID guidProfiles)
153 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
154 FIXME("STUB:(%p)\n",This);
158 static HRESULT WINAPI InputProcessorProfiles_ActivateLanguageProfile(
159 ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
160 REFGUID guidProfiles)
162 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
163 FIXME("STUB:(%p)\n",This);
167 static HRESULT WINAPI InputProcessorProfiles_GetActiveLanguageProfile(
168 ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID *plangid,
171 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
172 FIXME("STUB:(%p)\n",This);
176 static HRESULT WINAPI InputProcessorProfiles_GetLanguageProfileDescription(
177 ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
178 REFGUID guidProfile, BSTR *pbstrProfile)
180 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
181 FIXME("STUB:(%p)\n",This);
185 static HRESULT WINAPI InputProcessorProfiles_GetCurrentLanguage(
186 ITfInputProcessorProfiles *iface, LANGID *plangid)
188 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
189 TRACE("(%p) 0x%x\n",This,This->currentLanguage);
194 *plangid = This->currentLanguage;
199 static HRESULT WINAPI InputProcessorProfiles_ChangeCurrentLanguage(
200 ITfInputProcessorProfiles *iface, LANGID langid)
202 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
203 FIXME("STUB:(%p)\n",This);
207 static HRESULT WINAPI InputProcessorProfiles_GetLanguageList(
208 ITfInputProcessorProfiles *iface, LANGID **ppLangId, ULONG *pulCount)
210 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
211 FIXME("STUB:(%p)\n",This);
215 static HRESULT WINAPI InputProcessorProfiles_EnumLanguageProfiles(
216 ITfInputProcessorProfiles *iface, LANGID langid,
217 IEnumTfLanguageProfiles **ppEnum)
219 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
220 FIXME("STUB:(%p)\n",This);
224 static HRESULT WINAPI InputProcessorProfiles_EnableLanguageProfile(
225 ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
226 REFGUID guidProfile, BOOL fEnable)
228 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
229 FIXME("STUB:(%p)\n",This);
233 static HRESULT WINAPI InputProcessorProfiles_IsEnabledLanguageProfile(
234 ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
235 REFGUID guidProfile, BOOL *pfEnable)
237 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
238 FIXME("STUB:(%p)\n",This);
242 static HRESULT WINAPI InputProcessorProfiles_EnableLanguageProfileByDefault(
243 ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
244 REFGUID guidProfile, BOOL fEnable)
246 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
247 FIXME("STUB:(%p)\n",This);
251 static HRESULT WINAPI InputProcessorProfiles_SubstituteKeyboardLayout(
252 ITfInputProcessorProfiles *iface, REFCLSID rclsid, LANGID langid,
253 REFGUID guidProfile, HKL hKL)
255 InputProcessorProfiles *This = (InputProcessorProfiles*)iface;
256 FIXME("STUB:(%p)\n",This);
261 static const ITfInputProcessorProfilesVtbl InputProcessorProfiles_InputProcessorProfilesVtbl =
263 InputProcessorProfiles_QueryInterface,
264 InputProcessorProfiles_AddRef,
265 InputProcessorProfiles_Release,
267 InputProcessorProfiles_Register,
268 InputProcessorProfiles_Unregister,
269 InputProcessorProfiles_AddLanguageProfile,
270 InputProcessorProfiles_RemoveLanguageProfile,
271 InputProcessorProfiles_EnumInputProcessorInfo,
272 InputProcessorProfiles_GetDefaultLanguageProfile,
273 InputProcessorProfiles_SetDefaultLanguageProfile,
274 InputProcessorProfiles_ActivateLanguageProfile,
275 InputProcessorProfiles_GetActiveLanguageProfile,
276 InputProcessorProfiles_GetLanguageProfileDescription,
277 InputProcessorProfiles_GetCurrentLanguage,
278 InputProcessorProfiles_ChangeCurrentLanguage,
279 InputProcessorProfiles_GetLanguageList,
280 InputProcessorProfiles_EnumLanguageProfiles,
281 InputProcessorProfiles_EnableLanguageProfile,
282 InputProcessorProfiles_IsEnabledLanguageProfile,
283 InputProcessorProfiles_EnableLanguageProfileByDefault,
284 InputProcessorProfiles_SubstituteKeyboardLayout
287 HRESULT InputProcessorProfiles_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
289 InputProcessorProfiles *This;
291 return CLASS_E_NOAGGREGATION;
293 This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(InputProcessorProfiles));
295 return E_OUTOFMEMORY;
297 This->InputProcessorProfilesVtbl= &InputProcessorProfiles_InputProcessorProfilesVtbl;
299 This->currentLanguage = GetUserDefaultLCID();
301 TRACE("returning %p\n", This);
302 *ppOut = (IUnknown *)This;