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