nsIGlobalHistory2.idl 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* -*- Mode: C++; tab-width: 4; 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. /**
  6. * Provides information about global history to gecko.
  7. *
  8. * @note This interface replaces and deprecates nsIGlobalHistory.
  9. */
  10. #include "nsISupports.idl"
  11. interface nsIURI;
  12. %{ C++
  13. // nsIObserver topic to fire when you add new visited URIs to the history;
  14. // the nsIURI is the subject
  15. #define NS_LINK_VISITED_EVENT_TOPIC "link-visited"
  16. %}
  17. [scriptable, uuid(cf777d42-1270-4b34-be7b-2931c93feda5)]
  18. interface nsIGlobalHistory2 : nsISupports
  19. {
  20. /**
  21. * Add a URI to global history
  22. *
  23. * @param aURI the URI of the page
  24. * @param aRedirect whether the URI was redirected to another location;
  25. * this is 'true' for the original URI which is
  26. * redirected.
  27. * @param aToplevel whether the URI is loaded in a top-level window
  28. * @param aReferrer the URI of the referring page
  29. *
  30. * @note Docshell will not filter out URI schemes like chrome: data:
  31. * about: and view-source:. Embedders should consider filtering out
  32. * these schemes and others, e.g. mailbox: for the main URI and the
  33. * referrer.
  34. */
  35. void addURI(in nsIURI aURI, in boolean aRedirect, in boolean aToplevel, in nsIURI aReferrer);
  36. /**
  37. * Checks to see whether the given URI is in history.
  38. *
  39. * @param aURI the uri to the page
  40. * @return true if a URI has been visited
  41. */
  42. boolean isVisited(in nsIURI aURI);
  43. /**
  44. * Set the page title for the given uri. URIs that are not already in
  45. * global history will not be added.
  46. *
  47. * @param aURI the URI for which to set to the title
  48. * @param aTitle the page title
  49. */
  50. void setPageTitle(in nsIURI aURI, in AString aTitle);
  51. };