Bug 575870 - Enable the firefox button on xp themed, classic, and aero basic. r=dao...
[mozilla-central.git] / layout / generic / nsHTMLParts.h
blobefccd3a2f9e30a85d084df32ab1a2ad423f96eab
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.org 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 /* factory functions for rendering object classes */
40 #ifndef nsHTMLParts_h___
41 #define nsHTMLParts_h___
43 #include "nscore.h"
44 #include "nsISupports.h"
45 #include "nsIFrame.h"
46 class nsIAtom;
47 class nsNodeInfoManager;
48 class nsIContent;
49 class nsIContentIterator;
50 class nsIDocument;
51 class nsIFrame;
52 class nsIHTMLContentSink;
53 class nsIFragmentContentSink;
54 class nsStyleContext;
55 class nsIURI;
56 class nsString;
57 class nsIPresShell;
58 class nsIChannel;
59 class nsTableColFrame;
61 /**
62 * Additional frame-state bits used by nsBlockFrame
63 * See the meanings at http://www.mozilla.org/newlayout/doc/block-and-line.html
65 * NS_BLOCK_HAS_FIRST_LETTER_STYLE means that the block has first-letter style,
66 * even if it has no actual first-letter frame among its descendants.
68 * NS_BLOCK_HAS_FIRST_LETTER_CHILD means that there is an inflow first-letter
69 * frame among the block's descendants. If there is a floating first-letter
70 * frame, or the block has first-letter style but has no first letter, this
71 * bit is not set. This bit is set on the first continuation only.
73 #define NS_BLOCK_MARGIN_ROOT NS_FRAME_STATE_BIT(22)
74 #define NS_BLOCK_FLOAT_MGR NS_FRAME_STATE_BIT(23)
75 #define NS_BLOCK_HAS_FIRST_LETTER_STYLE NS_FRAME_STATE_BIT(29)
76 #define NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET NS_FRAME_STATE_BIT(30)
77 #define NS_BLOCK_HAS_FIRST_LETTER_CHILD NS_FRAME_STATE_BIT(31)
78 // These are the bits that get inherited from a block frame to its
79 // next-in-flows and are not private to blocks
80 #define NS_BLOCK_FLAGS_MASK (NS_BLOCK_MARGIN_ROOT | \
81 NS_BLOCK_FLOAT_MGR | \
82 NS_BLOCK_HAS_FIRST_LETTER_STYLE | \
83 NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \
84 NS_BLOCK_HAS_FIRST_LETTER_CHILD)
86 // Factory methods for creating html layout objects
88 // Create a frame that supports "display: block" layout behavior
89 nsIFrame*
90 NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags = 0);
92 // Special Generated Content Node. It contains text taken from an
93 // attribute of its *grandparent* content node.
94 nsresult
95 NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
96 PRInt32 aNameSpaceID, nsIAtom* aAttrName,
97 nsIContent** aResult);
99 // Create a basic area frame but the GetFrameForPoint is overridden to always
100 // return the option frame
101 // By default, area frames will extend
102 // their height to cover any children that "stick out".
103 nsIFrame*
104 NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
106 // Create a block formatting context blockframe
107 inline nsIFrame* NS_NewBlockFormattingContext(nsIPresShell* aPresShell,
108 nsStyleContext* aStyleContext)
110 return NS_NewBlockFrame(aPresShell, aStyleContext,
111 NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT);
114 nsIFrame*
115 NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
117 nsIFrame*
118 NS_NewCommentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
120 // <frame> and <iframe>
121 nsIFrame*
122 NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
123 // <frameset>
124 nsIFrame*
125 NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
127 nsIFrame*
128 NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
129 nsIFrame*
130 NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
131 nsIFrame*
132 NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
133 nsIFrame*
134 NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
135 nsIFrame*
136 NS_NewPositionedInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
137 nsIFrame*
138 NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
139 nsIFrame*
140 NS_NewTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
141 nsIFrame*
142 NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
143 nsIFrame*
144 NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
145 inline nsIFrame*
146 NS_NewWBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
147 return NS_NewEmptyFrame(aPresShell, aContext);
150 nsIFrame*
151 NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aStateFlags);
153 nsIFrame*
154 NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
155 nsIFrame*
156 NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
157 nsIFrame*
158 NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
159 nsIFrame*
160 NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
161 nsIFrame*
162 NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
163 nsIFrame*
164 NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
166 // forms
167 nsIFrame*
168 NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
169 nsIFrame*
170 NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
171 nsIFrame*
172 NS_NewImageControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
173 nsIFrame*
174 NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
175 nsIFrame*
176 NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
177 nsIFrame*
178 NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
179 nsIFrame*
180 NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
181 nsIFrame*
182 NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
183 nsIFrame*
184 NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
185 nsIFrame*
186 NS_NewNativeTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
187 nsIFrame*
188 NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
189 nsIFrame*
190 NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
191 nsIFrame*
192 NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
193 nsIFrame*
194 NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
195 nsIFrame*
196 NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
197 nsIFrame*
198 NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
199 nsIFrame*
200 NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
201 nsIFrame*
202 NS_NewIsIndexFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
204 // Table frame factories
205 nsIFrame*
206 NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
207 nsIFrame*
208 NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
209 nsIFrame*
210 NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
211 nsTableColFrame*
212 NS_NewTableColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
213 nsIFrame*
214 NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
215 nsIFrame*
216 NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
217 nsIFrame*
218 NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
219 nsIFrame*
220 NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsBorderCollapse);
222 nsresult
223 NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,
224 nsIDocument* aDoc, nsIURI* aURL,
225 nsISupports* aContainer, // e.g. docshell
226 nsIChannel* aChannel);
227 nsresult
228 NS_NewHTMLFragmentContentSink(nsIFragmentContentSink** aInstancePtrResult);
229 nsresult
230 NS_NewHTMLFragmentContentSink2(nsIFragmentContentSink** aInstancePtrResult);
232 // This strips all but a whitelist of elements and attributes defined
233 // in nsContentSink.h
234 nsresult
235 NS_NewHTMLParanoidFragmentSink(nsIFragmentContentSink** aInstancePtrResult);
236 nsresult
237 NS_NewHTMLParanoidFragmentSink2(nsIFragmentContentSink** aInstancePtrResult);
238 void
239 NS_HTMLParanoidFragmentSinkShutdown();
240 #endif /* nsHTMLParts_h___ */