ReactOS  0.4.15-dev-3165-gdf6fff7
CRecycleBin.h
Go to the documentation of this file.
1 /*
2  * Trash virtual folder support. The trashing engine is implemented in trash.c
3  *
4  * Copyright (C) 2006 Mikolaj Zalewski
5  * Copyright (C) 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_RECYCLEBIN_H_
23 #define _SHFLDR_RECYCLEBIN_H_
24 
28 
29 class CRecycleBin :
30  public CComCoClass<CRecycleBin, &CLSID_RecycleBin>,
31  public CComObjectRootEx<CComMultiThreadModelNoCS>,
32  public IShellFolder2,
33  public IPersistFolder2,
34  public IContextMenu,
35  public IShellPropSheetExt,
36  public IShellExtInit
37 {
38  private:
42 
43  public:
44  CRecycleBin();
45  ~CRecycleBin();
46 
47  // IPersistFolder
48  virtual HRESULT WINAPI GetClassID(CLSID *pClassID);
50 
51  // IPersistFolder2
53 
54  // IShellFolder
55  virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes);
56  virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList);
57  virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
58  virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
60  virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut);
61  virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut);
62  virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut);
64  virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut);
65 
66  // IShellFolder2
67  virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid);
68  virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum);
69  virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay);
70  virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags);
71  virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv);
74 
75  // IContextMenu
76  virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
78  virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
79 
80  // IShellPropSheetExt
82  virtual HRESULT WINAPI ReplacePage(EXPPS uPageID, LPFNSVADDPROPSHEETPAGE pfnReplaceWith, LPARAM lParam);
83 
84  // IShellExtInit
85  virtual HRESULT STDMETHODCALLTYPE Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID);
86 
89 
91 
93  COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
94  COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
95  COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
96  COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
97  COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
98  COM_INTERFACE_ENTRY_IID(IID_IShellPropSheetExt, IShellPropSheetExt)
99  COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
100  END_COM_MAP()
101 };
102 
103 #endif /* _SHFLDR_RECYCLEBIN_H_ */
#define REFIID
Definition: guiddef.h:118
BOOL TRASH_TrashFile(LPCWSTR wszPath)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
interface IBindCtx * LPBC
Definition: objfwd.h:18
virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
REFIID riid
Definition: precomp.h:44
virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
LPITEMIDLIST pidl
Definition: CRecycleBin.h:39
_In_ LPCSTR lpName
Definition: winbase.h:2768
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:612
BOOL RecycleBinIsEmpty()
UINT uFlags
Definition: api.c:59
char * LPSTR
Definition: xmlstorage.h:182
virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
static LPOLESTR
Definition: stg_prop.c:27
int32_t INT
Definition: typedefs.h:58
virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
unsigned int BOOL
Definition: ntddk_ex.h:94
virtual HRESULT WINAPI GetCurFolder(PIDLIST_ABSOLUTE *pidl)
virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
LONG_PTR LPARAM
Definition: windef.h:208
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid)
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:542
virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum)
virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidl)
virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
LONG HRESULT
Definition: typedefs.h:79
BOOL TRASH_CanTrashFile(LPCWSTR wszPath)
virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
#define WINAPI
Definition: msvc.h:6
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
unsigned long DWORD
Definition: ntddk_ex.h:95
LPARAM LPFNSVADDPROPSHEETPAGE
Definition: shobjidl.idl:117
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
virtual HRESULT WINAPI ReplacePage(EXPPS uPageID, LPFNSVADDPROPSHEETPAGE pfnReplaceWith, LPARAM lParam)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:606
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:562
HRESULT CRecyclerDropTarget_CreateInstance(REFIID riid, LPVOID *ppvOut)
unsigned int UINT
Definition: ndis.h:50
virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen)
virtual HRESULT WINAPI GetClassID(CLSID *pClassID)
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:640
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
virtual HRESULT WINAPI AddPages(LPFNSVADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
unsigned int ULONG
Definition: retypes.h:1
#define IDR_RECYCLEBIN
Definition: shresdef.h:860
#define END_COM_MAP()
Definition: atlcom.h:553
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LPARAM lParam
Definition: combotst.c:139
virtual HRESULT WINAPI CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid)