2 * Copyright 2009 Henri Verbeet for CodeWeavers
3 * Copyright 2011 André Hentschel
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include "wine/debug.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
29 ITaskbarList4 ITaskbarList4_iface;
33 static inline struct taskbar_list *impl_from_ITaskbarList4(ITaskbarList4 *iface)
35 return CONTAINING_RECORD(iface, struct taskbar_list, ITaskbarList4_iface);
38 /* IUnknown methods */
40 static HRESULT STDMETHODCALLTYPE taskbar_list_QueryInterface(ITaskbarList4 *iface, REFIID riid, void **object)
42 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
44 if (IsEqualGUID(riid, &IID_ITaskbarList) ||
45 IsEqualGUID(riid, &IID_ITaskbarList2) ||
46 IsEqualGUID(riid, &IID_ITaskbarList3) ||
47 IsEqualGUID(riid, &IID_ITaskbarList4) ||
48 IsEqualGUID(riid, &IID_IUnknown))
50 IUnknown_AddRef(iface);
55 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
61 static ULONG STDMETHODCALLTYPE taskbar_list_AddRef(ITaskbarList4 *iface)
63 struct taskbar_list *This = impl_from_ITaskbarList4(iface);
64 ULONG refcount = InterlockedIncrement(&This->refcount);
66 TRACE("%p increasing refcount to %u\n", This, refcount);
71 static ULONG STDMETHODCALLTYPE taskbar_list_Release(ITaskbarList4 *iface)
73 struct taskbar_list *This = impl_from_ITaskbarList4(iface);
74 ULONG refcount = InterlockedDecrement(&This->refcount);
76 TRACE("%p decreasing refcount to %u\n", This, refcount);
87 /* ITaskbarList methods */
89 static HRESULT STDMETHODCALLTYPE taskbar_list_HrInit(ITaskbarList4 *iface)
91 TRACE("iface %p\n", iface);
96 static HRESULT STDMETHODCALLTYPE taskbar_list_AddTab(ITaskbarList4 *iface, HWND hwnd)
98 FIXME("iface %p, hwnd %p stub!\n", iface, hwnd);
103 static HRESULT STDMETHODCALLTYPE taskbar_list_DeleteTab(ITaskbarList4 *iface, HWND hwnd)
105 FIXME("iface %p, hwnd %p stub!\n", iface, hwnd);
110 static HRESULT STDMETHODCALLTYPE taskbar_list_ActivateTab(ITaskbarList4 *iface, HWND hwnd)
112 FIXME("iface %p, hwnd %p stub!\n", iface, hwnd);
117 static HRESULT STDMETHODCALLTYPE taskbar_list_SetActiveAlt(ITaskbarList4 *iface, HWND hwnd)
119 FIXME("iface %p, hwnd %p stub!\n", iface, hwnd);
124 /* ITaskbarList2 method */
126 static HRESULT STDMETHODCALLTYPE taskbar_list_MarkFullscreenWindow(ITaskbarList4 *iface,
130 FIXME("iface %p, hwnd %p, fullscreen %s stub!\n", iface, hwnd, (fullscreen)?"true":"false");
135 /* ITaskbarList3 methods */
137 static HRESULT STDMETHODCALLTYPE taskbar_list_SetProgressValue(ITaskbarList4 *iface,
139 ULONGLONG ullCompleted,
142 static BOOL fixme_once;
143 if(!fixme_once++) FIXME("iface %p, hwnd %p, ullCompleted %s, ullTotal %s stub!\n", iface, hwnd,
144 wine_dbgstr_longlong(ullCompleted), wine_dbgstr_longlong(ullTotal));
149 static HRESULT STDMETHODCALLTYPE taskbar_list_SetProgressState(ITaskbarList4 *iface,
153 static BOOL fixme_once;
154 if(!fixme_once++) FIXME("iface %p, hwnd %p, flags %x stub!\n", iface, hwnd, tbpFlags);
159 static HRESULT STDMETHODCALLTYPE taskbar_list_RegisterTab(ITaskbarList4 *iface, HWND hwndTab, HWND hwndMDI)
161 FIXME("iface %p, hwndTab %p, hwndMDI %p stub!\n", iface, hwndTab, hwndMDI);
166 static HRESULT STDMETHODCALLTYPE taskbar_list_UnregisterTab(ITaskbarList4 *iface, HWND hwndTab)
168 FIXME("iface %p, hwndTab %p stub!\n", iface, hwndTab);
173 static HRESULT STDMETHODCALLTYPE taskbar_list_SetTabOrder(ITaskbarList4 *iface,
175 HWND hwndInsertBefore)
177 FIXME("iface %p, hwndTab %p, hwndInsertBefore %p stub!\n", iface, hwndTab, hwndInsertBefore);
182 static HRESULT STDMETHODCALLTYPE taskbar_list_SetTabActive(ITaskbarList4 *iface,
187 FIXME("iface %p, hwndTab %p, hwndMDI %p, dwReserved %x stub!\n", iface, hwndTab, hwndMDI, dwReserved);
192 static HRESULT STDMETHODCALLTYPE taskbar_list_ThumbBarAddButtons(ITaskbarList4 *iface,
195 LPTHUMBBUTTON pButton)
197 FIXME("iface %p, hwnd %p, cButtons %u, pButton %p stub!\n", iface, hwnd, cButtons, pButton);
202 static HRESULT STDMETHODCALLTYPE taskbar_list_ThumbBarUpdateButtons(ITaskbarList4 *iface,
205 LPTHUMBBUTTON pButton)
207 FIXME("iface %p, hwnd %p, cButtons %u, pButton %p stub!\n", iface, hwnd, cButtons, pButton);
212 static HRESULT STDMETHODCALLTYPE taskbar_list_ThumbBarSetImageList(ITaskbarList4 *iface,
216 FIXME("iface %p, hwnd %p, himl %p stub!\n", iface, hwnd, himl);
221 static HRESULT STDMETHODCALLTYPE taskbar_list_SetOverlayIcon(ITaskbarList4 *iface,
224 LPCWSTR pszDescription)
226 FIXME("iface %p, hwnd %p, hIcon %p, pszDescription %s stub!\n", iface, hwnd, hIcon,
227 debugstr_w(pszDescription));
232 static HRESULT STDMETHODCALLTYPE taskbar_list_SetThumbnailTooltip(ITaskbarList4 *iface,
236 FIXME("iface %p, hwnd %p, pszTip %s stub!\n", iface, hwnd, debugstr_w(pszTip));
241 static HRESULT STDMETHODCALLTYPE taskbar_list_SetThumbnailClip(ITaskbarList4 *iface,
245 FIXME("iface %p, hwnd %p, prcClip %s stub!\n", iface, hwnd, wine_dbgstr_rect(prcClip));
250 /* ITaskbarList4 method */
252 static HRESULT STDMETHODCALLTYPE taskbar_list_SetTabProperties(ITaskbarList4 *iface,
256 FIXME("iface %p, hwndTab %p, stpFlags %u stub!\n", iface, hwndTab, stpFlags);
261 static const struct ITaskbarList4Vtbl taskbar_list_vtbl =
263 /* IUnknown methods */
264 taskbar_list_QueryInterface,
266 taskbar_list_Release,
267 /* ITaskbarList methods */
270 taskbar_list_DeleteTab,
271 taskbar_list_ActivateTab,
272 taskbar_list_SetActiveAlt,
273 /* ITaskbarList2 method */
274 taskbar_list_MarkFullscreenWindow,
275 /* ITaskbarList3 methods */
276 taskbar_list_SetProgressValue,
277 taskbar_list_SetProgressState,
278 taskbar_list_RegisterTab,
279 taskbar_list_UnregisterTab,
280 taskbar_list_SetTabOrder,
281 taskbar_list_SetTabActive,
282 taskbar_list_ThumbBarAddButtons,
283 taskbar_list_ThumbBarUpdateButtons,
284 taskbar_list_ThumbBarSetImageList,
285 taskbar_list_SetOverlayIcon,
286 taskbar_list_SetThumbnailTooltip,
287 taskbar_list_SetThumbnailClip,
288 /* ITaskbarList4 method */
289 taskbar_list_SetTabProperties,
292 HRESULT WINAPI TaskbarList_Create(IClassFactory *iface, IUnknown *outer, REFIID riid, void **taskbar_list)
294 struct taskbar_list *object;
297 TRACE("outer %p, riid %s, taskbar_list %p\n", outer, debugstr_guid(riid), taskbar_list);
301 WARN("Aggregation not supported\n");
302 *taskbar_list = NULL;
303 return CLASS_E_NOAGGREGATION;
306 object = heap_alloc_zero(sizeof(*object));
309 ERR("Failed to allocate taskbar list object memory\n");
310 *taskbar_list = NULL;
311 return E_OUTOFMEMORY;
314 object->ITaskbarList4_iface.lpVtbl = &taskbar_list_vtbl;
315 object->refcount = 1;
318 TRACE("Created ITaskbarList4 %p\n", object);
320 hres = ITaskbarList4_QueryInterface(&object->ITaskbarList4_iface, riid, taskbar_list);
321 ITaskbarList4_Release(&object->ITaskbarList4_iface);