canmove, Confirmed users
2,675
edits
(Add a pointer to MDN for web developers) |
(add phoneticGivenName and phoneticFamilyName as proposed vCard4 extensions, and bug 909224. subheads for interfaces rather than span ids) |
||
Line 139: | Line 139: | ||
There is an object in window.navigator named ''mozContacts'' with the following interface: | There is an object in window.navigator named ''mozContacts'' with the following interface: | ||
=== ContactManager === | |||
[NoInterfaceObject] | [NoInterfaceObject] | ||
interface | interface ContactManager : EventTarget { | ||
DOMRequest find(optional ContactFindOptions options); | DOMRequest find(optional ContactFindOptions options); | ||
DOMCursor getAll(optional ContactFindSortOptions options); | DOMCursor getAll(optional ContactFindSortOptions options); | ||
Line 151: | Line 152: | ||
}; | }; | ||
dictionary | === ContactFindSortOptions === | ||
dictionary ContactFindSortOptions { | |||
DOMString sortBy; // "givenName" or "familyName" | DOMString sortBy; // "givenName" or "familyName" | ||
DOMString sortOrder = "ascending"; // e.g. "descending" | DOMString sortOrder = "ascending"; // e.g. "descending" | ||
}; | }; | ||
dictionary | === ContactFindOptions === | ||
dictionary ContactFindOptions : ContactFindSortOptions { | |||
DOMString filterValue; // e.g. "Tom" | DOMString filterValue; // e.g. "Tom" | ||
DOMString filterOp; // e.g. "startsWith" | DOMString filterOp; // e.g. "startsWith" | ||
Line 162: | Line 165: | ||
unsigned long filterLimit = 0; | unsigned long filterLimit = 0; | ||
}; | }; | ||
TO DO: Research/document device-specific address book capabilities and represent using methods on the ContactsManager interface. | TO DO: Research/document device-specific address book capabilities and represent using methods on the ContactsManager interface. | ||
=== ContactField === | |||
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 | interface ContactField { | ||
attribute DOMString[] type; // ["home"], ["work"], etc. | attribute DOMString[] type; // ["home"], ["work"], etc. | ||
attribute DOMString? value; | attribute DOMString? value; | ||
Line 173: | Line 178: | ||
}; | }; | ||
interface | === ContactTelField === | ||
interface ContactTelField : ContactField { | |||
attribute DOMString? carrier; // experimental extension - not in vCard! | attribute DOMString? carrier; // experimental extension - not in vCard! | ||
}; | }; | ||
=== ContactAddress === | |||
interface ContactAddress { | interface ContactAddress { | ||
attribute DOMString[] type; // ["home"], ["work"], etc. | attribute DOMString[] type; // ["home"], ["work"], etc. | ||
Line 187: | Line 194: | ||
}; | }; | ||
=== mozContact === | |||
[Constructor(optional ContactProperties properties)] | [Constructor(optional ContactProperties properties)] | ||
interface <span id="mozContact">mozContact</span> { | interface <span id="mozContact">mozContact</span> { | ||
Line 212: | Line 220: | ||
attribute DOMString[] honorificPrefix; | attribute DOMString[] honorificPrefix; | ||
attribute DOMString[] givenName; | attribute DOMString[] givenName; | ||
attribute DOMString[] phoneticGivenName; /* [http://tools.ietf.org/html/draft-fukuda-vcarddav-phonetic-transcription-02 proposed vCard4 addition], [https://bugzilla.mozilla.org/show_bug.cgi?id=909224 bug 909224] */ | |||
attribute DOMString[] additionalName; | attribute DOMString[] additionalName; | ||
attribute DOMString[] familyName; | attribute DOMString[] familyName; | ||
attribute DOMString[] phoneticFamilyName; /* [http://tools.ietf.org/html/draft-fukuda-vcarddav-phonetic-transcription-02 proposed vCard4 addition], [https://bugzilla.mozilla.org/show_bug.cgi?id=909224 bug 909224] */ | |||
attribute DOMString[] honorificSuffix; | attribute DOMString[] honorificSuffix; | ||
attribute DOMString[] nickname; | attribute DOMString[] nickname; | ||
Line 223: | Line 233: | ||
}; | }; | ||
=== ContactProperties === | |||
dictionary ContactProperties { | dictionary ContactProperties { | ||
Date? bday; | Date? bday; |