Bug 1606066 - Remove nsIAbItem; r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 11 Dec 2019 21:04:53 +1300
changeset 37829 81d8400783ab24cb18c3592dfe9d77ee9be7bf70
parent 37828 12617633b4ff2aabdace5cea2ba6f7cd1454d05e
child 37830 5292ffe33f9a27ddb171b1b1957e8b8d0b9fa6f6
push id397
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:16:13 +0000
reviewersmkmelin
bugs1606066
Bug 1606066 - Remove nsIAbItem; r=mkmelin
mailnews/addrbook/jsaddrbook/AddrBookCard.jsm
mailnews/addrbook/public/moz.build
mailnews/addrbook/public/nsIAbCard.idl
mailnews/addrbook/public/nsIAbDirectory.idl
mailnews/addrbook/public/nsIAbItem.idl
mailnews/addrbook/src/nsAbCardProperty.cpp
mailnews/addrbook/src/nsAbCardProperty.h
mailnews/addrbook/src/nsAbDirProperty.cpp
mailnews/addrbook/src/nsAbDirProperty.h
mailnews/addrbook/src/nsAbDirectoryQuery.cpp
mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
mailnews/addrbook/src/nsAbOSXDirectory.mm
mailnews/addrbook/src/nsAddbookProtocolHandler.cpp
mailnews/addrbook/test/unit/test_basic_nsIAbDirectory.js
mailnews/addrbook/test/unit/test_jsaddrbook.js
mailnews/base/src/nsSpamSettings.cpp
mailnews/import/text/src/nsTextAddress.cpp
mailnews/jsaccount/src/JaAbDirectory.cpp
mailnews/jsaccount/src/JaAbDirectory.h
mailnews/jsaccount/test/unit/test_componentsExist.js
--- a/mailnews/addrbook/jsaddrbook/AddrBookCard.jsm
+++ b/mailnews/addrbook/jsaddrbook/AddrBookCard.jsm
@@ -13,73 +13,69 @@ ChromeUtils.defineModuleGetter(
   this,
   "newUID",
   "resource:///modules/AddrBookUtils.jsm"
 );
 
 /**
  * Prototype for nsIAbCard objects that are not mailing lists.
  *
- * @implements {nsIAbItem}
  * @implements {nsIAbCard}
  */
 function AddrBookCard() {
   this._directoryId = "";
   this._localId = "";
   this._properties = new Map([
     ["PreferMailFormat", Ci.nsIAbPreferMailFormat.unknown],
     ["PopularityIndex", 0],
     ["LastModifiedDate", 0],
   ]);
 }
 
 AddrBookCard.prototype = {
   QueryInterface: ChromeUtils.generateQI([Ci.nsIAbCard]),
   classID: Components.ID("{1143991d-31cd-4ea6-9c97-c587d990d724}"),
 
-  /* nsIAbItem */
+  /* nsIAbCard */
 
   get uuid() {
     return MailServices.ab.generateUUID(this._directoryId, this._localId);
   },
   generateName(generateFormat, bundle) {
     let result = "";
     let format;
     switch (generateFormat) {
-      case Ci.nsIAbItem.GENERATE_DISPLAY_NAME:
+      case Ci.nsIAbCard.GENERATE_DISPLAY_NAME:
         result = this.displayName;
         break;
-      case Ci.nsIAbItem.GENERATE_LAST_FIRST_ORDER:
+      case Ci.nsIAbCard.GENERATE_LAST_FIRST_ORDER:
         format = bundle
           ? bundle.GetStringFromName("lastFirstFormat")
           : "%S, %S";
         result = format
           .replace("%S", this.lastName)
           .replace("%S", this.firstName);
         break;
-      case Ci.nsIAbItem.GENERATE_FIRST_LAST_ORDER:
+      case Ci.nsIAbCard.GENERATE_FIRST_LAST_ORDER:
         format = bundle ? bundle.GetStringFromName("firstLastFormat") : "%S %S";
         result = format
           .replace("%S", this.firstName)
           .replace("%S", this.lastName);
         break;
     }
 
     if (result == "") {
       result = this.getProperty("Company", "");
     }
     if (result == "") {
       result = this.primaryEmail.split("@", 1)[0];
     }
 
     return result;
   },
-
-  /* nsIAbCard */
-
   get directoryId() {
     return this._directoryId;
   },
   set directoryId(value) {
     return (this._directoryId = value);
   },
   get localId() {
     return this._localId;
--- a/mailnews/addrbook/public/moz.build
+++ b/mailnews/addrbook/public/moz.build
@@ -9,17 +9,16 @@ XPIDL_SOURCES += [
     'nsIAbBooleanExpression.idl',
     'nsIAbCard.idl',
     'nsIAbDirectory.idl',
     'nsIAbDirectoryQuery.idl',
     'nsIAbDirectoryQueryProxy.idl',
     'nsIAbDirFactory.idl',
     'nsIAbDirFactoryService.idl',
     'nsIAbDirSearchListener.idl',
-    'nsIAbItem.idl',
     'nsIAbLDAPAttributeMap.idl',
     'nsIAbLDIFService.idl',
     'nsIAbListener.idl',
     'nsIAbManager.idl',
     'nsIAbMDBDirectory.idl',
     'nsIAbView.idl',
     'nsIAddbookUrl.idl',
     'nsIAddrDatabase.idl',
--- a/mailnews/addrbook/public/nsIAbCard.idl
+++ b/mailnews/addrbook/public/nsIAbCard.idl
@@ -1,16 +1,17 @@
 /* -*- 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 "nsIAbItem.idl"
+#include "nsISupports.idl"
 
 interface nsISimpleEnumerator;
+interface nsIStringBundle;
 interface nsIVariant;
 
 [scriptable, uuid(97448252-F189-11d4-A422-001083003D0C)]
 interface nsIAbPreferMailFormat {
     const unsigned long unknown   = 0;
     const unsigned long plaintext = 1;
     const unsigned long html      = 2;
 };
@@ -61,17 +62,67 @@ interface nsIAbPreferMailFormat {
  *   - PhotoName
  *   - PhotoType
  *   - PhotoURI
  *
  * The contract id for the standard implementation is
  * <tt>\@mozilla.org/addressbook/cardproperty;1</tt>.
  */
 [scriptable, uuid(9bddf024-5178-4097-894e-d84b4ddde101)]
-interface nsIAbCard : nsIAbItem {
+interface nsIAbCard : 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 nsIAbCard 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);
+
   /**
    * The UUID for the nsIAbDirectory containing this card.
    *
    * The directory considered to contain this card is the directory which
    * produced this card (e.g., through nsIAbDirectory::getCardForProperty) or
    * the last directory to modify this card, if another directory did so. If the
    * last directory to modify this card deleted it, then this card is considered
    * unassociated.
@@ -84,17 +135,17 @@ interface nsIAbCard : nsIAbItem {
    * NOT, in general, modify this property.
    */
   attribute AUTF8String directoryId;
 
   /**
    * The per-directory ID of this card.
    *
    * This property is the second part of the tuple logically representing a card
-   * UUID. It shares many requirements with that of nsIAbItem::uuid. In
+   * UUID. It shares many requirements with that of nsIAbCard::uuid. In
    * particular:
    * - It MUST be unique (within the scope of its directory).
    * - The empty string MUST only be used to indicate that it has not yet been
    *   assigned a localId.
    * - It is STRONGLY RECOMMENDED that this id is consistent across sessions and
    *   that, should the card be deleted, its ids will not be reused.
    * - The format of localId is left undefined.
    *
--- a/mailnews/addrbook/public/nsIAbDirectory.idl
+++ b/mailnews/addrbook/public/nsIAbDirectory.idl
@@ -1,18 +1,19 @@
 /* -*- 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 "nsIAbCard.idl"
+#include "nsISupports.idl"
 
-interface nsISimpleEnumerator;
+interface nsIAbCard;
 interface nsIArray;
 interface nsIMutableArray;
+interface nsISimpleEnumerator;
 
 /* moz-abdirectory:// is the URI to access nsAbBSDirectory,
  * which is the root directory for all types of address books
  * this is used to get all address book directories. */
 
 %{C++
 #define kAllDirectoryRoot          "moz-abdirectory://"
 
@@ -44,17 +45,34 @@ interface nsIMutableArray;
  * the Mork-based address book type is:
  *
  * @mozilla.org/addressbook/directory;1?type=moz-abmdbdirectory
  *
  * The UUID of an nsIAbDirectory is its preference ID and its name, concatenated
  * together.
  */
 [scriptable, uuid(72dc868b-db5b-4daa-b6c6-071be4a05d02)]
-interface nsIAbDirectory : nsIAbItem {
+interface nsIAbDirectory : 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 nsIAbDirectory is purposefully left
+   * undefined, although any item contained by an nsIAbDirectory SHOULD use
+   * nsIAbManager::generateUUID to generate the UUID.
+   */
+  readonly attribute AUTF8String uuid;
+
   /**
    * Returns true if this collection is read-only.
    */
   readonly attribute boolean readOnly;
 
   /**
    * Returns true if this collection is accessed over a network connection.
    */
deleted file mode 100644
--- a/mailnews/addrbook/public/nsIAbItem.idl
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- 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);
-
-};
-
--- a/mailnews/addrbook/src/nsAbCardProperty.cpp
+++ b/mailnews/addrbook/src/nsAbCardProperty.cpp
@@ -112,17 +112,17 @@ nsAbCardProperty::nsAbCardProperty() : m
                       nsIAbPreferMailFormat::unknown);
   SetPropertyAsUint32(kPopularityIndexProperty, 0);
   // Uninitialized...
   SetPropertyAsUint32(kLastModifiedDateProperty, 0);
 }
 
 nsAbCardProperty::~nsAbCardProperty(void) {}
 
-NS_IMPL_ISUPPORTS(nsAbCardProperty, nsIAbCard, nsIAbItem)
+NS_IMPL_ISUPPORTS(nsAbCardProperty, nsIAbCard)
 
 NS_IMETHODIMP nsAbCardProperty::GetUuid(nsACString &uuid) {
   // If we have indeterminate sub-ids, return an empty uuid.
   if (m_directoryId.IsEmpty() || m_localId.IsEmpty()) {
     uuid.Truncate();
     return NS_OK;
   }
 
--- a/mailnews/addrbook/src/nsAbCardProperty.h
+++ b/mailnews/addrbook/src/nsAbCardProperty.h
@@ -26,17 +26,16 @@ struct AppendItem;
 /*
  * Address Book Card Property
  */
 
 class nsAbCardProperty : public nsIAbCard {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIABCARD
-  NS_DECL_NSIABITEM
 
   nsAbCardProperty();
 
  protected:
   virtual ~nsAbCardProperty();
   bool m_IsMailList;
   nsCString m_MailListURI;
 
--- a/mailnews/addrbook/src/nsAbDirProperty.cpp
+++ b/mailnews/addrbook/src/nsAbDirProperty.cpp
@@ -38,36 +38,29 @@ nsAbDirProperty::~nsAbDirProperty(void) 
     NS_ASSERTION(NS_SUCCEEDED(rv), "Count failed");
     int32_t i;
     for (i = count - 1; i >= 0; i--)
       m_AddressList->RemoveElementAt(i);
   }
 #endif
 }
 
-NS_IMPL_ISUPPORTS(nsAbDirProperty, nsIAbDirectory, nsISupportsWeakReference,
-                  nsIAbItem)
+NS_IMPL_ISUPPORTS(nsAbDirProperty, nsIAbDirectory, nsISupportsWeakReference)
 
 NS_IMETHODIMP nsAbDirProperty::GetUuid(nsACString &uuid) {
   // XXX: not all directories have a dirPrefId...
   nsresult rv = GetDirPrefId(uuid);
   NS_ENSURE_SUCCESS(rv, rv);
   uuid.Append('&');
   nsString dirName;
   GetDirName(dirName);
   uuid.Append(NS_ConvertUTF16toUTF8(dirName));
   return rv;
 }
 
-NS_IMETHODIMP nsAbDirProperty::GenerateName(int32_t aGenerateFormat,
-                                            nsIStringBundle *aBundle,
-                                            nsAString &name) {
-  return GetDirName(name);
-}
-
 NS_IMETHODIMP nsAbDirProperty::GetPropertiesChromeURI(nsACString &aResult) {
   aResult.AssignLiteral(
       "chrome://messenger/content/addressbook/abAddressBookNameDialog.xhtml");
   return NS_OK;
 }
 
 NS_IMETHODIMP nsAbDirProperty::GetDirName(nsAString &aDirName) {
   if (m_DirPrefId.IsEmpty()) {
--- a/mailnews/addrbook/src/nsAbDirProperty.h
+++ b/mailnews/addrbook/src/nsAbDirProperty.h
@@ -24,17 +24,16 @@
  * Address Book Directory
  */
 
 class nsAbDirProperty : public nsIAbDirectory, public nsSupportsWeakReference {
  public:
   nsAbDirProperty(void);
 
   NS_DECL_ISUPPORTS
-  NS_DECL_NSIABITEM
   NS_DECL_NSIABDIRECTORY
 
  protected:
   virtual ~nsAbDirProperty(void);
 
   /**
    * Initialise the directory prefs for this branch
    */
--- a/mailnews/addrbook/src/nsAbDirectoryQuery.cpp
+++ b/mailnews/addrbook/src/nsAbDirectoryQuery.cpp
@@ -1,13 +1,14 @@
 /* -*- 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 "nsIAbCard.h"
 #include "nsAbDirectoryQuery.h"
 #include "nsAbDirectoryQueryProxy.h"
 #include "nsAbUtils.h"
 #include "nsAbBooleanExpression.h"
 #include "nsArrayUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsString.h"
 #include "nsUnicharUtils.h"
--- a/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
@@ -1,13 +1,14 @@
 /* -*- 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 "nsIAbCard.h"
 #include "nsAbLDAPDirectoryQuery.h"
 #include "nsAbBoolExprToLDAPFilter.h"
 #include "nsILDAPMessage.h"
 #include "nsILDAPErrors.h"
 #include "nsIAbLDAPAttributeMap.h"
 #include "nsIAbLDAPCard.h"
 #include "nsAbUtils.h"
 #include "nsAbBaseCID.h"
--- a/mailnews/addrbook/src/nsAbOSXDirectory.mm
+++ b/mailnews/addrbook/src/nsAbOSXDirectory.mm
@@ -1162,17 +1162,17 @@ nsresult nsAbOSXDirectory::DeleteUid(con
   rv = m_AddressList->GetLength(&addressCount);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoCString uri(NS_ABOSXDIRECTORY_URI_PREFIX);
   uri.Append(aUid);
 
   // Iterate backwards in case we remove something
   while (addressCount--) {
-    nsCOMPtr<nsIAbItem> abItem(do_QueryElementAt(m_AddressList, addressCount, &rv));
+    nsCOMPtr<nsISupports> abItem(do_QueryElementAt(m_AddressList, addressCount, &rv));
     if (NS_FAILED(rv)) continue;
 
     nsCOMPtr<nsIAbDirectory> directory(do_QueryInterface(abItem, &rv));
     if (NS_SUCCEEDED(rv)) {
       nsAutoCString dirUri;
       directory->GetURI(dirUri);
       if (uri.Equals(dirUri)) return UnassertDirectory(abManager, directory);
     } else {
--- a/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp
+++ b/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp
@@ -8,16 +8,17 @@
 #include "nsAddbookProtocolHandler.h"
 
 #include "nsAddbookUrl.h"
 #include "nsAddbookProtocolHandler.h"
 #include "nsCOMPtr.h"
 #include "nsAbBaseCID.h"
 #include "nsNetUtil.h"
 #include "nsStringStream.h"
+#include "nsIAbCard.h"
 #include "nsIAbDirectory.h"
 #include "nsIAbManager.h"
 #include "prmem.h"
 #include "nsIAbView.h"
 #include "nsITreeView.h"
 #include "nsIStringBundle.h"
 #include "mozilla/Services.h"
 #include "nsIAsyncInputStream.h"
--- a/mailnews/addrbook/test/unit/test_basic_nsIAbDirectory.js
+++ b/mailnews/addrbook/test/unit/test_basic_nsIAbDirectory.js
@@ -34,17 +34,16 @@ function check_ab(abConfig) {
   // Test - Is it the right type?
 
   if (abConfig.dirType == 2) {
     Assert.ok(AB instanceof Ci.nsIAbMDBDirectory);
   }
 
   // Test - Check attributes
 
-  Assert.equal(AB.generateName(0), abConfig.dirName);
   Assert.equal(AB.propertiesChromeURI, kNormalPropertiesURI);
   Assert.equal(AB.readOnly, abConfig.readOnly);
   Assert.equal(AB.dirName, abConfig.dirName);
   Assert.equal(AB.dirType, abConfig.dirType);
   Assert.equal(AB.fileName, abConfig.fileName);
   Assert.equal(AB.URI, abConfig.URI);
   Assert.equal(AB.position, abConfig.position);
   Assert.equal(AB.isMailList, false);
--- a/mailnews/addrbook/test/unit/test_jsaddrbook.js
+++ b/mailnews/addrbook/test/unit/test_jsaddrbook.js
@@ -110,20 +110,18 @@ add_task(async function setUp() {
   ok(cabFile.exists());
 });
 
 add_task(async function createAddressBook() {
   let dirPrefId = MailServices.ab.newAddressBook("new book", "", DIR_TYPE);
   book = MailServices.ab.getDirectoryFromId(dirPrefId);
   observer.checkEvents(["onItemAdded", undefined, book]);
 
-  // Check nsIAbItem properties.
+  // Check nsIAbDirectory properties.
   equal(book.uuid, "ldap_2.servers.newbook&new book");
-
-  // Check nsIAbDirectory properties.
   ok(!book.readOnly);
   ok(!book.isRemote);
   ok(!book.isSecure);
   equal(book.dirName, "new book");
   equal(book.dirType, DIR_TYPE);
   equal(book.fileName, FILE_NAME);
   equal(book.UID.length, 36);
   equal(book.URI, `${SCHEME}://${FILE_NAME}`);
@@ -188,42 +186,40 @@ add_task(async function createContact() 
 
   // Check enumerations.
   let childCards = Array.from(book.childCards, cc =>
     cc.QueryInterface(Ci.nsIAbCard)
   );
   equal(childCards.length, 1);
   ok(childCards[0].equals(contact));
 
-  // Check nsIAbItem properties.
+  // Check nsIAbCard properties.
   equal(contact.uuid, "ldap_2.servers.newbook&updated book#1");
-
-  // Check nsIAbItem methods.
-  equal(
-    contact.generateName(Ci.nsIAbItem.GENERATE_DISPLAY_NAME),
-    "a new contact"
-  );
-  equal(
-    contact.generateName(Ci.nsIAbItem.GENERATE_LAST_FIRST_ORDER),
-    "contact, new"
-  );
-  equal(
-    contact.generateName(Ci.nsIAbItem.GENERATE_FIRST_LAST_ORDER),
-    "new contact"
-  );
-
-  // Check nsIAbCard properties.
   equal(contact.directoryId, book.uuid);
   equal(contact.localId, 1);
   equal(contact.UID.length, 36);
   equal(contact.firstName, "new");
   equal(contact.lastName, "contact");
   equal(contact.displayName, "a new contact");
   equal(contact.primaryEmail, "test@invalid");
   equal(contact.isMailList, false);
+
+  // Check nsIAbCard methods.
+  equal(
+    contact.generateName(Ci.nsIAbCard.GENERATE_DISPLAY_NAME),
+    "a new contact"
+  );
+  equal(
+    contact.generateName(Ci.nsIAbCard.GENERATE_LAST_FIRST_ORDER),
+    "contact, new"
+  );
+  equal(
+    contact.generateName(Ci.nsIAbCard.GENERATE_FIRST_LAST_ORDER),
+    "new contact"
+  );
 });
 
 add_task(async function editContact() {
   contact.firstName = "updated";
   contact.lastName = "contact";
   book.modifyCard(contact);
   observer.checkEvents(
     // TODO MDB has three null args but we can do better than that.
@@ -267,20 +263,18 @@ add_task(async function createMailingLis
   }
   equal(listCard.UID, list.UID);
 
   observer.checkEvents(
     ["onItemAdded", book, listCard],
     ["onItemAdded", book, list]
   );
 
-  // Check nsIAbItem properties.
+  // Check nsIAbDirectory properties.
   equal(list.uuid, "&new list");
-
-  // Check nsIAbDirectory properties.
   equal(list.dirName, "new list");
   equal(list.UID.length, 36);
   equal(list.URI, `${SCHEME}://${FILE_NAME}/MailList1`);
   equal(list.isMailList, true);
   equal(list.isQuery, false);
   equal(list.supportsMailingLists, false);
 
   // Check list enumerations.
--- a/mailnews/base/src/nsSpamSettings.cpp
+++ b/mailnews/base/src/nsSpamSettings.cpp
@@ -22,16 +22,17 @@
 #include "mozilla/mailnews/MimeHeaderParser.h"
 #include "nsIArray.h"
 #include "nsArrayUtils.h"
 #include "nsMailDirServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsISimpleEnumerator.h"
 #include "nsAbBaseCID.h"
+#include "nsIAbCard.h"
 #include "nsIAbManager.h"
 #include "nsIMsgAccountManager.h"
 #include "nsMsgBaseCID.h"
 
 using namespace mozilla::mailnews;
 
 nsSpamSettings::nsSpamSettings() {
   mLevel = 0;
--- a/mailnews/import/text/src/nsTextAddress.cpp
+++ b/mailnews/import/text/src/nsTextAddress.cpp
@@ -1,16 +1,17 @@
 /* -*- 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 "nsAbBaseCID.h"
 #include "nsTextAddress.h"
+#include "nsIAbCard.h"
 #include "nsIAbDirectory.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsIFile.h"
 #include "nsIInputStream.h"
 #include "nsNetUtil.h"
 #include "nsMsgI18N.h"
 #include "nsMsgUtils.h"
 #include "nsIConverterInputStream.h"
--- a/mailnews/jsaccount/src/JaAbDirectory.cpp
+++ b/mailnews/jsaccount/src/JaAbDirectory.cpp
@@ -21,17 +21,17 @@ NS_IMETHODIMP JaBaseCppAbDirectory::GetI
 }
 
 // Delegator
 NS_IMPL_ISUPPORTS_INHERITED(JaCppAbDirectoryDelegator, JaBaseCppAbDirectory,
                             msgIOverride)
 
 // Delegator object to bypass JS method override.
 NS_IMPL_ISUPPORTS(JaCppAbDirectoryDelegator::Super, nsIAbDirectory,
-                  nsIAbItem, nsIInterfaceRequestor)
+                  nsIInterfaceRequestor)
 
 JaCppAbDirectoryDelegator::JaCppAbDirectoryDelegator()
     : mCppBase(new Super(this)), mMethods(nullptr) {}
 
 NS_IMETHODIMP JaCppAbDirectoryDelegator::SetMethodsToDelegate(
     msgIDelegateList* aDelegateList) {
   if (!aDelegateList) {
     NS_WARNING("Null delegate list");
@@ -51,17 +51,16 @@ NS_IMETHODIMP JaCppAbDirectoryDelegator:
 }
 
 NS_IMETHODIMP JaCppAbDirectoryDelegator::SetJsDelegate(
     nsISupports* aJsDelegate) {
   // If these QIs fail, then overrides are not provided for methods in that
   // interface, which is OK.
   mJsISupports = aJsDelegate;
   mJsIAbDirectory = do_QueryInterface(aJsDelegate);
-  mJsIAbItem = do_QueryInterface(aJsDelegate);
   mJsIInterfaceRequestor = do_QueryInterface(aJsDelegate);
   return NS_OK;
 }
 NS_IMETHODIMP JaCppAbDirectoryDelegator::GetJsDelegate(
     nsISupports** aJsDelegate) {
   NS_ENSURE_ARG_POINTER(aJsDelegate);
   if (mJsISupports) {
     NS_ADDREF(*aJsDelegate = mJsISupports);
--- a/mailnews/jsaccount/src/JaAbDirectory.h
+++ b/mailnews/jsaccount/src/JaAbDirectory.h
@@ -7,17 +7,16 @@
 #ifndef _JaAbDirectory_H_
 #define _JaAbDirectory_H_
 
 #include "nsISupports.h"
 #include "DelegateList.h"
 #include "msgIOverride.h"
 #include "nsIAbDirectory.h"
 #include "nsAbDirProperty.h"
-#include "nsIAbItem.h"
 #include "nsAutoPtr.h"
 #include "nsDataHashtable.h"
 #include "nsIInterfaceRequestor.h"
 
 namespace mozilla {
 namespace mailnews {
 
 /* Header file */
@@ -38,46 +37,42 @@ class JaBaseCppAbDirectory : public nsAb
 class JaCppAbDirectoryDelegator : public JaBaseCppAbDirectory,
                                   public msgIOverride {
  public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_MSGIOVERRIDE
 
   // use mCppBase as a raw pointer where possible
   NS_FORWARD_NSIABDIRECTORY(DELEGATE_JS(mJsIAbDirectory, mMethods, mCppBase)->)
-  NS_FORWARD_NSIABITEM(DELEGATE_JS(mJsIAbItem, mMethods, (mCppBase.get()))->)
   NS_FORWARD_NSIINTERFACEREQUESTOR(
       DELEGATE_JS(
           mJsIInterfaceRequestor, mMethods,
           (nsCOMPtr<nsIInterfaceRequestor>(do_QueryInterface(mCppBase))))
           ->)
 
   JaCppAbDirectoryDelegator();
 
  private:
   virtual ~JaCppAbDirectoryDelegator() {}
 
-  // nsIAbDirectory inherits from nsIAbItem.
   class Super : public nsIAbDirectory, public nsIInterfaceRequestor {
    public:
     explicit Super(JaCppAbDirectoryDelegator* aFakeThis) {
       mFakeThis = aFakeThis;
     }
     NS_DECL_ISUPPORTS
     NS_FORWARD_NSIABDIRECTORY(mFakeThis->JaBaseCppAbDirectory::)
-    NS_FORWARD_NSIABITEM(mFakeThis->JaBaseCppAbDirectory::)
     NS_FORWARD_NSIINTERFACEREQUESTOR(mFakeThis->JaBaseCppAbDirectory::)
    private:
     virtual ~Super() {}
     JaCppAbDirectoryDelegator* mFakeThis;
   };
 
   // Interfaces that may be overridden by JS.
   nsCOMPtr<nsIAbDirectory> mJsIAbDirectory;
-  nsCOMPtr<nsIAbItem> mJsIAbItem;
   nsCOMPtr<nsIInterfaceRequestor> mJsIInterfaceRequestor;
 
   nsCOMPtr<nsISupports> mJsISupports;
 
   // Class to bypass JS delegates. nsCOMPtr for when we do cycle collection.
   nsCOMPtr<nsIAbDirectory> mCppBase;
 
   RefPtr<DelegateList> mDelegateList;
--- a/mailnews/jsaccount/test/unit/test_componentsExist.js
+++ b/mailnews/jsaccount/test/unit/test_componentsExist.js
@@ -23,17 +23,16 @@ let tests = [
   ["@mozilla.org/jsaccount/testjafoourl;1", "nsIMsgMessageUrl"],
   ["@mozilla.org/jsaccount/testjafoourl;1", "nsIURL"],
   ["@mozilla.org/jsaccount/testjafoourl;1", "nsIURI"],
   ["@mozilla.org/jsaccount/testjafoourl;1", "msgIOverride"],
   ["@mozilla.org/jsaccount/testjafoourl;1", "nsIInterfaceRequestor"],
   // JaAbDirectory
   ["@mozilla.org/jacppabdirectorydelegator;1", "nsISupports"],
   ["@mozilla.org/jacppabdirectorydelegator;1", "nsIAbDirectory"],
-  ["@mozilla.org/jacppabdirectorydelegator;1", "nsIAbItem"],
   ["@mozilla.org/jacppabdirectorydelegator;1", "msgIOverride"],
   ["@mozilla.org/jacppabdirectorydelegator;1", "nsIInterfaceRequestor"],
   ["@mozilla.org/jacppabdirectorydelegator;1", "nsISupportsWeakReference"],
   // JaCompose
   ["@mozilla.org/jacppcomposedelegator;1", "nsISupports"],
   ["@mozilla.org/jacppcomposedelegator;1", "nsIMsgCompose"],
   ["@mozilla.org/jacppcomposedelegator;1", "nsIMsgSendListener"],
   ["@mozilla.org/jacppcomposedelegator;1", "msgIOverride"],