ReactOS 0.4.16-dev-334-g4d9f67c
CDesktopFolder.h
Go to the documentation of this file.
1/*
2 * Virtual Desktop Folder
3 *
4 * Copyright 1997 Marcus Meissner
5 * Copyright 1998, 1999, 2002 Juergen Schmied
6 * Copyright 2009 Andrew Hill
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#ifndef _CDESKTOPFOLDER_H_
24#define _CDESKTOPFOLDER_H_
25
27 public CComCoClass<CDesktopFolder, &CLSID_ShellDesktop>,
28 public CComObjectRootEx<CComMultiThreadModelNoCS>,
29 public IShellFolder2,
30 public IPersistFolder2,
31 public IContextMenuCB,
32 public IItemNameLimits
33{
34 private:
35 /* both paths are parsible from the desktop */
36 CComPtr<IShellFolder2> m_DesktopFSFolder;
37 CComPtr<IShellFolder2> m_SharedDesktopFSFolder;
38 CComPtr<IShellFolder2> m_regFolder;
39
40 LPWSTR sPathTarget; /* complete path to target used for enumeration and ChangeNotify */
41 LPITEMIDLIST pidlRoot; /* absolute pidl */
42
44
46
48 HWND hwndOwner,
49 LPBC pbc,
50 LPOLESTR pszPath,
51 DWORD *pchEaten,
52 PIDLIST_RELATIVE *ppidl,
53 DWORD *pdwAttributes);
54
57 HWND hwndOwner,
58 LPBC pbc,
59 LPOLESTR lpszDisplayName,
60 DWORD *pchEaten,
61 PIDLIST_RELATIVE *ppidl,
62 DWORD *pdwAttributes);
63
66 HWND hwndOwner,
67 LPBC pbc,
68 LPOLESTR lpszDisplayName,
69 DWORD *pchEaten,
70 PIDLIST_RELATIVE *ppidl,
71 DWORD *pdwAttributes);
72
73 public:
77
78 // *** IShellFolder methods ***
79 STDMETHOD(ParseDisplayName)(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes) override;
80 STDMETHOD(EnumObjects)(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override;
81 STDMETHOD(BindToObject)(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override;
82 STDMETHOD(BindToStorage)(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override;
84 STDMETHOD(CreateViewObject)(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override;
85 STDMETHOD(GetAttributesOf)(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override;
86 STDMETHOD(GetUIObjectOf)(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) override;
88 STDMETHOD(SetNameOf)(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override;
89
90 // *** IShellFolder2 methods ***
91 STDMETHOD(GetDefaultSearchGUID)(GUID *pguid) override;
92 STDMETHOD(EnumSearches)(IEnumExtraSearch **ppenum) override;
93 STDMETHOD(GetDefaultColumn)(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override;
94 STDMETHOD(GetDefaultColumnState)(UINT iColumn, DWORD *pcsFlags) override;
95 STDMETHOD(GetDetailsEx)(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override;
96 STDMETHOD(GetDetailsOf)(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override;
98
99 // *** IPersist methods ***
100 STDMETHOD(GetClassID)(CLSID *lpClassId) override;
101
102 // *** IPersistFolder methods ***
103 STDMETHOD(Initialize)(PCIDLIST_ABSOLUTE pidl) override;
104
105 // *** IPersistFolder2 methods ***
106 STDMETHOD(GetCurFolder)(PIDLIST_ABSOLUTE * pidl) override;
107
108 // IContextMenuCB
109 STDMETHOD(CallBack)(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam) override;
110
111 /*** IItemNameLimits methods ***/
112
114 GetMaxLength(LPCWSTR pszName, int *piMaxNameLen) override
115 {
116 return E_NOTIMPL;
117 }
118
120 GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars) override
121 {
122 if (ppwszValidChars)
123 {
124 *ppwszValidChars = NULL;
125 }
126 if (ppwszInvalidChars)
127 {
128 SHStrDupW(INVALID_FILETITLE_CHARACTERSW, ppwszInvalidChars);
129 }
130 return S_OK;
131 }
132
134 DECLARE_CENTRAL_INSTANCE_NOT_AGGREGATABLE(CDesktopFolder)
135
137
139 COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
140 COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
141 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
142 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
144 COM_INTERFACE_ENTRY_IID(IID_IItemNameLimits, IItemNameLimits)
146};
147
149 public CComObjectRootEx<CComMultiThreadModelNoCS>,
150 public IShellFolderViewCB,
151 public IFolderFilter
152{
153 IShellView *m_pShellView; // Not ref-counted!
155
156 public:
157 CDesktopFolderViewCB() : m_IsProgmanHosted(0) {}
158 void Initialize(IShellView *psv) { m_pShellView = psv; }
159 static bool IsProgmanHostedBrowser(IShellView *psv);
160 bool IsProgmanHostedBrowser();
161
162 // IShellFolderViewCB
163 STDMETHOD(MessageSFVCB)(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
164
165 // IFolderFilter
166 STDMETHOD(ShouldShow)(IShellFolder *psf, PCIDLIST_ABSOLUTE pidlFolder, PCUITEMID_CHILD pidlItem) override;
168
172 COM_INTERFACE_ENTRY_IID(IID_IShellFolderViewCB, IShellFolderViewCB)
173 COM_INTERFACE_ENTRY_IID(IID_IFolderFilter, IFolderFilter)
175};
176
177#endif /* _CDESKTOPFOLDER_H_ */
unsigned char UINT8
const WCHAR * class
Definition: main.c:68
#define STDMETHODIMP
Definition: basetyps.h:43
#define STDMETHOD(m)
Definition: basetyps.h:62
void Initialize(IShellView *psv)
IShellView * m_pShellView
STDMETHODIMP GetEnumFlags(IShellFolder *, PCIDLIST_ABSOLUTE, HWND *, DWORD *) override
STDMETHOD() GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override
CComPtr< IShellFolder2 > m_SharedDesktopFSFolder
STDMETHOD() BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
HRESULT WINAPI FinalConstruct()
STDMETHOD() GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override
STDMETHOD() CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override
STDMETHOD() GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags) override
STDMETHOD() SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override
STDMETHOD() GetDefaultSearchGUID(GUID *pguid) override
STDMETHOD() CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
STDMETHODIMP GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars) override
STDMETHOD() MapColumnToSCID(UINT column, SHCOLUMNID *pscid) override
STDMETHOD() GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override
STDMETHOD() BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam) override
STDMETHODIMP GetMaxLength(LPCWSTR pszName, int *piMaxNameLen) override
HRESULT _GetSFFromPidl(LPCITEMIDLIST pidl, IShellFolder2 **psf)
CComPtr< IShellFolder2 > m_DesktopFSFolder
STDMETHODIMP HttpUrlParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
STDMETHOD() GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override
STDMETHOD() GetCurFolder(PIDLIST_ABSOLUTE *pidl) override
STDMETHOD() GetClassID(CLSID *lpClassId) override
STDMETHOD() EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override
STDMETHOD() EnumSearches(IEnumExtraSearch **ppenum) override
LPITEMIDLIST pidlRoot
STDMETHOD() GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override
CComPtr< IShellFolder2 > m_regFolder
STDMETHODIMP ShellUrlParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
STDMETHOD() GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut) override
HRESULT _ParseDisplayNameByParent(HWND hwndOwner, LPBC pbc, LPOLESTR pszPath, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
static HRESULT GetColumnDetails(UINT iColumn, SHELLDETAILS &sd)
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2018
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#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
#define DECLARE_NO_REGISTRY()
Definition: atlcom.h:639
static const WCHAR sd[]
Definition: suminfo.c:286
static IParseDisplayName ParseDisplayName
Definition: moniker.c:816
static LPOLESTR
Definition: stg_prop.c:27
unsigned int UINT
Definition: ndis.h:50
interface IBindCtx * LPBC
Definition: objfwd.h:18
const GUID IID_IPersist
Definition: proxy.cpp:14
#define REFIID
Definition: guiddef.h:118
#define IDR_SHELLDESKTOP
Definition: shresdef.h:897
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
uint32_t ULONG
Definition: typedefs.h:59
#define INVALID_FILETITLE_CHARACTERSW
Definition: undocshell.h:929
_In_ LPCSTR lpName
Definition: winbase.h:2814
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
static void Initialize()
Definition: xlate.c:212
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185