Class com.gContactSync.TBContact
Defined in: TBContact.js.
Constructor Attributes | Constructor Name and Description |
---|---|
com.gContactSync.TBContact(aContact, aDirectory)
Makes a new TBContact object that has functions to get and set various values
for a contact independently of the version of Thunderbird (using com.gContactSync.GAbManager).
|
Method Attributes | Method Name and Description |
---|---|
getID()
Returns the Google ID of this contact, if any, and forces it to be
https://.
|
|
getName()
Returns a 'name' for this contact.
|
|
getValue(aAttribute)
Returns the value of the requested property of this contact.
|
|
hasAddress(aPrefix)
Returns true if an only if this contact has a value for one or more of the
postal address fields (Address, Address2, City, State, ZipCode, or Country)
of the given type (Home, Work, etc.
|
|
remove()
Removes this card from its parent directory, if possible.
|
|
setValue(aAttribute, aValue, aUpdate)
Sets the value of the requested attribute of this contact and optionally
updates the contact in its parent directory.
|
|
update()
Updates this card in its parent directory, if possible.
|
Class Detail
com.gContactSync.TBContact(aContact, aDirectory)
Makes a new TBContact object that has functions to get and set various values
for a contact independently of the version of Thunderbird (using com.gContactSync.GAbManager).
Optionally takes the parent directory and is able to update the card in that
directory.
- Parameters:
- aContact
- {nsIAbCard} A Thunderbird contact.
- aDirectory
- {AddressBook} The parent directory. Optional.
Method Detail
{string}
getID()
Returns the Google ID of this contact, if any, and forces it to be
https://... (if present).
- Returns:
- {string} The GoogleID of this contact using https
{string}
getName()
Returns a 'name' for this contact. It is the first non-null and not blank
value for the following attributes:
- DisplayName
- PrimaryEmail
- GoogleID
- Returns:
- {string} The name of this contact.
{string}
getValue(aAttribute)
Returns the value of the requested property of this contact.
If the readOnly preference is enabled, then this will return 0 for the
LastModifiedDate.
- Parameters:
- aAttribute
- {string} The attribute to get (PrimaryEmail, for example)
- Returns:
- {string} The value of the attribute, or null if not set.
{boolean}
hasAddress(aPrefix)
Returns true if an only if this contact has a value for one or more of the
postal address fields (Address, Address2, City, State, ZipCode, or Country)
of the given type (Home, Work, etc.)
- Parameters:
- aPrefix
- {string} The type of address (Home, Work, etc.)
- Returns:
- {boolean} True if and only if one or more of the address fields of the given type has a value.
{boolean}
remove()
Removes this card from its parent directory, if possible.
- Returns:
- {boolean} True if the contact was removed.
{boolean}
setValue(aAttribute, aValue, aUpdate)
Sets the value of the requested attribute of this contact and optionally
updates the contact in its parent directory.
- Parameters:
- aAttribute
- {string} The attribute to set (PrimaryEmail, for example)
- aValue
- {string} The value for the given attribute. If null the attribute is 'deleted' from the contact.
- aUpdate
- {boolean} Set to true to update this card after setting the value of the attribute.
- Returns:
- {boolean} True if the contact was updated.
{boolean}
update()
Updates this card in its parent directory, if possible.
- Returns:
- {boolean} True if the contact was updated.