nsILoadGroup.idl 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4. *
  5. * The contents of this file are subject to the Mozilla Public License Version
  6. * 1.1 (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. * http://www.mozilla.org/MPL/
  9. *
  10. * Software distributed under the License is distributed on an "AS IS" basis,
  11. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12. * for the specific language governing rights and limitations under the
  13. * License.
  14. *
  15. * The Original Code is mozilla.org code.
  16. *
  17. * The Initial Developer of the Original Code is
  18. * Netscape Communications Corporation.
  19. * Portions created by the Initial Developer are Copyright (C) 1998
  20. * the Initial Developer. All Rights Reserved.
  21. *
  22. * Contributor(s):
  23. *
  24. * Alternatively, the contents of this file may be used under the terms of
  25. * either the GNU General Public License Version 2 or later (the "GPL"), or
  26. * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27. * in which case the provisions of the GPL or the LGPL are applicable instead
  28. * of those above. If you wish to allow use of your version of this file only
  29. * under the terms of either the GPL or the LGPL, and not to allow others to
  30. * use your version of this file under the terms of the MPL, indicate your
  31. * decision by deleting the provisions above and replace them with the notice
  32. * and other provisions required by the GPL or the LGPL. If you do not delete
  33. * the provisions above, a recipient may use your version of this file under
  34. * the terms of any one of the MPL, the GPL or the LGPL.
  35. *
  36. * ***** END LICENSE BLOCK ***** */
  37. #include "nsIRequest.idl"
  38. interface nsISimpleEnumerator;
  39. interface nsIRequestObserver;
  40. interface nsIInterfaceRequestor;
  41. /**
  42. * A load group maintains a collection of nsIRequest objects.
  43. *
  44. * @status FROZEN
  45. */
  46. [scriptable, uuid(3de0a31c-feaf-400f-9f1e-4ef71f8b20cc)]
  47. interface nsILoadGroup : nsIRequest
  48. {
  49. /**
  50. * The group observer is notified when requests are added to and removed
  51. * from this load group. The groupObserver is weak referenced.
  52. */
  53. attribute nsIRequestObserver groupObserver;
  54. /**
  55. * Accesses the default load request for the group. Each time a number
  56. * of requests are added to a group, the defaultLoadRequest may be set
  57. * to indicate that all of the requests are related to a base request.
  58. *
  59. * The load group inherits its load flags from the default load request.
  60. * If the default load request is NULL, then the group's load flags are
  61. * not changed.
  62. */
  63. attribute nsIRequest defaultLoadRequest;
  64. /**
  65. * Adds a new request to the group. This will cause the default load
  66. * flags to be applied to the request. If this is a foreground
  67. * request then the groupObserver's onStartRequest will be called.
  68. *
  69. * If the request is the default load request or if the default load
  70. * request is null, then the load group will inherit its load flags from
  71. * the request.
  72. */
  73. void addRequest(in nsIRequest aRequest,
  74. in nsISupports aContext);
  75. /**
  76. * Removes a request from the group. If this is a foreground request
  77. * then the groupObserver's onStopRequest will be called.
  78. */
  79. void removeRequest(in nsIRequest aRequest,
  80. in nsISupports aContext,
  81. in nsresult aStatus);
  82. /**
  83. * Returns the requests contained directly in this group.
  84. * Enumerator element type: nsIRequest.
  85. */
  86. readonly attribute nsISimpleEnumerator requests;
  87. /**
  88. * Returns the count of "active" requests (ie. requests without the
  89. * LOAD_BACKGROUND bit set).
  90. */
  91. readonly attribute unsigned long activeCount;
  92. /**
  93. * Notification callbacks for the load group.
  94. */
  95. attribute nsIInterfaceRequestor notificationCallbacks;
  96. };