mozilla

Revision 196226 of nsIFeedProgressListener

  • Raccourci de la révision : nsIFeedProgressListener
  • Titre de la révision : nsIFeedProgressListener
  • ID de la révision : 196226
  • Créé :
  • Créateur : Fredchat
  • Version actuelle ? Non
  • Commentaire /* Préparation de la traduction */

Contenu de la révision

{{template.Traduction_en_cours("nsIFeedProgressListener")}} The nsIFeedProgressListener interface defines callbacks used during the processing of an RSS or Atom feed. Programs using the feed content access API do not have to implement any of these callbacks; they are optional, but allow you to provide feedback during the parsing process.


{{template.InterfaceStatus("nsiFeedProgressListener", "toolkit/components/feeds/public/nsiFeedListener.idl", "unfrozen", "Mozilla 1.8.1", "yes")}}

Inherits from: nsIFeedResultListener

Method overview

void handleEntry(in nsIFeedEntry entry, in nsIFeedResult result);
void handleFeedAtFirstEntry(in nsIFeedResult result);
void handleStartFeed(in nsIFeedResult result);
void reportError(in AString errorText, in long lineNumber, in boolean bozo);

Methods

handleEntry()

Called after each entry or item is processed. If the document is a standalone item or entry, the handleFeedAtFirstEntry() method will not already have been called, and the received nsIFeedEntry will have a null parent value.

 void handleEntry(
   in nsIFeedEntry entry,
   in nsIFeedResult result
 );
Parameters
<tt>entry</tt>
Pointer to an nsIFeedEntry containing information about the entry that was just processed.
<tt>result</tt>
Pointer to an nsIFeedResult containing the current information about the feed being processed.

handleFeedAtFirstEntry()

Called when the first entry or item in the feed is encountered. In Atom, all feed data is required to precede the entries; in RSS, this isn't required but is typically the case. In other words, by the time this method is called, it is most likely that most or all of the feed-level metadata has been processed and is available in the received nsIFeedResult object.

 void handleFeedAtFirstEntry(
   in nsIFeedResult result
 );
Parameters
<tt>result</tt>
An nsIFeedResult describing the feed at the point at which the first entry is found, but before processing it.
Note: If the feed type is one of the entry or item-only types, this event will never be called.

handleStartFeed()

Called as soon as a reasonable start to a feed is detected; this lets your code know that the feed does appear to be an actual feed rather than some other sort of document.

 void handleStartFeed(
   in nsIFeedResult result
 );
Parameters
<tt>result</tt>
An nsIFeedResult describing the current state of the feed at the moment parsing begins.

reportError()

Called by the feed processor when a fatal XML parsing error occurs, or if the document isn't a feed.

 void reportError(
   in AString errorText,
   in long lineNumber,
   in boolean bozo
 );

Each method receives as input at least an nsIFeedResult that describes the current state of the processing.

See also

nsIFeedResultListener

{{ wiki.languages( { "en": "en/NsIFeedProgressListener" } ) }}

Source de la révision

<p>
{{template.Traduction_en_cours("nsIFeedProgressListener")}}
The <code>nsIFeedProgressListener</code> interface defines callbacks used during the processing of an RSS or Atom feed.  Programs using the feed content access API do not have to implement any of these callbacks; they are optional, but allow you to provide feedback during the parsing process.
</p><p><br>
{{template.InterfaceStatus("nsiFeedProgressListener", "toolkit/components/feeds/public/nsiFeedListener.idl", "unfrozen", "Mozilla 1.8.1", "yes")}}
</p><p>Inherits from: <code><a href="fr/NsIFeedResultListener">nsIFeedResultListener</a></code>
</p>
<h2 name="Method_overview">Method overview</h2>
<table class="standard-table">

