761901c8039a197c1251a15f83fc8f8467322a83
[reactos.git] / reactos / dll / win32 / browseui / addressband.h
1 /*
2 * ReactOS Explorer
3 *
4 * Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 #pragma once
22
23 class CAddressBand :
24 public CWindowImpl<CAddressBand, CWindow, CControlWinTraits>,
25 public CComCoClass<CAddressBand, &CLSID_SH_AddressBand>,
26 public CComObjectRootEx<CComMultiThreadModelNoCS>,
27 public IDeskBand,
28 public IObjectWithSite,
29 public IInputObject,
30 public IPersistStream,
31 public IOleCommandTarget,
32 public IServiceProvider,
33 public IWinEventHandler,
34 public IAddressBand,
35 public IInputObjectSite,
36 public IDispatch
37 {
38 private:
39 CComPtr<IDockingWindowSite> fSite;
40 CComPtr<IAddressEditBox> fAddressEditBox;
41 HWND fEditControl;
42 HWND fGoButton;
43 HWND fComboBox;
44 bool fGoButtonShown;
45 DWORD fAdviseCookie;
46 public:
47 CAddressBand();
48 virtual ~CAddressBand();
49 private:
50 void FocusChange(BOOL bFocus);
51 public:
52 // *** IDeskBand methods ***
53 virtual HRESULT STDMETHODCALLTYPE GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi);
54
55 // *** IObjectWithSite methods ***
56 virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite);
57 virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite);
58
59 // *** IOleWindow methods ***
60 virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd);
61 virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
62
63 // *** IDockingWindow methods ***
64 virtual HRESULT STDMETHODCALLTYPE CloseDW(DWORD dwReserved);
65 virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved);
66 virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow);
67
68 // *** IOleCommandTarget methods ***
69 virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT *pCmdText);
70 virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
71
72 // *** IInputObject methods ***
73 virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg);
74 virtual HRESULT STDMETHODCALLTYPE HasFocusIO();
75 virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO(LPMSG lpMsg);
76
77 // *** IWinEventHandler methods ***
78 virtual HRESULT STDMETHODCALLTYPE OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult);
79 virtual HRESULT STDMETHODCALLTYPE IsWindowOwner(HWND hWnd);
80
81 // *** IAddressBand methods ***
82 virtual HRESULT STDMETHODCALLTYPE FileSysChange(long param8, long paramC);
83 virtual HRESULT STDMETHODCALLTYPE Refresh(long param8);
84
85 // *** IServiceProvider methods ***
86 virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject);
87
88 // *** IInputObjectSite methods ***
89 virtual HRESULT STDMETHODCALLTYPE OnFocusChangeIS(IUnknown *punkObj, BOOL fSetFocus);
90
91 // *** IPersist methods ***
92 virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
93
94 // *** IPersistStream methods ***
95 virtual HRESULT STDMETHODCALLTYPE IsDirty();
96 virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm);
97 virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty);
98 virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize);
99
100 // *** IDispatch methods ***
101 virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo);
102 virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
103 virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
104 virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
105
106 // message handlers
107 LRESULT OnNotifyClick(WPARAM wParam, NMHDR *notifyHeader, BOOL &bHandled);
108 LRESULT OnTipText(UINT idControl, NMHDR *notifyHeader, BOOL &bHandled);
109 LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
110 LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
111 LRESULT OnWindowPosChanging(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
112
113 BEGIN_MSG_MAP(CAddressBand)
114 NOTIFY_CODE_HANDLER(NM_CLICK, OnNotifyClick)
115 NOTIFY_CODE_HANDLER(TTN_NEEDTEXTW, OnTipText)
116 MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)
117 MESSAGE_HANDLER(WM_SIZE, OnSize)
118 MESSAGE_HANDLER(WM_WINDOWPOSCHANGING, OnWindowPosChanging)
119 END_MSG_MAP()
120
121 DECLARE_REGISTRY_RESOURCEID(IDR_ADDRESSBAND)
122 DECLARE_NOT_AGGREGATABLE(CAddressBand)
123
124 DECLARE_PROTECT_FINAL_CONSTRUCT()
125
126 BEGIN_COM_MAP(CAddressBand)
127 COM_INTERFACE_ENTRY_IID(IID_IDeskBand, IDeskBand)
128 COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite)
129 COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IOleWindow)
130 COM_INTERFACE_ENTRY_IID(IID_IDockingWindow, IDockingWindow)
131 COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
132 COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
133 COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
134 COM_INTERFACE_ENTRY_IID(IID_IAddressBand, IAddressBand)
135 COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
136 COM_INTERFACE_ENTRY_IID(IID_IInputObjectSite, IInputObjectSite)
137 COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
138 COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
139 COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
140 END_COM_MAP()
141 };