ReactOS 0.4.16-dev-197-g92996da
CMergedFolder.h
Go to the documentation of this file.
1/*
2 * Shell Menu Site
3 *
4 * Copyright 2014 David Quintana
5 *
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.
10 *
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.
15 *
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
19 */
20#pragma once
21
22interface IAugmentedShellFolder : public IShellFolder
23{
28};
29
30interface IAugmentedShellFolder2 : public IAugmentedShellFolder
31{
33};
34
35/* No idea what QUERYNAMESPACEINFO struct contains, yet */
37{
39};
40
41interface IAugmentedShellFolder3 : public IAugmentedShellFolder2
42{
43 STDMETHOD(QueryNameSpace2)(ULONG, QUERYNAMESPACEINFO *) PURE;
44};
45
47
49 public CComCoClass<CMergedFolder, &CLSID_MergedFolder>,
50 public CComObjectRootEx<CComMultiThreadModelNoCS>,
51 public IShellFolder2,
52 public IPersistFolder2,
53 public IItemNameLimits,
54 public IAugmentedShellFolder3 // -- undocumented
55 //public IShellService, // DEPRECATED IE4 interface: https://msdn.microsoft.com/en-us/library/windows/desktop/bb774870%28v=vs.85%29.aspx
56 //public ITranslateShellChangeNotify,// -- undocumented
57 //public IStorage,
58 //public IPersistPropertyBag,
59 //public IShellIconOverlay, // -- undocumented
60 //public ICompositeFolder, // -- undocumented
61 //public IItemNameLimits, // https://msdn.microsoft.com/en-us/library/windows/desktop/bb761776%28v=vs.85%29.aspx
62{
63private:
64 CComPtr<IShellFolder> m_UserLocal;
65 CComPtr<IShellFolder> m_AllUsers;
66 CComPtr<CEnumMergedFolder> m_EnumSource;
67
71
72public:
74 virtual ~CMergedFolder();
75
77
81
84 COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
86 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
87 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
88 COM_INTERFACE_ENTRY_IID(IID_IItemNameLimits, IItemNameLimits)
89 COM_INTERFACE_ENTRY_IID(IID_IAugmentedShellFolder, IAugmentedShellFolder)
90 COM_INTERFACE_ENTRY_IID(IID_IAugmentedShellFolder2, IAugmentedShellFolder2)
91 COM_INTERFACE_ENTRY_IID(IID_IAugmentedShellFolder3, IAugmentedShellFolder3)
92 //COM_INTERFACE_ENTRY_IID(IID_IStorage, IStorage)
93 //COM_INTERFACE_ENTRY_IID(IID_IShellService, IShellService)
94 //COM_INTERFACE_ENTRY_IID(IID_ITranslateShellChangeNotify,ITranslateShellChangeNotify)
95 //COM_INTERFACE_ENTRY_IID(IID_IPersistPropertyBag,IPersistPropertyBag)
96 //COM_INTERFACE_ENTRY_IID(IID_IShellIconOverlay, IShellIconOverlay)
97 //COM_INTERFACE_ENTRY_IID(IID_ICompositeFolder, ICompositeFolder)
98 //COM_INTERFACE_ENTRY_IID(IID_IItemNameLimits, IItemNameLimits)
100
101 // IShellFolder
103 HWND hwndOwner,
104 LPBC pbcReserved,
105 LPOLESTR lpszDisplayName,
106 ULONG *pchEaten,
107 LPITEMIDLIST *ppidl,
108 ULONG *pdwAttributes) override;
109
111 HWND hwndOwner,
112 SHCONTF grfFlags,
113 IEnumIDList **ppenumIDList) override;
114
116 LPCITEMIDLIST pidl,
117 LPBC pbcReserved,
118 REFIID riid,
119 void **ppvOut) override;
120
122 LPCITEMIDLIST pidl,
123 LPBC pbcReserved,
124 REFIID riid,
125 void **ppvObj) override;
126
129 LPCITEMIDLIST pidl1,
130 LPCITEMIDLIST pidl2) override;
131
133 HWND hwndOwner,
134 REFIID riid,
135 void **ppvOut) override;
136
138 UINT cidl,
140 SFGAOF *rgfInOut) override;
141
143 HWND hwndOwner,
144 UINT cidl,
146 REFIID riid,
147 UINT *prgfInOut,
148 void **ppvOut) override;
149
151 LPCITEMIDLIST pidl,
154
156 HWND hwnd,
157 LPCITEMIDLIST pidl,
158 LPCOLESTR lpszName,
160 LPITEMIDLIST *ppidlOut) override;
161
162 // IShellFolder2
164 GUID *lpguid) override;
165
167 IEnumExtraSearch **ppenum) override;
168
171 ULONG *pSort,
172 ULONG *pDisplay) override;
173
175 UINT iColumn,
176 SHCOLSTATEF *pcsFlags) override;
177
179 LPCITEMIDLIST pidl,
180 const SHCOLUMNID *pscid,
181 VARIANT *pv) override;
182
184 LPCITEMIDLIST pidl,
185 UINT iColumn,
187
189 UINT iColumn,
190 SHCOLUMNID *pscid) override;
191
192 // IPersist
193 STDMETHOD(GetClassID)(CLSID *lpClassId) override;
194
195 // IPersistFolder
197
198 // IPersistFolder2
200
201 /*** IItemNameLimits methods ***/
202
203 STDMETHODIMP GetMaxLength(LPCWSTR pszName, int *piMaxNameLen) override
204 {
205 return E_NOTIMPL;
206 }
207
209 GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars) override
210 {
211 if (ppwszValidChars)
212 {
213 *ppwszValidChars = NULL;
214 }
215 if (ppwszInvalidChars)
216 {
217 SHStrDupW(INVALID_FILETITLE_CHARACTERSW, ppwszInvalidChars);
218 }
219 return S_OK;
220 }
221
222 // IAugmentedShellFolder2
223 STDMETHOD(AddNameSpace)(LPGUID lpGuid, IShellFolder * psf, LPCITEMIDLIST pcidl, ULONG dwUnknown) override;
224 STDMETHOD(GetNameSpaceID)(LPCITEMIDLIST pcidl, LPGUID lpGuid) override;
225 STDMETHOD(QueryNameSpace)(ULONG dwUnknown, LPGUID lpGuid, IShellFolder ** ppsf) override;
226 STDMETHOD(EnumNameSpace)(ULONG dwUnknown, PULONG lpUnknown) override;
227 STDMETHOD(UnWrapIDList)(LPCITEMIDLIST pcidl, LONG lUnknown, IShellFolder ** ppsf, LPITEMIDLIST * ppidl1, LPITEMIDLIST *ppidl2, LONG * lpUnknown) override;
228
229 // IAugmentedShellFolder3
231};
#define PURE
Definition: basetyps.h:64
#define STDMETHODIMP
Definition: basetyps.h:43
#define STDMETHOD(m)
Definition: basetyps.h:62
virtual ~CMergedFolder()
LPITEMIDLIST m_shellPidl
Definition: CMergedFolder.h:70
STDMETHOD() CreateViewObject(HWND hwndOwner, REFIID riid, void **ppvOut) override
STDMETHOD() GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, SFGAOF *rgfInOut) override
STDMETHOD() CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) override
CComPtr< IShellFolder > m_UserLocal
Definition: CMergedFolder.h:64
STDMETHOD() AddNameSpace(LPGUID lpGuid, IShellFolder *psf, LPCITEMIDLIST pcidl, ULONG dwUnknown) override
STDMETHODIMP GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars) override
STDMETHOD() GetDefaultColumnState(UINT iColumn, SHCOLSTATEF *pcsFlags) override
STDMETHOD() GetDefaultColumn(DWORD dwReserved, ULONG *pSort, ULONG *pDisplay) override
STDMETHOD() GetDisplayNameOf(LPCITEMIDLIST pidl, SHGDNF uFlags, STRRET *lpName) override
STDMETHOD() GetNameSpaceID(LPCITEMIDLIST pcidl, LPGUID lpGuid) override
STDMETHOD() GetDefaultSearchGUID(GUID *lpguid) override
STDMETHOD() QueryNameSpace(ULONG dwUnknown, LPGUID lpGuid, IShellFolder **ppsf) override
STDMETHOD() GetDetailsEx(LPCITEMIDLIST pidl, const SHCOLUMNID *pscid, VARIANT *pv) override
STDMETHOD() GetDetailsOf(LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS *psd) override
STDMETHOD() MapColumnToSCID(UINT iColumn, SHCOLUMNID *pscid) override
STDMETHOD() EnumSearches(IEnumExtraSearch **ppenum) override
STDMETHOD() EnumObjects(HWND hwndOwner, SHCONTF grfFlags, IEnumIDList **ppenumIDList) override
CComPtr< IShellFolder > m_AllUsers
Definition: CMergedFolder.h:65
LPITEMIDLIST m_AllUsersPidl
Definition: CMergedFolder.h:69
HRESULT _SetSources(IShellFolder *userLocal, IShellFolder *allUSers)
STDMETHOD() QueryNameSpace2(ULONG, QUERYNAMESPACEINFO *) override
STDMETHOD() SetNameOf(HWND hwnd, LPCITEMIDLIST pidl, LPCOLESTR lpszName, SHGDNF uFlags, LPITEMIDLIST *ppidlOut) override
STDMETHOD() GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, void **ppvOut) override
STDMETHODIMP GetMaxLength(LPCWSTR pszName, int *piMaxNameLen) override
STDMETHOD() BindToObject(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, void **ppvOut) override
STDMETHOD() UnWrapIDList(LPCITEMIDLIST pcidl, LONG lUnknown, IShellFolder **ppsf, LPITEMIDLIST *ppidl1, LPITEMIDLIST *ppidl2, LONG *lpUnknown) override
CComPtr< CEnumMergedFolder > m_EnumSource
Definition: CMergedFolder.h:66
LPITEMIDLIST m_UserLocalPidl
Definition: CMergedFolder.h:68
STDMETHOD() BindToStorage(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, void **ppvObj) override
STDMETHOD() GetClassID(CLSID *lpClassId) override
STDMETHOD() EnumNameSpace(ULONG dwUnknown, PULONG lpUnknown) override
STDMETHOD() GetCurFolder(PIDLIST_ABSOLUTE *pidl) override
LPARAM lParam
Definition: combotst.c:139
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
UINT uFlags
Definition: api.c:59
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2012
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID riid
Definition: atlbase.h:39
ULONG SFGAOF
Definition: shobjidl.idl:222
DWORD SHGDNF
Definition: shobjidl.idl:169
DWORD SHCONTF
Definition: shobjidl.idl:187
STDMETHOD() EnumNameSpace(ULONG, PULONG) PURE
STDMETHOD() GetNameSpaceID(LPCITEMIDLIST, LPGUID) PURE
STDMETHOD() QueryNameSpace(ULONG, LPGUID, IShellFolder **) PURE
#define S_OK
Definition: intsafe.h:52
#define COM_INTERFACE_ENTRY2_IID(iid, x, x2)
Definition: atlcom.h:609
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:679
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:651
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:645
#define END_COM_MAP()
Definition: atlcom.h:592
static HKEY override
Definition: compobj.c:81
static IParseDisplayName ParseDisplayName
Definition: moniker.c:816
static LPOLESTR
Definition: stg_prop.c:27
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
unsigned int UINT
Definition: ndis.h:50
interface IBindCtx * LPBC
Definition: objfwd.h:18
long LONG
Definition: pedump.c:60
const GUID IID_IPersist
Definition: proxy.cpp:14
GUID * LPGUID
Definition: guiddef.h:81
#define REFIID
Definition: guiddef.h:118
#define IDR_MERGEDFOLDER
Definition: shresdef.h:908
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
DWORD SHCOLSTATEF
Definition: shtypes.idl:142
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
#define INVALID_FILETITLE_CHARACTERSW
Definition: undocshell.h:929
_In_ LPCSTR lpName
Definition: winbase.h:2813
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
static void Initialize()
Definition: xlate.c:212
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193
#define const
Definition: zconf.h:233