Bug 1869043 allow a device to be specified with MediaTrackGraph::NotifyWhenDeviceStar...
[gecko.git] / layout / mathml / nsMathMLmoFrame.h
blob2dec3e2e9bb55adf354465e795d9611f61a37483
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/. */
7 #ifndef nsMathMLmoFrame_h___
8 #define nsMathMLmoFrame_h___
10 #include "mozilla/Attributes.h"
11 #include "nsMathMLTokenFrame.h"
12 #include "nsMathMLChar.h"
14 namespace mozilla {
15 class PresShell;
16 } // namespace mozilla
19 // <mo> -- operator, fence, or separator
22 class nsMathMLmoFrame final : public nsMathMLTokenFrame {
23 public:
24 NS_DECL_FRAMEARENA_HELPERS(nsMathMLmoFrame)
26 friend nsIFrame* NS_NewMathMLmoFrame(mozilla::PresShell* aPresShell,
27 ComputedStyle* aStyle);
29 eMathMLFrameType GetMathMLFrameType() override;
31 void DidSetComputedStyle(ComputedStyle* aOldStyle) override;
33 void BuildDisplayList(nsDisplayListBuilder* aBuilder,
34 const nsDisplayListSet& aLists) override;
36 NS_IMETHOD
37 InheritAutomaticData(nsIFrame* aParent) override;
39 NS_IMETHOD
40 TransmitAutomaticData() override;
42 void SetInitialChildList(ChildListID aListID,
43 nsFrameList&& aChildList) override;
45 virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
46 const ReflowInput& aReflowInput,
47 nsReflowStatus& aStatus) override;
49 virtual nsresult Place(DrawTarget* aDrawTarget, bool aPlaceOrigin,
50 ReflowOutput& aDesiredSize) override;
52 virtual void MarkIntrinsicISizesDirty() override;
54 virtual void GetIntrinsicISizeMetrics(gfxContext* aRenderingContext,
55 ReflowOutput& aDesiredSize) override;
57 virtual nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
58 int32_t aModType) override;
60 // This method is called by the parent frame to ask <mo>
61 // to stretch itself.
62 NS_IMETHOD
63 Stretch(DrawTarget* aDrawTarget, nsStretchDirection aStretchDirection,
64 nsBoundingMetrics& aContainerSize,
65 ReflowOutput& aDesiredStretchSize) override;
67 virtual nsresult ChildListChanged(int32_t aModType) override {
68 ProcessTextData();
69 return nsMathMLContainerFrame::ChildListChanged(aModType);
72 protected:
73 explicit nsMathMLmoFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
74 : nsMathMLTokenFrame(aStyle, aPresContext, kClassID),
75 mFlags(0),
76 mMinSize(0),
77 mMaxSize(0) {}
78 virtual ~nsMathMLmoFrame();
80 nsMathMLChar
81 mMathMLChar; // Here is the MathMLChar that will deal with the operator.
82 nsOperatorFlags mFlags;
83 float mMinSize;
84 float mMaxSize;
86 bool UseMathMLChar();
88 // overload the base method so that we can setup our nsMathMLChar
89 void ProcessTextData();
91 // helper to get our 'form' and lookup in the Operator Dictionary to fetch
92 // our default data that may come from there, and to complete the setup
93 // using attributes that we may have
94 void ProcessOperatorData();
96 // helper to double check thar our char should be rendered as a selected char
97 bool IsFrameInSelection(nsIFrame* aFrame);
100 #endif /* nsMathMLmoFrame_h___ */