nsIDOMOfflineResourceList.idl 2.9 KB

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