Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "domstubs.idl" |
michael@0 | 7 | |
michael@0 | 8 | [scriptable, uuid(6044702d-e4a9-420c-b711-558b7d6a3b9f)] |
michael@0 | 9 | interface nsIDOMOfflineResourceList : nsISupports |
michael@0 | 10 | { |
michael@0 | 11 | /** |
michael@0 | 12 | * Get the list of dynamically-managed entries. |
michael@0 | 13 | */ |
michael@0 | 14 | readonly attribute nsISupports mozItems; |
michael@0 | 15 | |
michael@0 | 16 | /** |
michael@0 | 17 | * Check that an entry exists in the list of dynamically-managed entries. |
michael@0 | 18 | * |
michael@0 | 19 | * @param uri |
michael@0 | 20 | * The resource to check. |
michael@0 | 21 | */ |
michael@0 | 22 | boolean mozHasItem(in DOMString uri); |
michael@0 | 23 | |
michael@0 | 24 | /** |
michael@0 | 25 | * Get the number of dynamically-managed entries. |
michael@0 | 26 | * @status DEPRECATED |
michael@0 | 27 | * Clients should use the "items" attribute. |
michael@0 | 28 | */ |
michael@0 | 29 | readonly attribute unsigned long mozLength; |
michael@0 | 30 | |
michael@0 | 31 | /** |
michael@0 | 32 | * Get the URI of a dynamically-managed entry. |
michael@0 | 33 | * @status DEPRECATED |
michael@0 | 34 | * Clients should use the "items" attribute. |
michael@0 | 35 | */ |
michael@0 | 36 | DOMString mozItem(in unsigned long index); |
michael@0 | 37 | |
michael@0 | 38 | /** |
michael@0 | 39 | * Add an item to the list of dynamically-managed entries. The resource |
michael@0 | 40 | * will be fetched into the application cache. |
michael@0 | 41 | * |
michael@0 | 42 | * @param uri |
michael@0 | 43 | * The resource to add. |
michael@0 | 44 | */ |
michael@0 | 45 | void mozAdd(in DOMString uri); |
michael@0 | 46 | |
michael@0 | 47 | /** |
michael@0 | 48 | * Remove an item from the list of dynamically-managed entries. If this |
michael@0 | 49 | * was the last reference to a URI in the application cache, the cache |
michael@0 | 50 | * entry will be removed. |
michael@0 | 51 | * |
michael@0 | 52 | * @param uri |
michael@0 | 53 | * The resource to remove. |
michael@0 | 54 | */ |
michael@0 | 55 | void mozRemove(in DOMString uri); |
michael@0 | 56 | |
michael@0 | 57 | /** |
michael@0 | 58 | * State of the application cache this object is associated with. |
michael@0 | 59 | */ |
michael@0 | 60 | |
michael@0 | 61 | /* This object is not associated with an application cache. */ |
michael@0 | 62 | const unsigned short UNCACHED = 0; |
michael@0 | 63 | |
michael@0 | 64 | /* The application cache is not being updated. */ |
michael@0 | 65 | const unsigned short IDLE = 1; |
michael@0 | 66 | |
michael@0 | 67 | /* The manifest is being fetched and checked for updates */ |
michael@0 | 68 | const unsigned short CHECKING = 2; |
michael@0 | 69 | |
michael@0 | 70 | /* Resources are being downloaded to be added to the cache */ |
michael@0 | 71 | const unsigned short DOWNLOADING = 3; |
michael@0 | 72 | |
michael@0 | 73 | /* There is a new version of the application cache available */ |
michael@0 | 74 | const unsigned short UPDATEREADY = 4; |
michael@0 | 75 | |
michael@0 | 76 | /* The application cache group is now obsolete. */ |
michael@0 | 77 | const unsigned short OBSOLETE = 5; |
michael@0 | 78 | |
michael@0 | 79 | readonly attribute unsigned short status; |
michael@0 | 80 | |
michael@0 | 81 | /** |
michael@0 | 82 | * Begin the application update process on the associated application cache. |
michael@0 | 83 | */ |
michael@0 | 84 | void update(); |
michael@0 | 85 | |
michael@0 | 86 | /** |
michael@0 | 87 | * Swap in the newest version of the application cache, or disassociate |
michael@0 | 88 | * from the cache if the cache group is obsolete. |
michael@0 | 89 | */ |
michael@0 | 90 | void swapCache(); |
michael@0 | 91 | |
michael@0 | 92 | /* Events */ |
michael@0 | 93 | [implicit_jscontext] attribute jsval onchecking; |
michael@0 | 94 | [implicit_jscontext] attribute jsval onerror; |
michael@0 | 95 | [implicit_jscontext] attribute jsval onnoupdate; |
michael@0 | 96 | [implicit_jscontext] attribute jsval ondownloading; |
michael@0 | 97 | [implicit_jscontext] attribute jsval onprogress; |
michael@0 | 98 | [implicit_jscontext] attribute jsval onupdateready; |
michael@0 | 99 | [implicit_jscontext] attribute jsval oncached; |
michael@0 | 100 | [implicit_jscontext] attribute jsval onobsolete; |
michael@0 | 101 | }; |