author Stefan Sitter <>
Mon, 29 Jun 2015 16:25:25 +0200
changeset 22819 99d02f70de9aff76228a13857aaf4020863c6974
parent 12286 84ac3c71109811da751f0ef2d72108075938f094
child 29787 12a18e736fca9a9ac8e0866caf470fa9342af842
permissions -rw-r--r--
Bug 1163306 - enable icaljs by default only on comm-central, use libical on comm-aurora. r=philipp

/* -*- 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 */

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