nsIDocShellTreeOwner.idl 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. /**
  8. * The nsIDocShellTreeOwner
  9. */
  10. interface nsIDocShellTreeItem;
  11. interface nsITabParent;
  12. [scriptable, uuid(0e3dc4b1-4cea-4a37-af71-79f0afd07574)]
  13. interface nsIDocShellTreeOwner : nsISupports
  14. {
  15. /**
  16. * Called when a content shell is added to the docshell tree. This is
  17. * _only_ called for "root" content shells (that is, ones whose parent is a
  18. * chrome shell).
  19. *
  20. * @param aContentShell the shell being added.
  21. * @param aPrimary whether the shell is primary.
  22. * @param aTargetable whether the shell can be a target for named window
  23. * targeting.
  24. * @param aID the "id" of the shell. What this actually means is
  25. * undefined. Don't rely on this for anything.
  26. */
  27. void contentShellAdded(in nsIDocShellTreeItem aContentShell,
  28. in boolean aPrimary, in boolean aTargetable,
  29. in AString aID);
  30. /**
  31. * Called when a content shell is removed from the docshell tree. This is
  32. * _only_ called for "root" content shells (that is, ones whose parent is a
  33. * chrome shell). Note that if aContentShell was never added,
  34. * contentShellRemoved should just do nothing.
  35. *
  36. * @param aContentShell the shell being removed.
  37. */
  38. void contentShellRemoved(in nsIDocShellTreeItem aContentShell);
  39. /*
  40. Returns the Primary Content Shell
  41. */
  42. readonly attribute nsIDocShellTreeItem primaryContentShell;
  43. void tabParentAdded(in nsITabParent aTab, in boolean aPrimary);
  44. void tabParentRemoved(in nsITabParent aTab);
  45. /*
  46. In multiprocess case we may not have primaryContentShell but
  47. primaryTabParent.
  48. */
  49. readonly attribute nsITabParent primaryTabParent;
  50. /*
  51. Tells the tree owner to size its window or parent window in such a way
  52. that the shell passed along will be the size specified.
  53. */
  54. void sizeShellTo(in nsIDocShellTreeItem shell, in long cx, in long cy);
  55. /*
  56. Gets the size of the primary content area in CSS pixels. This should work
  57. for both in-process and out-of-process content areas.
  58. */
  59. void getPrimaryContentSize(out long width, out long height);
  60. /*
  61. Sets the size of the primary content area in CSS pixels. This should work
  62. for both in-process and out-of-process content areas.
  63. */
  64. void setPrimaryContentSize(in long width, in long height);
  65. /*
  66. Gets the size of the root docshell in CSS pixels.
  67. */
  68. void getRootShellSize(out long width, out long height);
  69. /*
  70. Sets the size of the root docshell in CSS pixels.
  71. */
  72. void setRootShellSize(in long width, in long height);
  73. /*
  74. Sets the persistence of different attributes of the window.
  75. */
  76. void setPersistence(in boolean aPersistPosition,
  77. in boolean aPersistSize,
  78. in boolean aPersistSizeMode);
  79. /*
  80. Gets the current persistence states of the window.
  81. */
  82. void getPersistence(out boolean aPersistPosition,
  83. out boolean aPersistSize,
  84. out boolean aPersistSizeMode);
  85. /*
  86. Gets the number of targettable docshells.
  87. */
  88. readonly attribute unsigned long targetableShellCount;
  89. /*
  90. Returns true if there is a primary content shell or a primary
  91. tab parent.
  92. */
  93. readonly attribute bool hasPrimaryContent;
  94. };