We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS


The nsIAbCard interface is used to represent and manipulate cards in the addressbook. Following a huge refactoring of the address book code, most of the documentation below is out of date. Properties aren't stored anymore on the card, except for a handful of them. Complex properties are expected to be accessed through a call to getProperty. See http://mxr.mozilla.org/comm-central/source//mailnews/addrbook/public/nsIAbCard.idl for more details.

Inherits from: nsISupports

Method overview

AString getCardValue(in string name)
void setCardValue(in string attrname, in AString value)
void copy(in nsIAbCard srcCard)
boolean equals(in nsIAbCard card)
string convertToBase64EncodedXML()
AString convertToXMLPrintData()
string convertToEscapedVCard()
AString generateName(in long aGenerateFormat,[optional] in nsIStringBundle aBundle)
AString generatePhoneticName(in boolean aLastNameFirst)


Attribute Type Description
firstName AString  
lastName AString  
phoneticFirstName AString  
phoneticLastName AString  
displayName AString  
nickName AString  
primaryEmail AString  
secondEmail AString  
workPhone AString  
homePhone AString  
faxNumber AString  
pagerNumber AString  
cellularNumber AString  
workPhoneType AString  
homePhoneType AString  
faxNumberType AString  
pagerNumberType AString  
cellularNumberType AString  
homeAddress AString  
homeAddress2 AString  
homeCity AString  
homeState AString  
homeZipCode AString  
homeCountry AString  
workAddress AString  
workAddress2 AString  
workCity AString  
workState AString  
workZipCode AString  
workCountry AString  
jobTitle AString  
department AString  
company AString  
aimScreenName AString  
anniversaryYear AString  
anniversaryMonth AString  
anniversaryDay AString  
spouseName AString  
familyName AString  
defaultAddress AString  
category AString  
webPage1 AString Used for the contact's work web page
webPage2 AString Used for the contact's home web page
birthYear AString  
birthMonth AString  
birthDay AString  
custom1 AString  
custom2 AString  
custom3 AString  
custom4 AString  
notes AString  
lastModifiedDate unsigned long  
popularityIndex unsigned long popularityIndex is bumped every time e-mail is sent to this recipient .
preferMailFormat unsigned long Allowed values are stored in nsIAbPreferMailFormat.
isMailList boolean  
mailListURI string If isMailList is true then mailListURI will contain the URI of the associated mailing list.
allowRemoteContent boolean Allow remote content to be displayed in HTML mail received from this contact



AString getCardValue(in string name)
The attribute you want the value for.
Return value
The value of the attribute asked for.


void setCardValue(in string attrname, in AString value)
The attribute you want to set.
The value to set the attribute to.


This function will copy all values from one card to another.

void copy(in nsIAbCard srcCard)
The source card to copy values from.


boolean equals(in nsIAbCard card)
The card you are comparing with.
Return value
true if the cards are the same.



string convertToBase64EncodedXML()
Return value



AString convertToXMLPrintData()
Return value



string convertToEscapedVCard()
Return value


Generate a name from the card for display purposes. Using the firstName, lastName and the displayName. We allow the caller to cache the pref value, so we don't have to go to prefs every time.

AString generateName(in long aGenerateFormat,[optional] in nsIStringBundle aBundle)
The format to present the name in:
Generated name is displayName
lastFirst, formatted following lastFirstFormat property in addressBook.properties.
firstLast, formatted following firstLastFormat property in addressBook.properties.
An optional parameter that is a pointer to a string bundle that holds: 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 value
A string containing the generated name.


Generate a phonetic name from the card, using the firstName and lastName values.

AString generatePhoneticName(in boolean aLastNameFirst)
Set to true to put the last name before the first.
Return value
A string containing the generated phonetic name.

Document Tags and Contributors

Contributors to this page: fscholz, teoli, mozjonathan, Smi, Wjjohnst
Last updated by: fscholz,