WebAPI/ContactsAPI: Difference between revisions

no edit summary
(incorporate geo components / flatten into ContactAddress and use same types as Geolocation API, incorporate gender components/flatted into Contact interface)
No edit summary
Line 15: Line 15:
   interface ContactsManager
   interface ContactsManager
   {
   {
     attribute Contact[]  contacts;
     void    find(options, successCB, errorCB);
    Contact create(properties);
    void    clear(successCB, errorCB);
   };
   };


Line 22: Line 24:
The following Contact interface is based [[vCard4]]/hCard properties, flattened for the simple/typical case of one address (adr) based on the [http://microformats.org/wiki/microformats-2#h-card microformats 2.0 hCard] iteration.
The following Contact interface is based [[vCard4]]/hCard properties, flattened for the simple/typical case of one address (adr) based on the [http://microformats.org/wiki/microformats-2#h-card microformats 2.0 hCard] iteration.


   interface Contact {
   interface ContactAddress {
            attribute DOMString              streetAddress;
            attribute DOMString              locality;
            attribute DOMString              region;
            attribute DOMString              postalCode;
            attribute DOMString              countryName;
            attribute double                latitude;
            attribute double                longitude;
            attribute double                altitude;
  };
 
  interface ContactProperties {
             attribute DOMString[]            name;
             attribute DOMString[]            name;
             attribute DOMString[]            honorificPrefix;
             attribute DOMString[]            honorificPrefix;
Line 43: Line 56:
             attribute DOMString              sex; /* new in vCard4, gender sub-component 1 */
             attribute DOMString              sex; /* new in vCard4, gender sub-component 1 */
             attribute DOMstring              gender-identity'; /* new in vCard4, gender sub-comp 2 */
             attribute DOMstring              gender-identity'; /* new in vCard4, gender sub-comp 2 */
    readonly attribute Date                  rev;
/* readonly attribute DOMString              id; // private device-implementation-only field */
   };
   };
    
 
   interface ContactAddress {
   interface ContactsWriter : ContactsProperties
            attribute DOMString             streetAddress;
   {
            attribute DOMString              locality;
    readonly attribute DOMString id;
            attribute DOMString              region;
    readonly attribute Date      published;
            attribute DOMString              postalCode;
    readonly attribute Date      updated;
            attribute DOMString              countryName;
  };
            attribute double                latitude;
 
            attribute double                longitude;
  interface Contact : ContactWriter
            attribute double                altitude;
  {
    void    save(in SuccessCallback successCb,
                in ErrorCallback errorCb);
    void    remove(in SuccessCallback successCb,
                  in ErrorCallback errorCb);
    Contact clone();
   };
   };


20

edits