Defined in comm-central/ mailnews/ mime/ public/ nsIMsgHeaderParser.idl
nsISupports
Last changed in Gecko 1.9 (Firefox 3)To create an instance, use:
var msgHeaderParser = Components.classes["@mozilla.org/messenger/headerparser;1"]
.createInstance(Components.interfaces.nsIMsgHeaderParser);
string extractHeaderAddressMailboxes(in string line); |
void extractHeaderAddressName(in string line, out string name); |
void extractHeaderAddressNames(in string line, out string userNames); |
AString makeFullAddress(in AString aName, in AString aAddress); |
string makeFullAddressString(in string aName, in string aAddress); |
wstring makeFullAddressWString(in wstring name, in wstring addr); Obsolete since Gecko 1.9 |
void parseHeaderAddresses(in string line, out string names, out string addresses, out PRUint32 numAddresses); |
void parseHeadersWithArray(in wstring aLine, [array, size_is(count)] out wstring aEmailAddresses, [array, size_is(count)] out wstring aNames, [array, size_is(count)] out wstring aFullNames, [retval] out unsigned long count); |
void reformatHeaderAddresses(in string line, out string reformattedAddress); |
wstring reformatUnquotedAddresses(in wstring line); |
void removeDuplicateAddresses(in string addrs, in string other_addrs, in PRBool removeAliasesToMe, out string newAddress); |
string unquotePhraseOrAddr(in string line, in boolean preserveIntegrity); |
wstring unquotePhraseOrAddrWString(in wstring line, in boolean preserveIntegrity); |
Given a string which contains a list of Header addresses, returns a comma-separated list of just the 'mailbox' portions. If any of the addresses doesn't have a mailbox, then the user name is used instead.
AUTF8String extractHeaderAddressMailboxes(
in string line
);
line
A comma-separated list of just the mailbox parts of the addresses.
Missing ExceptionGiven a string which contains a list of Header addresses, returns a comma-separated list of just the 'user name' portions. If any of the addresses doesn't have a name, then the mailbox is used instead.
AUTF8String extractHeaderAddressNames(
in string line
);
lineA comma-separated list of just the name parts of the addresses.
Missing ExceptionLike extractHeaderAddressNames(), but only returns the first name in the list, if there is more than one.
AUTF8String extractHeaderAddressName(
in string line
);
lineThe first name found in the list
Missing ExceptionGiven an e-mail address and a person's name, concatenates them together into a single string, doing all the necessary quoting.
AString makeFullAddress( in AString aName, in AString aAddress );
aNameaAddressA string of the form name <address>.
Missing ExceptionGiven an e-mail address and a person's name, cons them together into a single string, doing all the necessary quoting (const char* version).
string makeFullAddressString( in string aName, in string aAddress );
aNameaAddressA string of the form name <address>.
Missing Exceptionwstring makeFullAddressWString( in wstring name, in wstring addr );
nameaddrA string of the form name <address>.
Missing ExceptionGiven a string which contains a list of Header addresses, parses it into their component names and mailboxes.
The returned value is the number of addresses, or a negative error code; the names and addresses are returned into the provided pointers as consecutive null-terminated strings. It is up to the caller to free them. Note that some of the strings may be zero-length.
The caller may pass nsnull for charset and it will be interpreted as "us-ascii".
Either of the provided pointers may be NULL if the caller is not interested in those components.
void parseHeaderAddresses( in string line, out string names, out string addresses, out PRUint32 numAddresses );
linenamesaddressesnumAddressesMissing Exceptionvoid parseHeadersWithArray( in wstring aLine, [array, size_is(count)] out wstring aEmailAddresses, [array, size_is(count)] out wstring aNames, [array, size_is(count)] out wstring aFullNames, [retval] out unsigned long count );
aLineaEmailAddressesaNamesaFullNamescountMissing ExceptionGiven a string which contains a list of Header addresses, returns a new string with the same data, but inserts missing commas, parses and reformats it, and wraps long lines with newline-tab.
string reformatHeaderAddresses( in string line );
lineThe reformatted header line.
Missing ExceptionGiven a string, will make it safe to use by adding missing quote and escaping needed quote
wstring reformatUnquotedAddresses( in wstring line );
lineSafe Addresses (?)
Missing ExceptionReturns a copy of ADDRS which may have had some addresses removed. Addresses are removed if they are already in either ADDRS or OTHER_ADDRS. (If OTHER_ADDRS contain addresses which are not in ADDRS, they are not added. That argument is for passing in addresses that were already mentioned in other header fields.)
Addresses are considered to be the same if they contain the same mailbox part (case-insensitive.) Real names and other comments are not compared.
removeAliasesToMe allows the address parser to use the preference which contains regular expressions which also mean 'me' for the purpose of stripping the user's email address(es) out of addrs
string removeDuplicateAddresses( in string addrs, in string other_addrs, in PRBool removeAliasesToMe );
addrsother_addrsMissing ExceptionThis function removes the quoting if you want to show the names to users. e.g. summary file, address book. If preserveIntegrity is set to true, quote will not be removed in case the name part of the email contains a comma.
string unquotePhraseOrAddr( in string line, in boolean preserveIntegrity );
linepreserveIntegrityUser friendly names
Missing ExceptionThis function removes the quoting if you want to show the names to users. e.g. summary file, address book. If preserveIntegrity is set to true, quote will not be removed in case the name part of the email contains a comma.
wstring unquotePhraseOrAddrWString( in wstring line, in boolean preserveIntegrity );
linepreserveIntegrityMissing Description
Missing ExceptionI think some of the charset parameters might be obsolete... So this page is still W.I.P.