ReactOS 0.4.15-dev-8348-gc1b9bb5
CSearchBar.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Search Shell Extension
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Search UI
5 * COPYRIGHT: Copyright 2019 Brock Mammen
6 */
7
8#pragma once
9
10#include "shellfind.h"
11
12class CSearchBar :
13 public CComCoClass<CSearchBar, &CLSID_FileSearchBand>,
14 public CComObjectRootEx<CComMultiThreadModelNoCS>,
15 public IDeskBand,
16 public IObjectWithSite,
17 public IInputObject,
18 public IPersistStream,
19 public IDispatch,
20 public CDialogImpl<CSearchBar>
21{
22
23private:
24 // *** BaseBarSite information ***
28
29 HRESULT GetSearchResultsFolder(IShellBrowser **ppShellBrowser, HWND *pHwnd, IShellFolder **ppShellFolder);
31 void SetSearchInProgress(BOOL bInProgress);
33
34 // *** ATL event handlers ***
37 LRESULT OnSearchButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
38 LRESULT OnStopButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
39 LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
40
41public:
43 virtual ~CSearchBar();
44
45 // *** IOleWindow methods ***
46 STDMETHOD(GetWindow)(HWND *lphwnd) override;
47 STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode) override;
48
49 // *** IDockingWindow methods ***
51 STDMETHOD(ResizeBorderDW)(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved) override;
52 STDMETHOD(ShowDW)(BOOL fShow) override;
53
54 // *** IDeskBand methods ***
55 STDMETHOD(GetBandInfo)(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi) override;
56
57 // *** IObjectWithSite methods ***
58 STDMETHOD(SetSite)(IUnknown *pUnkSite) override;
59 STDMETHOD(GetSite)(REFIID riid, void **ppvSite) override;
60
61 // *** IInputObject methods ***
62 STDMETHOD(UIActivateIO)(BOOL fActivate, LPMSG lpMsg) override;
63 STDMETHOD(HasFocusIO)() override;
64 STDMETHOD(TranslateAcceleratorIO)(LPMSG lpMsg) override;
65
66 // *** IPersist methods ***
67 STDMETHOD(GetClassID)(CLSID *pClassID) override;
68
69 // *** IPersistStream methods ***
70 STDMETHOD(IsDirty)() override;
71 STDMETHOD(Load)(IStream *pStm) override;
72 STDMETHOD(Save)(IStream *pStm, BOOL fClearDirty) override;
73 STDMETHOD(GetSizeMax)(ULARGE_INTEGER *pcbSize) override;
74
75 // *** IDispatch methods ***
76 STDMETHOD(GetTypeInfoCount)(UINT *pctinfo) override;
77 STDMETHOD(GetTypeInfo)(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) override;
78 STDMETHOD(GetIDsOfNames)(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) override;
79 STDMETHOD(Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) override;
80
81 enum { IDD = IDD_SEARCH_DLG };
82
85
87
90 COM_INTERFACE_ENTRY_IID(DIID_DWebBrowserEvents, IDispatch)
91 COM_INTERFACE_ENTRY_IID(DIID_DSearchCommandEvents, IDispatch)
96 COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
100
108};
#define STDMETHOD(m)
Definition: basetyps.h:62
STDMETHOD() HasFocusIO() override
Definition: CSearchBar.cpp:457
STDMETHOD() CloseDW(DWORD dwReserved) override
Definition: CSearchBar.cpp:322
STDMETHOD() ContextSensitiveHelp(BOOL fEnterMode) override
Definition: CSearchBar.cpp:314
STDMETHOD() Save(IStream *pStm, BOOL fClearDirty) override
Definition: CSearchBar.cpp:500
CComPtr< IUnknown > m_pSite
Definition: CSearchBar.h:25
STDMETHOD() GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) override
Definition: CSearchBar.cpp:527
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: CSearchBar.cpp:275
STDMETHOD() IsDirty() override
Definition: CSearchBar.cpp:488
virtual ~CSearchBar()
Definition: CSearchBar.cpp:29
LRESULT OnSearchButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
Definition: CSearchBar.cpp:158
BOOL m_bVisible
Definition: CSearchBar.h:27
STDMETHOD() GetClassID(CLSID *pClassID) override
Definition: CSearchBar.cpp:478
STDMETHOD() GetWindow(HWND *lphwnd) override
Definition: CSearchBar.cpp:306
HRESULT GetSearchResultsFolder(IShellBrowser **ppShellBrowser, HWND *pHwnd, IShellFolder **ppShellFolder)
Definition: CSearchBar.cpp:111
STDMETHOD() Load(IStream *pStm) override
Definition: CSearchBar.cpp:494
LRESULT OnStopButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
Definition: CSearchBar.cpp:238
STDMETHOD() ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved) override
Definition: CSearchBar.cpp:329
BOOL GetAddressEditBoxPath(WCHAR *szPath)
Definition: CSearchBar.cpp:248
STDMETHOD() SetSite(IUnknown *pUnkSite) override
Definition: CSearchBar.cpp:393
HRESULT TrySubscribeToSearchEvents()
Definition: CSearchBar.cpp:542
STDMETHOD() GetSizeMax(ULARGE_INTEGER *pcbSize) override
Definition: CSearchBar.cpp:506
STDMETHOD() GetSite(REFIID riid, void **ppvSite) override
Definition: CSearchBar.cpp:431
STDMETHOD() Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) override
Definition: CSearchBar.cpp:557
STDMETHOD() ShowDW(BOOL fShow) override
Definition: CSearchBar.cpp:335
STDMETHOD() GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) override
Definition: CSearchBar.cpp:521
LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: CSearchBar.cpp:104
STDMETHOD() GetTypeInfoCount(UINT *pctinfo) override
Definition: CSearchBar.cpp:515
void SetSearchInProgress(BOOL bInProgress)
Definition: CSearchBar.cpp:533
STDMETHOD() TranslateAcceleratorIO(LPMSG lpMsg) override
Definition: CSearchBar.cpp:462
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: CSearchBar.cpp:33
STDMETHOD() GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi) override
Definition: CSearchBar.cpp:344
STDMETHOD() UIActivateIO(BOOL fActivate, LPMSG lpMsg) override
Definition: CSearchBar.cpp:441
CComPtr< IAddressEditBox > m_AddressEditBox
Definition: CSearchBar.h:26
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define IDC_SEARCH_BUTTON
Definition: resource.h:169
#define IDD_SEARCH_DLG
Definition: resource.h:165
#define IDC_SEARCH_STOP_BUTTON
Definition: resource.h:170
#define IDR_EXPLORERBAND
Definition: resource.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
REFIID riid
Definition: atlbase.h:39
#define COM_INTERFACE_ENTRY2_IID(iid, x, x2)
Definition: atlcom.h:609
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:679
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:651
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:645
#define END_COM_MAP()
Definition: atlcom.h:592
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1926
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1898
#define END_MSG_MAP()
Definition: atlwin.h:1917
#define COMMAND_HANDLER(id, code, func)
Definition: atlwin.h:1944
LPCWSTR szPath
Definition: env.c:37
const IID IID_IObjectWithSite
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:52
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
unsigned int UINT
Definition: ndis.h:50
const GUID IID_IOleWindow
const GUID IID_IDispatch
const GUID IID_IPersist
Definition: proxy.cpp:14
const GUID IID_IPersistStream
Definition: proxy.cpp:13
#define REFIID
Definition: guiddef.h:118
DWORD LCID
Definition: nls.h:13
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WM_SIZE
Definition: winuser.h:1611
#define WM_SETFOCUS
Definition: winuser.h:1613
#define WM_INITDIALOG
Definition: winuser.h:1739
#define BN_CLICKED
Definition: winuser.h:1925
__wchar_t WCHAR
Definition: xmlstorage.h:180