1999-12-02 14:54:40 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 15:12:37 +04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-12-02 14:54:40 +03:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
2007-05-07 01:06:28 +04:00
|
|
|
|
|
|
|
interface nsIDocShellTreeItem;
|
1999-12-02 14:54:40 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The nsIDocShellTreeNode supplies the methods for interacting with children
|
|
|
|
* of a docshell. These are essentially the methods that turn a single docshell
|
|
|
|
* into a docshell tree.
|
|
|
|
*/
|
|
|
|
|
2007-05-07 01:06:28 +04:00
|
|
|
/*
|
|
|
|
* Long-term, we probably want to merge this interface into
|
|
|
|
* nsIDocShellTreeItem. Need to eliminate uses of this interface
|
|
|
|
* first.
|
|
|
|
*/
|
2004-12-08 20:32:06 +03:00
|
|
|
|
2005-01-11 22:36:40 +03:00
|
|
|
[scriptable, uuid(37f1ab73-f224-44b1-82f0-d2834ab1cec0)]
|
1999-12-02 14:54:40 +03:00
|
|
|
interface nsIDocShellTreeNode : nsISupports
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
The current number of DocShells which are immediate children of the
|
|
|
|
this object.
|
|
|
|
*/
|
|
|
|
readonly attribute long childCount;
|
|
|
|
|
|
|
|
/*
|
1999-12-03 13:00:23 +03:00
|
|
|
Add a new child DocShellTreeItem. Adds to the end of the list.
|
2004-12-08 20:32:06 +03:00
|
|
|
Note that this does NOT take a reference to the child. The child stays
|
|
|
|
alive only as long as it's referenced from outside the docshell tree.
|
|
|
|
@throws NS_ERROR_ILLEGAL_VALUE if child corresponds to the same
|
2007-05-07 01:06:28 +04:00
|
|
|
object as this treenode or an ancestor of this treenode
|
|
|
|
@throws NS_ERROR_UNEXPECTED if this node is a leaf in the tree.
|
1999-12-02 14:54:40 +03:00
|
|
|
*/
|
1999-12-03 13:00:23 +03:00
|
|
|
void addChild(in nsIDocShellTreeItem child);
|
1999-12-02 14:54:40 +03:00
|
|
|
|
|
|
|
/*
|
1999-12-03 13:00:23 +03:00
|
|
|
Removes a child DocShellTreeItem.
|
2007-05-07 01:06:28 +04:00
|
|
|
@throws NS_ERROR_UNEXPECTED if this node is a leaf in the tree.
|
1999-12-02 14:54:40 +03:00
|
|
|
*/
|
1999-12-03 13:00:23 +03:00
|
|
|
void removeChild(in nsIDocShellTreeItem child);
|
1999-12-02 14:54:40 +03:00
|
|
|
|
2007-05-07 01:06:28 +04:00
|
|
|
/**
|
|
|
|
* Return the child at the index requested. This is 0-based.
|
|
|
|
*
|
|
|
|
* @throws NS_ERROR_UNEXPECTED if the index is out of range
|
|
|
|
*/
|
1999-12-12 13:14:41 +03:00
|
|
|
nsIDocShellTreeItem getChildAt(in long index);
|
1999-12-02 14:54:40 +03:00
|
|
|
|
|
|
|
/*
|
1999-12-03 13:00:23 +03:00
|
|
|
Return the child DocShellTreeItem with the specified name.
|
1999-12-12 13:14:41 +03:00
|
|
|
aName - This is the name of the item that is trying to be found.
|
|
|
|
aRecurse - Is used to tell the function to recurse through children.
|
|
|
|
Note, recursion will only happen through items of the same type.
|
2000-03-11 03:55:39 +03:00
|
|
|
aSameType - If this is set only children of the same type will be returned.
|
1999-12-12 13:14:41 +03:00
|
|
|
aRequestor - This is the docshellTreeItem that is requesting the find. This
|
|
|
|
parameter is used when recursion is being used to avoid searching the same
|
|
|
|
tree again when a child has asked a parent to search for children.
|
2005-01-11 22:36:40 +03:00
|
|
|
aOriginalRequestor - The original treeitem that made the request, if any.
|
|
|
|
This is used to ensure that we don't run into cross-site issues.
|
1999-12-12 13:14:41 +03:00
|
|
|
|
1999-12-18 05:18:21 +03:00
|
|
|
Note the search is depth first when recursing.
|
1999-12-02 14:54:40 +03:00
|
|
|
*/
|
2005-01-11 22:36:40 +03:00
|
|
|
nsIDocShellTreeItem findChildWithName(in wstring aName,
|
|
|
|
in boolean aRecurse,
|
|
|
|
in boolean aSameType,
|
|
|
|
in nsIDocShellTreeItem aRequestor,
|
|
|
|
in nsIDocShellTreeItem aOriginalRequestor);
|
1999-12-02 14:54:40 +03:00
|
|
|
};
|
|
|
|
|