2 * NamespaceTreeControl implementation.
4 * Copyright 2010 David Hedberg
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
24 #define NONAMELESSUNION
25 #define NONAMELESSSTRUCT
31 #include "wine/debug.h"
33 #include "explorerframe_main.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(nstc
);
38 const INameSpaceTreeControl2Vtbl
*lpVtbl
;
42 /**************************************************************************
43 * INameSpaceTreeControl2 Implementation
45 static HRESULT WINAPI
NSTC2_fnQueryInterface(INameSpaceTreeControl2
* iface
,
49 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
50 TRACE("%p (%s, %p)\n", This
, debugstr_guid(riid
), ppvObject
);
53 if(IsEqualIID(riid
, &IID_INameSpaceTreeControl2
) ||
54 IsEqualIID(riid
, &IID_INameSpaceTreeControl
) ||
55 IsEqualIID(riid
, &IID_IUnknown
))
62 IUnknown_AddRef((IUnknown
*)*ppvObject
);
69 static ULONG WINAPI
NSTC2_fnAddRef(INameSpaceTreeControl2
* iface
)
71 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
72 LONG ref
= InterlockedIncrement(&This
->ref
);
74 TRACE("%p - ref %d\n", This
, ref
);
79 static ULONG WINAPI
NSTC2_fnRelease(INameSpaceTreeControl2
* iface
)
81 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
82 LONG ref
= InterlockedDecrement(&This
->ref
);
84 TRACE("%p - ref: %d\n", This
, ref
);
89 HeapFree(GetProcessHeap(), 0, This
);
90 EFRAME_UnlockModule();
97 static HRESULT WINAPI
NSTC2_fnInitialize(INameSpaceTreeControl2
* iface
,
100 NSTCSTYLE nstcsFlags
)
102 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
103 FIXME("stub, %p (%p, %p, %x)\n", This
, hwndParent
, prc
, nstcsFlags
);
107 static HRESULT WINAPI
NSTC2_fnTreeAdvise(INameSpaceTreeControl2
* iface
,
111 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
112 FIXME("stub, %p (%p, %p)\n", This
, punk
, pdwCookie
);
116 static HRESULT WINAPI
NSTC2_fnTreeUnadvise(INameSpaceTreeControl2
* iface
,
119 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
120 FIXME("stub, %p (%x)\n", This
, dwCookie
);
124 static HRESULT WINAPI
NSTC2_fnInsertRoot(INameSpaceTreeControl2
* iface
,
127 SHCONTF grfEnumFlags
,
128 NSTCROOTSTYLE grfRootStyle
,
129 IShellItemFilter
*pif
)
131 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
132 FIXME("stub, %p, %p, %x, %x, %p\n", This
, psiRoot
, grfEnumFlags
, grfRootStyle
, pif
);
136 static HRESULT WINAPI
NSTC2_fnAppendRoot(INameSpaceTreeControl2
* iface
,
138 SHCONTF grfEnumFlags
,
139 NSTCROOTSTYLE grfRootStyle
,
140 IShellItemFilter
*pif
)
142 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
143 FIXME("stub, %p, %p, %x, %x, %p\n",
144 This
, psiRoot
, grfEnumFlags
, grfRootStyle
, pif
);
148 static HRESULT WINAPI
NSTC2_fnRemoveRoot(INameSpaceTreeControl2
* iface
,
151 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
152 FIXME("stub, %p (%p)\n", This
, psiRoot
);
156 static HRESULT WINAPI
NSTC2_fnRemoveAllRoots(INameSpaceTreeControl2
* iface
)
158 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
159 FIXME("stub, %p\n", This
);
163 static HRESULT WINAPI
NSTC2_fnGetRootItems(INameSpaceTreeControl2
* iface
,
164 IShellItemArray
**ppsiaRootItems
)
166 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
167 FIXME("stub, %p (%p)\n", This
, ppsiaRootItems
);
171 static HRESULT WINAPI
NSTC2_fnSetItemState(INameSpaceTreeControl2
* iface
,
173 NSTCITEMSTATE nstcisMask
,
174 NSTCITEMSTATE nstcisFlags
)
176 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
177 FIXME("stub, %p (%p, %x, %x)\n", This
, psi
, nstcisMask
, nstcisFlags
);
181 static HRESULT WINAPI
NSTC2_fnGetItemState(INameSpaceTreeControl2
* iface
,
183 NSTCITEMSTATE nstcisMask
,
184 NSTCITEMSTATE
*pnstcisFlags
)
186 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
187 FIXME("stub, %p (%p, %x, %p)\n", This
, psi
, nstcisMask
, pnstcisFlags
);
191 static HRESULT WINAPI
NSTC2_fnGetSelectedItems(INameSpaceTreeControl2
* iface
,
192 IShellItemArray
**psiaItems
)
194 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
195 FIXME("stub, %p (%p)\n", This
, psiaItems
);
199 static HRESULT WINAPI
NSTC2_fnGetItemCustomState(INameSpaceTreeControl2
* iface
,
203 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
204 FIXME("stub, %p (%p, %p)\n", This
, psi
, piStateNumber
);
208 static HRESULT WINAPI
NSTC2_fnSetItemCustomState(INameSpaceTreeControl2
* iface
,
212 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
213 FIXME("stub, %p (%p, %d)\n", This
, psi
, iStateNumber
);
217 static HRESULT WINAPI
NSTC2_fnEnsureItemVisible(INameSpaceTreeControl2
* iface
,
220 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
221 FIXME("stub, %p (%p)\n", This
, psi
);
225 static HRESULT WINAPI
NSTC2_fnSetTheme(INameSpaceTreeControl2
* iface
,
228 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
229 FIXME("stub, %p (%p)\n", This
, pszTheme
);
233 static HRESULT WINAPI
NSTC2_fnGetNextItem(INameSpaceTreeControl2
* iface
,
236 IShellItem
**ppsiNext
)
238 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
239 FIXME("stub, %p (%p, %x, %p)\n", This
, psi
, nstcgi
, ppsiNext
);
243 static HRESULT WINAPI
NSTC2_fnHitTest(INameSpaceTreeControl2
* iface
,
245 IShellItem
**ppsiOut
)
247 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
248 FIXME("stub, %p (%p, %p)\n", This
, ppsiOut
, ppt
);
252 static HRESULT WINAPI
NSTC2_fnGetItemRect(INameSpaceTreeControl2
* iface
,
256 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
257 FIXME("stub, %p (%p, %p)\n", This
, psi
, prect
);
261 static HRESULT WINAPI
NSTC2_fnCollapseAll(INameSpaceTreeControl2
* iface
)
263 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
264 FIXME("stub, %p\n", This
);
268 static HRESULT WINAPI
NSTC2_fnSetControlStyle(INameSpaceTreeControl2
* iface
,
270 NSTCSTYLE nstcsStyle
)
272 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
273 FIXME("stub, %p (%x, %x)\n", This
, nstcsMask
, nstcsStyle
);
277 static HRESULT WINAPI
NSTC2_fnGetControlStyle(INameSpaceTreeControl2
* iface
,
279 NSTCSTYLE
*pnstcsStyle
)
281 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
282 FIXME("stub, %p (%x, %p)\n", This
, nstcsMask
, pnstcsStyle
);
286 static HRESULT WINAPI
NSTC2_fnSetControlStyle2(INameSpaceTreeControl2
* iface
,
287 NSTCSTYLE2 nstcsMask
,
288 NSTCSTYLE2 nstcsStyle
)
290 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
291 FIXME("stub, %p (%x, %x)\n", This
, nstcsMask
, nstcsStyle
);
295 static HRESULT WINAPI
NSTC2_fnGetControlStyle2(INameSpaceTreeControl2
* iface
,
296 NSTCSTYLE2 nstcsMask
,
297 NSTCSTYLE2
*pnstcsStyle
)
299 NSTC2Impl
*This
= (NSTC2Impl
*)iface
;
300 FIXME("stub, %p (%x, %p)\n", This
, nstcsMask
, pnstcsStyle
);
304 static const INameSpaceTreeControl2Vtbl vt_INameSpaceTreeControl2
= {
305 NSTC2_fnQueryInterface
,
310 NSTC2_fnTreeUnadvise
,
314 NSTC2_fnRemoveAllRoots
,
315 NSTC2_fnGetRootItems
,
316 NSTC2_fnSetItemState
,
317 NSTC2_fnGetItemState
,
318 NSTC2_fnGetSelectedItems
,
319 NSTC2_fnGetItemCustomState
,
320 NSTC2_fnSetItemCustomState
,
321 NSTC2_fnEnsureItemVisible
,
327 NSTC2_fnSetControlStyle
,
328 NSTC2_fnGetControlStyle
,
329 NSTC2_fnSetControlStyle2
,
330 NSTC2_fnGetControlStyle2
333 HRESULT
NamespaceTreeControl_Constructor(IUnknown
*pUnkOuter
, REFIID riid
, void **ppv
)
338 TRACE ("%p %s %p\n", pUnkOuter
, debugstr_guid(riid
), ppv
);
343 return CLASS_E_NOAGGREGATION
;
347 nstc
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(NSTC2Impl
));
349 nstc
->lpVtbl
= &vt_INameSpaceTreeControl2
;
351 ret
= INameSpaceTreeControl_QueryInterface((INameSpaceTreeControl
*)nstc
, riid
, ppv
);
352 INameSpaceTreeControl_Release((INameSpaceTreeControl
*)nstc
);
354 TRACE("--(%p)\n", ppv
);