[NTOBJSHEX]
[reactos.git] / reactos / 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
56 CNtObjectFolder();
57 virtual ~CNtObjectFolder();
58
59 // IShellFolder
60
61 virtual HRESULT STDMETHODCALLTYPE EnumObjects(
62 HWND hwndOwner,
63 SHCONTF grfFlags,
64 IEnumIDList **ppenumIDList);
65
66 virtual HRESULT STDMETHODCALLTYPE InternalBindToObject(
67 PWSTR path,
68 const NtPidlEntry * info,
69 LPITEMIDLIST first,
70 LPCITEMIDLIST rest,
71 LPITEMIDLIST fullPidl,
72 LPBC pbcReserved,
73 IShellFolder** ppsfChild);
74 virtual HRESULT STDMETHODCALLTYPE RedirectToSymLink(
75 const NtPidlEntry * info,
76 LPITEMIDLIST first,
77 LPCITEMIDLIST rest,
78 LPBC pbcReserved,
79 IShellFolder ** ppsfChild);
80
81 virtual HRESULT STDMETHODCALLTYPE GetDefaultColumnState(
82 UINT iColumn,
83 SHCOLSTATEF *pcsFlags);
84
85 virtual HRESULT STDMETHODCALLTYPE GetDetailsEx(
86 LPCITEMIDLIST pidl,
87 const SHCOLUMNID *pscid,
88 VARIANT *pv);
89
90 virtual HRESULT STDMETHODCALLTYPE GetDetailsOf(
91 LPCITEMIDLIST pidl,
92 UINT iColumn,
93 SHELLDETAILS *psd);
94
95 virtual HRESULT STDMETHODCALLTYPE MapColumnToSCID(
96 UINT iColumn,
97 SHCOLUMNID *pscid);
98
99 // IPersistFolder
100 virtual HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidl);
101
102 // Internal
103 HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidl, PCWSTR ntPath);
104
105 protected:
106 virtual HRESULT STDMETHODCALLTYPE CompareIDs(LPARAM lParam, const NtPidlEntry * first, const NtPidlEntry * second);
107 virtual ULONG STDMETHODCALLTYPE ConvertAttributes(const NtPidlEntry * entry, PULONG inMask);
108 virtual BOOL STDMETHODCALLTYPE IsFolder(LPCITEMIDLIST pcidl);
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 };