dom/interfaces/offline/nsIDOMOfflineResourceList.idl

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

mercurial