NokSync

KaarPoSoft

comparator.js_ File Reference


Detailed Description

Functionality for comparing Thunderbird with NOKIA.


Functions

int[]  aFieldIdxDefault (NokiaContact nokiaContact)
string[]  aStrFromAbCard (void abCard)
string[]  aStrFromNokiaContact (void nokiaContact, void aFieldIdx)
int  findMatchTbirdToNokia (string displayName, int[] aNokiaNames)
Date  getLastSyncDate ()
nsIRDFDataSource  getRDFAllSyncs (void comparison)
nsIRDFDataSource  getRDFitem (void abCard, void nokiaContact, void aFieldIdx)
void  initComparator ()
bool  matchPhone (string pNokia, string pTb)
int  matchTbirdToNokia (nsIAbCard abCard, nsIAbDirectory abook, NokiaContact nokiaContact, Object outMatch)
void  setLastSyncDate ()
Comparison  syncCompare (nsIAbCard[] aAbCards, nsIAbDirectory[] aCardAB, NokiaContact[] aNokiaContacts)

Variables

int[]  aNokiaAllCVT
int[][]  aNokiaCVT
int[]  aNokiaMainPhoneCVT
int[]  aNokiaOtherPhoneCVT
string[]  aStrItems
Item[]  aTbirdEmail
string[]  aTbirdField
boolean[]  aTbirdIsPhone
boolean[]  aTbirdPhone
enumeration  Item
int  nItems
nsIPrefBranch  prefBranch
string  prefLastSyncDate
nsIRDFContainerUtils  rdfContainerUtils
nsIRDFService  rdfService
stringbundle  stringBundle
string  where

Function Documentation

int [] aFieldIdxDefault ( NokiaContact  nokiaContact  ) 

Make default NokiaContact field index for each item to show in listview

Parameters:
nokiaContact  The NOKIA contact
Returns:
Array index by listview item number

string [] aStrFromAbCard ( void  abCard  ) 

Return an array of strings representing the Thunderbird card.

string [] aStrFromNokiaContact ( void  nokiaContact,
void  aFieldIdx  
)

Return an array of strings representing the NOKIA contact.

int findMatchTbirdToNokia ( string  displayName,
int[]  aNokiaNames  
)

See if there is a Nokia Contact with the same name as the Thunderbird displayName.

Parameters:
displayName  The name to look for.
aNokiaNames  Array string name -> int index
Returns:
Returns the index for displayName if found; -1 otherwise.

Date getLastSyncDate (  ) 

Get date of last synchronization from preferences

nsIRDFDataSource getRDFAllSyncs ( void  comparison  ) 

Return an RDF DataSource representing all items to be synchronized.

Returns:
RDF DataSource

nsIRDFDataSource getRDFitem ( void  abCard,
void  nokiaContact,
void  aFieldIdx  
)

Return an RDF DataSource representing ONE item to be synchronized.

Returns:
RDF DataSource

void initComparator (  ) 

Initialize stringBundle, aStrItems, rdfService, and rdfContainerUtils.

Returns:

bool matchPhone ( string  pNokia,
string  pTb  
)

Check if two phone numbers match

Parameters:
pNokia  Phone number in NOKIA phone.
pTb  Phone number in Thunderbird.

int matchTbirdToNokia ( nsIAbCard  abCard,
nsIAbDirectory  abook,
NokiaContact  nokiaContact,
Object  outMatch  
)

Match a Thunderbird card with a NOKIA contact.

Parameters:
abCard  The Thunderbird card.
abook  The address book the card is in.
nokiaContact  The NOKIA Contact.
outMatch  Details of the match. MUST be initialized to new Object() before call.
Returns:
Returns 0 for complete match; -1 for update needed in Thunderbird; 1 for update needed on NOKIA.

void setLastSyncDate (  ) 

Set date of last synchronization in preferences to now. The date is kept as number of seconds since midnight 01 January, 1970 UTC.

Comparison syncCompare ( nsIAbCard[]  aAbCards,
nsIAbDirectory[]  aCardAB,
NokiaContact[]  aNokiaContacts  
)

Compare array of Thunderbird cards with array of NOKIA Contacts.

Parameters:
aAbCards  Array of Thunderbird address cards.
aCardAB  Array of Thunderbird address books (mathcing aAbCards).
aNokiaContacts  Array of Nokia Contacts.
Returns:
Return a structure describing how the two compare.


Variable Documentation

int [] aNokiaAllCVT

Global. Array of all NokiaContact ContactValueTypes which we are matching. (used to disregard fields which we are not trying to match).

int [][] aNokiaCVT

Global. Array of array of NokiaContact ContactValueTypes. First index corresponding to Item. Second index just a list.

int [] aNokiaMainPhoneCVT

Global. Array of NokiaContact ContactValueTypes representing a phone number with specific NOKIA meaning

int [] aNokiaOtherPhoneCVT

Global. Array of NokiaContact ContactValueTypes representing a phone number with no specific NOKIA meaning

string [] aStrItems

Global array of the item titles for the item listview Index corresponding to Item.

Item [] aTbirdEmail

Global. List of Item's representing Thunderbird Email

string [] aTbirdField

Global. Names of properties in abCard. Index corresponding to Item.

boolean [] aTbirdIsPhone

Global. True if Item with same index is a phone number

boolean [] aTbirdPhone

Global. Item's with those indices is a phone number

enumeration Item

Enumeration of items in item listview

int nItems

Global number of items in item listview

nsIPrefBranch prefBranch

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

string prefLastSyncDate

Preference name for last synchronization date

nsIRDFContainerUtils rdfContainerUtils

Global RDF container utilities Initialized by initComparator();

nsIRDFService rdfService

Global RDF service Initialized by initComparator();

stringbundle stringBundle

Global bundle of strings for the GUI Initialized by initComparator();

string where

Global prefix string for logging

Doxygen.org   SourceForge.net