ReactOS  0.4.15-dev-1177-g6cb3b62
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 
14 class 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:
24  const CLSID *m_pclsid;
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 
32  HRESULT _CreateShellExtInstance(const CLSID *pclsid, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut);
36  public:
37  CFSFolder();
38  ~CFSFolder();
39 
40  // IShellFolder
41  virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes);
42  virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList);
43  virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
44  virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
46  virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut);
47  virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut);
48  virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut);
50  virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut);
51 
52  /* ShellFolder2 */
53  virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid);
54  virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum);
55  virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay);
56  virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags);
57  virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv);
58  virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd);
60 
61  // IPersist
62  virtual HRESULT WINAPI GetClassID(CLSID *lpClassId);
63 
64  // IPersistFolder
66 
67  // IPersistFolder2
69 
70  // IPersistFolder3
71  virtual HRESULT WINAPI InitializeEx(IBindCtx *pbc, LPCITEMIDLIST pidlRoot, const PERSIST_FOLDER_TARGET_INFO *ppfti);
73 
74  // IContextMenuCB
75  virtual HRESULT WINAPI CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam);
76 
77  // IShellFolderViewCB
79 
80  /*** IItemNameLimits methods ***/
81 
83  GetMaxLength(LPCWSTR pszName, int *piMaxNameLen)
84  {
85  return E_NOTIMPL;
86  }
87 
89  GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars)
90  {
91  if (ppwszValidChars)
92  {
93  *ppwszValidChars = NULL;
94  }
95  if (ppwszInvalidChars)
96  {
97  SHStrDupW(INVALID_FILETITLE_CHARACTERSW, ppwszInvalidChars);
98  }
99  return S_OK;
100  }
101 
104 
106 
108  COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
109  COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
110  COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
111  COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
112  COM_INTERFACE_ENTRY_IID(IID_IPersistFolder3, IPersistFolder3)
114  COM_INTERFACE_ENTRY_IID(IID_IShellFolderViewCB, IShellFolderViewCB)
115  COM_INTERFACE_ENTRY_IID(IID_IItemNameLimits, IItemNameLimits)
116  END_COM_MAP()
117 
118  protected:
120 };
121 
122 #endif /* _CFSFOLDER_H_ */
HRESULT _CreateShellExtInstance(const CLSID *pclsid, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1756
LPWSTR m_sPathTarget
Definition: CFSFolder.h:27
#define REFIID
Definition: guiddef.h:118
virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
Definition: CFSFolder.cpp:1488
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
interface IBindCtx * LPBC
Definition: objfwd.h:18
REFIID riid
Definition: precomp.h:44
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
Definition: CFSFolder.cpp:830
HRESULT _GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1712
const GUID IID_IPersist
Definition: proxy.cpp:14
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
_In_ LPCSTR lpName
Definition: winbase.h:2752
virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
Definition: CFSFolder.cpp:1480
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid)
Definition: CFSFolder.cpp:1536
UINT_PTR WPARAM
Definition: windef.h:207
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2004
static LPOLESTR
Definition: stg_prop.c:27
virtual HRESULT WINAPI GetClassID(CLSID *lpClassId)
Definition: CFSFolder.cpp:1546
WPARAM wParam
Definition: combotst.c:138
virtual HRESULT WINAPI GetCurFolder(PIDLIST_ABSOLUTE *pidl)
Definition: CFSFolder.cpp:1593
const CLSID * m_pclsid
Definition: CFSFolder.h:24
#define INVALID_FILETITLE_CHARACTERSW
Definition: undocshell.h:726
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
#define STDMETHODIMP
Definition: basetyps.h:43
#define IDR_SHELLFSFOLDER
Definition: shresdef.h:836
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
HRESULT _GetIconHandler(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1740
virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid)
Definition: CFSFolder.cpp:1442
virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
Definition: CFSFolder.cpp:1454
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
DWORD m_bGroupPolicyActive
Definition: CFSFolder.h:31
LONG HRESULT
Definition: typedefs.h:79
STDMETHODIMP GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars)
Definition: CFSFolder.h:89
STDMETHODIMP GetMaxLength(LPCWSTR pszName, int *piMaxNameLen)
Definition: CFSFolder.h:83
#define WINAPI
Definition: msvc.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: id3.c:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1171
static BOOL protected
Definition: protectdata.c:37
virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
Definition: CFSFolder.cpp:736
virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:846
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
virtual HRESULT WINAPI GetFolderTargetInfo(PERSIST_FOLDER_TARGET_INFO *ppfti)
Definition: CFSFolder.cpp:1679
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:605
virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:996
#define S_OK
Definition: intsafe.h:51
virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidl)
Definition: CFSFolder.cpp:1564
virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
Definition: CFSFolder.cpp:1378
LPITEMIDLIST m_pidlRoot
Definition: CFSFolder.h:29
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: CFSFolder.cpp:1320
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int UINT
Definition: ndis.h:50
virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum)
Definition: CFSFolder.cpp:1448
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
unsigned int ULONG
Definition: retypes.h:1
virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:918
virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
Definition: CFSFolder.cpp:1467
#define END_COM_MAP()
Definition: atlcom.h:552
WCHAR * LPWSTR
Definition: xmlstorage.h:184
virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
Definition: CFSFolder.cpp:1091
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
virtual HRESULT WINAPI InitializeEx(IBindCtx *pbc, LPCITEMIDLIST pidlRoot, const PERSIST_FOLDER_TARGET_INFO *ppfti)
Definition: CFSFolder.cpp:1609
LPARAM lParam
Definition: combotst.c:139
HRESULT _CreateExtensionUIObject(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
Definition: CFSFolder.cpp:1686
virtual HRESULT WINAPI CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
Definition: CFSFolder.cpp:935
virtual HRESULT WINAPI CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CFSFolder.cpp:1786
virtual HRESULT WINAPI MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CFSFolder.cpp:1938
HRESULT WINAPI GetCustomViewInfo(ULONG unknown, SFVM_CUSTOMVIEWINFO_DATA *data)
Definition: CFSFolder.cpp:1850