xpcom/ds/nsIEnumerator.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/ds/nsIEnumerator.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,50 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +%{C++
    1.12 +#define NS_ENUMERATOR_FALSE 1
    1.13 +%}
    1.14 +/*
    1.15 + * DO NOT USE THIS INTERFACE.  IT IS HORRIBLY BROKEN, USES NS_COMFALSE
    1.16 + * AND IS BASICALLY IMPOSSIBLE TO USE CORRECTLY THROUGH PROXIES OR
    1.17 + * XPCONNECT.  IF YOU SEE NEW USES OF THIS INTERFACE IN CODE YOU ARE
    1.18 + * REVIEWING, YOU SHOULD INSIST ON nsISimpleEnumerator.
    1.19 + *
    1.20 + * DON'T MAKE ME COME OVER THERE.
    1.21 + */
    1.22 +[scriptable, uuid(ad385286-cbc4-11d2-8cca-0060b0fc14a3)]
    1.23 +interface nsIEnumerator : nsISupports {
    1.24 +  /** First will reset the list. will return NS_FAILED if no items
    1.25 +   */
    1.26 +  void first();
    1.27 +
    1.28 +  /** Next will advance the list. will return failed if already at end
    1.29 +   */
    1.30 +  void next();
    1.31 +
    1.32 +  /** CurrentItem will return the CurrentItem item it will fail if the 
    1.33 +   *  list is empty
    1.34 +   */
    1.35 +  nsISupports currentItem();
    1.36 +
    1.37 +  /** return if the collection is at the end.  that is the beginning following 
    1.38 +   *  a call to Prev and it is the end of the list following a call to next
    1.39 +   */
    1.40 +  void isDone();
    1.41 +};
    1.42 +
    1.43 +[uuid(75f158a0-cadd-11d2-8cca-0060b0fc14a3)]
    1.44 +interface nsIBidirectionalEnumerator : nsIEnumerator {
    1.45 +
    1.46 +  /** Last will reset the list to the end. will return NS_FAILED if no items
    1.47 +   */
    1.48 +  void last();
    1.49 +
    1.50 +  /** Prev will decrement the list. will return failed if already at beginning
    1.51 +   */
    1.52 +  void prev();
    1.53 +};

mercurial