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
);
51 static HRESULT WINAPI
LangBarMgr_QueryInterface(ITfLangBarMgr
*iface
, REFIID iid
, LPVOID
*ppvOut
)
53 LangBarMgr
*This
= impl_from_ITfLangBarMgr(iface
);
56 if (IsEqualIID(iid
, &IID_IUnknown
) || IsEqualIID(iid
, &IID_ITfLangBarMgr
))
58 *ppvOut
= &This
->ITfLangBarMgr_iface
;
63 ITfLangBarMgr_AddRef(iface
);
67 WARN("unsupported interface: %s\n", debugstr_guid(iid
));
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
);
82 ret
= InterlockedDecrement(&This
->refCount
);
84 LangBarMgr_Destructor(This
);
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
);
100 static HRESULT WINAPI
LangBarMgr_UnAdviseEventSink( ITfLangBarMgr
* iface
, DWORD dwCookie
)
102 LangBarMgr
*This
= impl_from_ITfLangBarMgr(iface
);
104 FIXME("STUB:(%p)\n",This
);
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
);
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
);
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
);
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
);
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
);
148 static HRESULT WINAPI
LangBarMgr_ShowFloating( ITfLangBarMgr
* iface
, DWORD dwFlags
)
150 LangBarMgr
*This
= impl_from_ITfLangBarMgr(iface
);
152 FIXME("STUB:(%p)\n",This
);
156 static HRESULT WINAPI
LangBarMgr_GetShowFloatingStatus( ITfLangBarMgr
* iface
, DWORD
*pdwFlags
)
158 LangBarMgr
*This
= impl_from_ITfLangBarMgr(iface
);
160 FIXME("STUB:(%p)\n",This
);
164 static const ITfLangBarMgrVtbl LangBarMgr_LangBarMgrVtbl
=
166 LangBarMgr_QueryInterface
,
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
)
185 return CLASS_E_NOAGGREGATION
;
187 This
= malloc(sizeof(LangBarMgr
));
189 return E_OUTOFMEMORY
;
191 This
->ITfLangBarMgr_iface
.lpVtbl
= &LangBarMgr_LangBarMgrVtbl
;
194 *ppOut
= (IUnknown
*)&This
->ITfLangBarMgr_iface
;
195 TRACE("returning %p\n", *ppOut
);