nsISHistoryInternal.idl 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  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 "nsISupports.idl"
  6. interface nsIBFCacheEntry;
  7. interface nsISHEntry;
  8. interface nsISHistoryListener;
  9. interface nsISHTransaction;
  10. interface nsIDocShell;
  11. interface nsIURI;
  12. %{C++
  13. #define NS_SHISTORY_INTERNAL_CID \
  14. { 0x3dfb2f54, 0x378d, 0x4d3c, \
  15. { 0xa9, 0xf9, 0x95, 0xdd, 0x26, 0x73, 0x24, 0x8c } }
  16. #define NS_SHISTORY_INTERNAL_CONTRACTID "@mozilla.org/browser/shistory-internal;1"
  17. #include "nsTArrayForwardDeclare.h"
  18. %}
  19. [ref] native nsDocshellIDArray(nsTArray<uint64_t>);
  20. [scriptable, uuid(3dfb2f54-378d-4d3c-a9f9-95dd2673248c)]
  21. interface nsISHistoryInternal: nsISupports
  22. {
  23. /**
  24. * Add a new Entry to the History List
  25. * @param aEntry - The entry to add
  26. * @param aPersist - If true this specifies that the entry should persist
  27. * in the list. If false, this means that when new entries are added
  28. * this element will not appear in the session history list.
  29. */
  30. void addEntry(in nsISHEntry aEntry, in boolean aPersist);
  31. /**
  32. * Get the root transaction
  33. */
  34. readonly attribute nsISHTransaction rootTransaction;
  35. /**
  36. * Sets the toplevel docshell object to which this SHistory object belongs to.
  37. */
  38. void setRootDocShell(in nsIDocShell rootDocShell);
  39. /**
  40. * Update the index maintained by sessionHistory
  41. */
  42. void updateIndex();
  43. /**
  44. * Replace the nsISHEntry at a particular index
  45. * @param aIndex - The index at which the entry should be replaced
  46. * @param aReplaceEntry - The replacement entry for the index.
  47. */
  48. void replaceEntry(in long aIndex, in nsISHEntry aReplaceEntry);
  49. /**
  50. * Notifies all registered session history listeners about an impending
  51. * reload.
  52. *
  53. * @param aReloadURI The URI of the document to be reloaded.
  54. * @param aReloadFlags Flags that indicate how the document is to be
  55. * refreshed. See constants on the nsIWebNavigation
  56. * interface.
  57. * @return Whether the operation can proceed.
  58. */
  59. boolean notifyOnHistoryReload(in nsIURI aReloadURI, in unsigned long aReloadFlags);
  60. /**
  61. * Evict content viewers which don't lie in the "safe" range around aIndex.
  62. * In practice, this should leave us with no more than gHistoryMaxViewers
  63. * viewers associated with this SHistory object.
  64. *
  65. * Also make sure that the total number of content viewers in all windows is
  66. * not greater than our global max; if it is, evict viewers as appropriate.
  67. *
  68. * @param aIndex - The index around which the "safe" range is centered. In
  69. * general, if you just navigated the history, aIndex should be the index
  70. * history was navigated to.
  71. */
  72. void evictOutOfRangeContentViewers(in long aIndex);
  73. /**
  74. * Evict the content viewer associated with a bfcache entry
  75. * that has timed out.
  76. */
  77. void evictExpiredContentViewerForEntry(in nsIBFCacheEntry aEntry);
  78. /**
  79. * Evict all the content viewers in this session history
  80. */
  81. void evictAllContentViewers();
  82. /**
  83. * Removes entries from the history if their docshellID is in
  84. * aIDs array.
  85. */
  86. [noscript, notxpcom] void RemoveEntries(in nsDocshellIDArray aIDs,
  87. in long aStartIndex);
  88. };