2011-05-15 15:55:49 +00:00
|
|
|
/*
|
|
|
|
* Trash virtual folder support. The trashing engine is implemented in trash.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Mikolaj Zalewski
|
|
|
|
* Copyright (C) 2009 Andrew Hill
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _SHFLDR_RECYCLEBIN_H_
|
|
|
|
#define _SHFLDR_RECYCLEBIN_H_
|
|
|
|
|
2014-10-31 14:29:26 +00:00
|
|
|
BOOL TRASH_CanTrashFile(LPCWSTR wszPath);
|
|
|
|
BOOL TRASH_TrashFile(LPCWSTR wszPath);
|
2017-08-22 13:50:25 +00:00
|
|
|
HRESULT CRecyclerDropTarget_CreateInstance(REFIID riid, LPVOID * ppvOut);
|
2014-10-31 14:29:26 +00:00
|
|
|
|
2011-11-14 22:46:37 +00:00
|
|
|
class CRecycleBin :
|
2011-12-18 21:54:04 +00:00
|
|
|
public CComCoClass<CRecycleBin, &CLSID_RecycleBin>,
|
|
|
|
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
|
|
|
public IShellFolder2,
|
|
|
|
public IPersistFolder2,
|
|
|
|
public IContextMenu,
|
|
|
|
public IShellPropSheetExt,
|
|
|
|
public IShellExtInit
|
2011-05-15 15:55:49 +00:00
|
|
|
{
|
2011-12-18 21:54:04 +00:00
|
|
|
private:
|
|
|
|
LPITEMIDLIST pidl;
|
|
|
|
INT iIdEmpty;
|
2015-12-04 11:12:01 +00:00
|
|
|
BOOL RecycleBinIsEmpty();
|
2011-11-14 22:18:42 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
public:
|
|
|
|
CRecycleBin();
|
|
|
|
~CRecycleBin();
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
// IPersistFolder
|
|
|
|
virtual HRESULT WINAPI GetClassID(CLSID *pClassID);
|
2019-09-20 10:19:34 +00:00
|
|
|
virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidl);
|
2011-11-14 22:18:42 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
// IPersistFolder2
|
2019-09-10 10:24:11 +00:00
|
|
|
virtual HRESULT WINAPI GetCurFolder(PIDLIST_ABSOLUTE * pidl);
|
2011-11-14 22:18:42 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
// IShellFolder
|
2014-08-15 10:38:11 +00:00
|
|
|
virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes);
|
2011-12-18 21:54:04 +00:00
|
|
|
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList);
|
2014-08-15 10:38:11 +00:00
|
|
|
virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
|
|
|
|
virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
|
|
|
|
virtual HRESULT WINAPI CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2);
|
2011-12-18 21:54:04 +00:00
|
|
|
virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut);
|
2014-08-15 10:38:11 +00:00
|
|
|
virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut);
|
|
|
|
virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut);
|
|
|
|
virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet);
|
|
|
|
virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut);
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
// IShellFolder2
|
|
|
|
virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid);
|
|
|
|
virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum);
|
|
|
|
virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay);
|
|
|
|
virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags);
|
2014-08-15 10:38:11 +00:00
|
|
|
virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv);
|
|
|
|
virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd);
|
2011-12-18 21:54:04 +00:00
|
|
|
virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid);
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
// IContextMenu
|
|
|
|
virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
|
|
|
|
virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi);
|
|
|
|
virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
// IShellPropSheetExt
|
|
|
|
virtual HRESULT WINAPI AddPages(LPFNSVADDPROPSHEETPAGE pfnAddPage, LPARAM lParam);
|
|
|
|
virtual HRESULT WINAPI ReplacePage(EXPPS uPageID, LPFNSVADDPROPSHEETPAGE pfnReplaceWith, LPARAM lParam);
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
// IShellExtInit
|
2019-09-22 14:36:01 +00:00
|
|
|
virtual HRESULT STDMETHODCALLTYPE Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID);
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
DECLARE_REGISTRY_RESOURCEID(IDR_RECYCLEBIN)
|
|
|
|
DECLARE_NOT_AGGREGATABLE(CRecycleBin)
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
BEGIN_COM_MAP(CRecycleBin)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IShellPropSheetExt, IShellPropSheetExt)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
|
|
|
|
END_COM_MAP()
|
2011-05-15 15:55:49 +00:00
|
|
|
};
|
|
|
|
|
2014-01-25 17:24:24 +00:00
|
|
|
#endif /* _SHFLDR_RECYCLEBIN_H_ */
|