ReactOS 0.4.16-dev-319-g6cf4263
CFSFolder.h
Go to the documentation of this file.
1/*
2 * PROJECT: shell32
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: file system folder
5 * COPYRIGHT: Copyright 1997 Marcus Meissner
6 * Copyright 1998, 1999, 2002 Juergen Schmied
7 * Copyright 2009 Andrew Hill
8 * Copyright 2020 Mark Jansen (mark.jansen@reactos.org)
9 */
10
11#ifndef _CFSFOLDER_H_
12#define _CFSFOLDER_H_
13
14class CFSFolder :
15 public CComCoClass<CFSFolder, &CLSID_ShellFSFolder>,
16 public CComObjectRootEx<CComMultiThreadModelNoCS>,
17 public IShellFolder2,
18 public IPersistFolder3,
19 public IContextMenuCB,
20 public IShellFolderViewCB,
21 public IItemNameLimits
22{
23 private:
25
26 /* both paths are parsible from the desktop */
27 LPWSTR m_sPathTarget; /* complete path to target used for enumeration and ChangeNotify */
28
29 LPITEMIDLIST m_pidlRoot; /* absolute pidl */
30
36
38 _In_ LPOLESTR lpszDisplayName,
40 _Out_ LPITEMIDLIST *ppidl);
42 HRESULT _CreateIDListFromName(LPCWSTR pszName, DWORD attrs, IBindCtx *pbc, LPITEMIDLIST *ppidl);
43
44 public:
45 CFSFolder();
46 ~CFSFolder();
47
48 // IShellFolder
49 STDMETHOD(ParseDisplayName)(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes) override;
50 STDMETHOD(EnumObjects)(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override;
51 STDMETHOD(BindToObject)(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override;
52 STDMETHOD(BindToStorage)(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override;
54 STDMETHOD(CreateViewObject)(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override;
55 STDMETHOD(GetAttributesOf)(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override;
56 STDMETHOD(GetUIObjectOf)(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) override;
58 STDMETHOD(SetNameOf)(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override;
59
60 /* ShellFolder2 */
61 STDMETHOD(GetDefaultSearchGUID)(GUID *pguid) override;
62 STDMETHOD(EnumSearches)(IEnumExtraSearch **ppenum) override;
63 STDMETHOD(GetDefaultColumn)(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override;
64 STDMETHOD(GetDefaultColumnState)(UINT iColumn, DWORD *pcsFlags) override;
65 STDMETHOD(GetDetailsEx)(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override;
66 STDMETHOD(GetDetailsOf)(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override;
68
69 // IPersist
70 STDMETHOD(GetClassID)(CLSID *lpClassId) override;
71
72 // IPersistFolder
74
75 // IPersistFolder2
76 STDMETHOD(GetCurFolder)(PIDLIST_ABSOLUTE * pidl) override;
77
78 // IPersistFolder3
79 STDMETHOD(InitializeEx)(IBindCtx *pbc, LPCITEMIDLIST pidlRoot, const PERSIST_FOLDER_TARGET_INFO *ppfti) override;
81
82 // IContextMenuCB
83 STDMETHOD(CallBack)(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam) override;
84
85 // IShellFolderViewCB
87
88 /*** IItemNameLimits methods ***/
89
91 GetMaxLength(LPCWSTR pszName, int *piMaxNameLen) override
92 {
93 return E_NOTIMPL;
94 }
95
97 GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars) override
98 {
99 if (ppwszValidChars)
100 {
101 *ppwszValidChars = NULL;
102 }
103 if (ppwszInvalidChars)
104 {
105 SHStrDupW(INVALID_FILETITLE_CHARACTERSW, ppwszInvalidChars);
106 }
107 return S_OK;
108 }
109
112
114
116 COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
117 COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
118 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
119 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
120 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder3, IPersistFolder3)
122 COM_INTERFACE_ENTRY_IID(IID_IShellFolderViewCB, IShellFolderViewCB)
123 COM_INTERFACE_ENTRY_IID(IID_IItemNameLimits, IItemNameLimits)
125
126 protected:
128
129 public:
130 // Helper functions shared with CDesktopFolder
132 static HRESULT GetDefaultFSColumnState(UINT iColumn, SHCOLSTATEF &csFlags);
133};
134
135#endif /* _CFSFOLDER_H_ */
#define STDMETHODIMP
Definition: basetyps.h:43
#define STDMETHOD(m)
Definition: basetyps.h:62
STDMETHOD() GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override
Definition: CFSFolder.cpp:1487
STDMETHOD() CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam) override
Definition: CFSFolder.cpp:1954
STDMETHOD() EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override
Definition: CFSFolder.cpp:974
HRESULT _CreateShellExtInstance(const CLSID *pclsid, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1923
static HRESULT GetDefaultFSColumnState(UINT iColumn, SHCOLSTATEF &csFlags)
Definition: CFSFolder.cpp:590
STDMETHOD() SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override
Definition: CFSFolder.cpp:1545
DWORD m_bGroupPolicyActive
Definition: CFSFolder.h:31
HRESULT _GetIconHandler(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1907
LPWSTR m_sPathTarget
Definition: CFSFolder.h:27
STDMETHOD() GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override
Definition: CFSFolder.cpp:1259
HRESULT _ParseSimple(_In_ LPOLESTR lpszDisplayName, _Inout_ WIN32_FIND_DATAW *pFind, _Out_ LPITEMIDLIST *ppidl)
Definition: CFSFolder.cpp:759
static HRESULT GetFSColumnDetails(UINT iColumn, SHELLDETAILS &sd)
Definition: CFSFolder.cpp:580
STDMETHOD() CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override
Definition: CFSFolder.cpp:1095
STDMETHOD() GetCurFolder(PIDLIST_ABSOLUTE *pidl) override
Definition: CFSFolder.cpp:1763
BOOL _GetFindDataFromName(_In_ LPCWSTR pszName, _Out_ WIN32_FIND_DATAW *pFind)
Definition: CFSFolder.cpp:800
STDMETHOD() GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut) override
Definition: CFSFolder.cpp:1339
HRESULT _GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1879
HRESULT _CreateIDListFromName(LPCWSTR pszName, DWORD attrs, IBindCtx *pbc, LPITEMIDLIST *ppidl)
Definition: CFSFolder.cpp:814
STDMETHOD() MapColumnToSCID(UINT column, SHCOLUMNID *pscid) override
Definition: CFSFolder.cpp:1706
const CLSID * m_pclsid
Definition: CFSFolder.h:24
STDMETHOD() BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
Definition: CFSFolder.cpp:1078
STDMETHOD() InitializeEx(IBindCtx *pbc, LPCITEMIDLIST pidlRoot, const PERSIST_FOLDER_TARGET_INFO *ppfti) override
Definition: CFSFolder.cpp:1779
STDMETHOD() GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags) override
Definition: CFSFolder.cpp:1629
HRESULT WINAPI GetCustomViewInfo(ULONG unknown, SFVM_CUSTOMVIEWINFO_DATA *data)
Definition: CFSFolder.cpp:2004
STDMETHOD() MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) override
Definition: CFSFolder.cpp:2092
LPITEMIDLIST m_pidlRoot
Definition: CFSFolder.h:29
STDMETHOD() GetFolderTargetInfo(PERSIST_FOLDER_TARGET_INFO *ppfti) override
Definition: CFSFolder.cpp:1849
STDMETHODIMP GetMaxLength(LPCWSTR pszName, int *piMaxNameLen) override
Definition: CFSFolder.h:91
STDMETHOD() GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override
Definition: CFSFolder.cpp:1640
STDMETHOD() EnumSearches(IEnumExtraSearch **ppenum) override
Definition: CFSFolder.cpp:1610
STDMETHODIMP GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars) override
Definition: CFSFolder.h:97
STDMETHOD() GetDefaultSearchGUID(GUID *pguid) override
Definition: CFSFolder.cpp:1604
STDMETHOD() GetClassID(CLSID *lpClassId) override
Definition: CFSFolder.cpp:1716
STDMETHOD() CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
Definition: CFSFolder.cpp:1164
STDMETHOD() GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override
Definition: CFSFolder.cpp:1616
STDMETHOD() BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
Definition: CFSFolder.cpp:990
HRESULT _CreateExtensionUIObject(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1856
STDMETHOD() GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override
Definition: CFSFolder.cpp:1648
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
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2018
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
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
static BOOL protected
Definition: protectdata.c:37
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
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
interface IBindCtx * LPBC
Definition: objfwd.h:18
const GUID IID_IPersist
Definition: proxy.cpp:14
#define REFIID
Definition: guiddef.h:118
#define IDR_SHELLFSFOLDER
Definition: shresdef.h:898
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
DWORD SHCOLSTATEF
Definition: shtypes.idl:142
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