ReactOS  0.4.15-dev-1177-g6cb3b62
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 
45  public:
49 
50  // *** IShellFolder methods ***
51  virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes);
52  virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList);
53  virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
54  virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
56  virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut);
57  virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut);
58  virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut);
60  virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut);
61 
62  // *** IShellFolder2 methods ***
63  virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid);
64  virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum);
65  virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay);
66  virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags);
67  virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv);
68  virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd);
70 
71  // *** IPersist methods ***
72  virtual HRESULT WINAPI GetClassID(CLSID *lpClassId);
73 
74  // *** IPersistFolder methods ***
76 
77  // *** IPersistFolder2 methods ***
79 
80  // IContextMenuCB
81  virtual HRESULT WINAPI CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam);
82 
83  /*** IItemNameLimits methods ***/
84 
86  GetMaxLength(LPCWSTR pszName, int *piMaxNameLen)
87  {
88  return E_NOTIMPL;
89  }
90 
92  GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars)
93  {
94  if (ppwszValidChars)
95  {
96  *ppwszValidChars = NULL;
97  }
98  if (ppwszInvalidChars)
99  {
100  SHStrDupW(INVALID_FILETITLE_CHARACTERSW, ppwszInvalidChars);
101  }
102  return S_OK;
103  }
104 
106  DECLARE_CENTRAL_INSTANCE_NOT_AGGREGATABLE(CDesktopFolder)
107 
109 
111  COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
112  COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
113  COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
114  COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
116  COM_INTERFACE_ENTRY_IID(IID_IItemNameLimits, IItemNameLimits)
117  END_COM_MAP()
118 };
119 
120 #endif /* _CDESKTOPFOLDER_H_ */
virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
#define REFIID
Definition: guiddef.h:118
virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
interface IBindCtx * LPBC
Definition: objfwd.h:18
virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid)
REFIID riid
Definition: precomp.h:44
virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
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 Initialize(PCIDLIST_ABSOLUTE pidl)
virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
UINT_PTR WPARAM
Definition: windef.h:207
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2004
CComPtr< IShellFolder2 > m_DesktopFSFolder
virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
static LPOLESTR
Definition: stg_prop.c:27
WPARAM wParam
Definition: combotst.c:138
#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_SHELLDESKTOP
Definition: shresdef.h:835
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
CComPtr< IShellFolder2 > m_SharedDesktopFSFolder
virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum)
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
virtual HRESULT WINAPI CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid)
LONG HRESULT
Definition: typedefs.h:79
#define WINAPI
Definition: msvc.h:6
virtual HRESULT WINAPI GetCurFolder(PIDLIST_ABSOLUTE *pidl)
unsigned long DWORD
Definition: ntddk_ex.h:95
virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
STDMETHODIMP GetMaxLength(LPCWSTR pszName, int *piMaxNameLen)
virtual HRESULT WINAPI GetClassID(CLSID *lpClassId)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:605
virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
#define S_OK
Definition: intsafe.h:51
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
#define E_NOTIMPL
Definition: ddrawi.h:99
STDMETHODIMP GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars)
LPITEMIDLIST pidlRoot
unsigned int UINT
Definition: ndis.h:50
virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
CComPtr< IShellFolder2 > m_regFolder
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
unsigned int ULONG
Definition: retypes.h:1
HRESULT _GetSFFromPidl(LPCITEMIDLIST pidl, IShellFolder2 **psf)
#define END_COM_MAP()
Definition: atlcom.h:552
WCHAR * LPWSTR
Definition: xmlstorage.h:184
virtual HRESULT WINAPI CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam)
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
HRESULT WINAPI FinalConstruct()
LPARAM lParam
Definition: combotst.c:139