2013-10-17 14:29:56 -07:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
dictionary ContactAddress {
|
2013-10-17 14:29:56 -07:00
|
|
|
sequence<DOMString>? type;
|
2013-10-30 16:16:45 -07:00
|
|
|
DOMString? streetAddress;
|
|
|
|
DOMString? locality;
|
|
|
|
DOMString? region;
|
|
|
|
DOMString? postalCode;
|
|
|
|
DOMString? countryName;
|
|
|
|
boolean? pref;
|
2013-10-17 14:29:56 -07:00
|
|
|
};
|
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
dictionary ContactField {
|
2013-10-17 14:29:56 -07:00
|
|
|
sequence<DOMString>? type;
|
|
|
|
DOMString? value;
|
|
|
|
boolean? pref;
|
|
|
|
};
|
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
dictionary ContactTelField : ContactField {
|
2013-10-17 14:29:56 -07:00
|
|
|
DOMString? carrier;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ContactProperties {
|
|
|
|
Date? bday;
|
|
|
|
Date? anniversary;
|
|
|
|
|
|
|
|
DOMString? sex;
|
|
|
|
DOMString? genderIdentity;
|
|
|
|
|
|
|
|
sequence<Blob>? photo;
|
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
sequence<ContactAddress>? adr;
|
2013-10-17 14:29:56 -07:00
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
sequence<ContactField>? email;
|
|
|
|
sequence<ContactField>? url;
|
|
|
|
sequence<ContactField>? impp;
|
2013-10-17 14:29:56 -07:00
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
sequence<ContactTelField>? tel;
|
2013-10-17 14:29:56 -07:00
|
|
|
|
|
|
|
sequence<DOMString>? name;
|
|
|
|
sequence<DOMString>? honorificPrefix;
|
|
|
|
sequence<DOMString>? givenName;
|
|
|
|
sequence<DOMString>? additionalName;
|
|
|
|
sequence<DOMString>? familyName;
|
|
|
|
sequence<DOMString>? honorificSuffix;
|
|
|
|
sequence<DOMString>? nickname;
|
|
|
|
sequence<DOMString>? category;
|
|
|
|
sequence<DOMString>? org;
|
|
|
|
sequence<DOMString>? jobTitle;
|
|
|
|
sequence<DOMString>? note;
|
|
|
|
sequence<DOMString>? key;
|
|
|
|
};
|
|
|
|
|
|
|
|
[Constructor(optional ContactProperties properties),
|
|
|
|
JSImplementation="@mozilla.org/contact;1"]
|
|
|
|
interface mozContact {
|
2013-12-29 09:41:35 -08:00
|
|
|
attribute DOMString id;
|
|
|
|
readonly attribute Date? published;
|
|
|
|
readonly attribute Date? updated;
|
2013-10-17 14:29:56 -07:00
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
attribute Date? bday;
|
|
|
|
attribute Date? anniversary;
|
2013-10-17 14:29:56 -07:00
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
attribute DOMString? sex;
|
|
|
|
attribute DOMString? genderIdentity;
|
2013-10-17 14:29:56 -07:00
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
[Cached, Pure] attribute sequence<Blob>? photo;
|
2013-10-17 14:29:56 -07:00
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
[Cached, Pure] attribute sequence<ContactAddress>? adr;
|
2013-10-17 14:29:56 -07:00
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
[Cached, Pure] attribute sequence<ContactField>? email;
|
|
|
|
[Cached, Pure] attribute sequence<ContactField>? url;
|
|
|
|
[Cached, Pure] attribute sequence<ContactField>? impp;
|
2013-10-17 14:29:56 -07:00
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
[Cached, Pure] attribute sequence<ContactTelField>? tel;
|
2013-10-17 14:29:56 -07:00
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
[Cached, Pure] attribute sequence<DOMString>? name;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? honorificPrefix;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? givenName;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? additionalName;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? familyName;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? honorificSuffix;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? nickname;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? category;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? org;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? jobTitle;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? note;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? key;
|
2013-10-17 14:29:56 -07:00
|
|
|
|
|
|
|
[ChromeOnly]
|
2013-10-17 23:11:10 -07:00
|
|
|
void setMetadata(DOMString id, Date? published, Date? updated);
|
2013-10-17 14:29:56 -07:00
|
|
|
|
2013-12-29 09:41:35 -08:00
|
|
|
jsonifier;
|
2013-10-17 14:29:56 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ContactFindSortOptions {
|
|
|
|
DOMString sortBy; // "givenName" or "familyName"
|
|
|
|
DOMString sortOrder = "ascending"; // e.g. "descending"
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ContactFindOptions : ContactFindSortOptions {
|
|
|
|
DOMString filterValue; // e.g. "Tom"
|
|
|
|
DOMString filterOp; // e.g. "startsWith"
|
|
|
|
any filterBy; // e.g. ["givenName", "nickname"]
|
2013-10-17 23:11:10 -07:00
|
|
|
unsigned long filterLimit = 0;
|
2013-10-17 14:29:56 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
[NoInterfaceObject, NavigatorProperty="mozContacts",
|
|
|
|
JSImplementation="@mozilla.org/contactManager;1"]
|
|
|
|
interface ContactManager : EventTarget {
|
|
|
|
DOMRequest find(optional ContactFindOptions options);
|
|
|
|
DOMCursor getAll(optional ContactFindSortOptions options);
|
|
|
|
DOMRequest clear();
|
|
|
|
DOMRequest save(mozContact contact);
|
|
|
|
DOMRequest remove(mozContact contact);
|
|
|
|
DOMRequest getRevision();
|
|
|
|
DOMRequest getCount();
|
|
|
|
|
|
|
|
attribute EventHandler oncontactchange;
|
|
|
|
};
|