toolkit/components/feeds/nsIFeedListener.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/feeds/nsIFeedListener.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,87 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     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 +interface nsIFeedResult;
    1.11 +interface nsIFeedEntry;
    1.12 +
    1.13 +/**
    1.14 + * nsIFeedResultListener defines a callback used when feed processing
    1.15 + * completes.
    1.16 + */
    1.17 +[scriptable, uuid(4d2ebe88-36eb-4e20-bcd1-997b3c1f24ce)]
    1.18 +interface nsIFeedResultListener : nsISupports 
    1.19 +{
    1.20 +   /** 
    1.21 +   * Always called, even after an error. There could be new feed-level
    1.22 +   * data available at this point, if it followed or was interspersed
    1.23 +   * with the items. Fire-and-Forget implementations only need this.
    1.24 +   * 
    1.25 +   * @param result
    1.26 +   *        An object implementing nsIFeedResult representing the feed 
    1.27 +   *        and its metadata. 
    1.28 +   */
    1.29 +   void handleResult(in nsIFeedResult result);
    1.30 +};
    1.31 +
    1.32 +
    1.33 +/**
    1.34 + * nsIFeedProgressListener defines callbacks used during feed
    1.35 + * processing.
    1.36 + */
    1.37 +[scriptable, uuid(ebfd5de5-713c-40c0-ad7c-f095117fa580)]
    1.38 +interface nsIFeedProgressListener : nsIFeedResultListener {
    1.39 +  
    1.40 +   /**
    1.41 +   * ReportError will be called in the event of fatal
    1.42 +   * XML errors, or if the document is not a feed. The bozo 
    1.43 +   * bit will be set if the error was due to a fatal error. 
    1.44 +   * 
    1.45 +   * @param errorText
    1.46 +   *        A short description of the error.
    1.47 +   * @param lineNumber
    1.48 +   *        The line on which the error occurred.
    1.49 +   */
    1.50 +   void reportError(in AString errorText, in long lineNumber, 
    1.51 +                    in boolean bozo);
    1.52 +   
    1.53 +   /**
    1.54 +   * StartFeed will be called as soon as a reasonable start to
    1.55 +   * a feed is detected. 
    1.56 +   *  
    1.57 +   * @param result
    1.58 +   *        An object implementing nsIFeedResult representing the feed 
    1.59 +   *        and its metadata. At this point, the result has version 
    1.60 +   *        information.
    1.61 +   */
    1.62 +   void handleStartFeed(in nsIFeedResult result);
    1.63 +
    1.64 +   /**
    1.65 +   * Called when the first entry/item is encountered. In Atom, all
    1.66 +   * feed data is required to preceed the entries. In RSS, the data
    1.67 +   * usually does. If the type is one of the entry/item-only types,
    1.68 +   * this event will not be called.
    1.69 +   *
    1.70 +   * @param result
    1.71 +   *        An object implementing nsIFeedResult representing the feed 
    1.72 +   *        and its metadata. At this point, the result will likely have
    1.73 +   *        most of its feed-level metadata.
    1.74 +   */
    1.75 +   void handleFeedAtFirstEntry(in nsIFeedResult result); 
    1.76 +
    1.77 +   /**
    1.78 +   * Called after each entry/item. If the document is a standalone
    1.79 +   * item or entry, this HandleFeedAtFirstEntry will not have been
    1.80 +   * called. Also, this entry's parent field will be null.
    1.81 +   * 
    1.82 +   * @param entry
    1.83 +   *        An object implementing nsIFeedEntry that represents the latest
    1.84 +   *        entry encountered.
    1.85 +   * @param result
    1.86 +   *        An object implementing nsIFeedResult representing the feed 
    1.87 +   *        and its metadata. 
    1.88 +   */
    1.89 +   void handleEntry(in nsIFeedEntry entry, in nsIFeedResult result);
    1.90 +};

mercurial