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