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.

79 lines
2.6 KiB

  1. #ifndef _BASEFVCB_
  2. #define _BASEFVCB_
  3. #include <cowsite.h>
  4. // base shell folder view callback to derive from
  5. class CBaseShellFolderViewCB : public IShellFolderViewCB,
  6. public IServiceProvider,
  7. public CObjectWithSite
  8. {
  9. public:
  10. CBaseShellFolderViewCB(LPCITEMIDLIST pidl, LONG lEvents);
  11. STDMETHOD(RealMessage)(UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  12. // IUnknown
  13. STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
  14. STDMETHODIMP_(ULONG) AddRef();
  15. STDMETHODIMP_(ULONG) Release();
  16. // IShellFolderViewCB
  17. STDMETHODIMP MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam);
  18. // IServiceProvider
  19. STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, void **ppv) { *ppv = NULL; return E_NOTIMPL; };
  20. protected:
  21. virtual ~CBaseShellFolderViewCB();
  22. HRESULT _BrowseObject(LPCITEMIDLIST pidlFull, UINT uFlags = 0)
  23. {
  24. IShellBrowser* psb;
  25. HRESULT hr = IUnknown_QueryService(_punkSite, SID_STopLevelBrowser, IID_PPV_ARG(IShellBrowser, &psb));
  26. if (SUCCEEDED(hr))
  27. {
  28. hr = psb->BrowseObject(pidlFull, uFlags);
  29. psb->Release();
  30. }
  31. return hr;
  32. }
  33. HWND _hwndMain;
  34. LONG _cRef;
  35. LPITEMIDLIST _pidl;
  36. LONG _lEvents;
  37. };
  38. // view callback helpers
  39. typedef struct {
  40. ULONGLONG cbBytes; // total size of items selected
  41. int nItems; // number of items selected
  42. int cFiles; // # of files
  43. int cHiddenFiles; // # of hiddenf iles
  44. ULONGLONG cbSize; // total size of selected files
  45. int cNonFolders; // how many non-folders we have
  46. TCHAR szDrive[MAX_PATH];// drive info (if in explorer mode)
  47. ULONGLONG cbFree; // drive free space
  48. } FSSELCHANGEINFO;
  49. // status bar helpers to be used from the view callback
  50. STDAPI ViewUpdateStatusBar(IUnknown *psite, LPCITEMIDLIST pidlFolder, FSSELCHANGEINFO *pfssci);
  51. STDAPI_(void) ViewInsertDeleteItem(IShellFolder2 *psf, FSSELCHANGEINFO *pfssci, LPCITEMIDLIST pidl, int iMul);
  52. STDAPI_(void) ViewSelChange(IShellFolder2 *psf, SFVM_SELCHANGE_DATA* pdvsci, FSSELCHANGEINFO *pfssci);
  53. STDAPI_(void) ResizeStatus(IUnknown *psite, UINT cx);
  54. STDAPI_(void) InitializeStatus(IUnknown *psite);
  55. STDAPI_(void) SetStatusText(IUnknown *psite, LPCTSTR *ppszText, int iStart, int iEnd);
  56. // view callback helpers
  57. STDAPI DefaultGetWebViewTemplateFromHandler(LPCTSTR pszKey, SFVM_WEBVIEW_TEMPLATE_DATA* pvi);
  58. STDAPI DefaultGetWebViewTemplateFromClsid(REFCLSID clsid, SFVM_WEBVIEW_TEMPLATE_DATA* pvi);
  59. STDAPI DefaultGetWebViewTemplateFromPath(LPCTSTR pszDir, SFVM_WEBVIEW_TEMPLATE_DATA* pvi);
  60. #endif // _BASEFVCB_