Class Index | File Index

Classes


Class com.gContactSync.Accounts


Defined in: Accounts.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
The JavaScript variables and functions that handle different gContactSync accounts allowing each synchronized address book to have its own preferences.
Field Summary
Field Attributes Field Name and Description
<static>  
com.gContactSync.Accounts.mAbNameIndex
The column index of the address book name change this if adding a column before the AB name
<static>  
com.gContactSync.Accounts.mAbURIs
Stores the URIs of the ABs displayed in the Accounts dialog's tree
<static>  
com.gContactSync.Accounts.mPrefElemIDs
Element IDs used when enabling/disabling the preferences
<static>  
com.gContactSync.Accounts.mUnsavedChange
Stores whether there are any unsaved changes in the Accounts dialog
Method Summary
Method Attributes Method Name and Description
<static>  
com.gContactSync.Accounts.addGroups(aAtom, aUsername)
Adds groups in the given atom feed to the Groups menulist provided the username hasn't changed since the groups request was sent and the username isn't blank.
<static>  
com.gContactSync.Accounts.addToTree(aTreeChildren, aAB)
Adds login information (username and directory name) to the tree.
<static>  
com.gContactSync.Accounts.close()
This method is called when the user clicks the Accept button (labeled Close) or when acceptDialog() is called.
<static>  
com.gContactSync.Accounts.directionPopup()
Shows an alert dialog that briefly explains the synchronization direction preference.
<static>  
com.gContactSync.Accounts.enablePreferences(aEnable)
Enables or disables the preference elements.
<static>  
com.gContactSync.Accounts.fillAbTree()
Populates the address book tree with all Personal/Mork Address Books
<static>  
com.gContactSync.Accounts.fillUsernames(aDefault)
Fills the 'Username' menulist with all the usernames of the current plugin.
<static>  
com.gContactSync.Accounts.getAllGroups()
Fetch all groups for the selected account and add custom groups to the menulist.
<static>  
com.gContactSync.Accounts.getSelectedAb()
Returns the GAddressBook corresponding to the currently-selected address book in the accounts tree.
<static>  
com.gContactSync.Accounts.initDialog()
Initializes the Accounts dialog by filling the tree of address books, filling in the usernames, hiding the advanced settings, etc.
<static>  
com.gContactSync.Accounts.needsReset(aAB, aUsername, aSyncGroups, aMyContacts, aMyContactsName)
Returns whether the given address book should be reset and prompts the user before returning true.
<static>  
com.gContactSync.Accounts.newAddressBook()
Creates and returns a new address book after requesting a name for it.
<static>  
com.gContactSync.Accounts.newUsername()
Create a new username/account for the selected plugin.
<static>  
com.gContactSync.Accounts.restoreGroups()
Restores the Groups menulist to contain only the default groups.
<static>  
com.gContactSync.Accounts.saveSelectedAccount()
Saves the preferences for the selected address book.
<static>  
com.gContactSync.Accounts.selectedAbChange()
Called when the selected address book changes in the accounts tree.
<static>  
com.gContactSync.Accounts.showAdvancedSettings(aShow)
Show or hide the advanced settings and then call window.sizeToContent().
Class Detail
com.gContactSync.Accounts()
The JavaScript variables and functions that handle different gContactSync accounts allowing each synchronized address book to have its own preferences.
Field Detail
<static> com.gContactSync.Accounts.mAbNameIndex
The column index of the address book name change this if adding a column before the AB name

<static> com.gContactSync.Accounts.mAbURIs
Stores the URIs of the ABs displayed in the Accounts dialog's tree

<static> com.gContactSync.Accounts.mPrefElemIDs
Element IDs used when enabling/disabling the preferences

<static> com.gContactSync.Accounts.mUnsavedChange
Stores whether there are any unsaved changes in the Accounts dialog
Method Detail
<static> com.gContactSync.Accounts.addGroups(aAtom, aUsername)
Adds groups in the given atom feed to the Groups menulist provided the username hasn't changed since the groups request was sent and the username isn't blank.
Parameters:
aAtom
aUsername

