toolkit/components/feeds/nsIFeedProcessor.idl

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include "nsIStreamListener.idl"
     8 interface nsIURI;
     9 interface nsIFeedResultListener;
    10 interface nsIInputStream;
    12 /**
    13  * An nsIFeedProcessor parses feeds, triggering callbacks based on
    14  * their contents.
    15  */
    16 [scriptable, uuid(8a0b2908-21b0-45d7-b14d-30df0f92afc7)]
    17 interface nsIFeedProcessor : nsIStreamListener {
    19   /**
    20    * The listener that will respond to feed events. 
    21    */
    22   attribute nsIFeedResultListener listener;
    24   // Level is where to listen for the extension, a constant: FEED,
    25   // ENTRY, BOTH.
    26   //
    27   // XXX todo void registerExtensionHandler(in
    28   // nsIFeedExtensionHandler, in long level);
    30   /**
    31    * Parse a feed from an nsIInputStream.
    32    *
    33    * @param stream The input stream.
    34    * @param uri The base URI.
    35    */
    36   void parseFromStream(in nsIInputStream stream, in nsIURI uri);
    38   /**
    39    * Parse a feed from a string.
    40    *
    41    * @param str The string to parse.
    42    * @param uri The base URI.
    43    */
    44   void parseFromString(in AString str, in nsIURI uri);		
    46   /**
    47    * Parse a feed asynchronously. The caller must then call the
    48    * nsIFeedProcessor's nsIStreamListener methods to drive the
    49    * parse. Do not call the other parse methods during an asynchronous
    50    * parse.
    51    *
    52    * @param requestObserver The observer to notify on start/stop. This
    53    *                        argument can be null.
    54    * @param uri The base URI.
    55    */
    56   void parseAsync(in nsIRequestObserver requestObserver, in nsIURI uri);
    57 };

mercurial