ContactsAPI Draft: Stores

Further feedback on ContactsAPI [1], mostly focusing on Contacts Stores.

> 6. ContactsManager Interface
> The ContactsManager interface exposes the contacts management functionality.
> interface ContactsManager : EventTarget {
>    ContactsRequest clear ();
>    ContactsRequest remove (Contact contact);
>    ContactsRequest getSimContacts (DOMString type);
>             attribute EventHandler oncontactchanged;
> };

> 6.2 Methods
> clear This method allows to remove all contacts in the contacts store.

Afaict, there are 3 stores: [default], "ADN", "FDN".

Which does clear clear? Is oncontactchanged called?

> getSimContacts This method allows to retrieve the contacts stored in the SIM card.
> type This parameter specifies the type of contacts that are requested to be retrieved from the SIM card.
> It can have two different values "ADN" or "FDN" depending respectively on whether the regular SIM phonebook or the Fix Dialing Number list

Ok, so there are 3 stores, the normal one from navicator.contacts,
"ADN", and "FDN".

> The getSimContacts method when invoked must run the following steps:
> 1. Make a request to the system to retrieve the contacts from the SIM with type equal to the one indicated in the type parameter.
> 2. Create a new ContactsRequest object and set readyState of the ContactsRequest object to 'processing' and return the ContactsRequest to the caller
> 3. If there is an error invoke the onerror event handler of the ContactsRequest object
> 4. When the request has been completed: 1.set the readyState of the ContactsRequest object to 'done'
> 2. set the result of the ContactsRequest object to array of Contacts returned by the system.

"`Contacts`" isn't a defined object in this document, I'm pretty sure
you mean "`Contact`s" instead.

> 3. invoke the onsuccess event handler of the ContactsRequest

> remove This method allows to remove a contact from the contacts store.

Does this work with a contact from getSimContacts ?

> save This method allows to save a contact in the contacts store, e.g. an existing contact after having been edited.

> contact Contact The Contact object that is requested to be saved in the contacts store.

There are still 3 stores... How does one save a contact to "ADN" or "FDN"?

> find This method allows to instantiate a new ContactsRequest object intended to search contacts within the contacts store that match the criteria indicated in the options parameter.

The ContactFindOptions does not seem to allow specifying the contact
store (default/"ADN"/"FDN").

> 14. ContactChangeEvent Interface
> The ContactChangeEvent interface represents events related to a change in a contact.
> WebIDL[NoInterfaceObject]
> interface ContactChangeEvent : Event {
>     readonly attribute DOMString contactID;
> };
> 14.1 Attributes
> contactID of type DOMString, readonlyIndicates the identifier of the Contactobject that has changed.

There's no definition of when this is fired. Is it triggered when a
new contact is added? Is it triggered when a contact is deleted?

Is it triggered when the user inserts a SIM card?

It is triggered if the SIM card wipes itself out (and thus deletes its ADN/FDN)?

[1] http://sysapps.github.com/sysapps/proposals/Contacts/Contacts.html

-- 
Sent from my mobile device

Received on Friday, 26 October 2012 16:11:24 UTC