nsIRefreshURI.idl 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. #include "nsISupports.idl"
  7. interface nsIChannel;
  8. interface nsIPrincipal;
  9. interface nsIURI;
  10. [scriptable, uuid(a5e61a3c-51bd-45be-ac0c-e87b71860656)]
  11. interface nsIRefreshURI : nsISupports {
  12. /**
  13. * Load a uri after waiting for aMillis milliseconds. If the docshell
  14. * is busy loading a page currently, the refresh request will be
  15. * queued and executed when the current load finishes.
  16. *
  17. * @param aUri The uri to refresh.
  18. * @param aPrincipal The triggeringPrincipal for the refresh load
  19. * May be null, in which case the principal of current document will be
  20. * applied.
  21. * @param aMillis The number of milliseconds to wait.
  22. * @param aRepeat Flag to indicate if the uri is to be
  23. * repeatedly refreshed every aMillis milliseconds.
  24. * @param aMetaRefresh Flag to indicate if this is a Meta refresh.
  25. */
  26. void refreshURI(in nsIURI aURI,
  27. in long aMillis, in boolean aRepeat,
  28. in boolean aMetaRefresh,
  29. [optional] in nsIPrincipal aPrincipal);
  30. /**
  31. * Loads a URI immediately as if it were a refresh.
  32. *
  33. * @param aURI The URI to refresh.
  34. * @param aPrincipal The triggeringPrincipal for the refresh load
  35. * May be null, in which case the principal of current document will be
  36. * applied.
  37. * @param aMillis The number of milliseconds by which this refresh would
  38. * be delayed if it were not being forced.
  39. * @param aMetaRefresh Flag to indicate if this is a meta refresh.
  40. */
  41. void forceRefreshURI(in nsIURI aURI,
  42. in long aMillis, in boolean aMetaRefresh,
  43. [optional] in nsIPrincipal aPrincipal);
  44. /**
  45. * Checks the passed in channel to see if there is a refresh header,
  46. * if there is, will setup a timer to refresh the uri found
  47. * in the header. If docshell is busy loading a page currently, the
  48. * request will be queued and executed when the current page
  49. * finishes loading.
  50. *
  51. * Returns the NS_REFRESHURI_HEADER_FOUND success code if a refresh
  52. * header was found and successfully setup.
  53. *
  54. * @param aChannel The channel to be parsed.
  55. */
  56. void setupRefreshURI(in nsIChannel aChannel);
  57. /**
  58. * Parses the passed in header string and sets up a refreshURI if
  59. * a "refresh" header is found. If docshell is busy loading a page
  60. * currently, the request will be queued and executed when
  61. * the current page finishes loading.
  62. *
  63. * @param aBaseURI base URI to resolve refresh uri with.
  64. * @param aPrincipal The triggeringPrincipal for the refresh load
  65. * May be null, in which case the principal of current document will be
  66. * applied.
  67. * @param aHeader The meta refresh header string.
  68. */
  69. void setupRefreshURIFromHeader(in nsIURI aBaseURI,
  70. in nsIPrincipal principal,
  71. in ACString aHeader);
  72. /**
  73. * Cancels all timer loads.
  74. */
  75. void cancelRefreshURITimers();
  76. /**
  77. * True when there are pending refreshes, false otherwise.
  78. */
  79. readonly attribute boolean refreshPending;
  80. };