2007-06-12 10:10:23 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2004-04-18 18:30:37 +04:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* 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/
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
1999-09-21 06:12:01 +04:00
|
|
|
* The Original Code is Mozilla MathML Project.
|
2004-04-18 18:30:37 +04:00
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* The University Of Queensland.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1999
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-09-21 06:12:01 +04:00
|
|
|
* Roger B. Sidje <rbs@maths.uq.edu.au>
|
2004-04-18 18:30:37 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* 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"),
|
|
|
|
* 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
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* 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
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-09-21 06:12:01 +04:00
|
|
|
|
2002-08-17 01:36:31 +04:00
|
|
|
#ifndef nsMathMLTokenFrame_h___
|
|
|
|
#define nsMathMLTokenFrame_h___
|
1999-09-21 06:12:01 +04:00
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsMathMLContainerFrame.h"
|
|
|
|
|
|
|
|
//
|
2002-08-17 01:36:31 +04:00
|
|
|
// Base class to handle token elements
|
1999-09-21 06:12:01 +04:00
|
|
|
//
|
|
|
|
|
2002-08-17 01:36:31 +04:00
|
|
|
class nsMathMLTokenFrame : public nsMathMLContainerFrame {
|
1999-09-21 06:12:01 +04:00
|
|
|
public:
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2006-03-27 01:30:36 +04:00
|
|
|
friend nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1999-09-21 06:12:01 +04:00
|
|
|
|
2011-03-25 06:38:59 +03:00
|
|
|
NS_IMETHOD
|
|
|
|
TransmitAutomaticData() {
|
|
|
|
// The REC defines the following elements to be space-like:
|
|
|
|
// * an mtext, mspace, maligngroup, or malignmark element;
|
|
|
|
if (mContent->Tag() == nsGkAtoms::mtext_) {
|
|
|
|
mPresentationData.flags |= NS_MATHML_SPACE_LIKE;
|
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-05-13 01:37:03 +04:00
|
|
|
NS_IMETHOD
|
|
|
|
InheritAutomaticData(nsIFrame* aParent);
|
|
|
|
|
2006-08-15 08:49:43 +04:00
|
|
|
virtual eMathMLFrameType GetMathMLFrameType();
|
2002-08-17 01:36:31 +04:00
|
|
|
|
|
|
|
NS_IMETHOD
|
2006-03-09 21:55:21 +03:00
|
|
|
Init(nsIContent* aContent,
|
2002-08-17 01:36:31 +04:00
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow);
|
|
|
|
|
|
|
|
NS_IMETHOD
|
2011-08-25 00:54:30 +04:00
|
|
|
SetInitialChildList(ChildListID aListID,
|
2009-07-28 16:53:20 +04:00
|
|
|
nsFrameList& aChildList);
|
2000-01-07 17:49:46 +03:00
|
|
|
|
|
|
|
NS_IMETHOD
|
2004-08-01 03:15:21 +04:00
|
|
|
Reflow(nsPresContext* aPresContext,
|
2000-01-07 17:49:46 +03:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
2008-03-18 07:52:48 +03:00
|
|
|
virtual nsresult
|
2011-04-08 05:04:40 +04:00
|
|
|
Place(nsRenderingContext& aRenderingContext,
|
2000-01-07 17:49:46 +03:00
|
|
|
PRBool aPlaceOrigin,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize);
|
|
|
|
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
virtual void MarkIntrinsicWidthsDirty();
|
2002-02-07 07:38:08 +03:00
|
|
|
|
2002-08-17 01:36:31 +04:00
|
|
|
NS_IMETHOD
|
2005-09-07 20:49:21 +04:00
|
|
|
AttributeChanged(PRInt32 aNameSpaceID,
|
2002-08-17 01:36:31 +04:00
|
|
|
nsIAtom* aAttribute,
|
2003-07-12 01:16:12 +04:00
|
|
|
PRInt32 aModType);
|
2006-09-25 04:08:41 +04:00
|
|
|
|
|
|
|
virtual nsresult
|
|
|
|
ChildListChanged(PRInt32 aModType)
|
|
|
|
{
|
2008-01-27 05:49:47 +03:00
|
|
|
ProcessTextData();
|
2006-09-25 04:08:41 +04:00
|
|
|
return nsMathMLContainerFrame::ChildListChanged(aModType);
|
|
|
|
}
|
|
|
|
|
1999-09-21 06:12:01 +04:00
|
|
|
protected:
|
2006-03-27 01:30:36 +04:00
|
|
|
nsMathMLTokenFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
|
2002-08-17 01:36:31 +04:00
|
|
|
virtual ~nsMathMLTokenFrame();
|
2002-02-07 07:38:08 +03:00
|
|
|
|
1999-09-21 06:12:01 +04:00
|
|
|
virtual PRIntn GetSkipSides() const { return 0; }
|
2002-02-07 07:38:08 +03:00
|
|
|
|
2002-08-17 01:36:31 +04:00
|
|
|
// hook to perform MathML-specific actions depending on the tag
|
2008-01-27 05:49:47 +03:00
|
|
|
virtual void ProcessTextData();
|
2002-08-17 01:36:31 +04:00
|
|
|
|
|
|
|
// helper to set the style of <mi> which has to be italic or normal
|
|
|
|
// depending on its textual content
|
2006-09-25 07:14:18 +04:00
|
|
|
PRBool SetTextStyle();
|
2002-08-17 01:36:31 +04:00
|
|
|
|
|
|
|
// helper to set the quotes of <ms>
|
2009-10-07 08:28:41 +04:00
|
|
|
void SetQuotes(PRBool aNotify);
|
1999-09-21 06:12:01 +04:00
|
|
|
};
|
|
|
|
|
2002-08-17 01:36:31 +04:00
|
|
|
#endif /* nsMathMLTokentFrame_h___ */
|