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 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)

Attributes

AttributeTypeDescription
firstNameAString 
lastNameAString 
phoneticFirstNameAString 
phoneticLastNameAString 
displayNameAString 
nickNameAString 
primaryEmailAString 
secondEmailAString 
workPhoneAString 
homePhoneAString 
faxNumberAString 
pagerNumberAString 
cellularNumberAString 
workPhoneTypeAString 
homePhoneTypeAString 
faxNumberTypeAString 
pagerNumberTypeAString 
cellularNumberTypeAString 
homeAddressAString 
homeAddress2AString 
homeCityAString 
homeStateAString 
homeZipCodeAString 
homeCountryAString 
workAddressAString 
workAddress2AString 
workCityAString 
workStateAString 
workZipCodeAString 
workCountryAString 
jobTitleAString 
departmentAString 
companyAString 
aimScreenNameAString 
anniversaryYearAString 
anniversaryMonthAString 
anniversaryDayAString 
spouseNameAString 
familyNameAString 
defaultAddressAString 
categoryAString 
webPage1AStringUsed for the contact's work web page
webPage2AStringUsed for the contact's home web page
birthYearAString 
birthMonthAString 
birthDayAString 
custom1AString 
custom2AString 
custom3AString 
custom4AString 
notesAString 
lastModifiedDateunsigned long 
popularityIndexunsigned longpopularityIndex is bumped every time e-mail is sent to this recipient .
preferMailFormatunsigned longAllowed values are stored in nsIAbPreferMailFormat.
isMailListboolean 
mailListURIstringIf isMailList is true then mailListURI will contain the URI of the associated mailing list.
allowRemoteContentbooleanAllow 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:54 次

字数:13894

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文