layout/mathml/nsMathMLmencloseFrame.h

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6
michael@0 7 #ifndef nsMathMLmencloseFrame_h___
michael@0 8 #define nsMathMLmencloseFrame_h___
michael@0 9
michael@0 10 #include "mozilla/Attributes.h"
michael@0 11 #include "nsMathMLContainerFrame.h"
michael@0 12
michael@0 13 //
michael@0 14 // <menclose> -- enclose content with a stretching symbol such
michael@0 15 // as a long division sign.
michael@0 16 //
michael@0 17
michael@0 18 /*
michael@0 19 The MathML REC describes:
michael@0 20
michael@0 21 The menclose element renders its content inside the enclosing notation
michael@0 22 specified by its notation attribute. menclose accepts any number of arguments;
michael@0 23 if this number is not 1, its contents are treated as a single "inferred mrow"
michael@0 24 containing its arguments, as described in Section 3.1.3 Required Arguments.
michael@0 25 */
michael@0 26
michael@0 27 enum nsMencloseNotation
michael@0 28 {
michael@0 29 NOTATION_LONGDIV = 0x1,
michael@0 30 NOTATION_RADICAL = 0x2,
michael@0 31 NOTATION_ROUNDEDBOX = 0x4,
michael@0 32 NOTATION_CIRCLE = 0x8,
michael@0 33 NOTATION_LEFT = 0x10,
michael@0 34 NOTATION_RIGHT = 0x20,
michael@0 35 NOTATION_TOP = 0x40,
michael@0 36 NOTATION_BOTTOM = 0x80,
michael@0 37 NOTATION_UPDIAGONALSTRIKE = 0x100,
michael@0 38 NOTATION_DOWNDIAGONALSTRIKE = 0x200,
michael@0 39 NOTATION_VERTICALSTRIKE = 0x400,
michael@0 40 NOTATION_HORIZONTALSTRIKE = 0x800,
michael@0 41 NOTATION_UPDIAGONALARROW = 0x1000
michael@0 42 };
michael@0 43
michael@0 44 class nsMathMLmencloseFrame : public nsMathMLContainerFrame {
michael@0 45 public:
michael@0 46 NS_DECL_FRAMEARENA_HELPERS
michael@0 47
michael@0 48 friend nsIFrame* NS_NewMathMLmencloseFrame(nsIPresShell* aPresShell,
michael@0 49 nsStyleContext* aContext);
michael@0 50
michael@0 51 virtual nsresult
michael@0 52 Place(nsRenderingContext& aRenderingContext,
michael@0 53 bool aPlaceOrigin,
michael@0 54 nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
michael@0 55
michael@0 56 virtual nsresult
michael@0 57 MeasureForWidth(nsRenderingContext& aRenderingContext,
michael@0 58 nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
michael@0 59
michael@0 60 virtual nsresult
michael@0 61 AttributeChanged(int32_t aNameSpaceID,
michael@0 62 nsIAtom* aAttribute,
michael@0 63 int32_t aModType) MOZ_OVERRIDE;
michael@0 64
michael@0 65 virtual void
michael@0 66 SetAdditionalStyleContext(int32_t aIndex,
michael@0 67 nsStyleContext* aStyleContext) MOZ_OVERRIDE;
michael@0 68 virtual nsStyleContext*
michael@0 69 GetAdditionalStyleContext(int32_t aIndex) const MOZ_OVERRIDE;
michael@0 70
michael@0 71 virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
michael@0 72 const nsRect& aDirtyRect,
michael@0 73 const nsDisplayListSet& aLists) MOZ_OVERRIDE;
michael@0 74
michael@0 75 NS_IMETHOD
michael@0 76 InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE;
michael@0 77
michael@0 78 NS_IMETHOD
michael@0 79 TransmitAutomaticData() MOZ_OVERRIDE;
michael@0 80
michael@0 81 virtual nscoord
michael@0 82 FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
michael@0 83
michael@0 84 bool
michael@0 85 IsMrowLike() MOZ_OVERRIDE {
michael@0 86 return mFrames.FirstChild() != mFrames.LastChild() ||
michael@0 87 !mFrames.FirstChild();
michael@0 88 }
michael@0 89
michael@0 90 protected:
michael@0 91 nsMathMLmencloseFrame(nsStyleContext* aContext);
michael@0 92 virtual ~nsMathMLmencloseFrame();
michael@0 93
michael@0 94 nsresult PlaceInternal(nsRenderingContext& aRenderingContext,
michael@0 95 bool aPlaceOrigin,
michael@0 96 nsHTMLReflowMetrics& aDesiredSize,
michael@0 97 bool aWidthOnly);
michael@0 98
michael@0 99 // functions to parse the "notation" attribute.
michael@0 100 nsresult AddNotation(const nsAString& aNotation);
michael@0 101 void InitNotations();
michael@0 102
michael@0 103 // Description of the notations to draw
michael@0 104 uint32_t mNotationsToDraw;
michael@0 105 bool IsToDraw(nsMencloseNotation mask)
michael@0 106 {
michael@0 107 return mask & mNotationsToDraw;
michael@0 108 }
michael@0 109
michael@0 110 nscoord mRuleThickness;
michael@0 111 nsTArray<nsMathMLChar> mMathMLChar;
michael@0 112 int8_t mLongDivCharIndex, mRadicalCharIndex;
michael@0 113 nscoord mContentWidth;
michael@0 114 nsresult AllocateMathMLChar(nsMencloseNotation mask);
michael@0 115
michael@0 116 // Display a frame of the specified type.
michael@0 117 // @param aType Type of frame to display
michael@0 118 void DisplayNotation(nsDisplayListBuilder* aBuilder,
michael@0 119 nsIFrame* aFrame, const nsRect& aRect,
michael@0 120 const nsDisplayListSet& aLists,
michael@0 121 nscoord aThickness, nsMencloseNotation aType);
michael@0 122 };
michael@0 123
michael@0 124 #endif /* nsMathMLmencloseFrame_h___ */

mercurial