1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
7 dictionary ContactAddress {
8 sequence<DOMString>? type;
9 DOMString? streetAddress;
12 DOMString? postalCode;
13 DOMString? countryName;
17 dictionary ContactField {
18 sequence<DOMString>? type;
23 dictionary ContactTelField : ContactField {
27 dictionary ContactProperties {
32 DOMString? genderIdentity;
34 sequence<Blob>? photo;
36 sequence<ContactAddress>? adr;
38 sequence<ContactField>? email;
39 sequence<ContactField>? url;
40 sequence<ContactField>? impp;
42 sequence<ContactTelField>? tel;
44 sequence<DOMString>? name;
45 sequence<DOMString>? honorificPrefix;
46 sequence<DOMString>? givenName;
47 sequence<DOMString>? phoneticGivenName;
48 sequence<DOMString>? additionalName;
49 sequence<DOMString>? familyName;
50 sequence<DOMString>? phoneticFamilyName;
51 sequence<DOMString>? honorificSuffix;
52 sequence<DOMString>? nickname;
53 sequence<DOMString>? category;
54 sequence<DOMString>? org;
55 sequence<DOMString>? jobTitle;
56 sequence<DOMString>? note;
57 sequence<DOMString>? key;
60 [Constructor(optional ContactProperties properties),
61 JSImplementation="@mozilla.org/contact;1"]
62 interface mozContact {
63 attribute DOMString id;
64 readonly attribute Date? published;
65 readonly attribute Date? updated;
68 attribute Date? anniversary;
70 attribute DOMString? sex;
71 attribute DOMString? genderIdentity;
73 [Cached, Pure] attribute sequence<Blob>? photo;
75 [Cached, Pure] attribute sequence<ContactAddress>? adr;
77 [Cached, Pure] attribute sequence<ContactField>? email;
78 [Cached, Pure] attribute sequence<ContactField>? url;
79 [Cached, Pure] attribute sequence<ContactField>? impp;
81 [Cached, Pure] attribute sequence<ContactTelField>? tel;
83 [Cached, Pure] attribute sequence<DOMString>? name;
84 [Cached, Pure] attribute sequence<DOMString>? honorificPrefix;
85 [Cached, Pure] attribute sequence<DOMString>? givenName;
86 [Cached, Pure] attribute sequence<DOMString>? phoneticGivenName;
87 [Cached, Pure] attribute sequence<DOMString>? additionalName;
88 [Cached, Pure] attribute sequence<DOMString>? familyName;
89 [Cached, Pure] attribute sequence<DOMString>? phoneticFamilyName;
90 [Cached, Pure] attribute sequence<DOMString>? honorificSuffix;
91 [Cached, Pure] attribute sequence<DOMString>? nickname;
92 [Cached, Pure] attribute sequence<DOMString>? category;
93 [Cached, Pure] attribute sequence<DOMString>? org;
94 [Cached, Pure] attribute sequence<DOMString>? jobTitle;
95 [Cached, Pure] attribute sequence<DOMString>? note;
96 [Cached, Pure] attribute sequence<DOMString>? key;
98 void init(optional ContactProperties properties);
101 void setMetadata(DOMString id, Date? published, Date? updated);
106 dictionary ContactFindSortOptions {
107 DOMString sortBy; // "givenName" or "familyName"
108 DOMString sortOrder = "ascending"; // e.g. "descending"
111 dictionary ContactFindOptions : ContactFindSortOptions {
112 DOMString filterValue; // e.g. "Tom"
113 DOMString filterOp; // e.g. "startsWith"
114 any filterBy; // e.g. ["givenName", "nickname"]
115 unsigned long filterLimit = 0;
118 [NoInterfaceObject, NavigatorProperty="mozContacts",
119 JSImplementation="@mozilla.org/contactManager;1"]
120 interface ContactManager : EventTarget {
121 DOMRequest find(optional ContactFindOptions options);
122 DOMCursor getAll(optional ContactFindSortOptions options);
124 DOMRequest save(mozContact contact);
125 DOMRequest remove((mozContact or DOMString) contactOrId);
126 DOMRequest getRevision();
127 DOMRequest getCount();
129 attribute EventHandler oncontactchange;