Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this
4 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 :
6 : /* factory functions for rendering object classes */
7 :
8 : #ifndef nsHTMLParts_h___
9 : #define nsHTMLParts_h___
10 :
11 : #include "nscore.h"
12 : #include "nsISupports.h"
13 : #include "nsIFrame.h"
14 : class nsComboboxControlFrame;
15 : class nsIAtom;
16 : class nsNodeInfoManager;
17 : class nsIContent;
18 : class nsIDocument;
19 : class nsIFrame;
20 : class nsIHTMLContentSink;
21 : class nsIFragmentContentSink;
22 : class nsStyleContext;
23 : class nsIURI;
24 : class nsIPresShell;
25 : class nsIChannel;
26 : class nsTableColFrame;
27 : namespace mozilla {
28 : class ViewportFrame;
29 : } // namespace mozilla
30 :
31 : // These are all the block specific frame bits, they are copied from
32 : // the prev-in-flow to a newly created next-in-flow, except for the
33 : // NS_BLOCK_FLAGS_NON_INHERITED_MASK bits below.
34 : #define NS_BLOCK_FLAGS_MASK (NS_BLOCK_FORMATTING_CONTEXT_STATE_BITS | \
35 : NS_BLOCK_CLIP_PAGINATED_OVERFLOW | \
36 : NS_BLOCK_HAS_FIRST_LETTER_STYLE | \
37 : NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \
38 : NS_BLOCK_HAS_FIRST_LETTER_CHILD | \
39 : NS_BLOCK_FRAME_HAS_INSIDE_BULLET)
40 :
41 : // This is the subset of NS_BLOCK_FLAGS_MASK that is NOT inherited
42 : // by default. They should only be set on the first-in-flow.
43 : // See nsBlockFrame::Init.
44 : #define NS_BLOCK_FLAGS_NON_INHERITED_MASK \
45 : (NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \
46 : NS_BLOCK_HAS_FIRST_LETTER_CHILD | \
47 : NS_BLOCK_FRAME_HAS_INSIDE_BULLET)
48 :
49 : // Factory methods for creating html layout objects
50 :
51 : // Create a frame that supports "display: block" layout behavior
52 : class nsBlockFrame;
53 : nsBlockFrame*
54 : NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
55 :
56 : // Special Generated Content Node. It contains text taken from an
57 : // attribute of its *grandparent* content node.
58 : nsresult
59 : NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
60 : int32_t aNameSpaceID, nsIAtom* aAttrName,
61 : nsIContent** aResult);
62 :
63 : // Create a basic area frame but the GetFrameForPoint is overridden to always
64 : // return the option frame
65 : // By default, area frames will extend
66 : // their height to cover any children that "stick out".
67 : nsContainerFrame*
68 : NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags);
69 :
70 : // Create a block formatting context blockframe
71 : nsBlockFrame*
72 : NS_NewBlockFormattingContext(nsIPresShell* aPresShell, nsStyleContext* aStyleContext);
73 :
74 : nsIFrame*
75 : NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
76 :
77 : nsIFrame*
78 : NS_NewCommentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
79 :
80 : // <frame> and <iframe>
81 : nsIFrame*
82 : NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
83 : // <frameset>
84 : nsIFrame*
85 : NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
86 :
87 : mozilla::ViewportFrame*
88 : NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
89 : class nsCanvasFrame;
90 : nsCanvasFrame*
91 : NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
92 : nsIFrame*
93 : NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
94 : class nsInlineFrame;
95 : nsInlineFrame*
96 : NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
97 : nsIFrame*
98 : NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
99 : nsIFrame*
100 : NS_NewTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
101 : nsIFrame*
102 : NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
103 : nsIFrame*
104 : NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
105 : inline nsIFrame*
106 0 : NS_NewWBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
107 0 : return NS_NewEmptyFrame(aPresShell, aContext);
108 : }
109 :
110 : nsContainerFrame*
111 : NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aStateFlags);
112 :
113 : class nsSimplePageSequenceFrame;
114 : nsSimplePageSequenceFrame*
115 : NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
116 : class nsPageFrame;
117 : nsPageFrame*
118 : NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
119 : class nsPageContentFrame;
120 : nsPageContentFrame*
121 : NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
122 : nsIFrame*
123 : NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
124 : class nsFirstLetterFrame;
125 : nsFirstLetterFrame*
126 : NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
127 : class nsFirstLineFrame;
128 : nsFirstLineFrame*
129 : NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
130 :
131 : // forms
132 : nsContainerFrame*
133 : NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
134 : nsIFrame*
135 : NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
136 : nsIFrame*
137 : NS_NewImageControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
138 : nsContainerFrame*
139 : NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
140 : nsIFrame*
141 : NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
142 : nsIFrame*
143 : NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
144 : nsContainerFrame*
145 : NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
146 : nsIFrame*
147 : NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
148 : nsIFrame*
149 : NS_NewColorControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
150 : nsIFrame*
151 : NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
152 : nsIFrame*
153 : NS_NewNativeTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
154 : nsIFrame*
155 : NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
156 : nsIFrame*
157 : NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
158 : nsIFrame*
159 : NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
160 : nsIFrame*
161 : NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
162 : nsIFrame*
163 : NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
164 : nsContainerFrame*
165 : NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
166 : nsComboboxControlFrame*
167 : NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags);
168 : nsIFrame*
169 : NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
170 : nsIFrame*
171 : NS_NewMeterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
172 : nsIFrame*
173 : NS_NewRangeFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
174 : nsIFrame*
175 : NS_NewNumberControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
176 : nsIFrame*
177 : NS_NewDateTimeControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
178 : nsBlockFrame*
179 : NS_NewDetailsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
180 :
181 : // Table frame factories
182 : class nsTableWrapperFrame;
183 : nsTableWrapperFrame*
184 : NS_NewTableWrapperFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
185 : class nsTableFrame;
186 : nsTableFrame*
187 : NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
188 : nsTableColFrame*
189 : NS_NewTableColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
190 : class nsTableColGroupFrame;
191 : nsTableColGroupFrame*
192 : NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
193 : class nsTableRowFrame;
194 : nsTableRowFrame*
195 : NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
196 : class nsTableRowGroupFrame;
197 : nsTableRowGroupFrame*
198 : NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
199 : class nsTableCellFrame;
200 : nsTableCellFrame*
201 : NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsTableFrame* aTableFrame);
202 :
203 : nsresult
204 : NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,
205 : nsIDocument* aDoc, nsIURI* aURL,
206 : nsISupports* aContainer, // e.g. docshell
207 : nsIChannel* aChannel);
208 : nsresult
209 : NS_NewHTMLFragmentContentSink(nsIFragmentContentSink** aInstancePtrResult);
210 : nsresult
211 : NS_NewHTMLFragmentContentSink2(nsIFragmentContentSink** aInstancePtrResult);
212 :
213 : #endif /* nsHTMLParts_h___ */
|