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 const ITfLangBarMgrVtbl *LangBarMgrVtbl;
40 static void LangBarMgr_Destructor(LangBarMgr *This)
42 TRACE("destroying %p\n", This);
44 HeapFree(GetProcessHeap(),0,This);
47 static HRESULT WINAPI LangBarMgr_QueryInterface(ITfLangBarMgr *iface, REFIID iid, LPVOID *ppvOut)
49 LangBarMgr *This = (LangBarMgr *)iface;
52 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfLangBarMgr))
59 IUnknown_AddRef(iface);
63 WARN("unsupported interface: %s\n", debugstr_guid(iid));
67 static ULONG WINAPI LangBarMgr_AddRef(ITfLangBarMgr *iface)
69 LangBarMgr *This = (LangBarMgr *)iface;
70 return InterlockedIncrement(&This->refCount);
73 static ULONG WINAPI LangBarMgr_Release(ITfLangBarMgr *iface)
75 LangBarMgr *This = (LangBarMgr *)iface;
78 ret = InterlockedDecrement(&This->refCount);
80 LangBarMgr_Destructor(This);
84 /*****************************************************
85 * ITfLangBarMgr functions
86 *****************************************************/
88 static HRESULT WINAPI LangBarMgr_AdviseEventSink( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, HWND hwnd, DWORD dwflags, DWORD *pdwCookie)
90 LangBarMgr *This = (LangBarMgr *)iface;
92 FIXME("STUB:(%p)\n",This);
96 static HRESULT WINAPI LangBarMgr_UnAdviseEventSink( ITfLangBarMgr* iface, DWORD dwCookie)
98 LangBarMgr *This = (LangBarMgr *)iface;
100 FIXME("STUB:(%p)\n",This);
104 static HRESULT WINAPI LangBarMgr_GetThreadMarshalInterface( ITfLangBarMgr* iface, DWORD dwThreadId, DWORD dwType, REFIID riid, IUnknown **ppunk)
106 LangBarMgr *This = (LangBarMgr *)iface;
108 FIXME("STUB:(%p)\n",This);
112 static HRESULT WINAPI LangBarMgr_GetThreadLangBarItemMgr( ITfLangBarMgr* iface, DWORD dwThreadId, ITfLangBarItemMgr **pplbi, DWORD *pdwThreadid)
114 LangBarMgr *This = (LangBarMgr *)iface;
116 FIXME("STUB:(%p)\n",This);
120 static HRESULT WINAPI LangBarMgr_GetInputProcessorProfiles( ITfLangBarMgr* iface, DWORD dwThreadId, ITfInputProcessorProfiles **ppaip, DWORD *pdwThreadid)
122 LangBarMgr *This = (LangBarMgr *)iface;
124 FIXME("STUB:(%p)\n",This);
128 static HRESULT WINAPI LangBarMgr_RestoreLastFocus( ITfLangBarMgr* iface, DWORD *dwThreadId, BOOL fPrev)
130 LangBarMgr *This = (LangBarMgr *)iface;
132 FIXME("STUB:(%p)\n",This);
136 static HRESULT WINAPI LangBarMgr_SetModalInput( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, DWORD dwThreadId, DWORD dwFlags)
138 LangBarMgr *This = (LangBarMgr *)iface;
140 FIXME("STUB:(%p)\n",This);
144 static HRESULT WINAPI LangBarMgr_ShowFloating( ITfLangBarMgr* iface, DWORD dwFlags)
146 LangBarMgr *This = (LangBarMgr *)iface;
148 FIXME("STUB:(%p)\n",This);
152 static HRESULT WINAPI LangBarMgr_GetShowFloatingStatus( ITfLangBarMgr* iface, DWORD *pdwFlags)
154 LangBarMgr *This = (LangBarMgr *)iface;
156 FIXME("STUB:(%p)\n",This);
160 static const ITfLangBarMgrVtbl LangBarMgr_LangBarMgrVtbl =
162 LangBarMgr_QueryInterface,
166 LangBarMgr_AdviseEventSink,
167 LangBarMgr_UnAdviseEventSink,
168 LangBarMgr_GetThreadMarshalInterface,
169 LangBarMgr_GetThreadLangBarItemMgr,
170 LangBarMgr_GetInputProcessorProfiles,
171 LangBarMgr_RestoreLastFocus,
172 LangBarMgr_SetModalInput,
173 LangBarMgr_ShowFloating,
174 LangBarMgr_GetShowFloatingStatus
177 HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
181 return CLASS_E_NOAGGREGATION;
183 This = HeapAlloc(GetProcessHeap(),0,sizeof(LangBarMgr));
185 return E_OUTOFMEMORY;
187 This->LangBarMgrVtbl= &LangBarMgr_LangBarMgrVtbl;
190 TRACE("returning %p\n", This);
191 *ppOut = (IUnknown *)This;