Contact JavaScript library

Access to contact of the PIM database.


bool isAvailable ():
Returns TRUE (1) if PIM contact data is available.

int open ():
Loads contacts information in memory. Must be called before using all others methods.
Returns the number of contacts.

void close ():
Free contacts information.

String getInfo (int contactId, int info_constant):
Returns the info for a given a contactId (between 0 and max contacts).
The info_constant can be one of the constants.

int createContact ():
Create a new contact and returns the new number of contacts.
This new contact is found in the last of stack and setInfo method must be used to set fields.

int deleteContact (int contactId):
Delete a contact given by contactId (between 0 and max contacts).
Returns 1 if success otherwise returns 0.

void setInfo (int contactId, int info_constant, String info_string):
Sets info_string in a contact given by contactId (between 0 and max contacts).
The info_constant can be one of the constants.
This method must be called after a createContact() or if field given by info_contact is already set (even empty value).

void addInfo (int contactId, int info_constant, String info_string):
Sets info_string in a contact given by contactId (between 0 and max contacts).
The info_constant can be one of the constants.
Unlike setInfo() method, addInfo() must not called after a createContact() and must be called on empty fields.


FULL_NAME, FIRST_NAME, LAST_NAME, ADDRESS, MOBILE, MOBILE_HOME, MOBILE_WORK, HOME, WORK, FAX, OTHER, PREFERRED, EMAIL, PHOTO_URL:
Contants to use with the Contact.getInfo(), Contact.setInfo() and Contact.addInfo() methods.