2013-10-18 01:29:56 +04: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 21:41:35 +04:00
|
|
|
dictionary ContactAddress {
|
2013-10-18 01:29:56 +04:00
|
|
|
sequence<DOMString>? type;
|
2013-10-31 03:16:45 +04:00
|
|
|
DOMString? streetAddress;
|
|
|
|
DOMString? locality;
|
|
|
|
DOMString? region;
|
|
|
|
DOMString? postalCode;
|
|
|
|
DOMString? countryName;
|
|
|
|
boolean? pref;
|
2013-10-18 01:29:56 +04:00
|
|
|
};
|
|
|
|
|
2013-12-29 21:41:35 +04:00
|
|
|
dictionary ContactField {
|
2013-10-18 01:29:56 +04:00
|
|
|
sequence<DOMString>? type;
|
|
|
|
DOMString? value;
|
|
|
|
boolean? pref;
|
|
|
|
};
|
|
|
|
|
2013-12-29 21:41:35 +04:00
|
|
|
dictionary ContactTelField : ContactField {
|
2013-10-18 01:29:56 +04:00
|
|
|
DOMString? carrier;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ContactProperties {
|
|
|
|
Date? bday;
|
|
|
|
Date? anniversary;
|
|
|
|
|
|
|
|
DOMString? sex;
|
|
|
|
DOMString? genderIdentity;
|
|
|
|
|
|
|
|
sequence<Blob>? photo;
|
|
|
|
|
2013-12-29 21:41:35 +04:00
|
|
|
sequence<ContactAddress>? adr;
|
2013-10-18 01:29:56 +04:00
|
|
|
|
2013-12-29 21:41:35 +04:00
|
|
|
sequence<ContactField>? email;
|
|
|
|
sequence<ContactField>? url;
|
|
|
|
sequence<ContactField>? impp;
|
2013-10-18 01:29:56 +04:00
|
|
|
|
2013-12-29 21:41:35 +04:00
|
|
|
sequence<ContactTelField>? tel;
|
2013-10-18 01:29:56 +04:00
|
|
|
|
|
|
|
sequence<DOMString>? name;
|
|
|
|
sequence<DOMString>? honorificPrefix;
|
|
|
|
sequence<DOMString>? givenName;
|
2014-04-07 05:14:00 +04:00
|
|
|
sequence<DOMString>? phoneticGivenName;
|
2013-10-18 01:29:56 +04:00
|
|
|
sequence<DOMString>? additionalName;
|
|
|
|
sequence<DOMString>? familyName;
|
2014-04-07 05:14:00 +04:00
|
|
|
sequence<DOMString>? phoneticFamilyName;
|
2013-10-18 01:29:56 +04:00
|
|
|
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),
|
2016-03-12 21:45:54 +03:00
|
|
|
JSImplementation="@mozilla.org/contact;1",
|
|
|
|
CheckAnyPermissions="contacts-read contacts-write contacts-create"]
|
2013-10-18 01:29:56 +04:00
|
|
|
interface mozContact {
|
2013-12-29 21:41:35 +04:00
|
|
|
attribute DOMString id;
|
|
|
|
readonly attribute Date? published;
|
|
|
|
readonly attribute Date? updated;
|
2013-10-18 01:29:56 +04:00
|
|
|
|
2013-12-29 21:41:35 +04:00
|
|
|
attribute Date? bday;
|
|
|
|
attribute Date? anniversary;
|
2013-10-18 01:29:56 +04:00
|
|
|
|
2013-12-29 21:41:35 +04:00
|
|
|
attribute DOMString? sex;
|
|
|
|
attribute DOMString? genderIdentity;
|
2013-10-18 01:29:56 +04:00
|
|
|
|
2013-12-29 21:41:35 +04:00
|
|
|
[Cached, Pure] attribute sequence<Blob>? photo;
|
2013-10-18 01:29:56 +04:00
|
|
|
|
2013-12-29 21:41:35 +04:00
|
|
|
[Cached, Pure] attribute sequence<ContactAddress>? adr;
|
2013-10-18 01:29:56 +04:00
|
|
|
|
2013-12-29 21:41:35 +04:00
|
|
|
[Cached, Pure] attribute sequence<ContactField>? email;
|
|
|
|
[Cached, Pure] attribute sequence<ContactField>? url;
|
|
|
|
[Cached, Pure] attribute sequence<ContactField>? impp;
|
2013-10-18 01:29:56 +04:00
|
|
|
|
2013-12-29 21:41:35 +04:00
|
|
|
[Cached, Pure] attribute sequence<ContactTelField>? tel;
|
2013-10-18 01:29:56 +04:00
|
|
|
|
2013-12-29 21:41:35 +04:00
|
|
|
[Cached, Pure] attribute sequence<DOMString>? name;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? honorificPrefix;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? givenName;
|
2014-04-07 05:14:00 +04:00
|
|
|
[Cached, Pure] attribute sequence<DOMString>? phoneticGivenName;
|
2013-12-29 21:41:35 +04:00
|
|
|
[Cached, Pure] attribute sequence<DOMString>? additionalName;
|
|
|
|
[Cached, Pure] attribute sequence<DOMString>? familyName;
|
2014-04-07 05:14:00 +04:00
|
|
|
[Cached, Pure] attribute sequence<DOMString>? phoneticFamilyName;
|
2013-12-29 21:41:35 +04:00
|
|
|
[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-18 01:29:56 +04:00
|
|
|
|
2014-01-17 22:00:35 +04:00
|
|
|
void init(optional ContactProperties properties);
|
|
|
|
|
2013-10-18 01:29:56 +04:00
|
|
|
[ChromeOnly]
|
2013-10-18 10:11:10 +04:00
|
|
|
void setMetadata(DOMString id, Date? published, Date? updated);
|
2013-10-18 01:29:56 +04:00
|
|
|
|
2013-12-29 21:41:35 +04:00
|
|
|
jsonifier;
|
2013-10-18 01:29:56 +04: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-18 10:11:10 +04:00
|
|
|
unsigned long filterLimit = 0;
|
2013-10-18 01:29:56 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
[NoInterfaceObject, NavigatorProperty="mozContacts",
|
2016-03-12 21:45:54 +03:00
|
|
|
JSImplementation="@mozilla.org/contactManager;1",
|
|
|
|
CheckAnyPermissions="contacts-read contacts-write contacts-create"]
|
2013-10-18 01:29:56 +04:00
|
|
|
interface ContactManager : EventTarget {
|
|
|
|
DOMRequest find(optional ContactFindOptions options);
|
|
|
|
DOMCursor getAll(optional ContactFindSortOptions options);
|
|
|
|
DOMRequest clear();
|
|
|
|
DOMRequest save(mozContact contact);
|
2014-01-29 17:20:40 +04:00
|
|
|
DOMRequest remove((mozContact or DOMString) contactOrId);
|
2013-10-18 01:29:56 +04:00
|
|
|
DOMRequest getRevision();
|
|
|
|
DOMRequest getCount();
|
|
|
|
|
|
|
|
attribute EventHandler oncontactchange;
|
|
|
|
};
|