Leaked source code of windows server 2003
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.

192 lines
8.3 KiB

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