1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/generic/nsHTMLParts.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,200 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/* factory functions for rendering object classes */ 1.10 + 1.11 +#ifndef nsHTMLParts_h___ 1.12 +#define nsHTMLParts_h___ 1.13 + 1.14 +#include "nscore.h" 1.15 +#include "nsISupports.h" 1.16 +#include "nsIFrame.h" 1.17 +class nsIAtom; 1.18 +class nsNodeInfoManager; 1.19 +class nsIContent; 1.20 +class nsIContentIterator; 1.21 +class nsIDocument; 1.22 +class nsIFrame; 1.23 +class nsIHTMLContentSink; 1.24 +class nsIFragmentContentSink; 1.25 +class nsStyleContext; 1.26 +class nsIURI; 1.27 +class nsString; 1.28 +class nsIPresShell; 1.29 +class nsIChannel; 1.30 +class nsTableColFrame; 1.31 + 1.32 +// These are all the block specific frame bits, they are copied from 1.33 +// the prev-in-flow to a newly created next-in-flow, except for the 1.34 +// NS_BLOCK_FLAGS_NON_INHERITED_MASK bits below. 1.35 +#define NS_BLOCK_FLAGS_MASK (NS_BLOCK_MARGIN_ROOT | \ 1.36 + NS_BLOCK_FLOAT_MGR | \ 1.37 + NS_BLOCK_CLIP_PAGINATED_OVERFLOW | \ 1.38 + NS_BLOCK_HAS_FIRST_LETTER_STYLE | \ 1.39 + NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \ 1.40 + NS_BLOCK_HAS_FIRST_LETTER_CHILD | \ 1.41 + NS_BLOCK_FRAME_HAS_INSIDE_BULLET) 1.42 + 1.43 +// This is the subset of NS_BLOCK_FLAGS_MASK that is NOT inherited 1.44 +// by default. They should only be set on the first-in-flow. 1.45 +// See nsBlockFrame::Init. 1.46 +#define NS_BLOCK_FLAGS_NON_INHERITED_MASK \ 1.47 + (NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \ 1.48 + NS_BLOCK_HAS_FIRST_LETTER_CHILD | \ 1.49 + NS_BLOCK_FRAME_HAS_INSIDE_BULLET) 1.50 + 1.51 +// Factory methods for creating html layout objects 1.52 + 1.53 +// Create a frame that supports "display: block" layout behavior 1.54 +nsIFrame* 1.55 +NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags = nsFrameState(0)); 1.56 + 1.57 +// Special Generated Content Node. It contains text taken from an 1.58 +// attribute of its *grandparent* content node. 1.59 +nsresult 1.60 +NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager, 1.61 + int32_t aNameSpaceID, nsIAtom* aAttrName, 1.62 + nsIContent** aResult); 1.63 + 1.64 +// Create a basic area frame but the GetFrameForPoint is overridden to always 1.65 +// return the option frame 1.66 +// By default, area frames will extend 1.67 +// their height to cover any children that "stick out". 1.68 +nsIFrame* 1.69 +NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags); 1.70 + 1.71 +// Create a block formatting context blockframe 1.72 +inline nsIFrame* NS_NewBlockFormattingContext(nsIPresShell* aPresShell, 1.73 + nsStyleContext* aStyleContext) 1.74 +{ 1.75 + return NS_NewBlockFrame(aPresShell, aStyleContext, 1.76 + NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT); 1.77 +} 1.78 + 1.79 +nsIFrame* 1.80 +NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.81 + 1.82 +nsIFrame* 1.83 +NS_NewCommentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.84 + 1.85 +// <frame> and <iframe> 1.86 +nsIFrame* 1.87 +NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.88 +// <frameset> 1.89 +nsIFrame* 1.90 +NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.91 + 1.92 +nsIFrame* 1.93 +NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.94 +nsIFrame* 1.95 +NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.96 +nsIFrame* 1.97 +NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.98 +nsIFrame* 1.99 +NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.100 +nsIFrame* 1.101 +NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.102 +nsIFrame* 1.103 +NS_NewTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.104 +nsIFrame* 1.105 +NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.106 +nsIFrame* 1.107 +NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.108 +inline nsIFrame* 1.109 +NS_NewWBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { 1.110 + return NS_NewEmptyFrame(aPresShell, aContext); 1.111 +} 1.112 + 1.113 +nsIFrame* 1.114 +NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aStateFlags); 1.115 + 1.116 +nsIFrame* 1.117 +NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.118 +nsIFrame* 1.119 +NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.120 +nsIFrame* 1.121 +NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.122 +nsIFrame* 1.123 +NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.124 +nsIFrame* 1.125 +NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.126 +nsIFrame* 1.127 +NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.128 + 1.129 +// forms 1.130 +nsIFrame* 1.131 +NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.132 +nsIFrame* 1.133 +NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.134 +nsIFrame* 1.135 +NS_NewImageControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.136 +nsIFrame* 1.137 +NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.138 +nsIFrame* 1.139 +NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.140 +nsIFrame* 1.141 +NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.142 +nsIFrame* 1.143 +NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.144 +nsIFrame* 1.145 +NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.146 +nsIFrame* 1.147 +NS_NewColorControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.148 +nsIFrame* 1.149 +NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.150 +nsIFrame* 1.151 +NS_NewNativeTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.152 +nsIFrame* 1.153 +NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.154 +nsIFrame* 1.155 +NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.156 +nsIFrame* 1.157 +NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.158 +nsIFrame* 1.159 +NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.160 +nsIFrame* 1.161 +NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.162 +nsIFrame* 1.163 +NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.164 +nsIFrame* 1.165 +NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags); 1.166 +nsIFrame* 1.167 +NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.168 +nsIFrame* 1.169 +NS_NewMeterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.170 +nsIFrame* 1.171 +NS_NewRangeFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.172 +nsIFrame* 1.173 +NS_NewNumberControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.174 + 1.175 +// Table frame factories 1.176 +nsIFrame* 1.177 +NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.178 +nsIFrame* 1.179 +NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.180 +nsIFrame* 1.181 +NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.182 +nsTableColFrame* 1.183 +NS_NewTableColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.184 +nsIFrame* 1.185 +NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.186 +nsIFrame* 1.187 +NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.188 +nsIFrame* 1.189 +NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.190 +nsIFrame* 1.191 +NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsBorderCollapse); 1.192 + 1.193 +nsresult 1.194 +NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult, 1.195 + nsIDocument* aDoc, nsIURI* aURL, 1.196 + nsISupports* aContainer, // e.g. docshell 1.197 + nsIChannel* aChannel); 1.198 +nsresult 1.199 +NS_NewHTMLFragmentContentSink(nsIFragmentContentSink** aInstancePtrResult); 1.200 +nsresult 1.201 +NS_NewHTMLFragmentContentSink2(nsIFragmentContentSink** aInstancePtrResult); 1.202 + 1.203 +#endif /* nsHTMLParts_h___ */