Bug 451040 ? Passwords Manager Empty after convert to MozStorage. r=gavin
[wine-gecko.git] / layout / generic / nsHTMLParts.h
blobc69c9c17780561e6fd258fcb363719612c39f8c4
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 class nsIAtom;
46 class nsNodeInfoManager;
47 class nsIContent;
48 class nsIContentIterator;
49 class nsIDocument;
50 class nsIFrame;
51 class nsIHTMLContentSink;
52 class nsIFragmentContentSink;
53 class nsPresContext;
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.
73 #define NS_BLOCK_NO_AUTO_MARGINS 0x00200000
74 #define NS_BLOCK_MARGIN_ROOT 0x00400000
75 #define NS_BLOCK_SPACE_MGR 0x00800000
76 #define NS_BLOCK_HAS_FIRST_LETTER_STYLE 0x20000000
77 #define NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET 0x40000000
78 #define NS_BLOCK_HAS_FIRST_LETTER_CHILD 0x80000000
79 // These are the bits that get inherited from a block frame to its
80 // next-in-flows and are not private to blocks
81 #define NS_BLOCK_FLAGS_MASK 0xF0E00000
83 // Factory methods for creating html layout objects
85 // These are variations on AreaFrame with slightly different layout
86 // policies.
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 basic area frame.
107 nsIFrame*
108 NS_NewAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
110 // These AreaFrame's shrink wrap around their contents
111 inline nsIFrame*
112 NS_NewTableCellInnerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
113 return NS_NewBlockFrame(aPresShell, aContext);
116 // This type of AreaFrame is the document root, a margin root, and the
117 // initial containing block for absolutely positioned elements
118 inline nsIFrame*
119 NS_NewDocumentElementFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
120 return NS_NewAreaFrame(aPresShell, aContext, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
123 // This type of AreaFrame is a margin root, but does not shrink wrap
124 inline nsIFrame*
125 NS_NewAbsoluteItemWrapperFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
126 return NS_NewAreaFrame(aPresShell, aContext, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
129 // This type of AreaFrame shrink wraps
130 inline nsIFrame*
131 NS_NewFloatingItemWrapperFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
132 return NS_NewAreaFrame(aPresShell, aContext,
133 NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
136 // This type of AreaFrame doesn't use its own space manager and
137 // doesn't shrink wrap.
138 inline nsIFrame*
139 NS_NewRelativeItemWrapperFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags) {
140 return NS_NewAreaFrame(aPresShell, aContext, aFlags);
143 nsIFrame*
144 NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
146 nsIFrame*
147 NS_NewCommentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
149 // <frame> and <iframe>
150 nsIFrame*
151 NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
152 // <frameset>
153 nsIFrame*
154 NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
156 nsIFrame*
157 NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
158 nsIFrame*
159 NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
160 nsIFrame*
161 NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
162 nsIFrame*
163 NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
164 nsIFrame*
165 NS_NewPositionedInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
166 nsIFrame*
167 NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
168 nsIFrame*
169 NS_NewSpacerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
170 nsIFrame*
171 NS_NewTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
172 nsIFrame*
173 NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
174 nsIFrame*
175 NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
176 inline nsIFrame*
177 NS_NewWBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
178 return NS_NewEmptyFrame(aPresShell, aContext);
181 nsIFrame*
182 NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aStateFlags);
184 nsIFrame*
185 NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
186 nsIFrame*
187 NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
188 nsIFrame*
189 NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
190 nsIFrame*
191 NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
192 nsIFrame*
193 NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
194 nsIFrame*
195 NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
197 // forms
198 nsIFrame*
199 NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
200 nsIFrame*
201 NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
202 nsIFrame*
203 NS_NewImageControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
204 nsIFrame*
205 NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
206 nsIFrame*
207 NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
208 nsIFrame*
209 NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
210 nsIFrame*
211 NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
212 nsIFrame*
213 NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
214 nsIFrame*
215 NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
216 nsIFrame*
217 NS_NewNativeTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
218 nsIFrame*
219 NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
220 nsIFrame*
221 NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
222 nsIFrame*
223 NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
224 nsIFrame*
225 NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
226 nsIFrame*
227 NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
228 nsIFrame*
229 NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
230 nsIFrame*
231 NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
232 nsIFrame*
233 NS_NewIsIndexFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
235 // Table frame factories
236 nsIFrame*
237 NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
238 nsIFrame*
239 NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
240 nsIFrame*
241 NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
242 nsTableColFrame*
243 NS_NewTableColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
244 nsIFrame*
245 NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
246 nsIFrame*
247 NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
248 nsIFrame*
249 NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
250 nsIFrame*
251 NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsBorderCollapse);
253 nsresult
254 NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,
255 nsIDocument* aDoc, nsIURI* aURL,
256 nsISupports* aContainer, // e.g. docshell
257 nsIChannel* aChannel);
258 nsresult
259 NS_NewHTMLFragmentContentSink(nsIFragmentContentSink** aInstancePtrResult);
260 nsresult
261 NS_NewHTMLFragmentContentSink2(nsIFragmentContentSink** aInstancePtrResult);
263 // This strips all but a whitelist of elements and attributes defined
264 // in nsContentSink.h
265 nsresult
266 NS_NewHTMLParanoidFragmentSink(nsIFragmentContentSink** aInstancePtrResult);
267 void
268 NS_HTMLParanoidFragmentSinkShutdown();
269 #endif /* nsHTMLParts_h___ */