1998-10-19 21:48:55 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/*
|
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
|
|
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
|
|
|
* http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* NPL.
|
|
|
|
*
|
|
|
|
* The Initial Developer of this code under the NPL is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
|
|
* Reserved.
|
|
|
|
*/
|
|
|
|
|
1998-12-01 20:55:08 +03:00
|
|
|
#ifndef nsIEnumerator_h___
|
|
|
|
#define nsIEnumerator_h___
|
1998-10-19 21:48:55 +04:00
|
|
|
|
|
|
|
#include "nsISupports.h"
|
|
|
|
|
1999-02-24 12:31:34 +03:00
|
|
|
#define NS_IENUMERATOR_IID \
|
|
|
|
{ /* ad385286-cbc4-11d2-8cca-0060b0fc14a3 */ \
|
|
|
|
0xad385286, \
|
|
|
|
0xcbc4, \
|
|
|
|
0x11d2, \
|
|
|
|
{0x8c, 0xca, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
|
|
|
|
}
|
1998-10-19 21:48:55 +04:00
|
|
|
|
|
|
|
class nsIEnumerator : public nsISupports {
|
|
|
|
public:
|
1999-01-21 02:16:28 +03:00
|
|
|
|
1999-03-04 02:03:34 +03:00
|
|
|
static const nsIID& GetIID(void) { static nsIID iid = NS_IENUMERATOR_IID; return iid; }
|
1998-12-01 20:55:08 +03:00
|
|
|
|
|
|
|
/** First will reset the list. will return NS_FAILED if no items
|
|
|
|
*/
|
1999-02-23 11:10:24 +03:00
|
|
|
NS_IMETHOD First(void) = 0;
|
1998-12-01 20:55:08 +03:00
|
|
|
|
1999-02-23 11:10:24 +03:00
|
|
|
/** Next will advance the list. will return failed if already at end
|
1998-12-01 20:55:08 +03:00
|
|
|
*/
|
1999-02-23 11:10:24 +03:00
|
|
|
NS_IMETHOD Next(void) = 0;
|
1998-12-01 20:55:08 +03:00
|
|
|
|
|
|
|
/** CurrentItem will return the CurrentItem item it will fail if the list is empty
|
|
|
|
* @param aItem return value
|
|
|
|
*/
|
1999-02-23 11:10:24 +03:00
|
|
|
NS_IMETHOD CurrentItem(nsISupports **aItem) = 0;
|
1998-12-01 20:55:08 +03:00
|
|
|
|
|
|
|
/** 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
|
|
|
|
*/
|
1999-02-23 11:10:24 +03:00
|
|
|
NS_IMETHOD IsDone(void) = 0;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#define NS_IBIDIRECTIONALENUMERATOR_IID \
|
|
|
|
{ /* 75f158a0-cadd-11d2-8cca-0060b0fc14a3 */ \
|
|
|
|
0x75f158a0, \
|
|
|
|
0xcadd, \
|
|
|
|
0x11d2, \
|
|
|
|
{0x8c, 0xca, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
|
|
|
|
}
|
|
|
|
|
|
|
|
class nsIBidirectionalEnumerator : public nsIEnumerator {
|
|
|
|
public:
|
|
|
|
|
1999-03-04 02:03:34 +03:00
|
|
|
static const nsIID& GetIID(void) { static nsIID iid = NS_IBIDIRECTIONALENUMERATOR_IID; return iid; }
|
1999-02-23 11:10:24 +03:00
|
|
|
|
|
|
|
/** Last will reset the list to the end. will return NS_FAILED if no items
|
|
|
|
*/
|
|
|
|
NS_IMETHOD Last(void) = 0;
|
|
|
|
|
|
|
|
/** Prev will decrement the list. will return failed if already at beginning
|
|
|
|
*/
|
|
|
|
NS_IMETHOD Prev(void) = 0;
|
1998-12-01 20:55:08 +03:00
|
|
|
|
1998-10-19 21:48:55 +04:00
|
|
|
};
|
|
|
|
|
1999-02-24 10:58:06 +03:00
|
|
|
// Construct and return an implementation of a "conjoining enumerator." This
|
|
|
|
// enumerator lets you string together two other enumerators into one sequence.
|
|
|
|
// The result is an nsIBidirectionalEnumerator, but if either input is not
|
|
|
|
// also bidirectional, the Last and Prev operations will fail.
|
|
|
|
extern NS_COM nsresult
|
|
|
|
NS_NewConjoiningEnumerator(nsIEnumerator* first, nsIEnumerator* second,
|
|
|
|
nsIBidirectionalEnumerator* *aInstancePtrResult);
|
|
|
|
|
1998-12-01 20:55:08 +03:00
|
|
|
#endif // __nsIEnumerator_h
|
1998-10-19 21:48:55 +04:00
|
|
|
|