ReactOS  0.4.15-dev-1177-g6cb3b62
CMyDocsFolder.h
Go to the documentation of this file.
1 /*
2  * Virtual MyDocuments Folder
3  *
4  * Copyright 2007 Johannes Anderwald
5  * Copyright 2009 Andrew Hill
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21 
22 #ifndef _SHFLDR_MYDOCUMENTS_H_
23 #define _SHFLDR_MYDOCUMENTS_H_
24 
26  public CComCoClass<CMyDocsFolder, &CLSID_MyDocuments>,
27  public CComObjectRootEx<CComMultiThreadModelNoCS>,
28  public IShellFolder2,
29  public IPersistFolder2,
30  public IItemNameLimits
31 {
32  private:
33  CComPtr<IShellFolder2> m_pisfInner;
35 
37 
38  public:
39  CMyDocsFolder();
41 
43 
44  // IShellFolder
45  virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes);
46  virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList);
47  virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
48  virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
50  virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut);
51  virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut);
52  virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut);
54  virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut);
55 
56  /* ShellFolder2 */
57  virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid);
58  virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum);
59  virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay);
60  virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags);
61  virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv);
62  virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd);
64 
65  // IPersist
66  virtual HRESULT WINAPI GetClassID(CLSID *lpClassId);
67 
68  // IPersistFolder
70 
71  // IPersistFolder2
73 
74  /*** IItemNameLimits methods ***/
75 
77  GetMaxLength(LPCWSTR pszName, int *piMaxNameLen)
78  {
79  return E_NOTIMPL;
80  }
81 
83  GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars)
84  {
85  if (ppwszValidChars)
86  {
87  *ppwszValidChars = NULL;
88  }
89  if (ppwszInvalidChars)
90  {
91  SHStrDupW(INVALID_FILETITLE_CHARACTERSW, ppwszInvalidChars);
92  }
93  return S_OK;
94  }
95 
98 
100 
102  COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
103  COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
104  COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
105  COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
107  COM_INTERFACE_ENTRY_IID(IID_IItemNameLimits, IItemNameLimits)
108  END_COM_MAP()
109 };
110 
111 #endif /* _SHFLDR_MYDOCUMENTS_H_ */
virtual HRESULT WINAPI GetClassID(CLSID *lpClassId)
#define REFIID
Definition: guiddef.h:118
virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidl)
virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum)
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
interface IBindCtx * LPBC
Definition: objfwd.h:18
REFIID riid
Definition: precomp.h:44
virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
const GUID IID_IPersist
Definition: proxy.cpp:14
virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
virtual HRESULT WINAPI CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
_In_ LPCSTR lpName
Definition: winbase.h:2752
STDMETHODIMP GetMaxLength(LPCWSTR pszName, int *piMaxNameLen)
Definition: CMyDocsFolder.h:77
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
HRESULT WINAPI SHStrDupW(LPCWSTR src, LPWSTR *dest)
Definition: string.c:2004
virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
static LPOLESTR
Definition: stg_prop.c:27
virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid)
#define INVALID_FILETITLE_CHARACTERSW
Definition: undocshell.h:726
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
#define STDMETHODIMP
Definition: basetyps.h:43
virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI FinalConstruct()
virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
LONG_PTR LPARAM
Definition: windef.h:208
virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
STDMETHODIMP GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars)
Definition: CMyDocsFolder.h:83
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)
LONG HRESULT
Definition: typedefs.h:79
#define WINAPI
Definition: msvc.h:6
virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid)
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
LPITEMIDLIST m_pidlInner
Definition: CMyDocsFolder.h:34
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:605
virtual HRESULT WINAPI GetCurFolder(PIDLIST_ABSOLUTE *pidl)
#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
unsigned int UINT
Definition: ndis.h:50
HRESULT EnsureFolder()
virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
#define IDR_MYDOCUMENTS
Definition: shresdef.h:830
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
unsigned int ULONG
Definition: retypes.h:1
#define END_COM_MAP()
Definition: atlcom.h:552
WCHAR * LPWSTR
Definition: xmlstorage.h:184
CComPtr< IShellFolder2 > m_pisfInner
Definition: CMyDocsFolder.h:33
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
LPARAM lParam
Definition: combotst.c:139