nsMathMLmrootFrame.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. #ifndef nsMathMLmrootFrame_h___
  6. #define nsMathMLmrootFrame_h___
  7. #include "mozilla/Attributes.h"
  8. #include "nsMathMLContainerFrame.h"
  9. #include "nsMathMLChar.h"
  10. //
  11. // <msqrt> and <mroot> -- form a radical
  12. //
  13. class nsMathMLmrootFrame : public nsMathMLContainerFrame {
  14. public:
  15. NS_DECL_FRAMEARENA_HELPERS
  16. friend nsIFrame* NS_NewMathMLmrootFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
  17. virtual void
  18. SetAdditionalStyleContext(int32_t aIndex,
  19. nsStyleContext* aStyleContext) override;
  20. virtual nsStyleContext*
  21. GetAdditionalStyleContext(int32_t aIndex) const override;
  22. virtual void
  23. Init(nsIContent* aContent,
  24. nsContainerFrame* aParent,
  25. nsIFrame* aPrevInFlow) override;
  26. NS_IMETHOD
  27. TransmitAutomaticData() override;
  28. virtual void
  29. Reflow(nsPresContext* aPresContext,
  30. ReflowOutput& aDesiredSize,
  31. const ReflowInput& aReflowInput,
  32. nsReflowStatus& aStatus) override;
  33. void
  34. GetRadicalXOffsets(nscoord aIndexWidth, nscoord aSqrWidth,
  35. nsFontMetrics* aFontMetrics,
  36. nscoord* aIndexOffset,
  37. nscoord* aSqrOffset);
  38. virtual void
  39. GetIntrinsicISizeMetrics(nsRenderingContext* aRenderingContext,
  40. ReflowOutput& aDesiredSize) override;
  41. virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
  42. const nsDisplayListSet& aLists) override;
  43. uint8_t
  44. ScriptIncrement(nsIFrame* aFrame) override
  45. {
  46. return (aFrame && aFrame == mFrames.LastChild()) ? 2 : 0;
  47. }
  48. protected:
  49. explicit nsMathMLmrootFrame(nsStyleContext* aContext);
  50. virtual ~nsMathMLmrootFrame();
  51. nsMathMLChar mSqrChar;
  52. nsRect mBarRect;
  53. };
  54. #endif /* nsMathMLmrootFrame_h___ */