toolkit/components/feeds/nsIFeedProcessor.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/feeds/nsIFeedProcessor.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     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 "nsIStreamListener.idl"
    1.10 +
    1.11 +interface nsIURI;
    1.12 +interface nsIFeedResultListener;
    1.13 +interface nsIInputStream;
    1.14 +
    1.15 +/**
    1.16 + * An nsIFeedProcessor parses feeds, triggering callbacks based on
    1.17 + * their contents.
    1.18 + */
    1.19 +[scriptable, uuid(8a0b2908-21b0-45d7-b14d-30df0f92afc7)]
    1.20 +interface nsIFeedProcessor : nsIStreamListener {
    1.21 +
    1.22 +  /**
    1.23 +   * The listener that will respond to feed events. 
    1.24 +   */
    1.25 +  attribute nsIFeedResultListener listener;
    1.26 +
    1.27 +  // Level is where to listen for the extension, a constant: FEED,
    1.28 +  // ENTRY, BOTH.
    1.29 +  //
    1.30 +  // XXX todo void registerExtensionHandler(in
    1.31 +  // nsIFeedExtensionHandler, in long level);
    1.32 +  
    1.33 +  /**
    1.34 +   * Parse a feed from an nsIInputStream.
    1.35 +   *
    1.36 +   * @param stream The input stream.
    1.37 +   * @param uri The base URI.
    1.38 +   */
    1.39 +  void parseFromStream(in nsIInputStream stream, in nsIURI uri);
    1.40 +
    1.41 +  /**
    1.42 +   * Parse a feed from a string.
    1.43 +   *
    1.44 +   * @param str The string to parse.
    1.45 +   * @param uri The base URI.
    1.46 +   */
    1.47 +  void parseFromString(in AString str, in nsIURI uri);		
    1.48 +
    1.49 +  /**
    1.50 +   * Parse a feed asynchronously. The caller must then call the
    1.51 +   * nsIFeedProcessor's nsIStreamListener methods to drive the
    1.52 +   * parse. Do not call the other parse methods during an asynchronous
    1.53 +   * parse.
    1.54 +   *
    1.55 +   * @param requestObserver The observer to notify on start/stop. This
    1.56 +   *                        argument can be null.
    1.57 +   * @param uri The base URI.
    1.58 +   */
    1.59 +  void parseAsync(in nsIRequestObserver requestObserver, in nsIURI uri);
    1.60 +};

mercurial