<tbody><tr>
<td> <code>void <a href="fr/NsIFeedProgressListener#handleEntry.28.29">handleEntry</a>(in nsIFeedEntry entry, in nsIFeedResult result);</code>
</td></tr>
<tr>
<td> <code>void <a href="fr/NsIFeedProgressListener#handleFeedAtFirstEntry.28.29">handleFeedAtFirstEntry</a>(in nsIFeedResult result);</code>
</td></tr>
<tr>
<td> <code>void <a href="fr/NsIFeedProgressListener#handleStartFeed.28.29">handleStartFeed</a>(in nsIFeedResult result);</code>
</td></tr>
<tr>
<td> <code>void <a href="fr/NsIFeedProgressListener#reportError.28.29">reportError</a>(in AString errorText, in long lineNumber, in boolean bozo);</code>
</td></tr>
</tbody></table>
<h2 name="Methods">Methods</h2>
<h3 name="handleEntry.28.29">handleEntry()</h3>
<p>Called after each entry or item is processed.  If the document is a standalone item or entry, the <code><a href="fr/NsIFeedProgressListener#handleFeedAtFirstEntry.28.29">handleFeedAtFirstEntry()</a></code> method will not already have been called, and the received <code><a href="fr/NsIFeedEntry">nsIFeedEntry</a></code> will have a <code>null</code> <code>parent</code> value.
</p>
<pre class="eval"> void handleEntry(
   in nsIFeedEntry entry,
   in nsIFeedResult result
 );
</pre>
<h6 name="Parameters">Parameters</h6>
<dl><dt><tt>entry</tt>
</dt><dd> Pointer to an <code><a href="fr/NsIFeedEntry">nsIFeedEntry</a></code> containing information about the entry that was just processed.
</dd><dt><tt>result</tt>
</dt><dd> Pointer to an <code><a href="fr/NsIFeedResult">nsIFeedResult</a></code> containing the current information about the feed being processed.
</dd></dl>
<h3 name="handleFeedAtFirstEntry.28.29">handleFeedAtFirstEntry()</h3>
<p>Called when the first entry or item in the feed is encountered.  In Atom, all feed data is required to precede the entries; in RSS, this isn't required but is typically the case.  In other words, by the time this method is called, it is most likely that most or all of the feed-level metadata has been processed and is available in the received <code><a href="fr/NsIFeedResult">nsIFeedResult</a></code> object.
</p>
<pre class="eval"> void handleFeedAtFirstEntry(
   in nsIFeedResult result
 );
</pre>
<h6 name="Parameters_2">Parameters</h6>
<dl><dt><tt>result</tt>
</dt><dd>An <code><a href="fr/NsIFeedResult">nsIFeedResult</a></code> describing the feed at the point at which the first entry is found, but before processing it.
</dd></dl>
<div class="note"><b>Note:</b> If the feed type is one of the entry or item-only types, this event will never be called.</div>
<h3 name="handleStartFeed.28.29">handleStartFeed()</h3>
<p>Called as soon as a reasonable start to a feed is detected; this lets your code know that the feed does appear to be an actual feed rather than some other sort of document.
</p>
<pre class="eval"> void handleStartFeed(
   in nsIFeedResult result
 );
</pre>
<h6 name="Parameters_3">Parameters</h6>
<dl><dt><tt>result</tt>
</dt><dd> An <code><a href="fr/NsIFeedResult">nsIFeedResult</a></code> describing the current state of the feed at the moment parsing begins.
</dd></dl>
<h3 name="reportError.28.29">reportError()</h3>
<p>Called by the feed processor when a fatal XML parsing error occurs, or if the document isn't a feed.
</p>
<pre class="eval"> void reportError(
   in AString errorText,
   in long lineNumber,
   in boolean bozo
 );
</pre>
<p>Each method receives as input at least an <code><a href="fr/NsIFeedResult">nsIFeedResult</a></code> that describes the current state of the processing.
</p>
<h2 name="See_also">See also</h2>
<p><a href="fr/NsIFeedResultListener">nsIFeedResultListener</a>
</p>{{ wiki.languages( { "en": "en/NsIFeedProgressListener" } ) }}
Revenir à cette révision