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: // TODO Bug 957086 - The DataStoreImpl WebIDL will be removed once the michael@0: // DataStore API is fully rewritten in C++ (i.e. should be michael@0: // directly implemented by the DataStore WebIDL). michael@0: michael@0: [HeaderFile="mozilla/dom/DataStore.h", michael@0: Func="mozilla::dom::DataStore::EnabledForScope", michael@0: JSImplementation="@mozilla.org/dom/datastore-impl;1"] michael@0: interface DataStoreImpl { michael@0: void setEventTarget(EventTarget eventTarget); michael@0: michael@0: // Returns the label of the DataSource. michael@0: readonly attribute DOMString name; michael@0: michael@0: // Returns the origin of the DataSource (e.g., 'facebook.com'). michael@0: // This value is the manifest URL of the owner app. michael@0: readonly attribute DOMString owner; michael@0: michael@0: // is readOnly a F(current_app, datastore) function? yes michael@0: readonly attribute boolean readOnly; michael@0: michael@0: // Promise michael@0: Promise get(DataStoreKey... id); michael@0: michael@0: // Promise michael@0: Promise put(any obj, DataStoreKey id, optional DOMString revisionId = ""); michael@0: michael@0: // Promise michael@0: Promise add(any obj, optional DataStoreKey id, michael@0: optional DOMString revisionId = ""); michael@0: michael@0: // Promise michael@0: Promise remove(DataStoreKey id, optional DOMString revisionId = ""); michael@0: michael@0: // Promise michael@0: Promise clear(optional DOMString revisionId = ""); michael@0: michael@0: readonly attribute DOMString revisionId; michael@0: michael@0: // Promise michael@0: Promise getLength(); michael@0: michael@0: [NewObject] michael@0: DataStoreCursor sync(optional DOMString revisionId = ""); michael@0: }; michael@0: michael@0: michael@0: // TODO Bug 957086 - The DataStoreCursorImpl WebIDL will be removed once the michael@0: // DataStore API is fully rewritten in C++ (i.e. should be michael@0: // directly implemented by the DataStoreCursor WebIDL). michael@0: michael@0: [HeaderFile="mozilla/dom/DataStore.h", michael@0: Func="mozilla::dom::DataStore::EnabledForScope", michael@0: JSImplementation="@mozilla.org/dom/datastore-cursor-impl;1"] michael@0: interface DataStoreCursorImpl { michael@0: // the DataStore michael@0: readonly attribute DataStore store; michael@0: michael@0: // Promise michael@0: Promise next(); michael@0: michael@0: void close(); michael@0: };