mozilla

Revision 115473 of nsIMimeConverter

  • Revision slug: nsIMimeConverter
  • Revision title: nsIMimeConverter
  • Revision id: 115473
  • Created:
  • Creator: Jcranmer
  • Is current revision? No
  • Comment 329 words added

Revision Content

The nsIMimeConverter service allows you to convert headers into and out of MIME format.

{{ tbInterfaceStatus("nsIMimeConverter", "mailnews/mime/public/nsIMimeConverter.idl", "unfrozen", "Mozilla 1.9", "yes") }}

Inherits from: {{ Interface("nsISupports") }}

Implemented by: @mozilla.org/messenger/mimeconverter;1.

Method overview

 

string encodeMIMEPartIIStr(in string header, in boolean structured, in string mailCharset, in long fieldnamelen, in long encodedwordsize);
string encodeMIMEPartIIStr_UTF8(in AUTF8String header, in boolean structured, in string mailCharset, in long fieldnamelen, in long encodedwordsize);
string decodeMimeHeaderToCharPtr(in string header, in string default_charset, in boolean override_charset, in boolean eatContinuations);
AString decodeMimeHeader(in string header, in string default_charset, in boolean override_charset, in boolean eatContinuations);
MimeEncoderData *B64EncoderInit(in MimeConverterOutputCallback output_fn, in void *closure);
MimeEncoderData *QPEncoderInit(in MimeConverterOutputCallback output_fn, in void *closure);
void EncoderDestroy(in MimeEncoderData *data, in boolean abort_p);
long EncoderWrite(in MimeEncoderData *data, in string buffer, in long size);

 

Methods

encodeMimePartIIStr()

 AString getProperty(in string propertyName);
Parameters
propertyName
The name of the property to retrieve.
Return Value

The value of the property.

encodeMimePartIIStr_UTF8()

Sets a property on the header. For the currently selected message, Thunderbird provides a utility function: setMsgHdrPropertyAndReload(aProperty, aValue); which duplicates this functionality without requiring you to grab the current header.

 void setProperty(in string propertyName,
                  in AString propertyStr);
Parameters
propertyName
The name of the property to set.
propertyStr
The value of the property.

decodeMimeHeaderToCharPtr()

 void setStringProperty(in string propertyName,
                        in string propertyValue);
Parameters
propertyName
The name of the property to set.
propertyValue
The value of the property.

decodeMimeHeader()

 string getStringProperty(in string propertyName);
Parameters
propertyName
The name of the property to retrieve.
Return Value

The value of the property.

B64EncoderInit()

Get an integer property. Usually you would use this to store you own properties.

 unsigned long getUint32Property(in string propertyName);
Parameters
propertyName
The name of the property to retrieve. Thunderbird stored Uint32 properties (not a complete list):
indexed 
Used for Spotlight integration on OSX.
notAPhishMessage 
Indicates whether phisihing filters have been run on a message yet.

 

Return Value

The value of the property.

QPEncoderInit()

 void setUint32Property(in string propertyName,
                        in unsigned long propertyVal);
Parameters
propertyName
The name of the property to set.
propertyVal
The value of the property.

EncoderDestroy()

Marks this header as read. Thunderbird provides a utility function which performs this for the currently selected message: MarkCurrentMessageAsRead().

 void markRead(in boolean read);
Parameters
read
If true, mark as read. If false mark as undread.

EncoderWrite()

 void markFlagged(in boolean flagged);
Parameters
flagged
If true, mark as flagged. If false remove flag.

Revision Source

<p>The <code>nsIMimeConverter</code> service allows you to convert headers into and out of MIME format.</p>
<p>{{ tbInterfaceStatus("nsIMimeConverter", "mailnews/mime/public/nsIMimeConverter.idl", "unfrozen", "Mozilla 1.9", "yes") }}</p>
<p>Inherits from: {{ Interface("nsISupports") }}</p>
<p>Implemented by: <code>@mozilla.org/messenger/mimeconverter;1<span style="font-family: Verdana,Tahoma,sans-serif;">.</span></code></p>
<h2 name="Method_overview">Method overview</h2>
<p> </p>
<table class="standard-table"> <tbody> <tr> <td><code>string <a href="/#encodeMIMEPartIIStr.28.29" title="#encodeMIMEPartIIStr.28.29">encodeMIMEPartIIStr</a>(in string header, in boolean structured, in string mailCharset, in long fieldnamelen, in long encodedwordsize);</code></td> </tr> <tr> <td><code>string <a href="/#encodeMIMEPartIIStr_UTF8.28.29" title="#encodeMIMEPartIIStr UTF8.28.29">encodeMIMEPartIIStr_UTF8</a>(in AUTF8String header, in boolean structured, in string mailCharset, in long fieldnamelen, in long encodedwordsize);</code></td> </tr> <tr> <td><code>string <a href="/#decodeMimeHeaderToCharPtr.28.29" title="#decodeMimeHeaderToCharPtr.28.29">decodeMimeHeaderToCharPtr</a>(in string header, in string default_charset, in boolean override_charset, in boolean eatContinuations);</code></td> </tr> <tr> <td><code>AString <a href="/#decodeMimeHeader.28.29" title="#decodeMimeHeader.28.29">decodeMimeHeader</a>(</code><code>in string header, in string default_charset, in boolean override_charset, in boolean eatContinuations);</code></td> </tr> <tr> <td><code>MimeEncoderData *<a href="/#B64EncoderInit.28.29" title="#B64EncoderInit.28.29">B64EncoderInit</a>(in MimeConverterOutputCallback output_fn, in void *closure);</code></td> </tr> <tr> <td><code>MimeEncoderData *<a href="/#QPEncoderInit.28.29" title="#QPEncoderInit.28.29">QPEncoderInit</a></code><code>(in MimeConverterOutputCallback output_fn, in void *closure);</code></td> </tr> <tr> <td><code>void <a href="/#EncoderDestroy.28.29" title="#EncoderDestroy.28.29">EncoderDestroy</a>(in MimeEncoderData *data, in boolean abort_p);</code></td> </tr> <tr> <td><code>long <a href="/#EncoderWrite.28.29" title="#EncoderWrite.28.29">EncoderWrite</a>(in MimeEncoderData *data, in string buffer, in long size);</code></td> </tr> </tbody>
</table>
<p> </p>
<h2 name="Methods">Methods</h2>
<h3 name="getProperty.28.29">encodeMimePartIIStr()</h3>
<pre class="eval"> AString getProperty(in string propertyName);
</pre>
<h6 name="Parameters">Parameters</h6>
<dl> <dt><code>propertyName</code></dt> <dd>The name of the property to retrieve.</dd>
</dl>
<h6 name="Return_Value">Return Value</h6>
<p>The value of the property.</p>
<h3 name="setProperty.28.29">encodeMimePartIIStr_UTF8()</h3>
<p>Sets a property on the header. For the currently selected message, Thunderbird provides a utility function: <code><a class="external" href="http://mxr.mozilla.org/mozilla/source/mail/base/content/mailWindowOverlay.js#2617">setMsgHdrPropertyAndReload(aProperty, aValue);</a></code> which duplicates this functionality without requiring you to grab the current header.</p>
<pre class="eval"> void setProperty(in string propertyName,
                  in AString propertyStr);
