layout/mathml/nsMathMLTokenFrame.h

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:3adbc0dab9c5
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/. */
5
6 #ifndef nsMathMLTokenFrame_h___
7 #define nsMathMLTokenFrame_h___
8
9 #include "mozilla/Attributes.h"
10 #include "nsMathMLContainerFrame.h"
11
12 //
13 // Base class to handle token elements
14 //
15
16 class nsMathMLTokenFrame : public nsMathMLContainerFrame {
17 public:
18 NS_DECL_FRAMEARENA_HELPERS
19
20 friend nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
21
22 NS_IMETHOD
23 TransmitAutomaticData() MOZ_OVERRIDE {
24 // The REC defines the following elements to be space-like:
25 // * an mtext, mspace, maligngroup, or malignmark element;
26 if (mContent->Tag() == nsGkAtoms::mtext_) {
27 mPresentationData.flags |= NS_MATHML_SPACE_LIKE;
28 }
29 return NS_OK;
30 }
31
32 NS_IMETHOD
33 InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE;
34
35 virtual eMathMLFrameType GetMathMLFrameType() MOZ_OVERRIDE;
36
37 virtual nsresult
38 SetInitialChildList(ChildListID aListID,
39 nsFrameList& aChildList) MOZ_OVERRIDE;
40
41 virtual nsresult
42 AppendFrames(ChildListID aListID,
43 nsFrameList& aChildList) MOZ_OVERRIDE;
44
45 virtual nsresult
46 InsertFrames(ChildListID aListID,
47 nsIFrame* aPrevFrame,
48 nsFrameList& aChildList) MOZ_OVERRIDE;
49
50 virtual nsresult
51 Reflow(nsPresContext* aPresContext,
52 nsHTMLReflowMetrics& aDesiredSize,
53 const nsHTMLReflowState& aReflowState,
54 nsReflowStatus& aStatus) MOZ_OVERRIDE;
55
56 virtual nsresult
57 Place(nsRenderingContext& aRenderingContext,
58 bool aPlaceOrigin,
59 nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
60
61 protected:
62 nsMathMLTokenFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
63 virtual ~nsMathMLTokenFrame();
64
65 void MarkTextFramesAsTokenMathML();
66 };
67
68 #endif /* nsMathMLTokentFrame_h___ */

mercurial