/src/mozilla-central/layout/mathml/nsMathMLmoFrame.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef nsMathMLmoFrame_h___ |
8 | | #define nsMathMLmoFrame_h___ |
9 | | |
10 | | #include "mozilla/Attributes.h" |
11 | | #include "nsMathMLTokenFrame.h" |
12 | | #include "nsMathMLChar.h" |
13 | | |
14 | | // |
15 | | // <mo> -- operator, fence, or separator |
16 | | // |
17 | | |
18 | | class nsMathMLmoFrame final : public nsMathMLTokenFrame |
19 | | { |
20 | | public: |
21 | | NS_DECL_FRAMEARENA_HELPERS(nsMathMLmoFrame) |
22 | | |
23 | | friend nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle); |
24 | | |
25 | | virtual eMathMLFrameType GetMathMLFrameType() override; |
26 | | |
27 | | virtual void |
28 | | SetAdditionalComputedStyle(int32_t aIndex, |
29 | | ComputedStyle* aComputedStyle) override; |
30 | | virtual ComputedStyle* |
31 | | GetAdditionalComputedStyle(int32_t aIndex) const override; |
32 | | |
33 | | virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, |
34 | | const nsDisplayListSet& aLists) override; |
35 | | |
36 | | NS_IMETHOD |
37 | | InheritAutomaticData(nsIFrame* aParent) override; |
38 | | |
39 | | NS_IMETHOD |
40 | | TransmitAutomaticData() override; |
41 | | |
42 | | virtual void |
43 | | SetInitialChildList(ChildListID aListID, |
44 | | nsFrameList& aChildList) override; |
45 | | |
46 | | virtual void |
47 | | Reflow(nsPresContext* aPresContext, |
48 | | ReflowOutput& aDesiredSize, |
49 | | const ReflowInput& aReflowInput, |
50 | | nsReflowStatus& aStatus) override; |
51 | | |
52 | | virtual nsresult |
53 | | Place(DrawTarget* aDrawTarget, |
54 | | bool aPlaceOrigin, |
55 | | ReflowOutput& aDesiredSize) override; |
56 | | |
57 | | virtual void MarkIntrinsicISizesDirty() override; |
58 | | |
59 | | virtual void |
60 | | GetIntrinsicISizeMetrics(gfxContext* aRenderingContext, |
61 | | ReflowOutput& aDesiredSize) override; |
62 | | |
63 | | virtual nsresult |
64 | | AttributeChanged(int32_t aNameSpaceID, |
65 | | nsAtom* aAttribute, |
66 | | int32_t aModType) override; |
67 | | |
68 | | // This method is called by the parent frame to ask <mo> |
69 | | // to stretch itself. |
70 | | NS_IMETHOD |
71 | | Stretch(DrawTarget* aDrawTarget, |
72 | | nsStretchDirection aStretchDirection, |
73 | | nsBoundingMetrics& aContainerSize, |
74 | | ReflowOutput& aDesiredStretchSize) override; |
75 | | |
76 | | virtual nsresult |
77 | | ChildListChanged(int32_t aModType) override |
78 | 0 | { |
79 | 0 | ProcessTextData(); |
80 | 0 | return nsMathMLContainerFrame::ChildListChanged(aModType); |
81 | 0 | } |
82 | | |
83 | | protected: |
84 | | explicit nsMathMLmoFrame(ComputedStyle* aStyle) : |
85 | 0 | nsMathMLTokenFrame(aStyle, kClassID), mFlags(0), mMinSize(0), mMaxSize(0) {} |
86 | | virtual ~nsMathMLmoFrame(); |
87 | | |
88 | | nsMathMLChar mMathMLChar; // Here is the MathMLChar that will deal with the operator. |
89 | | nsOperatorFlags mFlags; |
90 | | float mMinSize; |
91 | | float mMaxSize; |
92 | | |
93 | | bool UseMathMLChar(); |
94 | | |
95 | | // overload the base method so that we can setup our nsMathMLChar |
96 | | void ProcessTextData(); |
97 | | |
98 | | // helper to get our 'form' and lookup in the Operator Dictionary to fetch |
99 | | // our default data that may come from there, and to complete the setup |
100 | | // using attributes that we may have |
101 | | void |
102 | | ProcessOperatorData(); |
103 | | |
104 | | // helper to double check thar our char should be rendered as a selected char |
105 | | bool |
106 | | IsFrameInSelection(nsIFrame* aFrame); |
107 | | }; |
108 | | |
109 | | #endif /* nsMathMLmoFrame_h___ */ |