Back to index

lightning-sunbird  0.9+nobinonly
nsIDocShellTreeNode.idl
Go to the documentation of this file.
00001 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is the Mozilla browser.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications, Inc.
00020  * Portions created by the Initial Developer are Copyright (C) 1999
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   Travis Bogard <travis@netscape.com>
00025  *   Steve Clark <buster@netscape.com>
00026  *
00027  * Alternatively, the contents of this file may be used under the terms of
00028  * either of the GNU General Public License Version 2 or later (the "GPL"),
00029  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00030  * in which case the provisions of the GPL or the LGPL are applicable instead
00031  * of those above. If you wish to allow use of your version of this file only
00032  * under the terms of either the GPL or the LGPL, and not to allow others to
00033  * use your version of this file under the terms of the MPL, indicate your
00034  * decision by deleting the provisions above and replace them with the notice
00035  * and other provisions required by the GPL or the LGPL. If you do not delete
00036  * the provisions above, a recipient may use your version of this file under
00037  * the terms of any one of the MPL, the GPL or the LGPL.
00038  *
00039  * ***** END LICENSE BLOCK ***** */
00040 
00041 #include "nsISupports.idl"
00042 #include "nsIDocShellTreeItem.idl"
00043 
00050 // XXXbz this interface should probably inherit from nsIDocShellTreeItem, and
00051 // some methods should move from there to here...
00052 
00053 [scriptable, uuid(37f1ab73-f224-44b1-82f0-d2834ab1cec0)]
00054 interface nsIDocShellTreeNode : nsISupports
00055 {
00056        /*
00057        The current number of DocShells which are immediate children of the 
00058        this object.
00059        */
00060        readonly attribute long childCount;
00061 
00062        /*
00063        Add a new child DocShellTreeItem.  Adds to the end of the list.
00064        Note that this does NOT take a reference to the child.  The child stays
00065        alive only as long as it's referenced from outside the docshell tree.
00066        @throws NS_ERROR_ILLEGAL_VALUE if child corresponds to the same
00067                object as this treenode or an ancestor of this treenode.
00068        // XXXbz this should take an nsIDocShellTreeNode, I think.
00069        */
00070        void addChild(in nsIDocShellTreeItem child);
00071 
00072        /*
00073        Removes a child DocShellTreeItem.
00074        // XXXbz this should take an nsIDocShellTreeNode, I think.
00075        */
00076        void removeChild(in nsIDocShellTreeItem child);
00077 
00078        /* Return the child at the index requested.  This is 0-based.*/
00079        nsIDocShellTreeItem getChildAt(in long index);
00080 
00081        /*
00082        Return the child DocShellTreeItem with the specified name.
00083        aName - This is the name of the item that is trying to be found.
00084        aRecurse - Is used to tell the function to recurse through children.
00085               Note, recursion will only happen through items of the same type.
00086        aSameType - If this is set only children of the same type will be returned.
00087        aRequestor - This is the docshellTreeItem that is requesting the find.  This
00088               parameter is used when recursion is being used to avoid searching the same
00089               tree again when a child has asked a parent to search for children.
00090        aOriginalRequestor - The original treeitem that made the request, if any.
00091        This is used to ensure that we don't run into cross-site issues.
00092 
00093        Note the search is depth first when recursing.
00094        // XXXbz this should return an nsIDocShellTreeNode, I think.
00095        */
00096        nsIDocShellTreeItem findChildWithName(in wstring aName,
00097                                              in boolean aRecurse,
00098                                              in boolean aSameType,
00099                                              in nsIDocShellTreeItem aRequestor,
00100                                              in nsIDocShellTreeItem aOriginalRequestor);
00101 };
00102