ReactOS  0.4.15-dev-506-ga3ec01c
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 
22 interface IAugmentedShellFolder : public IShellFolder
23 {
28 };
29 
30 interface IAugmentedShellFolder2 : public IAugmentedShellFolder
31 {
32  virtual HRESULT STDMETHODCALLTYPE UnWrapIDList(LPCITEMIDLIST, LONG, IShellFolder **, LPITEMIDLIST *, LPITEMIDLIST *, LONG *) = 0;
33 };
34 
35 /* No idea what QUERYNAMESPACEINFO struct contains, yet */
37 {
39 };
40 
41 interface IAugmentedShellFolder3 : public IAugmentedShellFolder2
42 {
43  virtual HRESULT STDMETHODCALLTYPE QueryNameSpace2(ULONG, QUERYNAMESPACEINFO *) = 0;
44 };
45 
46 class CEnumMergedFolder;
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 {
63 private:
64  CComPtr<IShellFolder> m_UserLocal;
65  CComPtr<IShellFolder> m_AllUsers;
66  CComPtr<CEnumMergedFolder> m_EnumSource;
67 
71 
72 public:
73  CMergedFolder();
74  virtual ~CMergedFolder();
75 
76  HRESULT _SetSources(IShellFolder* userLocal, IShellFolder* allUSers);
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)
99  END_COM_MAP()
100 
101  // IShellFolder
103  HWND hwndOwner,
104  LPBC pbcReserved,
105  LPOLESTR lpszDisplayName,
106  ULONG *pchEaten,
107  LPITEMIDLIST *ppidl,
108  ULONG *pdwAttributes);
109 
111  HWND hwndOwner,
112  SHCONTF grfFlags,
113  IEnumIDList **ppenumIDList);
114 
116  LPCITEMIDLIST pidl,
117  LPBC pbcReserved,
118  REFIID riid,
119  void **ppvOut);
120 
122  LPCITEMIDLIST pidl,
123  LPBC pbcReserved,
124  REFIID riid,
125  void **ppvObj);
126 
128  LPARAM lParam,
129  LPCITEMIDLIST pidl1,
130  LPCITEMIDLIST pidl2);
131 
133  HWND hwndOwner,
134  REFIID riid,
135  void **ppvOut);
136 
138  UINT cidl,
139  PCUITEMID_CHILD_ARRAY apidl,
140  SFGAOF *rgfInOut);
141 
143  HWND hwndOwner,
144  UINT cidl,
145  PCUITEMID_CHILD_ARRAY apidl,
146  REFIID riid,
147  UINT *prgfInOut,
148  void **ppvOut);
149 
151  LPCITEMIDLIST pidl,
152  SHGDNF uFlags,
153  STRRET *lpName);
154 
156  HWND hwnd,
157  LPCITEMIDLIST pidl,
158  LPCOLESTR lpszName,
159  SHGDNF uFlags,
160  LPITEMIDLIST *ppidlOut);
161 
162  // IShellFolder2
164  GUID *lpguid);
165 
167  IEnumExtraSearch **ppenum);
168 
171  ULONG *pSort,
172  ULONG *pDisplay);
173 
175  UINT iColumn,
176  SHCOLSTATEF *pcsFlags);
177 
179  LPCITEMIDLIST pidl,
180  const SHCOLUMNID *pscid,
181  VARIANT *pv);
182 
184  LPCITEMIDLIST pidl,
185  UINT iColumn,
186  SHELLDETAILS *psd);
187 
189  UINT iColumn,
190  SHCOLUMNID *pscid);
191 
192  // IPersist
193  virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *lpClassId);
194 
195  // IPersistFolder
197 
198  // IPersistFolder2
200 
201  /*** IItemNameLimits methods ***/
202 
204  GetMaxLength(LPCWSTR pszName, int *piMaxNameLen)
205  {
206  return E_NOTIMPL;
207  }
208 
210  GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars)
211  {
212  if (ppwszValidChars)
213  {
214  *ppwszValidChars = NULL;
215  }
216  if (ppwszInvalidChars)
217  {
218  SHStrDupW(INVALID_FILETITLE_CHARACTERSW, ppwszInvalidChars);
219  }
220  return S_OK;
221  }
222 
223  // IAugmentedShellFolder2
224  virtual HRESULT STDMETHODCALLTYPE AddNameSpace(LPGUID lpGuid, IShellFolder * psf, LPCITEMIDLIST pcidl, ULONG dwUnknown);
226  virtual HRESULT STDMETHODCALLTYPE QueryNameSpace(ULONG dwUnknown, LPGUID lpGuid, IShellFolder ** ppsf);
227  virtual HRESULT STDMETHODCALLTYPE EnumNameSpace(ULONG dwUnknown, PULONG lpUnknown);
228  virtual HRESULT STDMETHODCALLTYPE UnWrapIDList(LPCITEMIDLIST pcidl, LONG lUnknown, IShellFolder ** ppsf, LPITEMIDLIST * ppidl1, LPITEMIDLIST *ppidl2, LONG * lpUnknown);
229 
230  // IAugmentedShellFolder3
232 };
virtual HRESULT STDMETHODCALLTYPE GetDefaultSearchGUID(GUID *lpguid)
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
virtual HRESULT STDMETHODCALLTYPE GetDefaultColumnState(UINT iColumn, SHCOLSTATEF *pcsFlags)
STDMETHODIMP GetMaxLength(LPCWSTR pszName, int *piMaxNameLen)
#define REFIID
Definition: guiddef.h:118
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
interface IBindCtx * LPBC
Definition: objfwd.h:18
virtual HRESULT STDMETHODCALLTYPE GetNameSpaceID(LPCITEMIDLIST, LPGUID)=0
virtual HRESULT STDMETHODCALLTYPE QueryNameSpace(ULONG, LPGUID, IShellFolder **)=0
REFIID riid
Definition: precomp.h:44
virtual HRESULT STDMETHODCALLTYPE GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, SFGAOF *rgfInOut)
const GUID IID_IPersist
Definition: proxy.cpp:14
CComPtr< IShellFolder > m_UserLocal
Definition: CMergedFolder.h:64
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
_In_ LPCSTR lpName
Definition: winbase.h:2752
virtual HRESULT STDMETHODCALLTYPE EnumNameSpace(ULONG dwUnknown, PULONG lpUnknown)
STDMETHODIMP GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars)
virtual HRESULT STDMETHODCALLTYPE UnWrapIDList(LPCITEMIDLIST pcidl, LONG lUnknown, IShellFolder **ppsf, LPITEMIDLIST *ppidl1, LPITEMIDLIST *ppidl2, LONG *lpUnknown)
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
virtual HRESULT STDMETHODCALLTYPE SetNameOf(HWND hwnd, LPCITEMIDLIST pidl, LPCOLESTR lpszName, SHGDNF uFlags, LPITEMIDLIST *ppidlOut)
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2004
UINT uFlags
Definition: api.c:59
static LPOLESTR
Definition: stg_prop.c:27
DWORD SHCONTF
Definition: shobjidl.idl:187
virtual HRESULT STDMETHODCALLTYPE CreateViewObject(HWND hwndOwner, REFIID riid, void **ppvOut)
CComPtr< IShellFolder > m_AllUsers
Definition: CMergedFolder.h:65
#define INVALID_FILETITLE_CHARACTERSW
Definition: undocshell.h:710
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
long LONG
Definition: pedump.c:60
#define STDMETHODIMP
Definition: basetyps.h:43
smooth NULL
Definition: ftsmooth.c:416
LPITEMIDLIST m_shellPidl
Definition: CMergedFolder.h:70
virtual HRESULT STDMETHODCALLTYPE GetDefaultColumn(DWORD dwReserved, ULONG *pSort, ULONG *pDisplay)
LONG_PTR LPARAM
Definition: windef.h:208
LPITEMIDLIST m_UserLocalPidl
Definition: CMergedFolder.h:68
virtual HRESULT STDMETHODCALLTYPE Initialize(PCIDLIST_ABSOLUTE pidl)
virtual HRESULT STDMETHODCALLTYPE GetDetailsOf(LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS *psd)
virtual HRESULT STDMETHODCALLTYPE GetDisplayNameOf(LPCITEMIDLIST pidl, SHGDNF uFlags, STRRET *lpName)
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
LONG HRESULT
Definition: typedefs.h:78
HRESULT _SetSources(IShellFolder *userLocal, IShellFolder *allUSers)
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
unsigned long DWORD
Definition: ntddk_ex.h:95
#define COM_INTERFACE_ENTRY2_IID(iid, x, x2)
Definition: atlcom.h:569
virtual HRESULT STDMETHODCALLTYPE GetDetailsEx(LPCITEMIDLIST pidl, const SHCOLUMNID *pscid, VARIANT *pv)
DWORD SHCOLSTATEF
Definition: shtypes.idl:142
virtual HRESULT STDMETHODCALLTYPE GetCurFolder(PIDLIST_ABSOLUTE *pidl)
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:605
CComPtr< CEnumMergedFolder > m_EnumSource
Definition: CMergedFolder.h:66
unsigned char BYTE
Definition: xxhash.c:193
SFGAO_STORAGEANCESTOR typedef ULONG SFGAOF
Definition: shobjidl.idl:218
virtual HRESULT STDMETHODCALLTYPE EnumNameSpace(ULONG, PULONG)=0
virtual HRESULT STDMETHODCALLTYPE EnumObjects(HWND hwndOwner, SHCONTF grfFlags, IEnumIDList **ppenumIDList)
#define S_OK
Definition: intsafe.h:59
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
virtual HRESULT STDMETHODCALLTYPE BindToObject(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, void **ppvOut)
#define E_NOTIMPL
Definition: ddrawi.h:99
virtual HRESULT STDMETHODCALLTYPE CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
virtual HRESULT STDMETHODCALLTYPE AddNameSpace(LPGUID lpGuid, IShellFolder *psf, LPCITEMIDLIST pcidl, ULONG dwUnknown)
virtual HRESULT STDMETHODCALLTYPE MapColumnToSCID(UINT iColumn, SHCOLUMNID *pscid)
LPITEMIDLIST m_AllUsersPidl
Definition: CMergedFolder.h:69
unsigned int * PULONG
Definition: retypes.h:1
virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *lpClassId)
unsigned int UINT
Definition: ndis.h:50
virtual HRESULT STDMETHODCALLTYPE ParseDisplayName(HWND hwndOwner, LPBC pbcReserved, LPOLESTR lpszDisplayName, ULONG *pchEaten, LPITEMIDLIST *ppidl, ULONG *pdwAttributes)
#define IDR_MERGEDFOLDER
Definition: shresdef.h:833
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
virtual HRESULT STDMETHODCALLTYPE EnumSearches(IEnumExtraSearch **ppenum)
virtual HRESULT STDMETHODCALLTYPE QueryNameSpace2(ULONG, QUERYNAMESPACEINFO *)
virtual ~CMergedFolder()
unsigned int ULONG
Definition: retypes.h:1
#define const
Definition: zconf.h:230
virtual HRESULT STDMETHODCALLTYPE BindToStorage(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, void **ppvObj)
#define END_COM_MAP()
Definition: atlcom.h:552
WCHAR * LPWSTR
Definition: xmlstorage.h:184
virtual HRESULT STDMETHODCALLTYPE QueryNameSpace(ULONG dwUnknown, LPGUID lpGuid, IShellFolder **ppsf)
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
virtual HRESULT STDMETHODCALLTYPE GetNameSpaceID(LPCITEMIDLIST pcidl, LPGUID lpGuid)
LPARAM lParam
Definition: combotst.c:139
virtual HRESULT STDMETHODCALLTYPE GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, void **ppvOut)
DWORD SHGDNF
Definition: shobjidl.idl:169