nsIFeedProcessor.idl 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #include "nsIStreamListener.idl"
  6. interface nsIURI;
  7. interface nsIFeedResultListener;
  8. interface nsIInputStream;
  9. /**
  10. * An nsIFeedProcessor parses feeds, triggering callbacks based on
  11. * their contents.
  12. */
  13. [scriptable, uuid(8a0b2908-21b0-45d7-b14d-30df0f92afc7)]
  14. interface nsIFeedProcessor : nsIStreamListener {
  15. /**
  16. * The listener that will respond to feed events.
  17. */
  18. attribute nsIFeedResultListener listener;
  19. // Level is where to listen for the extension, a constant: FEED,
  20. // ENTRY, BOTH.
  21. //
  22. // XXX todo void registerExtensionHandler(in
  23. // nsIFeedExtensionHandler, in long level);
  24. /**
  25. * Parse a feed from an nsIInputStream.
  26. *
  27. * @param stream The input stream.
  28. * @param uri The base URI.
  29. */
  30. void parseFromStream(in nsIInputStream stream, in nsIURI uri);
  31. /**
  32. * Parse a feed from a string.
  33. *
  34. * @param str The string to parse.
  35. * @param uri The base URI.
  36. */
  37. void parseFromString(in AString str, in nsIURI uri);
  38. /**
  39. * Parse a feed asynchronously. The caller must then call the
  40. * nsIFeedProcessor's nsIStreamListener methods to drive the
  41. * parse. Do not call the other parse methods during an asynchronous
  42. * parse.
  43. *
  44. * @param requestObserver The observer to notify on start/stop. This
  45. * argument can be null.
  46. * @param uri The base URI.
  47. */
  48. void parseAsync(in nsIRequestObserver requestObserver, in nsIURI uri);
  49. };