ef948f7621add66b11d070e2e8c3e8cebdd6dc42
[reactos.git] / dll / shellext / ntobjshex / ntobjfolder.h
1 /*
2 * PROJECT: ReactOS shell extensions
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/shellext/ntobjshex/ntobjfolder.h
5 * PURPOSE: NT Object Namespace shell extension
6 * PROGRAMMERS: David Quintana <gigaherz@gmail.com>
7 */
8 #pragma once
9
10 extern const GUID CLSID_NtObjectFolder;
11
12 class CNtObjectFolderExtractIcon :
13 public CComObjectRootEx<CComMultiThreadModelNoCS>,
14 public IExtractIconW
15 {
16 PCWSTR m_NtPath;
17 PCIDLIST_ABSOLUTE m_pcidlFolder;
18 PCITEMID_CHILD m_pcidlChild;
19
20 public:
21 CNtObjectFolderExtractIcon();
22
23 virtual ~CNtObjectFolderExtractIcon();
24
25 HRESULT Initialize(LPCWSTR ntPath, PCIDLIST_ABSOLUTE parent, UINT cidl, PCUITEMID_CHILD_ARRAY apidl);
26
27 virtual HRESULT STDMETHODCALLTYPE GetIconLocation(
28 UINT uFlags,
29 LPWSTR szIconFile,
30 UINT cchMax,
31 INT *piIndex,
32 UINT *pwFlags);
33
34 virtual HRESULT STDMETHODCALLTYPE Extract(
35 LPCWSTR pszFile,
36 UINT nIconIndex,
37 HICON *phiconLarge,
38 HICON *phiconSmall,
39 UINT nIconSize);
40
41 DECLARE_NOT_AGGREGATABLE(CNtObjectFolderExtractIcon)
42 DECLARE_PROTECT_FINAL_CONSTRUCT()
43
44 BEGIN_COM_MAP(CNtObjectFolderExtractIcon)
45 COM_INTERFACE_ENTRY_IID(IID_IExtractIconW, IExtractIconW)
46 END_COM_MAP()
47
48 };
49
50 class CNtObjectFolder :
51 public CComCoClass<CNtObjectFolder, &CLSID_NtObjectFolder>,
52 public CCommonFolder<CNtObjectFolder, NtPidlEntry, CNtObjectFolderExtractIcon>
53 {
54 public:
55 DECLARE_REGISTRY_RESOURCEID(IDR_NTOBJECTFOLDER)
56
57 CNtObjectFolder();
58 virtual ~CNtObjectFolder();
59
60 // IShellFolder
61
62 virtual HRESULT STDMETHODCALLTYPE EnumObjects(
63 HWND hwndOwner,
64 SHCONTF grfFlags,
65 IEnumIDList **ppenumIDList);
66
67 protected:
68 virtual HRESULT STDMETHODCALLTYPE InternalBindToObject(
69 PWSTR path,
70 const NtPidlEntry * info,
71 LPITEMIDLIST first,
72 LPCITEMIDLIST rest,
73 LPITEMIDLIST fullPidl,
74 LPBC pbcReserved,
75 IShellFolder** ppsfChild);
76
77 virtual HRESULT STDMETHODCALLTYPE ResolveSymLink(
78 const NtPidlEntry * info,
79 LPITEMIDLIST * fullPidl);
80
81 public:
82 virtual HRESULT STDMETHODCALLTYPE GetDefaultColumnState(
83 UINT iColumn,
84 SHCOLSTATEF *pcsFlags);
85
86 virtual HRESULT STDMETHODCALLTYPE GetDetailsEx(
87 LPCITEMIDLIST pidl,
88 const SHCOLUMNID *pscid,
89 VARIANT *pv);
90
91 virtual HRESULT STDMETHODCALLTYPE GetDetailsOf(
92 LPCITEMIDLIST pidl,
93 UINT iColumn,
94 SHELLDETAILS *psd);
95
96 virtual HRESULT STDMETHODCALLTYPE MapColumnToSCID(
97 UINT iColumn,
98 SHCOLUMNID *pscid);
99
100 // IPersistFolder
101 virtual HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidl);
102
103 // Internal
104 HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidl, PCWSTR ntPath);
105
106 protected:
107 virtual HRESULT STDMETHODCALLTYPE CompareIDs(LPARAM lParam, const NtPidlEntry * first, const NtPidlEntry * second);
108 virtual ULONG STDMETHODCALLTYPE ConvertAttributes(const NtPidlEntry * entry, PULONG inMask);
109 virtual BOOL STDMETHODCALLTYPE IsFolder(const NtPidlEntry * info);
110 virtual BOOL STDMETHODCALLTYPE IsSymLink(const NtPidlEntry * info);
111
112 virtual HRESULT GetInfoFromPidl(LPCITEMIDLIST pcidl, const NtPidlEntry ** pentry);
113
114 HRESULT FormatValueData(DWORD contentType, PVOID td, DWORD contentsLength, PCWSTR * strContents);
115
116 HRESULT FormatContentsForDisplay(const NtPidlEntry * info, HKEY rootKey, LPCWSTR ntPath, PCWSTR * strContents);
117 };