summaryrefslogtreecommitdiffstats
path: root/comm/mailnews/compose/public/nsIMsgCompUtils.idl
diff options
context:
space:
mode:
Diffstat (limited to 'comm/mailnews/compose/public/nsIMsgCompUtils.idl')
-rw-r--r--comm/mailnews/compose/public/nsIMsgCompUtils.idl43
1 files changed, 43 insertions, 0 deletions
diff --git a/comm/mailnews/compose/public/nsIMsgCompUtils.idl b/comm/mailnews/compose/public/nsIMsgCompUtils.idl
new file mode 100644
index 0000000000..18749e1f9d
--- /dev/null
+++ b/comm/mailnews/compose/public/nsIMsgCompUtils.idl
@@ -0,0 +1,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);
+};