Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers...
[reactos.git] / dll / win32 / shell32 / folders / CDrivesFolder.h
1 /*
2 * Virtual Workplace 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 _CDRIVESFOLDER_H_
24 #define _CDRIVESFOLDER_H_
25
26 class CDrivesFolder :
27 public CComCoClass<CDrivesFolder, &CLSID_MyComputer>,
28 public CComObjectRootEx<CComMultiThreadModelNoCS>,
29 public IShellFolder2,
30 public IPersistFolder2
31 {
32 private:
33 /* both paths are parsible from the desktop */
34 LPITEMIDLIST pidlRoot; /* absolute pidl */
35 CComPtr<IShellFolder2> m_regFolder;
36
37 public:
38 CDrivesFolder();
39 ~CDrivesFolder();
40 HRESULT WINAPI FinalConstruct();
41
42 // IShellFolder
43 virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes);
44 virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList);
45 virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
46 virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
47 virtual HRESULT WINAPI CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2);
48 virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut);
49 virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut);
50 virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut);
51 virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet);
52 virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut);
53
54 /* ShellFolder2 */
55 virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid);
56 virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum);
57 virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay);
58 virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags);
59 virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv);
60 virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd);
61 virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid);
62
63 // IPersist
64 virtual HRESULT WINAPI GetClassID(CLSID *lpClassId);
65
66 // IPersistFolder
67 virtual HRESULT WINAPI Initialize(LPCITEMIDLIST pidl);
68
69 // IPersistFolder2
70 virtual HRESULT WINAPI GetCurFolder(LPITEMIDLIST * pidl);
71
72 DECLARE_REGISTRY_RESOURCEID(IDR_MYCOMPUTER)
73 DECLARE_CENTRAL_INSTANCE_NOT_AGGREGATABLE(CDrivesFolder)
74
75 DECLARE_PROTECT_FINAL_CONSTRUCT()
76
77 BEGIN_COM_MAP(CDrivesFolder)
78 COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
79 COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
80 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
81 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
82 COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
83 END_COM_MAP()
84 };
85
86 #endif /* _CDRIVESFOLDER_H_ */