2007-05-29 02:45:30 -07:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-05-29 02:45:30 -07:00
|
|
|
|
|
|
|
#include "domstubs.idl"
|
|
|
|
|
2013-07-09 10:54:21 -07:00
|
|
|
[scriptable, uuid(6044702d-e4a9-420c-b711-558b7d6a3b9f)]
|
2007-05-29 02:45:30 -07:00
|
|
|
interface nsIDOMOfflineResourceList : nsISupports
|
|
|
|
{
|
2008-01-16 13:54:33 -08:00
|
|
|
/**
|
2008-11-04 10:59:13 -08:00
|
|
|
* Get the list of dynamically-managed entries.
|
|
|
|
*/
|
2013-07-09 10:54:21 -07:00
|
|
|
readonly attribute nsISupports mozItems;
|
2008-11-04 10:59:13 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check that an entry exists in the list of dynamically-managed entries.
|
|
|
|
*
|
|
|
|
* @param uri
|
|
|
|
* The resource to check.
|
|
|
|
*/
|
2009-01-25 22:50:44 -08:00
|
|
|
boolean mozHasItem(in DOMString uri);
|
2008-11-04 10:59:13 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the number of dynamically-managed entries.
|
|
|
|
* @status DEPRECATED
|
|
|
|
* Clients should use the "items" attribute.
|
2008-01-16 13:54:33 -08:00
|
|
|
*/
|
2009-01-25 22:50:44 -08:00
|
|
|
readonly attribute unsigned long mozLength;
|
2008-11-04 10:59:13 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the URI of a dynamically-managed entry.
|
|
|
|
* @status DEPRECATED
|
|
|
|
* Clients should use the "items" attribute.
|
|
|
|
*/
|
2009-01-25 22:50:44 -08:00
|
|
|
DOMString mozItem(in unsigned long index);
|
2007-05-29 02:45:30 -07:00
|
|
|
|
2008-01-16 13:54:33 -08:00
|
|
|
/**
|
|
|
|
* Add an item to the list of dynamically-managed entries. The resource
|
|
|
|
* will be fetched into the application cache.
|
|
|
|
*
|
|
|
|
* @param uri
|
|
|
|
* The resource to add.
|
|
|
|
*/
|
2009-01-25 22:50:44 -08:00
|
|
|
void mozAdd(in DOMString uri);
|
2008-01-16 13:54:33 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove an item from the list of dynamically-managed entries. If this
|
|
|
|
* was the last reference to a URI in the application cache, the cache
|
|
|
|
* entry will be removed.
|
|
|
|
*
|
|
|
|
* @param uri
|
|
|
|
* The resource to remove.
|
|
|
|
*/
|
2009-01-25 22:50:44 -08:00
|
|
|
void mozRemove(in DOMString uri);
|
2007-05-29 02:45:30 -07:00
|
|
|
|
2008-01-16 13:54:33 -08:00
|
|
|
/**
|
|
|
|
* State of the application cache this object is associated with.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* This object is not associated with an application cache. */
|
|
|
|
const unsigned short UNCACHED = 0;
|
|
|
|
|
|
|
|
/* The application cache is not being updated. */
|
|
|
|
const unsigned short IDLE = 1;
|
|
|
|
|
|
|
|
/* The manifest is being fetched and checked for updates */
|
|
|
|
const unsigned short CHECKING = 2;
|
|
|
|
|
|
|
|
/* Resources are being downloaded to be added to the cache */
|
|
|
|
const unsigned short DOWNLOADING = 3;
|
|
|
|
|
2008-11-04 10:59:12 -08:00
|
|
|
/* There is a new version of the application cache available */
|
2008-01-16 13:54:33 -08:00
|
|
|
const unsigned short UPDATEREADY = 4;
|
|
|
|
|
2008-11-04 10:59:12 -08:00
|
|
|
/* The application cache group is now obsolete. */
|
|
|
|
const unsigned short OBSOLETE = 5;
|
|
|
|
|
2008-01-16 13:54:33 -08:00
|
|
|
readonly attribute unsigned short status;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Begin the application update process on the associated application cache.
|
|
|
|
*/
|
|
|
|
void update();
|
|
|
|
|
|
|
|
/**
|
2008-11-04 10:59:12 -08:00
|
|
|
* Swap in the newest version of the application cache, or disassociate
|
|
|
|
* from the cache if the cache group is obsolete.
|
2008-01-16 13:54:33 -08:00
|
|
|
*/
|
|
|
|
void swapCache();
|
|
|
|
|
|
|
|
/* Events */
|
2012-08-30 20:45:16 -07:00
|
|
|
[implicit_jscontext] attribute jsval onchecking;
|
|
|
|
[implicit_jscontext] attribute jsval onerror;
|
|
|
|
[implicit_jscontext] attribute jsval onnoupdate;
|
|
|
|
[implicit_jscontext] attribute jsval ondownloading;
|
|
|
|
[implicit_jscontext] attribute jsval onprogress;
|
|
|
|
[implicit_jscontext] attribute jsval onupdateready;
|
|
|
|
[implicit_jscontext] attribute jsval oncached;
|
|
|
|
[implicit_jscontext] attribute jsval onobsolete;
|
2007-05-29 02:45:30 -07:00
|
|
|
};
|