NokSync

KaarPoSoft

main.js_ File Reference


Detailed Description

Functionality for the main NokSync window.


Functions

void  cancel ()
boolean  checkProductType (string pt)
void  execute ()
void  getAbooks ()
void  handleCancelled (string step)
void  help ()
void  initMain ()
void  openPreferences ()
void  openSyncSelection ()
void  reportSupport ()
void  setStepCancel (string step)
void  setStepError (string step)
void  setStepLabel (string step, string label)
void  setStepLabelF (string step, string label, int n)
void  setStepLabelN (string step, string label, int n)
void  setStepOk (string step)
void  setStepWorking (string step)
void  showDisclaimer ()
void  stepFinished ()
void  stepNokiaConnect ()
void  stepNokiaConnectConnect ()
void  stepNokiaConnectDone ()
void  stepNokiaConnectNext ()
void  stepNokiaConnectRetry ()
void  stepNokiaReadContacts ()
void  stepNokiaReadContactsDone ()
void  stepNokiaReadContactsFirst ()
void  stepNokiaReadContactsNext ()
void  stepNokiaReadContactsPhonebook ()
void  stepPreferences ()
void  stepSelectContacts ()
void  stepSelectContactsCompare ()
void  stepSelectContactsWin ()
void  stepSynchronize ()
void  stepSynchronizeDeleteNokia ()
void  stepSynchronizeDeleteNokiaNext ()
void  stepSynchronizeDeleteTbird ()
void  stepSynchronizeDone ()
void  stepSynchronizeNewNokia ()
void  stepSynchronizeNewNokiaNext ()
void  stepSynchronizeNewTbird ()
void  stepSynchronizeUpdateNokia ()
void  stepSynchronizeUpdateNokiaNext ()
void  stepSynchronizeUpdateTbird ()
void  stepTBaddresses ()
void  trySMSeditor ()
void  verifyEnvironment ()

Variables

nsIAbCard[]  aAbCard
nsIAbDirectory  abDirectory
string[n]  aBookNames
nsIAbDirectory[n]  aBooks
nsIAbDirectory[]  aCardAB
INokiaContact[]  aNokiaContact
Comparison  comparison
nsIRDFDataSource  dsTree
Object  hResult
integer  iConnect
integer  iContact
boolean  isCancelled
boolean  isStarted
integer  msWait
integer  nConnect
integer  nContact
integer  nContacts
Object  nmpResult
INokiaPhonebook  nokiaPhonebook
INokiaPhoneInfo  nokiaPhoneInfo
string  prefAbook
nsIPrefBranch  prefBranch
string  prefNoDisclaimer
string  prefSupported
bool  productType
boolean  shouldCancel
stringbundle  strings
String[]  supportedProductTypes
bool  unsupported
string  where

Function Documentation

void cancel (  ) 

Cancel callback. Called when cancel button is pressed. Just remember that cancel was pressed, and let the step handle the actual cancellation. If operation was not started at all, or cancel was already handled, then close window.

boolean checkProductType ( string  pt  ) 

Check if NOKIA phone with given product type is supported by NokSync.

Parameters:
pt 

void execute (  ) 

Execute callback. Called by addEventListener on load of window

void getAbooks (  ) 

Find address books in Thunderbird. Set global aBooks to array of nsIAbDirectory, and set global aBookNames to array of the names of the addressbooks.

void handleCancelled ( string  step  ) 

Set icon and prompt to indicate that operation was cancelled. Also set global isCancelled to true.

Parameters:
step 

void help (  ) 

Help callback. Called when help button is pressed

void initMain (  ) 

Call the nokSyncLib initialization. Then initialize AbDirectory, PrefBranch, and strings, i.e. noksync-strings. Finally, set a timeout to start verifying the environment.

void openPreferences (  ) 

Open the preferences window

void openSyncSelection (  ) 

Open the SyncSelection window

void reportSupport (  ) 

Report

void setStepCancel ( string  step  ) 

Set class to show "Cancelled" icon for step (Icon identified in noksync.css)

Parameters:
step 

void setStepError ( string  step  ) 

Set class to show "Error" icon for step (Icon identified in noksync.css)

Parameters:
step 

void setStepLabel ( string  step,
string  label  
)

Set label for step

Parameters:
step 
label 

void setStepLabelF ( string  step,
string  label,
int  n  
)

Set label for step; put n in label by getFormattedString

Parameters:
step 
label 
n 

void setStepLabelN ( string  step,
string  label,
int  n  
)

Set label for step; postfix count

Parameters:
step 
label 
n 

void setStepOk ( string  step  ) 

Set class to show "OK" icon for step (Icon identified in noksync.css)

Parameters:
step 

void setStepWorking ( string  step  ) 

Set class to show "working" icon for step (Icon identified in noksync.css)

Parameters:
step 

void showDisclaimer (  ) 

Show disclaimer window

void stepFinished (  ) 

Final step. Synchronization finished successfully

void stepNokiaConnect (  ) 

Step 3: Connect to phone

void stepNokiaConnectConnect (  ) 

Step 3xxx: Connect to phone - do the first connect

void stepNokiaConnectDone (  ) 

Step 3xxx: Connect to phone - DONE

void stepNokiaConnectNext (  ) 

Step 3xxx: Connect to phone - NEXT

void stepNokiaConnectRetry (  ) 

Step 3xxx: Connect to phone - RETRY

void stepNokiaReadContacts (  ) 

Step 4: Read contacts from phone

void stepNokiaReadContactsDone (  ) 

Step 4xxx: Read contacts from phone - DONE

void stepNokiaReadContactsFirst (  ) 

Step 4xxx: Read contacts from phone - FIRST

void stepNokiaReadContactsNext (  ) 

