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.1 KiB

  1. /*****************************************************************************
  2. * ftppl.h
  3. *****************************************************************************/
  4. #ifndef _FTPPIDLLIST_H
  5. #define _FTPPIDLLIST_H
  6. #include "ftplist.h"
  7. typedef HRESULT (CALLBACK *LPFNPROCESSITEMCB)(LPVOID pfnProcessItemCB, HINTERNET hint, LPCITEMIDLIST pidlFull, BOOL * pfValidhinst, LPVOID pvData);
  8. HRESULT EnumFolder(LPFNPROCESSITEMCB pfnProcessItemCB, HINTERNET hint, LPCITEMIDLIST pidlFull, CWireEncoding * pwe, BOOL * pfValidhinst, LPVOID pvData);
  9. int RecursiveProcessPidl(LPVOID pvPidl, LPVOID pvInetEnum);
  10. /*****************************************************************************
  11. *
  12. * CFtpPidlList
  13. *
  14. *****************************************************************************/
  15. class CFtpPidlList : public IUnknown
  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. public:
  26. CFtpPidlList();
  27. ~CFtpPidlList(void);
  28. // Public Member Functions
  29. HRESULT CompareAndDeletePidl(LPCITEMIDLIST pidl);
  30. HRESULT ReplacePidl(LPCITEMIDLIST pidlSrc, LPCITEMIDLIST pidlDest);
  31. HRESULT InsertSorted(LPCITEMIDLIST pidl);
  32. HRESULT RecursiveEnum(LPCITEMIDLIST pidlRoot, LPFNPROCESSITEMCB pfnProcessItemCB, HINTERNET hint, LPVOID pvData);
  33. void Enum(PFNDPAENUMCALLBACK pfn, LPVOID pv) { m_pfl->Enum(pfn, pv); };
  34. void DeletePidl(LPITEMIDLIST pidl) { m_pfl->DeleteItemPtr((LPVOID) pidl); ILFree(pidl); };
  35. void Delete(int nIndex);
  36. int GetCount(void) { return m_pfl->GetCount(); };
  37. int FindPidlIndex(LPCITEMIDLIST pidlToFind, BOOL fCaseInsensitive);
  38. LPITEMIDLIST GetPidl(UINT ipv) { return (LPITEMIDLIST) m_pfl->GetItemPtr(ipv); }; // TODO: Rename GetPidlReference()
  39. LPITEMIDLIST FindPidl(LPCITEMIDLIST pidlToFind, BOOL fCaseInsensitive);
  40. BOOL AreAllFolders(void);
  41. BOOL AreAllFiles(void);
  42. LPCITEMIDLIST * GetPidlList(void);
  43. void FreePidlList(LPCITEMIDLIST * ppidl);
  44. void TraceDump(LPCITEMIDLIST pidl, LPCTSTR pszCaller);
  45. void UseCachedDirListings(BOOL fUseCachedDirListings);
  46. // Friend Functions
  47. static int CFtpPidlList::ComparePidlName(LPVOID pvPidl1, LPVOID pvPidl2, LPARAM lParam);
  48. friend HRESULT CFtpPidlList_Create(int cpidl, LPCITEMIDLIST rgpidl[], CFtpPidlList ** ppfl);
  49. friend HRESULT _EnumFolderPrep(HINTERNET hint, LPCITEMIDLIST pidlFull, CFtpPidlList * pPidlList, CWireEncoding * pwe, LPITEMIDLIST * ppidlCurrFtpPath);
  50. protected:
  51. // Private Member Variables
  52. int m_cRef;
  53. CFtpList * m_pfl;
  54. CWireEncoding * m_pwe; // We don't hold a ref, so we assume the object will outlive us.
  55. DWORD m_dwInetFlags; // What flags do we want to set for enumeration?
  56. // Private Member Functions
  57. HRESULT _Fill(int cpidl, LPCITEMIDLIST rgpidl[]);
  58. void AssertSorted(void);
  59. };
  60. #endif // _FTPPIDLLIST_H