|
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/. */ |
|
5 |
|
6 #include "nsIStreamListener.idl" |
|
7 |
|
8 interface nsIURI; |
|
9 interface nsIFeedResultListener; |
|
10 interface nsIInputStream; |
|
11 |
|
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 { |
|
18 |
|
19 /** |
|
20 * The listener that will respond to feed events. |
|
21 */ |
|
22 attribute nsIFeedResultListener listener; |
|
23 |
|
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); |
|
29 |
|
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); |
|
37 |
|
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); |
|
45 |
|
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 }; |