making big changes to enumerator class and adding nsICollection

This commit is contained in:
mjudge%netscape.com 1998-12-01 17:55:08 +00:00
parent 30e57ff4a6
commit 500a20c8b4
5 changed files with 67 additions and 10 deletions

View File

@ -16,8 +16,8 @@
* Reserved.
*/
#ifndef __nsIEnumerator_h
#define __nsIEnumerator_h
#ifndef nsIEnumerator_h___
#define nsIEnumerator_h___
#include "nsISupports.h"
@ -29,9 +29,36 @@
class nsIEnumerator : public nsISupports {
public:
NS_IMETHOD_(nsISupports*) Next() = 0;
NS_IMETHOD_(void) Reset()= 0;
public:
/** First will reset the list. will return NS_FAILED if no items
*/
virtual nsresult First()=0;
/** Last will reset the list to the end. will return NS_FAILED if no items
*/
virtual nsresult Last()=0;
/** Next will advance the list. will return failed if allready at end
*/
virtual nsresult Next()=0;
/** Prev will decrement the list. will return failed if allready at beginning
*/
virtual nsresult Prev()=0;
/** CurrentItem will return the CurrentItem item it will fail if the list is empty
* @param aItem return value
*/
virtual nsresult CurrentItem(nsISupports **aItem)=0;
/** return if the collection is at the end. that is the beginning following a call to Prev
* and it is the end of the list following a call to next
* @param aItem return value
*/
virtual nsresult IsDone(PRBool *aDone)=0;
};
#endif // __nsIFactory_h
#endif // __nsIEnumerator_h

View File

@ -20,3 +20,4 @@ nsVector.h
nsMacRepository.h
nsTraceRefcnt.h
plvector.h
nsICollection.h

View File

@ -30,6 +30,7 @@ EXPORTS = \
nsDebug.h \
nsError.h \
nsHashtable.h \
nsICollection.h \
nsID.h \
nsIFactory.h \
nsISupports.h \

View File

@ -26,6 +26,7 @@ EXPORTS = \
nsDebug.h \
nsError.h \
nsHashtable.h \
nsICollection.h \
nsID.h \
nsIFactory.h \
nsISupports.h \

View File

@ -16,8 +16,8 @@
* Reserved.
*/
#ifndef __nsIEnumerator_h
#define __nsIEnumerator_h
#ifndef nsIEnumerator_h___
#define nsIEnumerator_h___
#include "nsISupports.h"
@ -29,9 +29,36 @@
class nsIEnumerator : public nsISupports {
public:
NS_IMETHOD_(nsISupports*) Next() = 0;
NS_IMETHOD_(void) Reset()= 0;
public:
/** First will reset the list. will return NS_FAILED if no items
*/
virtual nsresult First()=0;
/** Last will reset the list to the end. will return NS_FAILED if no items
*/
virtual nsresult Last()=0;
/** Next will advance the list. will return failed if allready at end
*/
virtual nsresult Next()=0;
/** Prev will decrement the list. will return failed if allready at beginning
*/
virtual nsresult Prev()=0;
/** CurrentItem will return the CurrentItem item it will fail if the list is empty
* @param aItem return value
*/
virtual nsresult CurrentItem(nsISupports **aItem)=0;
/** return if the collection is at the end. that is the beginning following a call to Prev
* and it is the end of the list following a call to next
* @param aItem return value
*/
virtual nsresult IsDone(PRBool *aDone)=0;
};
#endif // __nsIFactory_h
#endif // __nsIEnumerator_h