Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
5.6 KiB

  1. /**************************************************************\
  2. FILE: address.h
  3. DESCRIPTION:
  4. The Class CAddressBand exists to support a "Address" Band
  5. ToolBar. This will be used in the Browser's toolbar or can
  6. be used in the Start Menu.
  7. \**************************************************************/
  8. #ifndef _ADDRESS_H
  9. #define _ADDRESS_H
  10. #include "bands.h"
  11. #include "bandprxy.h"
  12. ///////////////////////////////////////////////////////////////////
  13. // #DEFINEs
  14. ///////////////////////////////////////////////////////////////////
  15. // Data Structures
  16. ///////////////////////////////////////////////////////////////////
  17. // Prototypes
  18. /**************************************************************\
  19. CLASS: CAddressBand
  20. DESCRIPTION:
  21. This Class CAddressBand exists to support a "Address" Band
  22. ToolBar. This will be used in the Browser's toolbar or can
  23. be used in the Start Menu/Taskbar. If the Band is part of
  24. a Browser toolbar, any modifications made to the AddressBar
  25. will go the the browser window.
  26. By default, the this AddressBand will not point to a
  27. browser window when it is on the Taskbar or Start Menu.
  28. Anything "executed" in the AddressBar will create a new
  29. browser window. Future support may allow for the AddressBand
  30. in the taskbar/start menu to reference a currently existing
  31. browser window.
  32. \**************************************************************/
  33. class CAddressBand
  34. : public CToolBand
  35. , public IWinEventHandler
  36. , public IAddressBand
  37. , public IInputObjectSite
  38. {
  39. public:
  40. //////////////////////////////////////////////////////
  41. // Public Interfaces
  42. //////////////////////////////////////////////////////
  43. // *** IUnknown ***
  44. virtual STDMETHODIMP_(ULONG) AddRef(void) { return CToolBand::AddRef(); };
  45. virtual STDMETHODIMP_(ULONG) Release(void){ return CToolBand::Release(); };
  46. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  47. // *** IOleCommandTarget methods ***
  48. virtual STDMETHODIMP QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds,
  49. OLECMD rgCmds[], OLECMDTEXT *pcmdtext); // Interface forwarding
  50. virtual STDMETHODIMP Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt,
  51. VARIANTARG *pvarargIn, VARIANTARG *pvarargOut); // Interface forwarding
  52. // *** IDockingWindow methods ***
  53. virtual STDMETHODIMP ShowDW(BOOL fShow);
  54. virtual STDMETHODIMP CloseDW(DWORD dw);
  55. // *** IObjectWithSite methods ***
  56. virtual STDMETHODIMP SetSite(IUnknown* punkSite);
  57. // *** IInputObject methods ***
  58. virtual STDMETHODIMP TranslateAcceleratorIO(LPMSG lpMsg);
  59. virtual STDMETHODIMP HasFocusIO(void);
  60. // *** IInputObjectSite methods ***
  61. virtual STDMETHODIMP OnFocusChangeIS(IUnknown *punk, BOOL fSetFocus);
  62. // *** IShellToolband methods ***
  63. STDMETHOD(GetBandInfo) (THIS_ DWORD dwBandID, DWORD fViewMode,
  64. DESKBANDINFO* pdbi) ;
  65. // *** IWinEventHandler methods ***
  66. virtual STDMETHODIMP OnWinEvent(HWND hwnd, UINT dwMsg, WPARAM wParam, LPARAM lParam, LRESULT* plre);
  67. virtual STDMETHODIMP IsWindowOwner(HWND hwnd);
  68. // *** IAddressBand methods ***
  69. virtual STDMETHODIMP FileSysChange(DWORD dwEvent, LPCITEMIDLIST * ppidl);
  70. virtual STDMETHODIMP Refresh(VARIANT * pvarType);
  71. // *** IPersistStream methods ***
  72. virtual STDMETHODIMP GetClassID(CLSID *pClassID){ *pClassID = CLSID_AddressBand; return S_OK; }
  73. virtual STDMETHODIMP Load(IStream *pStm);
  74. virtual STDMETHODIMP Save(IStream *pStm, BOOL fClearDirty);
  75. virtual STDMETHODIMP IsDirty(void) {return S_OK;} // Indicate that we are dirty and ::Save() needs to be called.
  76. protected:
  77. //////////////////////////////////////////////////////
  78. // Private Member Functions
  79. //////////////////////////////////////////////////////
  80. // Constructor / Destructor
  81. CAddressBand();
  82. virtual ~CAddressBand();
  83. HRESULT _CreateAddressBand(IUnknown * punkSite);
  84. static LRESULT CALLBACK _ComboExWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  85. static LRESULT CALLBACK _ComboExEditProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  86. BOOL _CreateGoButton();
  87. void _InitGoButton();
  88. void _OnGetInfoTip(LPNMTBGETINFOTIP pnmTT);
  89. // Friend Functions
  90. friend HRESULT CAddressBand_CreateInstance(IUnknown *punkOuter, IUnknown **ppunk, LPCOBJECTINFO poi);
  91. //////////////////////////////////////////////////////
  92. // Private Member Variables
  93. //////////////////////////////////////////////////////
  94. BOOL _fVertical :1;
  95. // Only valid if _fInited == TRUE
  96. HWND _hwndEdit; // Address edit control child Window
  97. HWND _hwndCombo; // Address combo control child Window
  98. BOOL _fVisible:1; // TRUE when the toolbar is visible.
  99. BOOL _fGoButton:1; // TRUE if go button is visible
  100. IAddressEditBox* _paeb; // IAddressEditBox that controls
  101. IWinEventHandler* _pweh; // IWinEventHandler interface for the AddressEditBox object. (Cached for Perf)
  102. HIMAGELIST _himlDefault; // default gray-scale go button
  103. HIMAGELIST _himlHot; // color go button
  104. HWND _hwndTools; // toolbar containing go button
  105. WNDPROC _pfnOldWndProc; // Former WndProc of ComboBoxEx
  106. WNDPROC _pfnOldEditProc;// Former WndProc of Edit control in ComboBoxEx
  107. };
  108. #endif /* _ADDRESS_H */