Revision control

Copy as Markdown

Other Tools

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
#include "nsIMsgIdentity.idl"
[scriptable, uuid(00b4569a-077e-4236-b993-980fd82bb948)]
interface nsIMsgCompUtils : nsISupports {
string mimeMakeSeparator(in string prefix);
/**
* Try to use the provided identity and/or host name to generate a message ID.
*
* To identify the host name to use in the message ID, this will:
* - if the attribute "FQDN" of the identity is set to a valid host name, use it
* - otherwise, if the provided host name is valid, use it
* - otherwise, if the identity's email address includes a valid host name after
* an '@' symbol, use it
* - otherwise, bail without generating a message ID (returns with an empty value)
*
* @param nsIMsgIdentity The identity to use to generate the message ID.
* @param string The host to use to generate the message ID. Ignored if empty.
*
* @returns A message ID usable in a Message-ID header, or an empty string
* if no message ID could be generated.
*/
AUTF8String msgGenerateMessageId(in nsIMsgIdentity identity, in AUTF8String host);
/**
* Detect the text encoding of an input string. This is a wrapper of
* mozilla::EncodingDetector to be used by JavaScript code. For C++, use
* MsgDetectCharsetFromFile from nsMsgUtils.cpp instead.
*
* @param aContent The string to detect charset.
*
* @returns Detected charset.
*/
ACString detectCharset(in ACString aContent);
};