1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsMathMLmoFrame_h___
7 #define nsMathMLmoFrame_h___
9 #include "mozilla/Attributes.h"
10 #include "nsMathMLTokenFrame.h"
11 #include "nsMathMLChar.h"
14 // <mo> -- operator, fence, or separator
17 class nsMathMLmoFrame
: public nsMathMLTokenFrame
{
19 NS_DECL_FRAMEARENA_HELPERS
21 friend nsIFrame
* NS_NewMathMLmoFrame(nsIPresShell
* aPresShell
, nsStyleContext
* aContext
);
23 virtual eMathMLFrameType
GetMathMLFrameType() MOZ_OVERRIDE
;
26 SetAdditionalStyleContext(int32_t aIndex
,
27 nsStyleContext
* aStyleContext
) MOZ_OVERRIDE
;
28 virtual nsStyleContext
*
29 GetAdditionalStyleContext(int32_t aIndex
) const MOZ_OVERRIDE
;
31 virtual void BuildDisplayList(nsDisplayListBuilder
* aBuilder
,
32 const nsRect
& aDirtyRect
,
33 const nsDisplayListSet
& aLists
) MOZ_OVERRIDE
;
36 InheritAutomaticData(nsIFrame
* aParent
) MOZ_OVERRIDE
;
39 TransmitAutomaticData() MOZ_OVERRIDE
;
42 SetInitialChildList(ChildListID aListID
,
43 nsFrameList
& aChildList
) MOZ_OVERRIDE
;
46 Reflow(nsPresContext
* aPresContext
,
47 nsHTMLReflowMetrics
& aDesiredSize
,
48 const nsHTMLReflowState
& aReflowState
,
49 nsReflowStatus
& aStatus
) MOZ_OVERRIDE
;
52 Place(nsRenderingContext
& aRenderingContext
,
54 nsHTMLReflowMetrics
& aDesiredSize
) MOZ_OVERRIDE
;
56 virtual void MarkIntrinsicISizesDirty() MOZ_OVERRIDE
;
59 GetIntrinsicISizeMetrics(nsRenderingContext
* aRenderingContext
,
60 nsHTMLReflowMetrics
& aDesiredSize
) MOZ_OVERRIDE
;
63 AttributeChanged(int32_t aNameSpaceID
,
65 int32_t aModType
) MOZ_OVERRIDE
;
67 // This method is called by the parent frame to ask <mo>
70 Stretch(nsRenderingContext
& aRenderingContext
,
71 nsStretchDirection aStretchDirection
,
72 nsBoundingMetrics
& aContainerSize
,
73 nsHTMLReflowMetrics
& aDesiredStretchSize
) MOZ_OVERRIDE
;
76 ChildListChanged(int32_t aModType
) MOZ_OVERRIDE
79 return nsMathMLContainerFrame::ChildListChanged(aModType
);
83 explicit nsMathMLmoFrame(nsStyleContext
* aContext
) : nsMathMLTokenFrame(aContext
) {}
84 virtual ~nsMathMLmoFrame();
86 nsMathMLChar mMathMLChar
; // Here is the MathMLChar that will deal with the operator.
87 nsOperatorFlags mFlags
;
93 // overload the base method so that we can setup our nsMathMLChar
94 void ProcessTextData();
96 // helper to get our 'form' and lookup in the Operator Dictionary to fetch
97 // our default data that may come from there, and to complete the setup
98 // using attributes that we may have
100 ProcessOperatorData();
102 // helper to double check thar our char should be rendered as a selected char
104 IsFrameInSelection(nsIFrame
* aFrame
);
107 #endif /* nsMathMLmoFrame_h___ */