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.

123 lines
4.7 KiB

  1. #ifndef _browbs_h
  2. #define _browbs_h
  3. #define WANT_CBANDSITE_CLASS
  4. #include "bandsite.h"
  5. class CBrowserBandSite :
  6. public CBandSite,
  7. public IExplorerToolbar
  8. {
  9. public:
  10. CBrowserBandSite();
  11. virtual ~CBrowserBandSite();
  12. // *** IUnknown ***
  13. STDMETHODIMP QueryInterface(REFIID riid, void ** ppvObj) { return CBandSite::QueryInterface(riid, ppvObj);};
  14. STDMETHODIMP_(ULONG) AddRef(void) { return CBandSite::AddRef();};
  15. STDMETHODIMP_(ULONG) Release(void) { return CBandSite::Release();};
  16. // *** IOleCommandTarget ***
  17. STDMETHODIMP Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG *pvarargIn, VARIANTARG *pvarargOut);
  18. // *** IWinEventHandler ***
  19. STDMETHODIMP OnWinEvent(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plres);
  20. STDMETHODIMP IsWindowOwner(HWND hwnd);
  21. // *** IInputObject methods ***
  22. STDMETHODIMP TranslateAcceleratorIO(LPMSG lpMsg);
  23. STDMETHODIMP HasFocusIO();
  24. // *** IBandSite methods ***
  25. STDMETHODIMP SetBandSiteInfo(const BANDSITEINFO * pbsinfo);
  26. // *** IDeskBarClient methods ***
  27. STDMETHODIMP SetModeDBC(DWORD dwMode);
  28. // *** IExplorerToolbar ***
  29. STDMETHODIMP SetCommandTarget(IUnknown* punkCmdTarget, const GUID* pguidButtonGroup, DWORD dwFlags);
  30. STDMETHODIMP AddStdBrowserButtons(void) { return E_NOTIMPL; };
  31. STDMETHODIMP AddButtons(const GUID* pguidButtonGroup, UINT nButtons, const TBBUTTON* lpButtons);
  32. STDMETHODIMP AddString(const GUID * pguidButtonGroup, HINSTANCE hInst, UINT_PTR uiResID, LONG_PTR *pOffset);
  33. STDMETHODIMP GetButton(const GUID* pguidButtonGroup, UINT uiCommand, LPTBBUTTON lpButton);
  34. STDMETHODIMP GetState(const GUID* pguidButtonGroup, UINT uiCommand, UINT* pfState);
  35. STDMETHODIMP SetState(const GUID* pguidButtonGroup, UINT uiCommand, UINT fState);
  36. STDMETHODIMP AddBitmap(const GUID* pguidButtonGroup, UINT uiBMPType, UINT uiCount, TBADDBITMAP* ptb,
  37. LRESULT* pOffset, COLORREF rgbMask) { return E_NOTIMPL; };
  38. STDMETHODIMP GetBitmapSize(UINT* uiID) { return E_NOTIMPL; };
  39. STDMETHODIMP SendToolbarMsg(const GUID* pguidButtonGroup, UINT uMsg, WPARAM wParam,
  40. LPARAM lParam, LRESULT *plRes) { return E_NOTIMPL; };
  41. STDMETHODIMP SetImageList(const GUID* pguidCmdGroup, HIMAGELIST himlNormal, HIMAGELIST himlHot, HIMAGELIST himlDisabled);
  42. STDMETHODIMP ModifyButton( const GUID* pguidButtonGroup, UINT uiCommand, LPTBBUTTON lpButton) { return E_NOTIMPL; };
  43. protected:
  44. virtual void _OnCloseBand(DWORD dwBandID);
  45. virtual LRESULT _OnBeginDrag(NMREBAR* pnm);
  46. virtual LRESULT _OnNotify(LPNMHDR pnm);
  47. virtual HRESULT _Initialize(HWND hwndParent);
  48. virtual IDropTarget* _WrapDropTargetForBand(IDropTarget* pdtBand);
  49. virtual HRESULT v_InternalQueryInterface(REFIID riid, void **ppvObj);
  50. virtual DWORD _GetWindowStyle(DWORD* pdwExStyle);
  51. virtual HMENU _LoadContextMenu();
  52. LRESULT _OnCDNotify(LPNMCUSTOMDRAW pnm);
  53. virtual void _Close();
  54. HRESULT _TrySetFocusTB(int iDir);
  55. virtual HRESULT _CycleFocusBS(LPMSG lpMsg);
  56. LRESULT _OnHotItemChange(LPNMTBHOTITEM pnmtb);
  57. LRESULT _OnNotifyBBS(LPNMHDR pnm);
  58. virtual void _BandInfoFromBandItem(REBARBANDINFO *prbbi, LPBANDITEMDATA pbid, BOOL fBSOnly);
  59. virtual void _ShowBand(LPBANDITEMDATA pbid, BOOL fShow);
  60. virtual void _UpdateAllBands(BOOL fBSOnly, BOOL fNoAutoSize);
  61. virtual int _ContextMenuHittest(LPARAM lParam, POINT* ppt);
  62. HFONT _GetTitleFont(BOOL fForceRefresh);
  63. virtual void _CalcHeights();
  64. void _InitLayout();
  65. void _UpdateLayout();
  66. void _UpdateToolbarFont();
  67. void _CreateTBRebar();
  68. void _InsertToolbarBand();
  69. void _UpdateToolbarBand();
  70. void _CreateTB();
  71. void _RemoveAllButtons();
  72. void _UpdateHeaderHeight(int iBand);
  73. virtual void _PositionToolbars(LPPOINT ppt);
  74. void _CreateOptionsTB();
  75. virtual void _PrepareOptionsTB();
  76. virtual void _SizeOptionsTB();
  77. void _DrawEtchline(HDC hdc, LPRECT prc, int iOffset, BOOL fVertical);
  78. BITBOOL _fTheater:1;
  79. BITBOOL _fNoAutoHide:1;
  80. BITBOOL _fToolbar:1; // do we have a toolbar for the current band?
  81. HWND _hwndTBRebar;
  82. HWND _hwndTB;
  83. HWND _hwndOptionsTB;
  84. IOleCommandTarget* _pCmdTarget;
  85. GUID _guidButtonGroup;
  86. HFONT _hfont;
  87. UINT _uTitle;
  88. UINT _uToolbar;
  89. DWORD _dwBandIDCur; // the currently visible band
  90. };
  91. #define BROWSERBAR_ICONWIDTH 16
  92. #define BROWSERBAR_FONTSIZE 18
  93. #ifndef UNIX
  94. #define BROWSERBAR_TITLEHEIGHT 22
  95. #else
  96. #define BROWSERBAR_TITLEHEIGHT 24
  97. #endif
  98. #define BROWSERBAR_TOOLBARHEIGHT 24
  99. #endif // _browbs_h