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
3.3 KiB

  1. /*****************************************************************************
  2. * ftpeidl.h
  3. *****************************************************************************/
  4. #ifndef _FTPEIDL_H
  5. #define _FTPEIDL_H
  6. #include "cowsite.h"
  7. /*****************************************************************************
  8. *
  9. * CFtpEidl
  10. *
  11. * The stuff that tracks the state of an enumeration.
  12. *
  13. *****************************************************************************/
  14. class CFtpEidl : public IEnumIDList
  15. , public CObjectWithSite
  16. {
  17. public:
  18. //////////////////////////////////////////////////////
  19. // Public Interfaces
  20. //////////////////////////////////////////////////////
  21. // *** IUnknown ***
  22. virtual STDMETHODIMP_(ULONG) AddRef(void);
  23. virtual STDMETHODIMP_(ULONG) Release(void);
  24. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  25. // *** IEnumIDList ***
  26. virtual STDMETHODIMP Next(ULONG celt, LPITEMIDLIST *rgelt, ULONG *pceltFetched);
  27. virtual STDMETHODIMP Skip(ULONG celt);
  28. virtual STDMETHODIMP Reset(void);
  29. virtual STDMETHODIMP Clone(IEnumIDList **ppenum);
  30. public:
  31. CFtpEidl();
  32. ~CFtpEidl(void);
  33. // Friend Functions
  34. friend HRESULT CFtpEidl_Create(CFtpDir * pfd, CFtpFolder * pff, HWND hwndOwner, DWORD shcontf, IEnumIDList ** ppenum);
  35. protected:
  36. // Private Member Variables
  37. int m_cRef;
  38. BITBOOL m_fInited : 1; // Have we been inited?
  39. BITBOOL m_fDead : 1; // Is this enumerator dead because we had to do a redirect (because password was needed or was invalid).
  40. BITBOOL m_fErrorDisplayed : 1; // Only show one error per enum. This is how we keep track.
  41. DWORD m_nIndex; // Current Item in the list
  42. DWORD m_shcontf; // Filter flags
  43. CFtpPidlList * m_pflHfpl; // Where the cache lives
  44. CFtpDir * m_pfd; // My FtpDir
  45. CFtpFolder * m_pff; // My FtpDir
  46. IMalloc * m_pm; // Today's itemid allocator
  47. HWND m_hwndOwner; // My UI window
  48. HRESULT m_hrOleInited; // We need to Init Ole because of Win95's Shell32 doesn't do that on the background enum thread.
  49. // CAN DO: Someday we could implement hiden files: int m_cHiddenFiles;
  50. // Public Member Functions
  51. BOOL _fFilter(DWORD shcontf, DWORD dwFAFLFlags);
  52. HRESULT _Init(void);
  53. LPITEMIDLIST _NextOne(DWORD * pdwIndex);
  54. HRESULT _PopulateItem(HINTERNET hint0, HINTPROCINFO * phpi);
  55. HRESULT _AddFindDataToPidlList(LPCITEMIDLIST pidl);
  56. HRESULT _HandleSoftLinks(HINTERNET hint, LPITEMIDLIST pidl, LPWIRESTR pwCurrentDir, DWORD cchSize);
  57. BOOL _IsNavigationItem(LPWIN32_FIND_DATA pwfd);
  58. static HRESULT _PopulateItemCB(HINTERNET hint0, HINTPROCINFO * phpi, LPVOID pvCFtpEidl, BOOL * pfReleaseHint) {return ((CFtpEidl *)pvCFtpEidl)->_PopulateItem(hint0, phpi);};
  59. // Friend Functions
  60. friend HRESULT CFtpEidl_Create(CFtpDir * pfd, CFtpFolder * pff, HWND hwndOwner, DWORD shcontf, CFtpEidl ** ppfe);
  61. friend HRESULT CFtpEidl_Create(CFtpDir * pfd, CFtpFolder * pff, HWND hwndOwner, DWORD shcontf, DWORD dwIndex, IEnumIDList ** ppenum);
  62. };
  63. #endif // _FTPEIDL_H