nsISimpleEnumerator.idl revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
4632N/A/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
4632N/A/* ***** BEGIN LICENSE BLOCK *****
4632N/A * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4632N/A *
4632N/A * The contents of this file are subject to the Mozilla Public License Version
4632N/A * 1.1 (the "License"); you may not use this file except in compliance with
4632N/A * the License. You may obtain a copy of the License at
4632N/A * http://www.mozilla.org/MPL/
4632N/A *
4632N/A * Software distributed under the License is distributed on an "AS IS" basis,
4632N/A * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
4632N/A * for the specific language governing rights and limitations under the
4632N/A * License.
4632N/A *
4632N/A * The Original Code is mozilla.org code.
4632N/A *
4632N/A * The Initial Developer of the Original Code is
4632N/A * Netscape Communications Corporation.
4632N/A * Portions created by the Initial Developer are Copyright (C) 1998
4632N/A * the Initial Developer. All Rights Reserved.
4632N/A *
4632N/A * Contributor(s):
4632N/A *
4632N/A * Alternatively, the contents of this file may be used under the terms of
4632N/A * either of the GNU General Public License Version 2 or later (the "GPL"),
4632N/A * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
4632N/A * in which case the provisions of the GPL or the LGPL are applicable instead
4632N/A * of those above. If you wish to allow use of your version of this file only
4639N/A * under the terms of either the GPL or the LGPL, and not to allow others to
4639N/A * use your version of this file under the terms of the MPL, indicate your
4632N/A * decision by deleting the provisions above and replace them with the notice
4632N/A * and other provisions required by the GPL or the LGPL. If you do not delete
4632N/A * the provisions above, a recipient may use your version of this file under
4632N/A * the terms of any one of the MPL, the GPL or the LGPL.
4632N/A *
4632N/A * ***** END LICENSE BLOCK ***** */
4632N/A
4639N/A#include "nsISupports.idl"
4632N/A
4632N/A/**
4632N/A * Used to enumerate over elements defined by its implementor.
4632N/A * Although hasMoreElements() can be called independently of getNext(),
4632N/A * getNext() must be pre-ceeded by a call to hasMoreElements(). There is
4632N/A * no way to "reset" an enumerator, once you obtain one.
4632N/A *
4632N/A * @status FROZEN
4639N/A * @version 1.0
4632N/A */
4691N/A
4632N/A[scriptable, uuid(D1899240-F9D2-11D2-BDD6-000064657374)]
4632N/Ainterface nsISimpleEnumerator : nsISupports {
/**
* Called to determine whether or not the enumerator has
* any elements that can be returned via getNext(). This method
* is generally used to determine whether or not to initiate or
* continue iteration over the enumerator, though it can be
* called without subsequent getNext() calls. Does not affect
* internal state of enumerator.
*
* @see getNext()
* @return PR_TRUE if there are remaining elements in the enumerator.
* PR_FALSE if there are no more elements in the enumerator.
*/
boolean hasMoreElements();
/**
* Called to retrieve the next element in the enumerator. The "next"
* element is the first element upon the first call. Must be
* pre-ceeded by a call to hasMoreElements() which returns PR_TRUE.
* This method is generally called within a loop to iterate over
* the elements in the enumerator.
*
* @see hasMoreElements()
* @return NS_OK if the call succeeded in returning a non-null
* value through the out parameter.
* NS_ERROR_FAILURE if there are no more elements
* to enumerate.
* @return the next element in the enumeration.
*/
nsISupports getNext();
};