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/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
[ChromeOnly, Constructor, JSImplementation="@mozilla.org/contactAddress;1"]
|
|
|
|
interface ContactAddress {
|
|
|
|
attribute object? type; // DOMString[]
|
2013-10-30 16:16:45 -07:00
|
|
|
[TreatUndefinedAs=Null] attribute DOMString? streetAddress;
|
|
|
|
[TreatUndefinedAs=Null] attribute DOMString? locality;
|
|
|
|
[TreatUndefinedAs=Null] attribute DOMString? region;
|
|
|
|
[TreatUndefinedAs=Null] attribute DOMString? postalCode;
|
|
|
|
[TreatUndefinedAs=Null] attribute DOMString? countryName;
|
2013-10-17 14:29:56 -07:00
|
|
|
attribute boolean? pref;
|
|
|
|
|
|
|
|
[ChromeOnly]
|
|
|
|
void initialize(optional sequence<DOMString>? type,
|
|
|
|
optional DOMString streetAddress,
|
|
|
|
optional DOMString locality,
|
|
|
|
optional DOMString region,
|
|
|
|
optional DOMString postalCode,
|
|
|
|
optional DOMString countryName,
|
|
|
|
optional boolean pref);
|
2013-11-01 09:01:59 -07:00
|
|
|
|
|
|
|
object toJSON();
|
2013-10-17 14:29:56 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ContactAddressInit {
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
[ChromeOnly, Constructor, JSImplementation="@mozilla.org/contactField;1"]
|
|
|
|
interface ContactField {
|
|
|
|
attribute object? type; // DOMString[]
|
2013-10-30 16:16:45 -07:00
|
|
|
[TreatUndefinedAs=Null] attribute DOMString? value;
|
2013-10-17 14:29:56 -07:00
|
|
|
attribute boolean? pref;
|
|
|
|
|
|
|
|
[ChromeOnly]
|
|
|
|
void initialize(optional sequence<DOMString>? type,
|
|
|
|
optional DOMString value,
|
|
|
|
optional boolean pref);
|
2013-11-01 09:01:59 -07:00
|
|
|
|
|
|
|
object toJSON();
|
2013-10-17 14:29:56 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ContactFieldInit {
|
|
|
|
sequence<DOMString>? type;
|
|
|
|
DOMString? value;
|
|
|
|
boolean? pref;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
[ChromeOnly, Constructor, JSImplementation="@mozilla.org/contactTelField;1"]
|
|
|
|
interface ContactTelField : ContactField {
|
2013-10-30 16:16:45 -07:00
|
|
|
[TreatUndefinedAs=Null] attribute DOMString? carrier;
|
2013-10-17 14:29:56 -07:00
|
|
|
|
|
|
|
[ChromeOnly]
|
|
|
|
void initialize(optional sequence<DOMString>? type,
|
|
|
|
optional DOMString value,
|
|
|
|
optional DOMString? carrier,
|
|
|
|
optional boolean pref);
|
2013-11-01 09:01:59 -07:00
|
|
|
|
|
|
|
object toJSON();
|
2013-10-17 14:29:56 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ContactTelFieldInit : ContactFieldInit {
|
|
|
|
DOMString? carrier;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
dictionary ContactProperties {
|
|
|
|
Date? bday;
|
|
|
|
Date? anniversary;
|
|
|
|
|
|
|
|
DOMString? sex;
|
|
|
|
DOMString? genderIdentity;
|
|
|
|
|
|
|
|
sequence<Blob>? photo;
|
|
|
|
|
|
|
|
sequence<ContactAddressInit>? adr;
|
|
|
|
|
|
|
|
sequence<ContactFieldInit>? email;
|
|
|
|
sequence<ContactFieldInit>? url;
|
|
|
|
sequence<ContactFieldInit>? impp;
|
|
|
|
|
|
|
|
sequence<ContactTelFieldInit>? tel;
|
|
|
|
|
|
|
|
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 {
|
|
|
|
attribute DOMString id;
|
|
|
|
readonly attribute Date? published;
|
|
|
|
readonly attribute Date? updated;
|
|
|
|
|
|
|
|
attribute Date? bday;
|
|
|
|
attribute Date? anniversary;
|
|
|
|
|
2013-10-30 16:16:45 -07:00
|
|
|
[TreatUndefinedAs=Null] attribute DOMString? sex;
|
|
|
|
[TreatUndefinedAs=Null] attribute DOMString? genderIdentity;
|
2013-10-17 14:29:56 -07:00
|
|
|
|
|
|
|
attribute object? photo;
|
|
|
|
|
|
|
|
attribute object? adr;
|
|
|
|
|
|
|
|
attribute object? email;
|
|
|
|
attribute object? url;
|
|
|
|
attribute object? impp;
|
|
|
|
|
|
|
|
attribute object? tel;
|
|
|
|
|
|
|
|
attribute object? name;
|
|
|
|
attribute object? honorificPrefix;
|
|
|
|
attribute object? givenName;
|
|
|
|
attribute object? additionalName;
|
|
|
|
attribute object? familyName;
|
|
|
|
attribute object? honorificSuffix;
|
|
|
|
attribute object? nickname;
|
|
|
|
attribute object? category;
|
|
|
|
attribute object? org;
|
|
|
|
attribute object? jobTitle;
|
|
|
|
attribute object? note;
|
|
|
|
attribute object? key;
|
|
|
|
|
|
|
|
[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-11-01 09:01:59 -07:00
|
|
|
object toJSON();
|
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;
|
|
|
|
};
|