2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 18:30:37 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
2004-04-18 18:30:37 +04: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-14 00:24:54 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04: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-14 00:24:54 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 18:30:37 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-29 00:14:13 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:40:37 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 18:30:37 +04: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-29 00:14:13 +04: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 18:30:37 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-29 00:14:13 +04: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 18:30:37 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2006-03-29 22:29:03 +04:00
|
|
|
|
|
|
|
/* factory functions for rendering object classes */
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#ifndef nsHTMLParts_h___
|
|
|
|
#define nsHTMLParts_h___
|
|
|
|
|
|
|
|
#include "nscore.h"
|
|
|
|
#include "nsISupports.h"
|
|
|
|
class nsIAtom;
|
2005-09-24 22:43:15 +04:00
|
|
|
class nsNodeInfoManager;
|
1998-04-14 00:24:54 +04:00
|
|
|
class nsIContent;
|
2000-03-22 08:55:05 +03:00
|
|
|
class nsIContentIterator;
|
1998-04-14 00:24:54 +04:00
|
|
|
class nsIDocument;
|
2001-12-18 01:39:59 +03:00
|
|
|
class nsIFrame;
|
1998-04-14 00:24:54 +04:00
|
|
|
class nsIHTMLContentSink;
|
2004-10-01 02:27:45 +04:00
|
|
|
class nsIFragmentContentSink;
|
2004-08-01 03:15:21 +04:00
|
|
|
class nsPresContext;
|
2006-03-27 01:30:36 +04:00
|
|
|
class nsStyleContext;
|
1999-06-23 07:29:44 +04:00
|
|
|
class nsIURI;
|
1998-04-14 00:24:54 +04:00
|
|
|
class nsString;
|
1999-12-05 02:49:50 +03:00
|
|
|
class nsIPresShell;
|
2001-03-03 03:41:02 +03:00
|
|
|
class nsIChannel;
|
2007-11-18 21:56:49 +03:00
|
|
|
class nsTableColFrame;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2001-02-23 15:42:12 +03: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 11:15:15 +03: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
|
|
|
|
* bit is not set.
|
2001-02-23 15:42:12 +03:00
|
|
|
*/
|
|
|
|
#define NS_BLOCK_NO_AUTO_MARGINS 0x00200000
|
|
|
|
#define NS_BLOCK_MARGIN_ROOT 0x00400000
|
2009-01-05 03:39:54 +03:00
|
|
|
#define NS_BLOCK_FLOAT_MGR 0x00800000
|
2004-08-26 07:07:05 +04:00
|
|
|
#define NS_BLOCK_HAS_FIRST_LETTER_STYLE 0x20000000
|
|
|
|
#define NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET 0x40000000
|
2007-12-05 11:15:15 +03:00
|
|
|
#define NS_BLOCK_HAS_FIRST_LETTER_CHILD 0x80000000
|
2004-08-26 07:07:05 +04:00
|
|
|
// These are the bits that get inherited from a block frame to its
|
|
|
|
// next-in-flows and are not private to blocks
|
2007-09-03 11:00:10 +04:00
|
|
|
#define NS_BLOCK_FLAGS_MASK 0xF0E00000
|
2001-02-23 15:42:12 +03:00
|
|
|
|
1998-09-01 05:33:19 +04:00
|
|
|
// Factory methods for creating html layout objects
|
|
|
|
|
1999-10-08 08:32:46 +04:00
|
|
|
// Create a frame that supports "display: block" layout behavior
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags = 0);
|
1999-05-12 02:03:29 +04:00
|
|
|
|
2008-08-18 05:16:42 +04:00
|
|
|
// Special Generated Content Node. It contains text taken from an
|
|
|
|
// attribute of its *grandparent* content node.
|
2003-03-05 18:08:41 +03:00
|
|
|
nsresult
|
2005-09-24 22:43:15 +04:00
|
|
|
NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
|
|
|
|
PRInt32 aNameSpaceID, nsIAtom* aAttrName,
|
|
|
|
nsIContent** aResult);
|
1999-08-19 18:32:19 +04:00
|
|
|
|
1999-09-03 18:52:17 +04: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 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
|
1999-08-19 18:32:19 +04:00
|
|
|
|
2009-02-18 16:25:29 +03: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-12 02:03:29 +04:00
|
|
|
}
|
|
|
|
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1999-05-12 02:03:29 +04:00
|
|
|
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewCommentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1998-09-06 04:17:30 +04:00
|
|
|
|
1998-09-10 03:30:30 +04:00
|
|
|
// <frame> and <iframe>
|
2005-10-27 01:46:39 +04:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1998-09-10 03:30:30 +04:00
|
|
|
// <frameset>
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2003-03-05 18:08:41 +03:00
|
|
|
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewPositionedInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewSpacerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewEmptyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
inline nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewWBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) {
|
|
|
|
return NS_NewEmptyFrame(aPresShell, aContext);
|
1999-05-12 02:03:29 +04:00
|
|
|
}
|
2004-10-08 16:17:10 +04:00
|
|
|
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aStateFlags);
|
2004-10-08 16:17:10 +04:00
|
|
|
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1998-10-13 02:13:23 +04:00
|
|
|
|
1998-09-23 21:16:51 +04:00
|
|
|
// forms
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewImageControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewNativeTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
|
2005-11-01 23:40:54 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewIsIndexFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1999-05-12 02:03:29 +04:00
|
|
|
|
|
|
|
// Table frame factories
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2007-11-18 21:56:49 +03:00
|
|
|
nsTableColFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2005-11-04 05:38:33 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsBorderCollapse);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2003-03-05 18:08:41 +03:00
|
|
|
nsresult
|
|
|
|
NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,
|
2003-04-02 15:18:00 +04:00
|
|
|
nsIDocument* aDoc, nsIURI* aURL,
|
|
|
|
nsISupports* aContainer, // e.g. docshell
|
2003-03-05 18:08:41 +03:00
|
|
|
nsIChannel* aChannel);
|
|
|
|
nsresult
|
2004-10-01 02:27:45 +04:00
|
|
|
NS_NewHTMLFragmentContentSink(nsIFragmentContentSink** aInstancePtrResult);
|
2003-03-05 18:08:41 +03:00
|
|
|
nsresult
|
2004-10-01 02:27:45 +04:00
|
|
|
NS_NewHTMLFragmentContentSink2(nsIFragmentContentSink** aInstancePtrResult);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2006-08-12 08:46:43 +04:00
|
|
|
// This strips all but a whitelist of elements and attributes defined
|
|
|
|
// in nsContentSink.h
|
|
|
|
nsresult
|
|
|
|
NS_NewHTMLParanoidFragmentSink(nsIFragmentContentSink** aInstancePtrResult);
|
|
|
|
void
|
|
|
|
NS_HTMLParanoidFragmentSinkShutdown();
|
1998-04-14 00:24:54 +04:00
|
|
|
#endif /* nsHTMLParts_h___ */
|