summaryrefslogtreecommitdiffstats
path: root/mailnews/addrbook/public/nsIAbItem.idl
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-11-03 00:17:46 -0400
committerMatt A. Tobin <email@mattatobin.com>2019-11-03 00:17:46 -0400
commit302bf1b523012e11b60425d6eee1221ebc2724eb (patch)
treeb191a895f8716efcbe42f454f37597a545a6f421 /mailnews/addrbook/public/nsIAbItem.idl
parent21b3f6247403c06f85e1f45d219f87549862198f (diff)
downloadUXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar
UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.gz
UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.lz
UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.xz
UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.zip
Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1
Diffstat (limited to 'mailnews/addrbook/public/nsIAbItem.idl')
-rw-r--r--mailnews/addrbook/public/nsIAbItem.idl90
1 files changed, 90 insertions, 0 deletions
diff --git a/mailnews/addrbook/public/nsIAbItem.idl b/mailnews/addrbook/public/nsIAbItem.idl
new file mode 100644
index 000000000..adda32d96
--- /dev/null
+++ b/mailnews/addrbook/public/nsIAbItem.idl
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 2; 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"
+
+interface nsIMsgHeaderParser;
+interface nsIStringBundle;
+
+/**
+ * A containable item for address books.
+ */
+[scriptable, uuid(bb691a55-cbfe-4cf8-974a-e18cfa845a73)]
+interface nsIAbItem : nsISupports {
+ /**
+ * A universally-unique identifier for this item.
+ *
+ * If this item cannot be associated with a UUID for some reason, it MUST
+ * return the empty string. The empty string MUST NOT be a valid UUID for any
+ * item. Under no circumstances may this function throw an error.
+ *
+ * It is STRONGLY RECOMMENDED that implementations guarantee that this UUID
+ * will not change between two different sessions of the application and that,
+ * if this item is deleted, the UUID will not be reused.
+ *
+ * The format of the UUID for a generic nsIAbItem is purposefully left
+ * undefined, although any item contained by an nsIAbDirectory SHOULD use
+ * nsIAbManager::generateUUID to generate the UUID.
+ */
+ readonly attribute AUTF8String uuid;
+
+ /**
+ * @{
+ * These constants reflect the possible values of the
+ * mail.addr_book.lastnamefirst preferences. They are intended to be used in
+ * generateName, defined below.
+ */
+ const unsigned long GENERATE_DISPLAY_NAME = 0;
+ const unsigned long GENERATE_LAST_FIRST_ORDER = 1;
+ const unsigned long GENERATE_FIRST_LAST_ORDER = 2;
+ /** @} */
+
+ /**
+ * Generate a name from the item for display purposes.
+ *
+ * If this item is an nsIAbCard, then it will use the aGenerateFormat option
+ * to determine the string to return.
+ * If this item is not an nsIAbCard, then the aGenerateFormat option may be
+ * ignored, and the displayName of the item returned.
+ *
+ * @param aGenerateFormat The format to generate as per the GENERATE_*
+ * constants above.
+ * @param aBundle An optional parameter that is a pointer to a string
+ * bundle that holds:
+ * chrome://messenger/locale/addressbook/addressBook.properties
+ * If this bundle is not supplied, then the function
+ * will obtain the bundle itself. If cached by the
+ * caller and supplied to this function, then
+ * performance will be improved over many calls.
+ * @return A string containing the generated name.
+ */
+ AString generateName(in long aGenerateFormat,
+ [optional] in nsIStringBundle aBundle);
+
+ /**
+ * Generate a formatted email address from the card, that can be used for
+ * sending emails.
+ *
+ * @param aExpandList If this card is a list, and this parameter is set
+ * to true, then the list will be expanded to include
+ * the emails of the cards within the list.
+ * @param aGroupMailLists If this card (or the items within this card) is a
+ * list, and this is set to true, then the list will
+ * be expanded in the RFC 2822 group format
+ * "displayname : email1 ; email2 ; etc".
+ * @param aHeaderParser An optional parameter pointing to the
+ * nsIMsgHeaderParser service. If this is not supplied
+ * the function will obtain the service itself. If
+ * cached by the called and supplied to this function,
+ * then performance will be improved over many calls.
+ * @return A string containing a comma-separated list of
+ * formatted addresses.
+ */
+ //AString generateFormattedEmail(in boolean aExpandList,
+ // in boolean aAsGroupMailLists,
+ // [optional] in nsIMsgHeaderParser aHeaderParser);
+
+};
+