canmove, Confirmed users
2,887
edits
(add 'key' to ContactProperties per bug 807717, 807688, move key property to a background section to keep documentation) |
(→Contacts API specification: add some ids for the interfaces) |
||
| Line 28: | Line 28: | ||
== API == | == API == | ||
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: | ||
interface ContactsManager | interface <span id="ContactsManager">ContactsManager</span> | ||
{ | { | ||
DOMRequest find(in ContactFindOptions options); | DOMRequest find(in ContactFindOptions options); | ||
| Line 36: | Line 36: | ||
}; | }; | ||
interface ContactFindOptions : nsISupports | interface <span id="ContactFindOptions">ContactFindOptions</span> : nsISupports | ||
{ | { | ||
attribute DOMString filterValue; // e.g. "Tom" | attribute DOMString filterValue; // e.g. "Tom" | ||
| Line 50: | Line 50: | ||
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 ContactField : nsISupports | interface <span id="ContactField">ContactField</span> : nsISupports | ||
{ | { | ||
attribute DOMString[] type; // "home", "work", etc. | attribute DOMString[] type; // "home", "work", etc. | ||
| Line 57: | Line 57: | ||
}; | }; | ||
interface ContactTelField : ContactField | interface <span id="ContactTelField">ContactTelField</span> : ContactField | ||
{ | { | ||
attribute DOMString carrier; // experimental extension - not in vCard! | attribute DOMString carrier; // experimental extension - not in vCard! | ||
}; | }; | ||
interface ContactAddress { | interface <span id="ContactAddress">ContactAddress</span> { | ||
attribute DOMString[] type; // "home", "work", etc. | attribute DOMString[] type; // "home", "work", etc. | ||
attribute integer pref; // 0 = no pref, 1 = preferred. | attribute integer pref; // 0 = no pref, 1 = preferred. | ||
| Line 72: | Line 72: | ||
}; | }; | ||
interface ContactProperties { | interface <span id="ContactProperties">ContactProperties</span> { | ||
attribute DOMString[] name; | attribute DOMString[] name; | ||
attribute DOMString[] honorificPrefix; | attribute DOMString[] honorificPrefix; | ||
| Line 98: | Line 98: | ||
[Constructor(in ContactProperties properties)] | [Constructor(in ContactProperties properties)] | ||
interface Contact : ContactProperties | interface <span id="Contact">Contact</span> : ContactProperties | ||
{ | { | ||
readonly attribute DOMString id; | readonly attribute DOMString id; | ||