michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: interface nsIFeedResult; michael@0: interface nsIFeedEntry; michael@0: michael@0: /** michael@0: * nsIFeedResultListener defines a callback used when feed processing michael@0: * completes. michael@0: */ michael@0: [scriptable, uuid(4d2ebe88-36eb-4e20-bcd1-997b3c1f24ce)] michael@0: interface nsIFeedResultListener : nsISupports michael@0: { michael@0: /** michael@0: * Always called, even after an error. There could be new feed-level michael@0: * data available at this point, if it followed or was interspersed michael@0: * with the items. Fire-and-Forget implementations only need this. michael@0: * michael@0: * @param result michael@0: * An object implementing nsIFeedResult representing the feed michael@0: * and its metadata. michael@0: */ michael@0: void handleResult(in nsIFeedResult result); michael@0: }; michael@0: michael@0: michael@0: /** michael@0: * nsIFeedProgressListener defines callbacks used during feed michael@0: * processing. michael@0: */ michael@0: [scriptable, uuid(ebfd5de5-713c-40c0-ad7c-f095117fa580)] michael@0: interface nsIFeedProgressListener : nsIFeedResultListener { michael@0: michael@0: /** michael@0: * ReportError will be called in the event of fatal michael@0: * XML errors, or if the document is not a feed. The bozo michael@0: * bit will be set if the error was due to a fatal error. michael@0: * michael@0: * @param errorText michael@0: * A short description of the error. michael@0: * @param lineNumber michael@0: * The line on which the error occurred. michael@0: */ michael@0: void reportError(in AString errorText, in long lineNumber, michael@0: in boolean bozo); michael@0: michael@0: /** michael@0: * StartFeed will be called as soon as a reasonable start to michael@0: * a feed is detected. michael@0: * michael@0: * @param result michael@0: * An object implementing nsIFeedResult representing the feed michael@0: * and its metadata. At this point, the result has version michael@0: * information. michael@0: */ michael@0: void handleStartFeed(in nsIFeedResult result); michael@0: michael@0: /** michael@0: * Called when the first entry/item is encountered. In Atom, all michael@0: * feed data is required to preceed the entries. In RSS, the data michael@0: * usually does. If the type is one of the entry/item-only types, michael@0: * this event will not be called. michael@0: * michael@0: * @param result michael@0: * An object implementing nsIFeedResult representing the feed michael@0: * and its metadata. At this point, the result will likely have michael@0: * most of its feed-level metadata. michael@0: */ michael@0: void handleFeedAtFirstEntry(in nsIFeedResult result); michael@0: michael@0: /** michael@0: * Called after each entry/item. If the document is a standalone michael@0: * item or entry, this HandleFeedAtFirstEntry will not have been michael@0: * called. Also, this entry's parent field will be null. michael@0: * michael@0: * @param entry michael@0: * An object implementing nsIFeedEntry that represents the latest michael@0: * entry encountered. michael@0: * @param result michael@0: * An object implementing nsIFeedResult representing the feed michael@0: * and its metadata. michael@0: */ michael@0: void handleEntry(in nsIFeedEntry entry, in nsIFeedResult result); michael@0: };