michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* factory functions for rendering object classes */ michael@0: michael@0: #ifndef nsHTMLParts_h___ michael@0: #define nsHTMLParts_h___ michael@0: michael@0: #include "nscore.h" michael@0: #include "nsISupports.h" michael@0: #include "nsIFrame.h" michael@0: class nsIAtom; michael@0: class nsNodeInfoManager; michael@0: class nsIContent; michael@0: class nsIContentIterator; michael@0: class nsIDocument; michael@0: class nsIFrame; michael@0: class nsIHTMLContentSink; michael@0: class nsIFragmentContentSink; michael@0: class nsStyleContext; michael@0: class nsIURI; michael@0: class nsString; michael@0: class nsIPresShell; michael@0: class nsIChannel; michael@0: class nsTableColFrame; michael@0: michael@0: // These are all the block specific frame bits, they are copied from michael@0: // the prev-in-flow to a newly created next-in-flow, except for the michael@0: // NS_BLOCK_FLAGS_NON_INHERITED_MASK bits below. michael@0: #define NS_BLOCK_FLAGS_MASK (NS_BLOCK_MARGIN_ROOT | \ michael@0: NS_BLOCK_FLOAT_MGR | \ michael@0: NS_BLOCK_CLIP_PAGINATED_OVERFLOW | \ michael@0: NS_BLOCK_HAS_FIRST_LETTER_STYLE | \ michael@0: NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \ michael@0: NS_BLOCK_HAS_FIRST_LETTER_CHILD | \ michael@0: NS_BLOCK_FRAME_HAS_INSIDE_BULLET) michael@0: michael@0: // This is the subset of NS_BLOCK_FLAGS_MASK that is NOT inherited michael@0: // by default. They should only be set on the first-in-flow. michael@0: // See nsBlockFrame::Init. michael@0: #define NS_BLOCK_FLAGS_NON_INHERITED_MASK \ michael@0: (NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \ michael@0: NS_BLOCK_HAS_FIRST_LETTER_CHILD | \ michael@0: NS_BLOCK_FRAME_HAS_INSIDE_BULLET) michael@0: michael@0: // Factory methods for creating html layout objects michael@0: michael@0: // Create a frame that supports "display: block" layout behavior michael@0: nsIFrame* michael@0: NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags = nsFrameState(0)); michael@0: michael@0: // Special Generated Content Node. It contains text taken from an michael@0: // attribute of its *grandparent* content node. michael@0: nsresult michael@0: NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager, michael@0: int32_t aNameSpaceID, nsIAtom* aAttrName, michael@0: nsIContent** aResult); michael@0: michael@0: // Create a basic area frame but the GetFrameForPoint is overridden to always michael@0: // return the option frame michael@0: // By default, area frames will extend michael@0: // their height to cover any children that "stick out". michael@0: nsIFrame* michael@0: NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags); michael@0: michael@0: // Create a block formatting context blockframe michael@0: inline nsIFrame* NS_NewBlockFormattingContext(nsIPresShell* aPresShell, michael@0: nsStyleContext* aStyleContext) michael@0: { michael@0: return NS_NewBlockFrame(aPresShell, aStyleContext, michael@0: NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT); michael@0: } michael@0: michael@0: nsIFrame* michael@0: NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); michael@0: michael@0: nsIFrame* michael@0: NS_NewCommentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); michael@0: michael@0: // and