Step 4xxx: Read contacts from phone - NEXT

void stepNokiaReadContactsPhonebook (  ) 

Step 4xxx: Read contacts from phone - PHONEBOOK

void stepPreferences (  ) 

Step 1: Get address-books from preferences

void stepSelectContacts (  ) 

Step 5: Select contacts to synchronize

void stepSelectContactsCompare (  ) 

Step 5xxx: Select contacts to synchronize

void stepSelectContactsWin (  ) 

Step 5xxx: Select contacts to synchronize

void stepSynchronize (  ) 

Step 6: Synchronize

void stepSynchronizeDeleteNokia (  ) 

Step 6xxx: Synchronize delete on NOKIA

void stepSynchronizeDeleteNokiaNext (  ) 

Step 6xxx: Synchronize delete on NOKIA - next

void stepSynchronizeDeleteTbird (  ) 

Step 6xxx: Synchronize delete in Thunderbird

void stepSynchronizeDone (  ) 

Step 6xxx: Synchronization DOne

void stepSynchronizeNewNokia (  ) 

Step 6xxx: Synchronize new on NOKIA

void stepSynchronizeNewNokiaNext (  ) 

Step 6xxx: Synchronize new on NOKIA - next

void stepSynchronizeNewTbird (  ) 

Step 6xxx: Synchronize new in Thunderbird

void stepSynchronizeUpdateNokia (  ) 

Step 6xxx: Synchronize updates on NOKIA

void stepSynchronizeUpdateNokiaNext (  ) 

Step 6xxx: Synchronize updates on NOKIA - next

void stepSynchronizeUpdateTbird (  ) 

Step 6xxx: Synchronize updates to in Thunderbird

void stepTBaddresses (  ) 

Step 2: Get addresses from Thunderbird

void trySMSeditor (  ) 

Try to launch the NOKIA PC Suite SMS editor

void verifyEnvironment (  ) 

Verify Environment. Verify that


Variable Documentation

nsIAbCard [] aAbCard

Global variable holding an array of thunderbird address cards Initialized by stepTBaddresses().

Todo:
DESTROY

nsIAbDirectory abDirectory

Global Thunderbird address book directory. Initialized by initMain();

string [n] aBookNames

Array of the names of the Thunderbird address books selected in preferences. Set by getAbooks();

nsIAbDirectory [n] aBooks

Array of Thunderbird address books selected in preferences. Set by getAbooks();

nsIAbDirectory [] aCardAB

Global variable holding an array of thunderbird addressbooks, matching aAbCard. Initialized by stepTBaddresses().

Todo:
DESTROY

INokiaContact [] aNokiaContact

Global variable holding an array of NOKIA contacts. Initialized by stepNokiaReadContacts...().

Todo:
DESTROY

Comparison comparison

Global variable holding the comparison between Thunderbird and NOKIA. See Comparator.js_. Initialized by stepSelectContactsCompare and used in stepSelectContactsCompareWin and hence in the SyncSelection window.

nsIRDFDataSource dsTree

Global variable holding the RDF data source from the SyncSelection window. Initialized in stepSelectContactsWin as return value from opening SyncSelection.xul. Used in stepSynchronizeXXX, which checks properties of dsTree, to check if each contact should be synchronized.

Object hResult

Global variable holding the error result of a call to a C++ function. Must be initialized to an Object, as it is an out parameter. The actual (long) value is found in hResult.value The only reason for keeping it global is to make sure it is initialized.

integer iConnect

Global variable holding the number of times we have tried to connect to the NOKIA phone. Used by stepNokiaConnect...

integer iContact

Global variable holding the index of the current NOKIA contact to be read. Used by stepNokiaReadContacts...().

boolean isCancelled

When a function has responed to a isCancelled, it should set isCancelled=true. When cancel is subsequently pressed again, cancel() will close the window.

boolean isStarted

When OK is pressed, execute sets isStarted=true. If cancel is pressed before isStarted=true, cancel simply closes the window.

integer msWait

Global constant defining the number of milliseconds to wait between each try to connect to the NOKIA phone.

integer nConnect

Global constant defining the number of times to try to connect to the NOKIA phone.

integer nContact

Global variable holding the number of available NOKIA contacts. Initialized by stepNokiaReadContacts().

integer nContacts

Global variable holding the total number of contacts to synchronize. Initialized by stepSynchronize().

Object nmpResult

Global variable holding the NMP error result of a call to a C++ function. Must be initialized to an Object, as it is an out parameter. The actual (long) value is found in nmpResult.value. The only reason for keeping it global is to make sure it is initialized.

INokiaPhonebook nokiaPhonebook

Global variable holding reference to NOKIA phone book. Initialized by stepNokiaReadContacts().

Todo:
DESTROY

INokiaPhoneInfo nokiaPhoneInfo

Global variable holding reference to NOKIA phone information. Initialized by stepNokiaConnect(). Destroyed by stepNokiaConnectDone().

string prefAbook

Preference prefix for selected address books. Also defined in preferences.js.

nsIPrefBranch prefBranch

The branch of the preference tree, in which NokSync preferences lives. Initialized by initMain();

string prefNoDisclaimer

Preference name for do not show disclaimer

string prefSupported

Preference name for users supported phone

bool productType

Global The user's phone's product type

boolean shouldCancel

When cancel is pressed, cancel() will set shouldCancel=true. Each function should check this, and cancel further actions if true.

stringbundle strings

Bundle of strings to be used on the GUI. Initialized by initMain();

String [] supportedProductTypes

Global array of product types supported by NokSync.

bool unsupported

Global Was phone originally thought as unsupported?

string where

Global prefix string for logging

Doxygen.org   SourceForge.net