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.

172 lines
7.2 KiB

  1. #ifndef BANDISF
  2. #define BANDISF
  3. #include "bands.h"
  4. #include "logo.h"
  5. #include "sftbar.h"
  6. class CISFBand : public CToolbarBand,
  7. public CSFToolbar,
  8. public CLogoBase,
  9. public IFolderBandPriv
  10. {
  11. public:
  12. // *** IUnknown ***
  13. virtual STDMETHODIMP_(ULONG) AddRef(void) { return CToolBand::AddRef(); };
  14. virtual STDMETHODIMP_(ULONG) Release(void){ return CToolBand::Release(); };
  15. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  16. // *** IDockingWindow methods (override) ***
  17. virtual STDMETHODIMP ShowDW(BOOL fShow);
  18. virtual STDMETHODIMP CloseDW(DWORD dw);
  19. // *** IObjectWithSite methods ***
  20. virtual STDMETHODIMP SetSite(IUnknown* punkSite);
  21. // *** IDeskBand methods ***
  22. virtual STDMETHODIMP GetBandInfo(DWORD dwBandID, DWORD fViewMode,
  23. DESKBANDINFO* pdbi);
  24. // *** IPersistStream methods (CToolBand PURE) ***
  25. virtual STDMETHODIMP GetClassID(LPCLSID lpClassID);
  26. virtual STDMETHODIMP Load(IStream *pStm);
  27. virtual STDMETHODIMP Save(IStream *pStm, BOOL fClearDirty);
  28. // *** IContextMenu methods (override) ***
  29. virtual STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpici);
  30. // *** IOleCommandTarget ***
  31. virtual STDMETHODIMP QueryStatus(const GUID *pguidCmdGroup,
  32. ULONG cCmds, OLECMD rgCmds[], OLECMDTEXT *pcmdtext);
  33. virtual STDMETHODIMP Exec(const GUID *pguidCmdGroup,
  34. DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG *pvarargIn,
  35. VARIANTARG *pvarargOut);
  36. // *** IShellFolderBand methods ***
  37. virtual STDMETHODIMP InitializeSFB(LPSHELLFOLDER psf, LPCITEMIDLIST pidl);
  38. virtual STDMETHODIMP SetBandInfoSFB(BANDINFOSFB * pbi);
  39. virtual STDMETHODIMP GetBandInfoSFB(BANDINFOSFB * pbi);
  40. // *** IInputObject methods ***
  41. virtual STDMETHODIMP TranslateAcceleratorIO(LPMSG lpMsg);
  42. // *** IFolderBandPriv
  43. // for internal guys so that we don't have to use a prop page
  44. virtual STDMETHODIMP SetCascade(BOOL f) { _fCascadeFolder = BOOLIFY(f); return S_OK; };
  45. virtual STDMETHODIMP SetAccelerators(BOOL f) { _fAccelerators = BOOLIFY(f); return S_OK; };
  46. virtual STDMETHODIMP SetNoIcons(BOOL f) { _fNoIcons = BOOLIFY(f); return S_OK; };
  47. virtual STDMETHODIMP SetNoText(BOOL f) { _fNoShowText = BOOLIFY(f); return S_OK; };
  48. protected:
  49. friend HRESULT CISFBand_CreateInstance(IUnknown * punkOuter, REFIID riid, void **ppv);
  50. friend HRESULT CISFBand_CreateEx(IShellFolder * psf, LPCITEMIDLIST pidl, REFIID riid, void **ppv);
  51. CISFBand();
  52. virtual ~CISFBand();
  53. void _ReleaseMenu();
  54. void _SetDirty(BOOL fDirty);
  55. virtual HRESULT _SetSubMenuPopup(IMenuPopup* pmp, UINT uiCmd, LPCITEMIDLIST pidl, DWORD dwFlagsMDBPU);
  56. virtual void _SendInitMenuPopup(IMenuPopup * pmp, LPCITEMIDLIST pidl);
  57. virtual LRESULT _OnHotItemChange(NMTBHOTITEM * pnmhot);
  58. virtual LRESULT _DefWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  59. virtual LRESULT _OnContextMenu(WPARAM wParam, LPARAM lParam);
  60. virtual LRESULT _OnNotify(LPNMHDR pnm);
  61. virtual HRESULT _TBStyleForPidl(LPCITEMIDLIST pidl,
  62. DWORD * pdwTBStyle, DWORD* pdwTBState, DWORD * pdwMIFFlags, int* piIcon);
  63. virtual HMENU _GetContextMenu();
  64. void _ReleaseMenuPopup(IMenuPopup** ppmp);
  65. void _SetCacheMenuPopup(IMenuPopup* pmp);
  66. HRESULT _DropdownItem(LPCITEMIDLIST pidl, UINT idCmd);
  67. LRESULT _TryChannelSurfing(LPCITEMIDLIST pidl);
  68. HRESULT _GetChannelBrowser(IWebBrowser2 **ppwb);
  69. HRESULT _IStreamFromOrderList(VARIANT* pvarargOut);
  70. HRESULT _OrderListFromIStream(VARIANT* pvarargIn);
  71. IMenuPopup *_pmpCache;
  72. IMenuPopup * _pmp; // Submenu popup
  73. const GUID* _pguidUEMGroup;
  74. BITBOOL _fCascadeFolder :1;
  75. BITBOOL _fNoRecalcDefaults :1;// Don't recalc defaults during GetBandInfo
  76. BITBOOL _fInitialized :1; // have we initialized the toolbar
  77. BITBOOL _fDebossed :1; // TRUE to enable debossed rebar style
  78. BITBOOL _fLinksMode :1; // TRUE: do not allow drag & drop onto content items.
  79. BITBOOL _fHaveBkColor :1; // TRUE if _crBkgnd is valid
  80. BITBOOL _fHaveColors :1; // TRUE if _crBtnXX are valid
  81. BITBOOL _fFullOpen :1; // TRUE if band should maximize when opened
  82. BITBOOL _fClosing : 1; // TRUE if we are shutting down....
  83. BITBOOL _fDesktop :1; // 1:desktop 0:browser(or non-ActDesk)
  84. BITBOOL _fBtnMinSize :1; // TRUE if band should report min thickness of button
  85. BITBOOL _fDelayPainting :1;
  86. BITBOOL _fChannels :1; // TRUE if we want "Navigate Target" sup
  87. BITBOOL _fCreatedBandProxy :1; // TRUE if we created a BandProxy ourself and hence need to call SetOwner on it
  88. BITBOOL _fAllowDropdown: 1;
  89. BITBOOL _fDelayInit :1;
  90. BOOL _fIgnoreAddToFront;
  91. int _eUemLog :2; // UEMIND_* (NIL:off, o.w.:group)
  92. int _iIdealLength; // our ideal height/width last time bandsite asked
  93. COLORREF _crBkgnd; // Background color (must set _fHaveBkColor)
  94. COLORREF _crBtnLt; // Button hilite color (must set _fHaveColors)
  95. COLORREF _crBtnDk; // Button lolite color (must set _fHaveColors)
  96. DWORD _dwPriv; // private for bsmenu
  97. IBandProxy * _pbp;
  98. HPALETTE _hpalOld; // the old palette saved while we do a draw.....
  99. int _GetIdealSize(PSIZE psize);
  100. HRESULT _IsPidlVisible(LPITEMIDLIST pidl);
  101. virtual LRESULT _OnCommand(WPARAM wParam, LPARAM lParam);
  102. virtual LRESULT _OnCustomDraw(NMCUSTOMDRAW* pnmcd);
  103. virtual void _OnDragBegin(int iItem, DWORD dwPreferredEffect);
  104. virtual HRESULT _CreateToolbar(HWND hwndParent);
  105. virtual HWND _CreatePager(HWND hwndParent);
  106. virtual int _GetBitmap(int iCommandID, PIBDATA pibData, BOOL fUseCache);
  107. virtual void _ToolbarChanged() { _BandInfoChanged(); };
  108. BOOL _IsChildID(LPCITEMIDLIST pidl, LPCITEMIDLIST pidlChild);
  109. BOOL _UpdateIconSize(UINT fIconSize, BOOL fUpdateButtons);
  110. void _UpdateVerticalMode(BOOL fVertical);
  111. LRESULT _TryCascadingItem(LPCITEMIDLIST pidl, UINT uiCmd);
  112. LRESULT _TrySimpleInvoke(LPCITEMIDLIST pidl);
  113. HRESULT _SiteOnSelect(DWORD dwType);
  114. virtual HRESULT _GetTitleW(LPWSTR pwzTitle, DWORD cchSize);
  115. virtual void _Initialize();
  116. friend class CExtractImageTask;
  117. friend HRESULT CALLBACK UpdateBandLogo( LPVOID pData, DWORD dwItem, HBITMAP hImage, LPCWSTR pszCache, BOOL fCache );
  118. // stuff for CLogoBase
  119. virtual IShellFolder * GetSF();
  120. virtual HWND GetHWND();
  121. virtual REFTASKOWNERID GetTOID();
  122. virtual HRESULT OnTranslatedChange(LONG lEvent, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  123. virtual HRESULT UpdateLogoCallback( DWORD dwItem, int iIcon, HBITMAP hImage, LPCWSTR pszCache, BOOL fCache );
  124. void _StopDelayPainting();
  125. void _FixupAppDataDirectory();
  126. };
  127. HRESULT CISFBand_CreateEx(IShellFolder * psf, LPCITEMIDLIST pidl, REFIID riid, void **ppv);
  128. HRESULT IUnknown_SetBandInfoSFB(IUnknown *punkBand, BANDINFOSFB *pbi);
  129. #endif