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 nsMathMLmspaceFrame_h___
7 : #define nsMathMLmspaceFrame_h___
8 :
9 : #include "mozilla/Attributes.h"
10 : #include "nsMathMLContainerFrame.h"
11 :
12 : //
13 : // <mspace> -- space
14 : //
15 :
16 : class nsMathMLmspaceFrame : public nsMathMLContainerFrame {
17 : public:
18 0 : NS_DECL_FRAMEARENA_HELPERS(nsMathMLmspaceFrame)
19 :
20 : friend nsIFrame* NS_NewMathMLmspaceFrame(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 : mPresentationData.flags |= NS_MATHML_SPACE_LIKE;
27 0 : return NS_OK;
28 : }
29 :
30 : virtual void
31 : Reflow(nsPresContext* aPresContext,
32 : ReflowOutput& aDesiredSize,
33 : const ReflowInput& aReflowInput,
34 : nsReflowStatus& aStatus) override;
35 :
36 : protected:
37 0 : explicit nsMathMLmspaceFrame(nsStyleContext* aContext) :
38 0 : nsMathMLContainerFrame(aContext, kClassID), mWidth(0), mHeight(0), mDepth(0) {}
39 : virtual ~nsMathMLmspaceFrame();
40 :
41 : virtual nsresult
42 : MeasureForWidth(DrawTarget* aDrawTarget,
43 : ReflowOutput& aDesiredSize) override;
44 :
45 : private:
46 : nscoord mWidth;
47 : nscoord mHeight;
48 : nscoord mDepth;
49 :
50 : // helper method to initialize our member data
51 : void
52 : ProcessAttributes(nsPresContext* aPresContext);
53 : };
54 :
55 : #endif /* nsMathMLmspaceFrame_h___ */
|