The Deep End

go to graworks.com! email!

Tuesday, March 01, 2005

Thunderbird Extensions: nsIMsgCompType and nsIMsgCompFormat

I didn't include this in the post "How to Open a Compose Window" because I'm not 100% sure what these components do. I have played around with them some, so the theory is this:

nsIMsgCompType dictates which type of compose window is going to be opened. How exactly this will change the look of the message, I don't know.

nsIMsgCompFormat formats, I think, the text that will make up the body of your message. For example, if you use PlainText on text that has HTML in it, you'll get tags.

In Relation to Opening a Compose Window

The component nsIMsgComposeParams has type and format properties--use nsIMsgCompType and nsIMsgCompFormat.

Obviously, if you write

var params = Components.classes['@mozilla.org/messengercompose/composeparams;1'].
createInstance(Components.interfaces.nsIMsgComposeParams);
var msgComposeFormat = Components.interfaces.nsIMsgCompFormat;
...
params.format = msgComposeFormat.PlainText;


and later set body to text that uses HTML, then you'll see tags.

0 Comments:

Post a Comment

<< Home