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.

96 lines
2.9 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved
  3. Module Name:
  4. wsbenum.h
  5. Abstract:
  6. These classes provides enumerators (iterators) for the collection classes.
  7. Author:
  8. Chuck Bardeen [cbardeen] 29-Oct-1996
  9. Revision History:
  10. --*/
  11. #include "resource.h" // main symbols
  12. #if !defined WSBENUM_INCL
  13. #define WSBENUM_INCL
  14. class CWsbIndexedEnum :
  15. public IEnumUnknown,
  16. public IWsbEnum,
  17. public IWsbEnumEx,
  18. public CComObjectRoot,
  19. public CComCoClass<CWsbIndexedEnum,&CLSID_CWsbIndexedEnum>
  20. {
  21. public:
  22. CWsbIndexedEnum() {}
  23. BEGIN_COM_MAP(CWsbIndexedEnum)
  24. COM_INTERFACE_ENTRY(IWsbEnum)
  25. COM_INTERFACE_ENTRY(IWsbEnumEx)
  26. COM_INTERFACE_ENTRY(IEnumUnknown)
  27. END_COM_MAP()
  28. DECLARE_REGISTRY_RESOURCEID(IDR_CWsbIndexedEnum)
  29. // CComObjectRoot
  30. public:
  31. STDMETHOD(FinalConstruct)(void);
  32. // IWsbEnum
  33. public:
  34. STDMETHOD(First)(REFIID riid, void** ppElement);
  35. STDMETHOD(Next)(REFIID riid, void** ppElement);
  36. STDMETHOD(This)(REFIID riid, void** ppElement);
  37. STDMETHOD(Previous)(REFIID riid, void** ppElement);
  38. STDMETHOD(Last)(REFIID riid, void** ppElement);
  39. STDMETHOD(FindNext)(IUnknown* pCollectable, REFIID riid, void** ppElement);
  40. STDMETHOD(Find)(IUnknown* pCollectable, REFIID riid, void** ppElements);
  41. STDMETHOD(FindPrevious)(IUnknown* pCollectable, REFIID riid, void** ppElement);
  42. STDMETHOD(SkipToFirst)(void);
  43. STDMETHOD(SkipNext)(ULONG element);
  44. STDMETHOD(SkipTo)(ULONG index);
  45. STDMETHOD(SkipPrevious)(ULONG element);
  46. STDMETHOD(SkipToLast)(void);
  47. STDMETHOD(Init)(IWsbCollection* pCollection);
  48. STDMETHOD(Clone)(IWsbEnum** ppEnum);
  49. // IWsbEnumEx
  50. public:
  51. STDMETHOD(First)(ULONG element, REFIID riid, void** elements, ULONG* pElementsFetched);
  52. STDMETHOD(Next)(ULONG element, REFIID riid, void** elements, ULONG* pElementsFetched);
  53. STDMETHOD(This)(ULONG element, REFIID riid, void** elements, ULONG* pElementsFetched);
  54. STDMETHOD(Previous)(ULONG element, REFIID riid, void** elements, ULONG* pElementsFetched);
  55. STDMETHOD(Last)(ULONG element, REFIID riid, void** elements, ULONG* pElementsFetched);
  56. STDMETHOD(FindNext)(IUnknown* pCollectable, ULONG element, REFIID riid, void** elements, ULONG* elementsFetched);
  57. STDMETHOD(Find)(IUnknown* pCollectable, ULONG element, REFIID riid, void** elements, ULONG* elementsFetched);
  58. STDMETHOD(FindPrevious)(IUnknown* pCollectable, ULONG element, REFIID riid, void** elements, ULONG* elementsFetched);
  59. STDMETHOD(Clone)(IWsbEnumEx** ppEnum);
  60. // IEnumUnknown
  61. public:
  62. STDMETHOD(Next)(ULONG element, IUnknown** elements, ULONG* pElementsFetched);
  63. STDMETHOD(Skip)(ULONG element);
  64. STDMETHOD(Clone)(IEnumUnknown** ppEnum);
  65. // Shared
  66. public:
  67. STDMETHOD(Reset)(void);
  68. protected:
  69. CComPtr<IWsbIndexedCollection> m_pCollection;
  70. ULONG m_currentIndex;
  71. };
  72. #endif