1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/OfflineResourceList.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,108 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +interface OfflineResourceList : EventTarget { 1.9 + /** 1.10 + * State of the application cache this object is associated with. 1.11 + */ 1.12 + 1.13 + /* This object is not associated with an application cache. */ 1.14 + const unsigned short UNCACHED = 0; 1.15 + 1.16 + /* The application cache is not being updated. */ 1.17 + const unsigned short IDLE = 1; 1.18 + 1.19 + /* The manifest is being fetched and checked for updates */ 1.20 + const unsigned short CHECKING = 2; 1.21 + 1.22 + /* Resources are being downloaded to be added to the cache */ 1.23 + const unsigned short DOWNLOADING = 3; 1.24 + 1.25 + /* There is a new version of the application cache available */ 1.26 + const unsigned short UPDATEREADY = 4; 1.27 + 1.28 + /* The application cache group is now obsolete. */ 1.29 + const unsigned short OBSOLETE = 5; 1.30 + 1.31 + [Throws] 1.32 + readonly attribute unsigned short status; 1.33 + 1.34 + /** 1.35 + * Begin the application update process on the associated application cache. 1.36 + */ 1.37 + [Throws] 1.38 + void update(); 1.39 + 1.40 + /** 1.41 + * Swap in the newest version of the application cache, or disassociate 1.42 + * from the cache if the cache group is obsolete. 1.43 + */ 1.44 + [Throws] 1.45 + void swapCache(); 1.46 + 1.47 + /* Events */ 1.48 + attribute EventHandler onchecking; 1.49 + attribute EventHandler onerror; 1.50 + attribute EventHandler onnoupdate; 1.51 + attribute EventHandler ondownloading; 1.52 + attribute EventHandler onprogress; 1.53 + attribute EventHandler onupdateready; 1.54 + attribute EventHandler oncached; 1.55 + attribute EventHandler onobsolete; 1.56 +}; 1.57 + 1.58 +// Mozilla extensions. 1.59 +partial interface OfflineResourceList { 1.60 + /** 1.61 + * Get the list of dynamically-managed entries. 1.62 + */ 1.63 + [Throws] 1.64 + readonly attribute DOMStringList mozItems; 1.65 + 1.66 + /** 1.67 + * Check that an entry exists in the list of dynamically-managed entries. 1.68 + * 1.69 + * @param uri 1.70 + * The resource to check. 1.71 + */ 1.72 + [Throws] 1.73 + boolean mozHasItem(DOMString uri); 1.74 + 1.75 + /** 1.76 + * Get the number of dynamically-managed entries. 1.77 + * @status DEPRECATED 1.78 + * Clients should use the "items" attribute. 1.79 + */ 1.80 + [Throws] 1.81 + readonly attribute unsigned long mozLength; 1.82 + 1.83 + /** 1.84 + * Get the URI of a dynamically-managed entry. 1.85 + * @status DEPRECATED 1.86 + * Clients should use the "items" attribute. 1.87 + */ 1.88 + [Throws] 1.89 + getter DOMString mozItem(unsigned long index); 1.90 + 1.91 + /** 1.92 + * Add an item to the list of dynamically-managed entries. The resource 1.93 + * will be fetched into the application cache. 1.94 + * 1.95 + * @param uri 1.96 + * The resource to add. 1.97 + */ 1.98 + [Throws] 1.99 + void mozAdd(DOMString uri); 1.100 + 1.101 + /** 1.102 + * Remove an item from the list of dynamically-managed entries. If this 1.103 + * was the last reference to a URI in the application cache, the cache 1.104 + * entry will be removed. 1.105 + * 1.106 + * @param uri 1.107 + * The resource to remove. 1.108 + */ 1.109 + [Throws] 1.110 + void mozRemove(DOMString uri); 1.111 +};