[SHELLFIND] Add "Open Containing Folder" to right-click menu
[reactos.git] / dll / win32 / browseui / shellfind / CFindFolder.h
1 #pragma once
2
3 #include "shellfind.h"
4
5 #define SWM_ADD_ITEM (WM_USER + 0)
6
7 class CFindFolder :
8 public CWindowImpl<CFindFolder>,
9 public CComCoClass<CFindFolder, &CLSID_FindFolder>,
10 public CComObjectRootEx<CComMultiThreadModelNoCS>,
11 public IShellFolder2,
12 public IPersistFolder2,
13 public IShellFolderViewCB,
14 public IContextMenuCB
15 {
16 // *** IShellFolder2 methods ***
17 STDMETHODIMP GetDefaultSearchGUID(GUID *pguid);
18
19 STDMETHODIMP EnumSearches(IEnumExtraSearch **ppenum);
20
21 STDMETHODIMP GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay);
22
23 STDMETHODIMP GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags);
24
25 STDMETHODIMP GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv);
26
27 STDMETHODIMP GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *pDetails);
28
29 STDMETHODIMP MapColumnToSCID(UINT iColumn, SHCOLUMNID *pscid);
30
31
32 // *** IShellFolder methods ***
33 STDMETHODIMP ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten,
34 PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes);
35
36 STDMETHODIMP EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList);
37
38 STDMETHODIMP BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
39
40 STDMETHODIMP BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
41
42 STDMETHODIMP CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2);
43
44 STDMETHODIMP CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut);
45
46 STDMETHODIMP GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut);
47
48 STDMETHODIMP GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut,
49 LPVOID *ppvOut);
50
51
52 STDMETHODIMP GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET pName);
53 STDMETHODIMP SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags,
54 PITEMID_CHILD *pPidlOut);
55
56 //// *** IShellFolderViewCB methods ***
57 STDMETHODIMP MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam);
58
59 //// *** IContextMenuCB method ***
60 STDMETHODIMP CallBack(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam,
61 LPARAM lParam);
62
63 private:
64 LPITEMIDLIST m_pidl;
65 CComPtr<IShellFolder2> m_pisfInner;
66 CComPtr<IShellFolderView> m_shellFolderView;
67
68 //// *** IPersistFolder2 methods ***
69 STDMETHODIMP GetCurFolder(LPITEMIDLIST *pidl);
70
71
72 // *** IPersistFolder methods ***
73 STDMETHODIMP Initialize(LPCITEMIDLIST pidl);
74
75
76 // *** IPersist methods ***
77 STDMETHODIMP GetClassID(CLSID *pClassId);
78
79 LRESULT AddItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
80
81 public:
82 DECLARE_REGISTRY_RESOURCEID(IDR_FINDFOLDER)
83
84 DECLARE_NOT_AGGREGATABLE(CFindFolder)
85
86 DECLARE_PROTECT_FINAL_CONSTRUCT()
87
88 BEGIN_MSG_MAP(CFindFolder)
89 MESSAGE_HANDLER(SWM_ADD_ITEM, AddItem)
90 END_MSG_MAP()
91
92 BEGIN_COM_MAP(CFindFolder)
93 COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
94 COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
95 COM_INTERFACE_ENTRY_IID(IID_IShellFolderViewCB, IShellFolderViewCB)
96 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
97 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
98 COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
99 COM_INTERFACE_ENTRY_IID(IID_IContextMenuCB, IContextMenuCB)
100 END_COM_MAP()
101 };
102