</pre>
<h6 name="Parameters_2">Parameters</h6>
<dl> <dt><code>propertyName</code></dt> <dd>The name of the property to set.</dd> <dt><code>propertyStr</code></dt> <dd>The value of the property.</dd>
</dl>
<h3 name="setStringProperty.28.29">decodeMimeHeaderToCharPtr()</h3>
<pre class="eval"> void setStringProperty(in string propertyName,
                        in string propertyValue);
</pre>
<h6 name="Parameters_3">Parameters</h6>
<dl> <dt><code>propertyName</code></dt> <dd>The name of the property to set.</dd> <dt><code>propertyValue</code></dt> <dd>The value of the property.</dd>
</dl>
<h3 name="getStringProperty.28.29">decodeMimeHeader()</h3>
<pre class="eval"> string getStringProperty(in string propertyName);
</pre>
<h6 name="Parameters_4">Parameters</h6>
<dl> <dt><code>propertyName</code></dt> <dd>The name of the property to retrieve.</dd>
</dl>
<h6 name="Return_Value_2">Return Value</h6>
<p>The value of the property.</p>
<h3 name="getUint32Property.28.29">B64EncoderInit()</h3>
<p>Get an integer property. Usually you would use this to store you own properties.</p>
<pre class="eval"> unsigned long getUint32Property(in string propertyName);
</pre>
<h6 name="Parameters_5">Parameters</h6>
<dl> <dt><code>propertyName</code></dt> <dd>The name of the property to retrieve. <a href="/en/Thunderbird" title="en/Thunderbird">Thunderbird</a> stored Uint32 properties (not a complete list): <dl> <dt><code>indexed</code> </dt> <dd>Used for Spotlight integration on <a href="/en/OSX" title="en/OSX">OSX</a>.</dd> <dt><code>notAPhishMessage</code> </dt> <dd>Indicates whether phisihing filters have been run on a message yet.</dd> </dl> </dd>
</dl>
<p> </p>
<h6 name="Return_Value_3">Return Value</h6>
<p>The value of the property.</p>
<h3 name="setUint32Property.28.29">QPEncoderInit()</h3>
<pre class="eval"> void setUint32Property(in string propertyName,
                        in unsigned long propertyVal);
</pre>
<h6 name="Parameters_6">Parameters</h6>
<dl> <dt><code>propertyName</code></dt> <dd>The name of the property to set.</dd> <dt><code>propertyVal</code></dt> <dd>The value of the property.</dd>
</dl>
<h3 name="markRead.28.29">EncoderDestroy()</h3>
<p>Marks this header as read. <a href="/en/Thunderbird" title="en/Thunderbird">Thunderbird</a> provides a utility function which performs this for the currently selected message: <a class="external" href="http://mxr.mozilla.org/mozilla/source/mail/base/content/mailWindowOverlay.js#2629">MarkCurrentMessageAsRead()</a>.</p>
<pre class="eval"> void markRead(in boolean read);
</pre>
<h6 name="Parameters_7">Parameters</h6>
<dl> <dt><code>read</code></dt> <dd>If <code>true</code>, mark as read. If <code>false</code> mark as undread.</dd>
</dl>
<h3 name="markFlagged.28.29">EncoderWrite()</h3>
<pre class="eval"> void markFlagged(in boolean flagged);
</pre>
<h6 name="Parameters_8">Parameters</h6>
<dl> <dt><code>flagged</code></dt> <dd>If <code>true</code>, mark as flagged. If <code>false</code> remove flag.</dd>
</dl>
Revert to this revision