[SHELLFIND] Message handler for adding search results
[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 IShellFolderViewCB,
13 public IPersistFolder2
14 {
15 // *** IShellFolder2 methods ***
16 STDMETHODIMP GetDefaultSearchGUID(GUID *pguid);
17
18 STDMETHODIMP EnumSearches(IEnumExtraSearch **ppenum);
19
20 STDMETHODIMP GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay);
21
22 STDMETHODIMP GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags);
23
24 STDMETHODIMP GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv);
25
26 STDMETHODIMP GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *pDetails);
27
28 STDMETHODIMP MapColumnToSCID(UINT iColumn, SHCOLUMNID *pscid);
29
30
31 // *** IShellFolder methods ***
32 STDMETHODIMP ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, ULONG *pchEaten,
33 PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes);
34
35 STDMETHODIMP EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList);
36
37 STDMETHODIMP BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
38
39 STDMETHODIMP BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
40
41 STDMETHODIMP CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2);
42
43 STDMETHODIMP CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut);
44
45 STDMETHODIMP GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut);
46
47 STDMETHODIMP GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut,
48 LPVOID *ppvOut);
49
50 STDMETHODIMP GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET pName);
51
52 STDMETHODIMP SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags,
53 PITEMID_CHILD *pPidlOut);
54
55 //// *** IShellFolderViewCB methods ***
56 STDMETHODIMP MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam);
57
58 private:
59 LPITEMIDLIST m_pidl;
60 CComPtr<IShellFolder2> m_pisfInner;
61 CComPtr<IShellFolderView> m_shellFolderView;
62
63 //// *** IPersistFolder2 methods ***
64 STDMETHODIMP GetCurFolder(LPITEMIDLIST *pidl);
65
66
67 // *** IPersistFolder methods ***
68 STDMETHODIMP Initialize(LPCITEMIDLIST pidl);
69
70
71 // *** IPersist methods ***
72 STDMETHODIMP GetClassID(CLSID *pClassId);
73
74 LRESULT AddItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
75
76 public:
77 DECLARE_REGISTRY_RESOURCEID(IDR_FINDFOLDER)
78
79 DECLARE_NOT_AGGREGATABLE(CFindFolder)
80
81 DECLARE_PROTECT_FINAL_CONSTRUCT()
82
83 BEGIN_MSG_MAP(CFindFolder)
84 MESSAGE_HANDLER(SWM_ADD_ITEM, AddItem)
85 END_MSG_MAP()
86
87 BEGIN_COM_MAP(CFindFolder)
88 COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
89 COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
90 COM_INTERFACE_ENTRY_IID(IID_IShellFolderViewCB, IShellFolderViewCB)
91 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
92 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
93 COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
94 END_COM_MAP()
95 };
96