Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

nsIAbCard

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 https://mxr.mozilla.org/comm-central/source//mailnews/addrbook/public/nsIAbCard.idl for more details.

web.html($0) is defined in wiki.template('tbsource', mediawiki.args([$1])). It is wiki.template(mediawiki.path('InterfaceStatus:Scriptable_' + $4, "en")) and wiki.template(mediawiki.path('InterfaceStatus:' + $2, "en"), mediawiki.args([$3])).

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)

Attributes

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

Methods

getCardValue()

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

setCardValue()

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

copy()

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

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

equals()

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

 

convertToBase64EncodedXML()

string convertToBase64EncodedXML()
Return value

 

convertToXMLPrintData()

AString convertToXMLPrintData()
Return value

 

convertToEscapedVCard()

string convertToEscapedVCard()
Return value

generateName()

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)
Parameters
aGenerateFormat
The format to present the name in:
0
Generated name is displayName
1
lastFirst, formatted following lastFirstFormat property in addressBook.properties.
2
firstLast, formatted following firstLastFormat property in addressBook.properties.
aBundle
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.

generatePhoneticName()

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

AString generatePhoneticName(in boolean aLastNameFirst)
Parameters
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: teoli, mozjonathan, Smi, Wjjohnst
 Last updated by: mozjonathan,