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 michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "domstubs.idl" michael@0: michael@0: [scriptable, uuid(6044702d-e4a9-420c-b711-558b7d6a3b9f)] michael@0: interface nsIDOMOfflineResourceList : nsISupports michael@0: { michael@0: /** michael@0: * Get the list of dynamically-managed entries. michael@0: */ michael@0: readonly attribute nsISupports mozItems; michael@0: michael@0: /** michael@0: * Check that an entry exists in the list of dynamically-managed entries. michael@0: * michael@0: * @param uri michael@0: * The resource to check. michael@0: */ michael@0: boolean mozHasItem(in DOMString uri); michael@0: michael@0: /** michael@0: * Get the number of dynamically-managed entries. michael@0: * @status DEPRECATED michael@0: * Clients should use the "items" attribute. michael@0: */ michael@0: readonly attribute unsigned long mozLength; michael@0: michael@0: /** michael@0: * Get the URI of a dynamically-managed entry. michael@0: * @status DEPRECATED michael@0: * Clients should use the "items" attribute. michael@0: */ michael@0: DOMString mozItem(in unsigned long index); michael@0: michael@0: /** michael@0: * Add an item to the list of dynamically-managed entries. The resource michael@0: * will be fetched into the application cache. michael@0: * michael@0: * @param uri michael@0: * The resource to add. michael@0: */ michael@0: void mozAdd(in DOMString uri); michael@0: michael@0: /** michael@0: * Remove an item from the list of dynamically-managed entries. If this michael@0: * was the last reference to a URI in the application cache, the cache michael@0: * entry will be removed. michael@0: * michael@0: * @param uri michael@0: * The resource to remove. michael@0: */ michael@0: void mozRemove(in DOMString uri); michael@0: michael@0: /** michael@0: * State of the application cache this object is associated with. michael@0: */ michael@0: michael@0: /* This object is not associated with an application cache. */ michael@0: const unsigned short UNCACHED = 0; michael@0: michael@0: /* The application cache is not being updated. */ michael@0: const unsigned short IDLE = 1; michael@0: michael@0: /* The manifest is being fetched and checked for updates */ michael@0: const unsigned short CHECKING = 2; michael@0: michael@0: /* Resources are being downloaded to be added to the cache */ michael@0: const unsigned short DOWNLOADING = 3; michael@0: michael@0: /* There is a new version of the application cache available */ michael@0: const unsigned short UPDATEREADY = 4; michael@0: michael@0: /* The application cache group is now obsolete. */ michael@0: const unsigned short OBSOLETE = 5; michael@0: michael@0: readonly attribute unsigned short status; michael@0: michael@0: /** michael@0: * Begin the application update process on the associated application cache. michael@0: */ michael@0: void update(); michael@0: michael@0: /** michael@0: * Swap in the newest version of the application cache, or disassociate michael@0: * from the cache if the cache group is obsolete. michael@0: */ michael@0: void swapCache(); michael@0: michael@0: /* Events */ michael@0: [implicit_jscontext] attribute jsval onchecking; michael@0: [implicit_jscontext] attribute jsval onerror; michael@0: [implicit_jscontext] attribute jsval onnoupdate; michael@0: [implicit_jscontext] attribute jsval ondownloading; michael@0: [implicit_jscontext] attribute jsval onprogress; michael@0: [implicit_jscontext] attribute jsval onupdateready; michael@0: [implicit_jscontext] attribute jsval oncached; michael@0: [implicit_jscontext] attribute jsval onobsolete; michael@0: };