Class com.gContactSync.ContactConverter
Defined in: ContactConverter.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Converts contacts between Thunderbird's format (a 'card') and the Atom/XML
representation of a contact.
|
Field Attributes | Field Name and Description |
---|---|
<static> |
com.gContactSync.ContactConverter.ATOM
The ATOM/XML Namespace
|
<static> |
com.gContactSync.ContactConverter.GD
The GD Namespace
|
<static> |
com.gContactSync.ContactConverter.mAddedAttributes
Extra attributes added by this extension.
|
<static> |
com.gContactSync.ContactConverter.mConverterArr
An array of ContactConverter objects
|
<static> |
com.gContactSync.ContactConverter.mCurrentCard
The current TBContact being converted into a GContact
|
<static> |
com.gContactSync.ContactConverter.mInitialized
Stores whether this object has been initialized yet
|
Method Attributes | Method Name and Description |
---|---|
<static> |
com.gContactSync.ContactConverter.cardToAtomXML(aTBContact, aGContact)
Updates or creates a GContact object's Atom/XML representation using its
complementary Address Book card.
|
<static> |
com.gContactSync.ContactConverter.checkValue(aValue)
Check if the given string is null, of length 0, or consists only of spaces
and return null if any of the listed conditions is true.
|
<static> |
com.gContactSync.ContactConverter.getExtraSyncAttributes(aIncludeURLs, aIncludeAddresses)
Returns an array of all of the extra attributes synced by this extension.
|
<static> |
com.gContactSync.ContactConverter.init()
Initializes this object by populating the array of ConverterElement
objects and the two namespaces most commonly used by this object.
|
<static> |
com.gContactSync.ContactConverter.makeCard(aGContact, aTBContact)
Converts an GContact's Atom/XML representation of a contact to
Thunderbird's address book card format.
|
Class Detail
com.gContactSync.ContactConverter()
Converts contacts between Thunderbird's format (a 'card') and the Atom/XML
representation of a contact. Must be initialized before the first use by
calling the init() function.
NOTE: The first 6 screennames of a contact from Google are stored as:
_AimScreenName, TalkScreenName, ICQScreenName, YahooScreenName, MSNScreenName
and JabberScreenName for compatibility with gContactSync 0.1b1 and the
default type for those textboxes.
Field Detail
<static>
com.gContactSync.ContactConverter.ATOM
The ATOM/XML Namespace
<static>
com.gContactSync.ContactConverter.GD
The GD Namespace
<static>
com.gContactSync.ContactConverter.mAddedAttributes
Extra attributes added by this extension. Doesn't include GoogleID or any
of the URLs. Should be obtained w/ ContactConverter.getExtraSyncAttributes
<static>
com.gContactSync.ContactConverter.mConverterArr
An array of ContactConverter objects
<static>
com.gContactSync.ContactConverter.mCurrentCard
The current TBContact being converted into a GContact
<static>
com.gContactSync.ContactConverter.mInitialized
Stores whether this object has been initialized yet
Method Detail
<static>
{GContact}
com.gContactSync.ContactConverter.cardToAtomXML(aTBContact, aGContact)
Updates or creates a GContact object's Atom/XML representation using its
complementary Address Book card.
- Parameters:
- aTBContact
- {TBContact} The address book card used to update the Atom feed. Must be in an address book.
- aGContact
- {GContact} Optional. The GContact object with the Atom/XML representation of the contact, if it exists. If not supplied, a contact and feed will be created.
- Returns:
- {GContact} A GContact object with the Atom feed for the contact.
<static>
com.gContactSync.ContactConverter.checkValue(aValue)
Check if the given string is null, of length 0, or consists only of spaces
and return null if any of the listed conditions is true.
This function was added to fix Bug 20389: Values with only spaces should be
treated as empty
- Parameters:
- aValue
- {string} The string to check.
- Returns:
- null - The string is null, of length 0, or consists only of spaces aValue - The string has at least one character that is not a space
<static>
com.gContactSync.ContactConverter.getExtraSyncAttributes(aIncludeURLs, aIncludeAddresses)
Returns an array of all of the extra attributes synced by this extension.
- Parameters:
- aIncludeURLs
- {boolean} Should be true if the URL-related attributes should be returned.
- aIncludeAddresses
<static>
com.gContactSync.ContactConverter.init()
Initializes this object by populating the array of ConverterElement
objects and the two namespaces most commonly used by this object.
<static>
{TBContact}
com.gContactSync.ContactConverter.makeCard(aGContact, aTBContact)
Converts an GContact's Atom/XML representation of a contact to
Thunderbird's address book card format.
- Parameters:
- aGContact
- {GContact} A GContact object with the contact to convert.
- aTBContact
- {TBContact} An existing card that can be QI'd to Components.interfaces.nsIAbMDBCard if this is before 413260 landed.
- Returns:
- {TBContact} The updated TBContact.