ReactOS 0.4.15-dev-7654-g6bc40d3
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 virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd);
48
49 // *** IDockingWindow methods ***
51 virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved);
52 virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow);
53
54 // *** IDeskBand methods ***
55 virtual HRESULT STDMETHODCALLTYPE GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi);
56
57 // *** IObjectWithSite methods ***
58 virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite);
59 virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite);
60
61 // *** IInputObject methods ***
62 virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg);
65
66 // *** IPersist methods ***
67 virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
68
69 // *** IPersistStream methods ***
72 virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty);
74
75 // *** IDispatch methods ***
77 virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
78 virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
79 virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
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 STDMETHODCALLTYPE
Definition: bdasup.h:9
virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize)
Definition: CSearchBar.cpp:506
CComPtr< IUnknown > m_pSite
Definition: CSearchBar.h:25
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: CSearchBar.cpp:275
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
virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: CSearchBar.cpp:557
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO(LPMSG lpMsg)
Definition: CSearchBar.cpp:462
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: CSearchBar.cpp:521
HRESULT GetSearchResultsFolder(IShellBrowser **ppShellBrowser, HWND *pHwnd, IShellFolder **ppShellFolder)
Definition: CSearchBar.cpp:111
LRESULT OnStopButtonClicked(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
Definition: CSearchBar.cpp:238
BOOL GetAddressEditBoxPath(WCHAR *szPath)
Definition: CSearchBar.cpp:248
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd)
Definition: CSearchBar.cpp:306
virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm)
Definition: CSearchBar.cpp:494
virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg)
Definition: CSearchBar.cpp:441
HRESULT TrySubscribeToSearchEvents()
Definition: CSearchBar.cpp:542
LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: CSearchBar.cpp:104
void SetSearchInProgress(BOOL bInProgress)
Definition: CSearchBar.cpp:533
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: CSearchBar.cpp:33
virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite)
Definition: CSearchBar.cpp:393
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode)
Definition: CSearchBar.cpp:314
virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID)
Definition: CSearchBar.cpp:478
virtual HRESULT STDMETHODCALLTYPE CloseDW(DWORD dwReserved)
Definition: CSearchBar.cpp:322
virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty)
Definition: CSearchBar.cpp:500
virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite)
Definition: CSearchBar.cpp:431
virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow)
Definition: CSearchBar.cpp:335
virtual HRESULT STDMETHODCALLTYPE IsDirty()
Definition: CSearchBar.cpp:488
virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved)
Definition: CSearchBar.cpp:329
virtual HRESULT STDMETHODCALLTYPE GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi)
Definition: CSearchBar.cpp:344
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: CSearchBar.cpp:527
CComPtr< IAddressEditBox > m_AddressEditBox
Definition: CSearchBar.h:26
virtual HRESULT STDMETHODCALLTYPE HasFocusIO()
Definition: CSearchBar.cpp:457
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo)
Definition: CSearchBar.cpp:515
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define IDC_SEARCH_BUTTON
Definition: resource.h:168
#define IDD_SEARCH_DLG
Definition: resource.h:164
#define IDC_SEARCH_STOP_BUTTON
Definition: resource.h:169
#define IDR_EXPLORERBAND
Definition: resource.h:101
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:1610
#define WM_SETFOCUS
Definition: winuser.h:1612
#define WM_INITDIALOG
Definition: winuser.h:1738
#define BN_CLICKED
Definition: winuser.h:1924
__wchar_t WCHAR
Definition: xmlstorage.h:180