2 * ITfLangBarMgr implementation
4 * Copyright 2010 Justin Chevrier
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
23 #include "wine/debug.h"
29 #include "msctf_internal.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(msctf);
33 typedef struct tagLangBarMgr {
34 ITfLangBarMgr ITfLangBarMgr_iface;
40 static inline LangBarMgr *impl_from_ITfLangBarMgr(ITfLangBarMgr *iface)
42 return CONTAINING_RECORD(iface, LangBarMgr, ITfLangBarMgr_iface);
45 static void LangBarMgr_Destructor(LangBarMgr *This)
47 TRACE("destroying %p\n", This);
49 HeapFree(GetProcessHeap(),0,This);
52 static HRESULT WINAPI LangBarMgr_QueryInterface(ITfLangBarMgr *iface, REFIID iid, LPVOID *ppvOut)
54 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
57 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfLangBarMgr))
64 IUnknown_AddRef(iface);
68 WARN("unsupported interface: %s\n", debugstr_guid(iid));
72 static ULONG WINAPI LangBarMgr_AddRef(ITfLangBarMgr *iface)
74 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
75 return InterlockedIncrement(&This->refCount);
78 static ULONG WINAPI LangBarMgr_Release(ITfLangBarMgr *iface)
80 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
83 ret = InterlockedDecrement(&This->refCount);
85 LangBarMgr_Destructor(This);
89 /*****************************************************
90 * ITfLangBarMgr functions
91 *****************************************************/
93 static HRESULT WINAPI LangBarMgr_AdviseEventSink( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, HWND hwnd, DWORD dwflags, DWORD *pdwCookie)
95 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
97 FIXME("STUB:(%p)\n",This);
101 static HRESULT WINAPI LangBarMgr_UnAdviseEventSink( ITfLangBarMgr* iface, DWORD dwCookie)
103 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
105 FIXME("STUB:(%p)\n",This);
109 static HRESULT WINAPI LangBarMgr_GetThreadMarshalInterface( ITfLangBarMgr* iface, DWORD dwThreadId, DWORD dwType, REFIID riid, IUnknown **ppunk)
111 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
113 FIXME("STUB:(%p)\n",This);
117 static HRESULT WINAPI LangBarMgr_GetThreadLangBarItemMgr( ITfLangBarMgr* iface, DWORD dwThreadId, ITfLangBarItemMgr **pplbi, DWORD *pdwThreadid)
119 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
121 FIXME("STUB:(%p)\n",This);
125 static HRESULT WINAPI LangBarMgr_GetInputProcessorProfiles( ITfLangBarMgr* iface, DWORD dwThreadId, ITfInputProcessorProfiles **ppaip, DWORD *pdwThreadid)
127 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
129 FIXME("STUB:(%p)\n",This);
133 static HRESULT WINAPI LangBarMgr_RestoreLastFocus( ITfLangBarMgr* iface, DWORD *dwThreadId, BOOL fPrev)
135 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
137 FIXME("STUB:(%p)\n",This);
141 static HRESULT WINAPI LangBarMgr_SetModalInput( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, DWORD dwThreadId, DWORD dwFlags)
143 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
145 FIXME("STUB:(%p)\n",This);
149 static HRESULT WINAPI LangBarMgr_ShowFloating( ITfLangBarMgr* iface, DWORD dwFlags)
151 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
153 FIXME("STUB:(%p)\n",This);
157 static HRESULT WINAPI LangBarMgr_GetShowFloatingStatus( ITfLangBarMgr* iface, DWORD *pdwFlags)
159 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
161 FIXME("STUB:(%p)\n",This);
165 static const ITfLangBarMgrVtbl LangBarMgr_LangBarMgrVtbl =
167 LangBarMgr_QueryInterface,
171 LangBarMgr_AdviseEventSink,
172 LangBarMgr_UnAdviseEventSink,
173 LangBarMgr_GetThreadMarshalInterface,
174 LangBarMgr_GetThreadLangBarItemMgr,
175 LangBarMgr_GetInputProcessorProfiles,
176 LangBarMgr_RestoreLastFocus,
177 LangBarMgr_SetModalInput,
178 LangBarMgr_ShowFloating,
179 LangBarMgr_GetShowFloatingStatus
182 HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
186 return CLASS_E_NOAGGREGATION;
188 This = HeapAlloc(GetProcessHeap(),0,sizeof(LangBarMgr));
190 return E_OUTOFMEMORY;
192 This->ITfLangBarMgr_iface.lpVtbl = &LangBarMgr_LangBarMgrVtbl;
195 TRACE("returning %p\n", This);
196 *ppOut = (IUnknown *)This;