2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 14:30:37 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-04-13 20:24:54 +00:00
|
|
|
*
|
2004-04-18 14:30:37 +00:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
1998-04-13 20:24:54 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1998-04-13 20:24:54 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 14:30:37 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-28 20:14:13 +00:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 03:40:37 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 14:30:37 +00:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-28 20:14:13 +00:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-18 14:30:37 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-28 20:14:13 +00:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-18 14:30:37 +00:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-28 20:14:13 +00:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2006-03-29 18:29:03 +00:00
|
|
|
|
|
|
|
/* factory functions for rendering object classes */
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
#ifndef nsHTMLParts_h___
|
|
|
|
#define nsHTMLParts_h___
|
|
|
|
|
|
|
|
#include "nscore.h"
|
|
|
|
#include "nsISupports.h"
|
2010-06-09 05:28:14 +00:00
|
|
|
#include "nsIFrame.h"
|
1998-04-13 20:24:54 +00:00
|
|
|
class nsIAtom;
|
2005-09-24 18:43:15 +00:00
|
|
|
class nsNodeInfoManager;
|
1998-04-13 20:24:54 +00:00
|
|
|
class nsIContent;
|
2000-03-22 05:55:05 +00:00
|
|
|
class nsIContentIterator;
|
1998-04-13 20:24:54 +00:00
|
|
|
class nsIDocument;
|
2001-12-17 22:39:59 +00:00
|
|
|
class nsIFrame;
|
1998-04-13 20:24:54 +00:00
|
|
|
class nsIHTMLContentSink;
|
2004-09-30 22:27:45 +00:00
|
|
|
class nsIFragmentContentSink;
|
2006-03-26 21:30:36 +00:00
|
|
|
class nsStyleContext;
|
1999-06-23 03:29:44 +00:00
|
|
|
class nsIURI;
|
1998-04-13 20:24:54 +00:00
|
|
|
class nsString;
|
1999-12-04 23:49:50 +00:00
|
|
|
class nsIPresShell;
|
2001-03-03 00:41:02 +00:00
|
|
|
class nsIChannel;
|
2007-11-18 18:56:49 +00:00
|
|
|
class nsTableColFrame;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2001-02-23 12:42:12 +00:00
|
|
|
/**
|
|
|
|
* Additional frame-state bits used by nsBlockFrame
|
|
|
|
* See the meanings at http://www.mozilla.org/newlayout/doc/block-and-line.html
|
2007-12-05 08:15:15 +00:00
|
|
|
*
|
2010-11-30 18:19:57 +00:00
|
|
|
* NS_BLOCK_CLIP_PAGINATED_OVERFLOW is only set in paginated prescontexts, on
|
|
|
|
* blocks which were forced to not have scrollframes but still need to clip
|
|
|
|
* the display of their kids.
|
|
|
|
*
|
2007-12-05 08:15:15 +00:00
|
|
|
* NS_BLOCK_HAS_FIRST_LETTER_STYLE means that the block has first-letter style,
|
|
|
|
* even if it has no actual first-letter frame among its descendants.
|
|
|
|
*
|
|
|
|
* NS_BLOCK_HAS_FIRST_LETTER_CHILD means that there is an inflow first-letter
|
|
|
|
* frame among the block's descendants. If there is a floating first-letter
|
|
|
|
* frame, or the block has first-letter style but has no first letter, this
|
2009-12-22 23:44:35 +00:00
|
|
|
* bit is not set. This bit is set on the first continuation only.
|
2001-02-23 12:42:12 +00:00
|
|
|
*/
|
2010-06-09 05:28:14 +00:00
|
|
|
#define NS_BLOCK_MARGIN_ROOT NS_FRAME_STATE_BIT(22)
|
|
|
|
#define NS_BLOCK_FLOAT_MGR NS_FRAME_STATE_BIT(23)
|
2010-11-30 18:19:57 +00:00
|
|
|
#define NS_BLOCK_CLIP_PAGINATED_OVERFLOW NS_FRAME_STATE_BIT(28)
|
2010-06-09 05:28:14 +00:00
|
|
|
#define NS_BLOCK_HAS_FIRST_LETTER_STYLE NS_FRAME_STATE_BIT(29)
|
|
|
|
#define NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET NS_FRAME_STATE_BIT(30)
|
|
|
|
#define NS_BLOCK_HAS_FIRST_LETTER_CHILD NS_FRAME_STATE_BIT(31)
|
2004-08-26 03:07:05 +00:00
|
|
|
// These are the bits that get inherited from a block frame to its
|
|
|
|
// next-in-flows and are not private to blocks
|
2010-06-09 05:28:14 +00:00
|
|
|
#define NS_BLOCK_FLAGS_MASK (NS_BLOCK_MARGIN_ROOT | \
|
2010-06-09 05:28:14 +00:00
|
|
|
NS_BLOCK_FLOAT_MGR | \
|
2010-11-30 18:19:57 +00:00
|
|
|
NS_BLOCK_CLIP_PAGINATED_OVERFLOW | \
|
2010-06-09 05:28:14 +00:00
|
|
|
NS_BLOCK_HAS_FIRST_LETTER_STYLE | \
|
|
|
|
NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET | \
|
|
|
|
NS_BLOCK_HAS_FIRST_LETTER_CHILD)
|
2001-02-23 12:42:12 +00:00
|
|
|
|
1998-09-01 01:33:19 +00:00
|
|
|
// Factory methods for creating html layout objects
|
|
|
|
|
1999-10-08 04:32:46 +00:00
|
|
|
// Create a frame that supports "display: block" layout behavior
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags = 0);
|
1999-05-11 22:03:29 +00:00
|
|
|
|
2008-08-18 01:16:42 +00:00
|
|
|
// Special Generated Content Node. It contains text taken from an
|
|
|
|
// attribute of its *grandparent* content node.
|
2003-03-05 15:08:41 +00:00
|
|
|
nsresult
|
2005-09-24 18:43:15 +00:00
|
|
|
NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
|
|
|
|
PRInt32 aNameSpaceID, nsIAtom* aAttrName,
|
|
|
|
nsIContent** aResult);
|
1999-08-19 14:32:19 +00:00
|
|
|
|
1999-09-03 14:52:17 +00:00
|
|
|
// 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".
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
|
1999-08-19 14:32:19 +00:00
|
|
|
|
2009-02-18 13:25:29 +00: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);
|
1999-05-11 22:03:29 +00:00
|
|
|
}
|
|
|
|
|
2005-11-01 20:40:54 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1999-05-11 22:03:29 +00:00
|
|
|
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewCommentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1998-09-06 00:17:30 +00:00
|
|
|
|
1998-09-09 23:30:30 +00:00
|
|
|
// <frame> and <iframe>
|
2005-10-26 21:46:39 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1998-09-09 23:30:30 +00:00
|
|
|
// <frameset>
|
2005-11-01 20:40:54 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2003-03-05 15:08:41 +00:00
|
|
|
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 20:40:54 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2011-06-01 20:18:15 +00:00
|
|
|
NS_NewPositionedInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 20:40:54 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 20:40:54 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 20:40:54 +00:00
|
|
|
inline nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewWBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
|
|
|
|
return NS_NewEmptyFrame(aPresShell, aContext);
|
1999-05-11 22:03:29 +00:00
|
|
|
}
|
2004-10-08 12:17:10 +00:00
|
|
|
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aStateFlags);
|
2004-10-08 12:17:10 +00:00
|
|
|
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1998-10-12 22:13:23 +00:00
|
|
|
|
1998-09-23 17:16:51 +00:00
|
|
|
// forms
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 20:40:54 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewImageControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 20:40:54 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 20:40:54 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewNativeTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 20:40:54 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
|
2005-11-01 20:40:54 +00:00
|
|
|
nsIFrame*
|
2011-05-10 12:59:07 +00:00
|
|
|
NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1999-05-11 22:03:29 +00:00
|
|
|
|
|
|
|
// Table frame factories
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2007-11-18 18:56:49 +00:00
|
|
|
nsTableColFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewTableColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 02:38:33 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsBorderCollapse);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
2003-03-05 15:08:41 +00:00
|
|
|
nsresult
|
|
|
|
NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,
|
2003-04-02 11:18:00 +00:00
|
|
|
nsIDocument* aDoc, nsIURI* aURL,
|
|
|
|
nsISupports* aContainer, // e.g. docshell
|
2003-03-05 15:08:41 +00:00
|
|
|
nsIChannel* aChannel);
|
|
|
|
nsresult
|
2004-09-30 22:27:45 +00:00
|
|
|
NS_NewHTMLFragmentContentSink(nsIFragmentContentSink** aInstancePtrResult);
|
2003-03-05 15:08:41 +00:00
|
|
|
nsresult
|
2004-09-30 22:27:45 +00:00
|
|
|
NS_NewHTMLFragmentContentSink2(nsIFragmentContentSink** aInstancePtrResult);
|
1998-04-13 20:24:54 +00:00
|
|
|
|
|
|
|
#endif /* nsHTMLParts_h___ */
|