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.

100 lines
3.1 KiB

  1. #ifndef BANDS_H_
  2. #define BANDS_H_
  3. #include "cowsite.h"
  4. // this is a virtual class!
  5. class CToolBand : public IDeskBand
  6. , public CObjectWithSite
  7. , public IInputObject
  8. , public IPersistStream
  9. , public IOleCommandTarget
  10. , public IServiceProvider
  11. {
  12. public:
  13. // *** IUnknown ***
  14. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  15. virtual STDMETHODIMP_(ULONG) AddRef(void);
  16. virtual STDMETHODIMP_(ULONG) Release(void);
  17. // *** IPersistStreamInit methods ***
  18. virtual STDMETHODIMP GetClassID(CLSID *pClassID) = 0;
  19. virtual STDMETHODIMP IsDirty(void);
  20. virtual STDMETHODIMP Load(IStream *pStm) = 0;
  21. virtual STDMETHODIMP Save(IStream *pStm, BOOL fClearDirty) = 0;
  22. virtual STDMETHODIMP GetSizeMax(ULARGE_INTEGER *pcbSize);
  23. // *** IOleCommandTarget methods ***
  24. virtual STDMETHODIMP QueryStatus(const GUID *pguidCmdGroup,
  25. ULONG cCmds, OLECMD rgCmds[], OLECMDTEXT *pcmdtext);
  26. virtual STDMETHODIMP Exec(const GUID *pguidCmdGroup,
  27. DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG *pvarargIn, VARIANTARG *pvarargOut);
  28. // *** IServiceProvider methods ***
  29. virtual STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, LPVOID* ppvObj);
  30. // *** IOleWindow methods ***
  31. virtual STDMETHODIMP GetWindow(HWND * lphwnd);
  32. virtual STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode) { return E_NOTIMPL; }
  33. // *** IDockingWindow methods ***
  34. virtual STDMETHODIMP ShowDW(BOOL fShow);
  35. virtual STDMETHODIMP CloseDW(DWORD dwReserved);
  36. virtual STDMETHODIMP ResizeBorderDW(LPCRECT prcBorder,
  37. IUnknown* punkToolbarSite,
  38. BOOL fReserved);
  39. // *** IObjectWithSite methods ***
  40. virtual STDMETHODIMP SetSite(IUnknown* punkSite);
  41. // *** IDeskBand methods ***
  42. virtual STDMETHODIMP GetBandInfo(DWORD dwBandID, DWORD fViewMode,
  43. DESKBANDINFO* pdbi) PURE;
  44. // *** IInputObject methods ***
  45. virtual STDMETHODIMP TranslateAcceleratorIO(LPMSG lpMsg);
  46. virtual STDMETHODIMP HasFocusIO();
  47. virtual STDMETHODIMP UIActivateIO(BOOL fActivate, LPMSG lpMsg);
  48. protected:
  49. CToolBand();
  50. virtual ~CToolBand();
  51. HRESULT _BandInfoChanged();
  52. int _cRef;
  53. HWND _hwnd;
  54. HWND _hwndParent;
  55. //IUnknown* CObjectWithSite::_punkSite;
  56. BOOL _fCanFocus:1; // we accept focus (see UIActivateIO)
  57. DWORD _dwBandID;
  58. };
  59. IDeskBand* CBrowserBand_Create(LPCITEMIDLIST pidl);
  60. IDeskBand* CSearchBand_Create();
  61. #define CX_FILENAME_AVG (6 * 12) // '8.3' name in 'typical' font (approx)
  62. class CToolbarBand: public CToolBand,
  63. public IWinEventHandler
  64. {
  65. public:
  66. // *** IWinEventHandler methods ***
  67. virtual STDMETHODIMP OnWinEvent(HWND hwnd, UINT dwMsg, WPARAM wParam, LPARAM lParam, LRESULT* plres);
  68. virtual STDMETHODIMP IsWindowOwner(HWND hwnd);
  69. protected:
  70. HRESULT _PushChevron(BOOL bLast);
  71. LRESULT _OnHotItemChange(LPNMTBHOTITEM pnmtb);
  72. virtual LRESULT _OnNotify(LPNMHDR pnmh);
  73. };
  74. #endif // BANDS_H_