nsIDocShellTreeOwner.idl (3410B)
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 7 #include "nsISupports.idl" 8 9 /** 10 * The nsIDocShellTreeOwner 11 */ 12 13 interface nsIDocShellTreeItem; 14 interface nsIRemoteTab; 15 webidl BrowsingContext; 16 17 [scriptable, uuid(0e3dc4b1-4cea-4a37-af71-79f0afd07574)] 18 interface nsIDocShellTreeOwner : nsISupports 19 { 20 /** 21 * Called when a content shell is added to the docshell tree. This is 22 * _only_ called for "root" content shells (that is, ones whose parent is a 23 * chrome shell). 24 * 25 * @param aContentShell the shell being added. 26 * @param aPrimary whether the shell is primary. 27 */ 28 void contentShellAdded(in nsIDocShellTreeItem aContentShell, 29 in boolean aPrimary); 30 31 /** 32 * Called when a content shell is removed from the docshell tree. This is 33 * _only_ called for "root" content shells (that is, ones whose parent is a 34 * chrome shell). Note that if aContentShell was never added, 35 * contentShellRemoved should just do nothing. 36 * 37 * @param aContentShell the shell being removed. 38 */ 39 void contentShellRemoved(in nsIDocShellTreeItem aContentShell); 40 41 /* 42 Returns the Primary Content Shell 43 */ 44 readonly attribute nsIDocShellTreeItem primaryContentShell; 45 46 void remoteTabAdded(in nsIRemoteTab aTab, in boolean aPrimary); 47 void remoteTabRemoved(in nsIRemoteTab aTab); 48 49 /* 50 In multiprocess case we may not have primaryContentShell but 51 primaryRemoteTab. 52 */ 53 readonly attribute nsIRemoteTab primaryRemoteTab; 54 55 /* 56 Get the BrowsingContext associated with either the primary content shell or 57 primary remote tab, depending on which is available. 58 */ 59 readonly attribute BrowsingContext primaryContentBrowsingContext; 60 61 /* 62 Tells the tree owner to size its window or parent window in such a way 63 that the shell passed along will be the size specified. 64 */ 65 [can_run_script] 66 void sizeShellTo(in nsIDocShellTreeItem shell, in long cx, in long cy); 67 68 /* 69 Gets the size of the primary content area in device pixels. This should work 70 for both in-process and out-of-process content areas. 71 */ 72 void getPrimaryContentSize(out long width, out long height); 73 /* 74 Sets the size of the primary content area in device pixels. This should work 75 for both in-process and out-of-process content areas. 76 */ 77 void setPrimaryContentSize(in long width, in long height); 78 79 /* 80 Gets the size of the root docshell in device pixels. 81 */ 82 void getRootShellSize(out long width, out long height); 83 /* 84 Sets the size of the root docshell in device pixels. 85 */ 86 void setRootShellSize(in long width, in long height); 87 88 /* 89 Sets the persistence of different attributes of the window. 90 */ 91 void setPersistence(in boolean aPersistPosition, 92 in boolean aPersistSize, 93 in boolean aPersistSizeMode); 94 95 /* 96 Gets the current persistence states of the window. 97 */ 98 void getPersistence(out boolean aPersistPosition, 99 out boolean aPersistSize, 100 out boolean aPersistSizeMode); 101 102 /* 103 Returns true if there is a primary content shell or a primary 104 remote tab. 105 */ 106 readonly attribute boolean hasPrimaryContent; 107 };