Bug 460926 A11y hierachy is broken on Ubuntu 8.10 (GNOME 2.24), r=Evan.Yan sr=roc
[wine-gecko.git] / content / xul / document / public / nsIXULDocument.h
blobbcc30d03a72381b28e5c924c7bf724c3efee8d0f
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is Mozilla Communicator client code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #ifndef nsIXULDocument_h___
39 #define nsIXULDocument_h___
41 #include "nsISupports.h"
42 #include "nsString.h"
43 #include "nsCOMArray.h"
45 class nsIXULTemplateBuilder;
46 class nsIContent;
47 class nsIScriptGlobalObjectOwner;
50 // {AF676EDD-1FB9-4C75-9B1F-CB4E02E1C779}
51 #define NS_IXULDOCUMENT_IID \
52 { 0xaf676edd, 0x1fb9, 0x4c75, \
53 { 0x9b, 0x1f, 0xcb, 0x4e, 0x02, 0xe1, 0xc7, 0x79 } }
57 * An XUL-specific extension to nsIDocument. Includes methods for
58 * setting the root resource of the document content model, a factory
59 * method for constructing the children of a node, etc.
61 class nsIXULDocument : public nsISupports
63 public:
64 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXULDOCUMENT_IID)
66 // The resource-to-element map is a one-to-many mapping of RDF
67 // resources to content elements.
69 /**
70 * Add an entry to the ID-to-element map.
72 NS_IMETHOD AddElementForID(nsIContent* aElement) = 0;
74 /**
75 * Get the elements for a particular resource --- all elements whose 'id'
76 * or 'ref' is aID. The nsCOMArray will be truncated and filled in with
77 * nsIContent pointers.
79 NS_IMETHOD GetElementsForID(const nsAString& aID, nsCOMArray<nsIContent>& aElements) = 0;
81 /**
82 * Get the nsIScriptGlobalObjectOwner for this document.
84 NS_IMETHOD GetScriptGlobalObjectOwner(nsIScriptGlobalObjectOwner** aGlobalOwner) = 0;
86 /**
87 * Notify the XUL document that a subtree has been added
89 NS_IMETHOD AddSubtreeToDocument(nsIContent* aElement) = 0;
91 /**
92 * Notify the XUL document that a subtree has been removed
94 NS_IMETHOD RemoveSubtreeFromDocument(nsIContent* aElement) = 0;
96 /**
97 * Attach a XUL template builder to the specified content node.
98 * @param aBuilder the template builder to attach, or null if
99 * the builder is to be removed.
101 NS_IMETHOD SetTemplateBuilderFor(nsIContent* aContent, nsIXULTemplateBuilder* aBuilder) = 0;
104 * Retrieve the XUL template builder that's attached to a content
105 * node.
107 NS_IMETHOD GetTemplateBuilderFor(nsIContent* aContent, nsIXULTemplateBuilder** aResult) = 0;
110 * This is invoked whenever the prototype for this document is loaded
111 * and should be walked, regardless of whether the XUL cache is
112 * disabled, whether the protototype was loaded, whether the
113 * prototype was loaded from the cache or created by parsing the
114 * actual XUL source, etc.
116 * @param aResumeWalk whether this should also call ResumeWalk().
117 * Sometimes the caller of OnPrototypeLoadDone resumes the walk itself
119 NS_IMETHOD OnPrototypeLoadDone(PRBool aResumeWalk) = 0;
122 * Callback notifying when a document could not be parsed properly.
124 virtual PRBool OnDocumentParserError() = 0;
127 NS_DEFINE_STATIC_IID_ACCESSOR(nsIXULDocument, NS_IXULDOCUMENT_IID)
129 // factory functions
130 nsresult NS_NewXULDocument(nsIXULDocument** result);
132 #endif // nsIXULDocument_h___