odbc32: Correct SQLSetConnectOptionW length parameter type.
[wine.git] / dlls / msctf / langbarmgr.c
blobcd21085be4e519fee5643324dfbe8ca4a7e4b379
1 /*
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
21 #define COBJMACROS
23 #include "wine/debug.h"
24 #include "winbase.h"
25 #include "winreg.h"
26 #include "shlwapi.h"
28 #include "msctf.h"
29 #include "msctf_internal.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(msctf);
33 typedef struct tagLangBarMgr {
34 ITfLangBarMgr ITfLangBarMgr_iface;
36 LONG refCount;
38 } LangBarMgr;
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);
48 free(This);
51 static HRESULT WINAPI LangBarMgr_QueryInterface(ITfLangBarMgr *iface, REFIID iid, LPVOID *ppvOut)
53 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
54 *ppvOut = NULL;
56 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfLangBarMgr))
58 *ppvOut = &This->ITfLangBarMgr_iface;
61 if (*ppvOut)
63 ITfLangBarMgr_AddRef(iface);
64 return S_OK;
67 WARN("unsupported interface: %s\n", debugstr_guid(iid));
68 return E_NOINTERFACE;
71 static ULONG WINAPI LangBarMgr_AddRef(ITfLangBarMgr *iface)
73 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
74 return InterlockedIncrement(&This->refCount);
77 static ULONG WINAPI LangBarMgr_Release(ITfLangBarMgr *iface)
79 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
80 ULONG ret;
82 ret = InterlockedDecrement(&This->refCount);
83 if (ret == 0)
84 LangBarMgr_Destructor(This);
85 return ret;
88 /*****************************************************
89 * ITfLangBarMgr functions
90 *****************************************************/
92 static HRESULT WINAPI LangBarMgr_AdviseEventSink( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, HWND hwnd, DWORD dwflags, DWORD *pdwCookie)
94 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
96 FIXME("STUB:(%p)\n",This);
97 return E_NOTIMPL;
100 static HRESULT WINAPI LangBarMgr_UnAdviseEventSink( ITfLangBarMgr* iface, DWORD dwCookie)
102 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
104 FIXME("STUB:(%p)\n",This);
105 return E_NOTIMPL;
108 static HRESULT WINAPI LangBarMgr_GetThreadMarshalInterface( ITfLangBarMgr* iface, DWORD dwThreadId, DWORD dwType, REFIID riid, IUnknown **ppunk)
110 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
112 FIXME("STUB:(%p)\n",This);
113 return E_NOTIMPL;
116 static HRESULT WINAPI LangBarMgr_GetThreadLangBarItemMgr( ITfLangBarMgr* iface, DWORD dwThreadId, ITfLangBarItemMgr **pplbi, DWORD *pdwThreadid)
118 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
120 FIXME("STUB:(%p)\n",This);
121 return E_NOTIMPL;
124 static HRESULT WINAPI LangBarMgr_GetInputProcessorProfiles( ITfLangBarMgr* iface, DWORD dwThreadId, ITfInputProcessorProfiles **ppaip, DWORD *pdwThreadid)
126 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
128 FIXME("STUB:(%p)\n",This);
129 return E_NOTIMPL;
132 static HRESULT WINAPI LangBarMgr_RestoreLastFocus( ITfLangBarMgr* iface, DWORD *dwThreadId, BOOL fPrev)
134 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
136 FIXME("STUB:(%p)\n",This);
137 return E_NOTIMPL;
140 static HRESULT WINAPI LangBarMgr_SetModalInput( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, DWORD dwThreadId, DWORD dwFlags)
142 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
144 FIXME("STUB:(%p)\n",This);
145 return E_NOTIMPL;
148 static HRESULT WINAPI LangBarMgr_ShowFloating( ITfLangBarMgr* iface, DWORD dwFlags)
150 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
152 FIXME("STUB:(%p)\n",This);
153 return E_NOTIMPL;
156 static HRESULT WINAPI LangBarMgr_GetShowFloatingStatus( ITfLangBarMgr* iface, DWORD *pdwFlags)
158 LangBarMgr *This = impl_from_ITfLangBarMgr(iface);
160 FIXME("STUB:(%p)\n",This);
161 return E_NOTIMPL;
164 static const ITfLangBarMgrVtbl LangBarMgr_LangBarMgrVtbl =
166 LangBarMgr_QueryInterface,
167 LangBarMgr_AddRef,
168 LangBarMgr_Release,
170 LangBarMgr_AdviseEventSink,
171 LangBarMgr_UnAdviseEventSink,
172 LangBarMgr_GetThreadMarshalInterface,
173 LangBarMgr_GetThreadLangBarItemMgr,
174 LangBarMgr_GetInputProcessorProfiles,
175 LangBarMgr_RestoreLastFocus,
176 LangBarMgr_SetModalInput,
177 LangBarMgr_ShowFloating,
178 LangBarMgr_GetShowFloatingStatus
181 HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
183 LangBarMgr *This;
184 if (pUnkOuter)
185 return CLASS_E_NOAGGREGATION;
187 This = malloc(sizeof(LangBarMgr));
188 if (This == NULL)
189 return E_OUTOFMEMORY;
191 This->ITfLangBarMgr_iface.lpVtbl = &LangBarMgr_LangBarMgrVtbl;
192 This->refCount = 1;
194 *ppOut = (IUnknown *)&This->ITfLangBarMgr_iface;
195 TRACE("returning %p\n", *ppOut);
196 return S_OK;