summaryrefslogtreecommitdiffstats
path: root/comm/mailnews/compose/public/nsIMsgCompUtils.idl
blob: 18749e1f9da7bd618c47d9d092a6206f259e8535 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* -*- 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);

  readonly attribute boolean msgMimeConformToStandard;

  /**
   * 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);
};