<static> com.gContactSync.Accounts.addToTree(aTreeChildren, aAB)
Adds login information (username and directory name) to the tree.
Parameters:
aTreeChildren
{object} The XUL element.
aAB
{GAddressBook} The GAddressBook to add.

<static> {boolean} com.gContactSync.Accounts.close()
This method is called when the user clicks the Accept button (labeled Close) or when acceptDialog() is called. If there are unsaved changes it will let the user save changes if desired.
Returns:
{boolean} Always returns true (close the dialog).

<static> com.gContactSync.Accounts.directionPopup()
Shows an alert dialog that briefly explains the synchronization direction preference.

<static> com.gContactSync.Accounts.enablePreferences(aEnable)
Enables or disables the preference elements.
Parameters:
aEnable
{boolean} Set to true to enable elements or false to disable them.

<static> com.gContactSync.Accounts.fillAbTree()
Populates the address book tree with all Personal/Mork Address Books

<static> com.gContactSync.Accounts.fillUsernames(aDefault)
Fills the 'Username' menulist with all the usernames of the current plugin.
Parameters:
aDefault
{string} The default account to select. If not present or evaluating to 'false' then 'None' will be selected.

<static> com.gContactSync.Accounts.getAllGroups()
Fetch all groups for the selected account and add custom groups to the menulist.

<static> {com.gContactSync.GAddressBook} com.gContactSync.Accounts.getSelectedAb()
Returns the GAddressBook corresponding to the currently-selected address book in the accounts tree.
Returns:
{com.gContactSync.GAddressBook} A GAddressBook if one is selected, else false.

<static> com.gContactSync.Accounts.initDialog()
Initializes the Accounts dialog by filling the tree of address books, filling in the usernames, hiding the advanced settings, etc.

<static> {boolean} com.gContactSync.Accounts.needsReset(aAB, aUsername, aSyncGroups, aMyContacts, aMyContactsName)
Returns whether the given address book should be reset and prompts the user before returning true. Resetting an address book is necessary when ALL of the following conditions marked with * are met: * The username was NOT originally blank * The new username is NOT blank * The last sync date of the AB is > 0 * The user agrees that the AB should be reset (using a confirm dialog) * AND at least one of the following is true: o The username has changed (and wasn't originally blank) o OR The group to sync has been changed
Parameters:
aAB
{string} The GAddressBook being modified. If this function returns true this AB should be reset.
aUsername
{string} The new username for the account with which aAB will be synchronized.
aSyncGroups
{string} The new value for the syncGroups pref.
aMyContacts
{string} The new value for the myContacts pref.
aMyContactsName
{string} The new value for the myContactsName pref.
Returns:
{boolean} true if the AB should be reset. See the detailed description for more details.

<static> {nsIAbDirectory} com.gContactSync.Accounts.newAddressBook()
Creates and returns a new address book after requesting a name for it. If an AB of any type already exists this function will do nothing.
Returns:
{nsIAbDirectory} The new address book.

<static> {boolean} com.gContactSync.Accounts.newUsername()
Create a new username/account for the selected plugin.
Returns:
{boolean} True if an authentication HTTP request was sent.

<static> com.gContactSync.Accounts.restoreGroups()
Restores the Groups menulist to contain only the default groups.

<static> {boolean} com.gContactSync.Accounts.saveSelectedAccount()
Saves the preferences for the selected address book.
Returns:
{boolean} True if the preferences were saved

<static> {boolean} com.gContactSync.Accounts.selectedAbChange()
Called when the selected address book changes in the accounts tree.
Returns:
{boolean} true if there is currently an address book selected.

<static> {boolean} com.gContactSync.Accounts.showAdvancedSettings(aShow)
Show or hide the advanced settings and then call window.sizeToContent().
Parameters:
aShow
{boolean} Set to true to show the advanced settings or false to hide them.
Returns:
{boolean} True if the advanced settings were shown or hidden.

Documentation generated by JsDoc Toolkit 2.1.0 on Fri May 06 2011 09:24:18 GMT-0400 (EDT)