2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/* factory functions for rendering object classes */
|
|
|
|
|
|
|
|
#ifndef nsHTMLParts_h___
|
|
|
|
#define nsHTMLParts_h___
|
|
|
|
|
|
|
|
#include "nscore.h"
|
|
|
|
#include "nsISupports.h"
|
2010-06-08 22:28:14 -07:00
|
|
|
#include "nsIFrame.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
class nsIAtom;
|
|
|
|
class nsNodeInfoManager;
|
|
|
|
class nsIContent;
|
|
|
|
class nsIContentIterator;
|
|
|
|
class nsIDocument;
|
|
|
|
class nsIFrame;
|
|
|
|
class nsIHTMLContentSink;
|
|
|
|
class nsIFragmentContentSink;
|
|
|
|
class nsStyleContext;
|
|
|
|
class nsIURI;
|
|
|
|
class nsString;
|
|
|
|
class nsIPresShell;
|
|
|
|
class nsIChannel;
|
2007-11-18 10:56:49 -08:00
|
|
|
class nsTableColFrame;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-03-07 17:57:37 -08:00
|
|
|
// These are all the block specific frame bits, they are copied from
|
|
|
|
// the prev-in-flow to a newly created next-in-flow, except for the
|
|
|
|
// NS_BLOCK_FLAGS_NON_INHERITED_MASK bits below.
|
|
|
|
#define NS_BLOCK_FLAGS_MASK (NS_BLOCK_MARGIN_ROOT | \
|
|
|
|
NS_BLOCK_FLOAT_MGR | \
|
|
|
|
NS_BLOCK_CLIP_PAGINATED_OVERFLOW | \
|
|
|
|
NS_BLOCK_HAS_FIRST_LETTER_STYLE | \
|
|
|
|
NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \
|
|
|
|
NS_BLOCK_HAS_FIRST_LETTER_CHILD | \
|
|
|
|
NS_BLOCK_FRAME_HAS_INSIDE_BULLET)
|
|
|
|
|
|
|
|
// This is the subset of NS_BLOCK_FLAGS_MASK that is NOT inherited
|
|
|
|
// by default. They should only be set on the first-in-flow.
|
|
|
|
// See nsBlockFrame::Init.
|
|
|
|
#define NS_BLOCK_FLAGS_NON_INHERITED_MASK \
|
|
|
|
(NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \
|
|
|
|
NS_BLOCK_HAS_FIRST_LETTER_CHILD | \
|
|
|
|
NS_BLOCK_FRAME_HAS_INSIDE_BULLET)
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Factory methods for creating html layout objects
|
|
|
|
|
|
|
|
// Create a frame that supports "display: block" layout behavior
|
|
|
|
nsIFrame*
|
2014-02-04 17:59:39 -08:00
|
|
|
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags = nsFrameState(0));
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-08-17 18:16:42 -07:00
|
|
|
// Special Generated Content Node. It contains text taken from an
|
|
|
|
// attribute of its *grandparent* content node.
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult
|
|
|
|
NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t aNameSpaceID, nsIAtom* aAttrName,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIContent** aResult);
|
|
|
|
|
|
|
|
// Create a basic area frame but the GetFrameForPoint is overridden to always
|
|
|
|
// return the option frame
|
|
|
|
// By default, area frames will extend
|
|
|
|
// their height to cover any children that "stick out".
|
|
|
|
nsIFrame*
|
2014-02-04 17:59:39 -08:00
|
|
|
NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-02-18 05:25:29 -08:00
|
|
|
// Create a block formatting context blockframe
|
|
|
|
inline nsIFrame* NS_NewBlockFormattingContext(nsIPresShell* aPresShell,
|
|
|
|
nsStyleContext* aStyleContext)
|
|
|
|
{
|
|
|
|
return NS_NewBlockFrame(aPresShell, aStyleContext,
|
|
|
|
NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewCommentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
|
|
|
|
// <frame> and <iframe>
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
// <frameset>
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
inline nsIFrame*
|
|
|
|
NS_NewWBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
|
|
|
|
return NS_NewEmptyFrame(aPresShell, aContext);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsIFrame*
|
2014-02-04 17:59:39 -08:00
|
|
|
NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aStateFlags);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
|
|
|
|
// forms
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewImageControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
2013-07-09 15:25:27 -07:00
|
|
|
NS_NewColorControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewNativeTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
2014-02-04 17:59:39 -08:00
|
|
|
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags);
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIFrame*
|
2011-05-10 05:59:07 -07:00
|
|
|
NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2012-05-16 08:47:10 -07:00
|
|
|
nsIFrame*
|
|
|
|
NS_NewMeterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2013-02-16 09:57:21 -08:00
|
|
|
nsIFrame*
|
|
|
|
NS_NewRangeFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2013-09-04 03:30:36 -07:00
|
|
|
nsIFrame*
|
|
|
|
NS_NewNumberControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Table frame factories
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2007-11-18 10:56:49 -08:00
|
|
|
nsTableColFrame*
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_NewTableColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
2011-09-28 23:19:26 -07:00
|
|
|
NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsBorderCollapse);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,
|
|
|
|
nsIDocument* aDoc, nsIURI* aURL,
|
|
|
|
nsISupports* aContainer, // e.g. docshell
|
|
|
|
nsIChannel* aChannel);
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLFragmentContentSink(nsIFragmentContentSink** aInstancePtrResult);
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLFragmentContentSink2(nsIFragmentContentSink** aInstancePtrResult);
|
|
|
|
|
|
|
|
#endif /* nsHTMLParts_h___ */
|