2007-06-11 23:10:23 -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
|
|
|
|
|
|
|
#ifndef nsMathMLmoFrame_h___
|
|
|
|
#define nsMathMLmoFrame_h___
|
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsMathMLTokenFrame.h"
|
2013-08-30 14:37:12 -07:00
|
|
|
#include "nsMathMLChar.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
//
|
|
|
|
// <mo> -- operator, fence, or separator
|
|
|
|
//
|
|
|
|
|
|
|
|
class nsMathMLmoFrame : public nsMathMLTokenFrame {
|
|
|
|
public:
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
friend nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
|
2013-05-14 09:33:23 -07:00
|
|
|
virtual eMathMLFrameType GetMathMLFrameType() MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
virtual void
|
2012-08-22 08:56:38 -07:00
|
|
|
SetAdditionalStyleContext(int32_t aIndex,
|
2013-05-14 09:33:23 -07:00
|
|
|
nsStyleContext* aStyleContext) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual nsStyleContext*
|
2013-05-14 09:33:23 -07:00
|
|
|
GetAdditionalStyleContext(int32_t aIndex) const MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-02-14 03:12:27 -08:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD
|
2012-09-14 09:10:08 -07:00
|
|
|
InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD
|
2012-09-14 09:10:08 -07:00
|
|
|
TransmitAutomaticData() MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-02-17 23:47:48 -08:00
|
|
|
virtual nsresult
|
2013-12-02 08:50:10 -08:00
|
|
|
SetInitialChildList(ChildListID aListID,
|
|
|
|
nsFrameList& aChildList) MOZ_OVERRIDE;
|
|
|
|
|
2014-05-12 17:47:52 -07:00
|
|
|
virtual void
|
2007-03-22 10:30:00 -07:00
|
|
|
Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
2012-09-14 09:10:08 -07:00
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-11-25 06:20:20 -08:00
|
|
|
virtual void
|
|
|
|
GetIntrinsicWidthMetrics(nsRenderingContext* aRenderingContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
|
2008-02-27 02:47:43 -08:00
|
|
|
|
2014-02-17 23:47:48 -08:00
|
|
|
virtual nsresult
|
2012-08-22 08:56:38 -07:00
|
|
|
AttributeChanged(int32_t aNameSpaceID,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIAtom* aAttribute,
|
2012-09-14 09:10:08 -07:00
|
|
|
int32_t aModType) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// This method is called by the parent frame to ask <mo>
|
|
|
|
// to stretch itself.
|
|
|
|
NS_IMETHOD
|
2011-04-07 18:04:40 -07:00
|
|
|
Stretch(nsRenderingContext& aRenderingContext,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsStretchDirection aStretchDirection,
|
|
|
|
nsBoundingMetrics& aContainerSize,
|
2012-09-14 09:10:08 -07:00
|
|
|
nsHTMLReflowMetrics& aDesiredStretchSize) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-12-02 08:50:10 -08:00
|
|
|
virtual nsresult
|
|
|
|
ChildListChanged(int32_t aModType) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
ProcessTextData();
|
|
|
|
return nsMathMLContainerFrame::ChildListChanged(aModType);
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
|
|
|
nsMathMLmoFrame(nsStyleContext* aContext) : nsMathMLTokenFrame(aContext) {}
|
|
|
|
virtual ~nsMathMLmoFrame();
|
|
|
|
|
|
|
|
nsMathMLChar mMathMLChar; // Here is the MathMLChar that will deal with the operator.
|
|
|
|
nsOperatorFlags mFlags;
|
|
|
|
float mMinSize;
|
|
|
|
float mMaxSize;
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool UseMathMLChar();
|
2008-03-13 21:05:43 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// overload the base method so that we can setup our nsMathMLChar
|
2013-12-02 08:50:10 -08:00
|
|
|
void ProcessTextData();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// helper to get our 'form' and lookup in the Operator Dictionary to fetch
|
|
|
|
// our default data that may come from there, and to complete the setup
|
|
|
|
// using attributes that we may have
|
|
|
|
void
|
|
|
|
ProcessOperatorData();
|
|
|
|
|
|
|
|
// helper to double check thar our char should be rendered as a selected char
|
2011-09-28 23:19:26 -07:00
|
|
|
bool
|
2007-03-22 10:30:00 -07:00
|
|
|
IsFrameInSelection(nsIFrame* aFrame);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsMathMLmoFrame_h___ */
|