Line data Source code
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 0 : NS_DECL_FRAMEARENA_HELPERS(nsMathMLTokenFrame)
19 :
20 : friend nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
21 :
22 : NS_IMETHOD
23 0 : TransmitAutomaticData() override {
24 : // The REC defines the following elements to be space-like:
25 : // * an mtext, mspace, maligngroup, or malignmark element;
26 0 : if (mContent->IsMathMLElement(nsGkAtoms::mtext_)) {
27 0 : mPresentationData.flags |= NS_MATHML_SPACE_LIKE;
28 : }
29 0 : return NS_OK;
30 : }
31 :
32 : NS_IMETHOD
33 : InheritAutomaticData(nsIFrame* aParent) override;
34 :
35 : virtual eMathMLFrameType GetMathMLFrameType() override;
36 :
37 : virtual void
38 : SetInitialChildList(ChildListID aListID,
39 : nsFrameList& aChildList) override;
40 :
41 : virtual void
42 : AppendFrames(ChildListID aListID,
43 : nsFrameList& aChildList) override;
44 :
45 : virtual void
46 : InsertFrames(ChildListID aListID,
47 : nsIFrame* aPrevFrame,
48 : nsFrameList& aChildList) override;
49 :
50 : virtual void
51 : Reflow(nsPresContext* aPresContext,
52 : ReflowOutput& aDesiredSize,
53 : const ReflowInput& aReflowInput,
54 : nsReflowStatus& aStatus) override;
55 :
56 : virtual nsresult
57 : Place(DrawTarget* aDrawTarget,
58 : bool aPlaceOrigin,
59 : ReflowOutput& aDesiredSize) override;
60 :
61 : protected:
62 0 : explicit nsMathMLTokenFrame(nsStyleContext* aContext, ClassID aID = kClassID)
63 0 : : nsMathMLContainerFrame(aContext, aID) {}
64 : virtual ~nsMathMLTokenFrame();
65 :
66 : void MarkTextFramesAsTokenMathML();
67 : };
68 :
69 : #endif /* nsMathMLTokentFrame_h___ */
|