ReactOS  0.4.14-dev-98-gb0d4763
addressband.h
Go to the documentation of this file.
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 {
37 private:
38  CComPtr<IDockingWindowSite> fSite;
39  CComPtr<IAddressEditBox> fAddressEditBox;
46 
47 public:
48  CAddressBand();
49  virtual ~CAddressBand();
50 private:
51  void FocusChange(BOOL bFocus);
52  void CreateGoButton();
53 public:
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  // *** IOleWindow methods ***
62  virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd);
64 
65  // *** IDockingWindow methods ***
67  virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved);
68  virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow);
69 
70  // *** IOleCommandTarget methods ***
71  virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT *pCmdText);
72  virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
73 
74  // *** IInputObject methods ***
75  virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg);
78 
79  // *** IWinEventHandler methods ***
82 
83  // *** IAddressBand methods ***
84  virtual HRESULT STDMETHODCALLTYPE FileSysChange(long param8, long paramC);
85  virtual HRESULT STDMETHODCALLTYPE Refresh(long param8);
86 
87  // *** IServiceProvider methods ***
88  virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject);
89 
90  // *** IInputObjectSite methods ***
91  virtual HRESULT STDMETHODCALLTYPE OnFocusChangeIS(IUnknown *punkObj, BOOL fSetFocus);
92 
93  // *** IPersist methods ***
94  virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
95 
96  // *** IPersistStream methods ***
98  virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm);
99  virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty);
101 
102  // message handlers
103  LRESULT OnNotifyClick(WPARAM wParam, NMHDR *notifyHeader, BOOL &bHandled);
104  LRESULT OnTipText(UINT idControl, NMHDR *notifyHeader, BOOL &bHandled);
106  LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
108 
115  END_MSG_MAP()
116 
119 
121 
123  COM_INTERFACE_ENTRY_IID(IID_IDeskBand, IDeskBand)
126  COM_INTERFACE_ENTRY_IID(IID_IDockingWindow, IDockingWindow)
127  COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
128  COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
129  COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
130  COM_INTERFACE_ENTRY_IID(IID_IAddressBand, IAddressBand)
131  COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
132  COM_INTERFACE_ENTRY_IID(IID_IInputObjectSite, IInputObjectSite)
135  END_COM_MAP()
136 };
DBIM_BKCOLOR struct tagDESKBANDINFO DESKBANDINFO
LRESULT OnNotifyClick(WPARAM wParam, NMHDR *notifyHeader, BOOL &bHandled)
virtual HRESULT STDMETHODCALLTYPE IsDirty()
virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW(const RECT *prcBorder, IUnknown *punkToolbarSite, BOOL fReserved)
virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite)
#define REFIID
Definition: guiddef.h:118
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
virtual HRESULT STDMETHODCALLTYPE GetBandInfo(DWORD dwBandID, DWORD dwViewMode, DESKBANDINFO *pdbi)
Definition: addressband.cpp:65
virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID)
Definition: scsiwmi.h:51
virtual HRESULT STDMETHODCALLTYPE OnFocusChangeIS(IUnknown *punkObj, BOOL fSetFocus)
REFIID riid
Definition: precomp.h:44
const GUID IID_IPersist
Definition: proxy.cpp:14
virtual HRESULT STDMETHODCALLTYPE IsWindowOwner(HWND hWnd)
CComPtr< IDockingWindowSite > fSite
Definition: addressband.h:38
HWND fComboBox
Definition: addressband.h:42
HWND hWnd
Definition: settings.c:17
virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
UINT_PTR WPARAM
Definition: windef.h:207
virtual HRESULT STDMETHODCALLTYPE HasFocusIO()
virtual ~CAddressBand()
Definition: addressband.cpp:48
HWND fEditControl
Definition: addressband.h:40
WPARAM wParam
Definition: combotst.c:138
bool fGoButtonShown
Definition: addressband.h:43
HIMAGELIST m_himlHot
Definition: addressband.h:45
virtual HRESULT STDMETHODCALLTYPE OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize)
void CreateGoButton()
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow)
virtual HRESULT STDMETHODCALLTYPE Refresh(long param8)
LONG_PTR LPARAM
Definition: windef.h:208
virtual HRESULT STDMETHODCALLTYPE FileSysChange(long param8, long paramC)
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode)
virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm)
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty)
#define WM_SIZE
Definition: winuser.h:1593
LONG HRESULT
Definition: typedefs.h:77
#define END_MSG_MAP()
Definition: atlwin.h:1789
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
const IID IID_IObjectWithSite
unsigned long DWORD
Definition: ntddk_ex.h:95
const GUID IID_IPersistStream
Definition: proxy.cpp:13
virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite)
HWND fGoButton
Definition: addressband.h:41
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:605
#define NM_CLICK
Definition: commctrl.h:130
HIMAGELIST m_himlNormal
Definition: addressband.h:44
#define TBN_GETINFOTIP
Definition: commctrl.h:1364
void FocusChange(BOOL bFocus)
Definition: addressband.cpp:52
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO(LPMSG lpMsg)
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg)
unsigned int UINT
Definition: ndis.h:50
LRESULT OnWindowPosChanging(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
#define NOTIFY_CODE_HANDLER(cd, func)
Definition: atlwin.h:1852
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1770
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1798
#define IDR_ADDRESSBAND
Definition: resource.h:91
const GUID IID_IOleWindow
unsigned int ULONG
Definition: retypes.h:1
virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
#define END_COM_MAP()
Definition: atlcom.h:552
#define WM_ERASEBKGND
Definition: winuser.h:1607
LONG_PTR LRESULT
Definition: windef.h:209
CComPtr< IAddressEditBox > fAddressEditBox
Definition: addressband.h:39
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd)
LPARAM lParam
Definition: combotst.c:139
LRESULT OnTipText(UINT idControl, NMHDR *notifyHeader, BOOL &bHandled)
virtual HRESULT STDMETHODCALLTYPE CloseDW(DWORD dwReserved)