michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsMathMLmpaddedFrame_h___ michael@0: #define nsMathMLmpaddedFrame_h___ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsMathMLContainerFrame.h" michael@0: michael@0: // michael@0: // -- adjust space around content michael@0: // michael@0: michael@0: class nsMathMLmpaddedFrame : public nsMathMLContainerFrame { michael@0: public: michael@0: NS_DECL_FRAMEARENA_HELPERS michael@0: michael@0: friend nsIFrame* NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); michael@0: michael@0: NS_IMETHOD michael@0: InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE; michael@0: michael@0: NS_IMETHOD michael@0: TransmitAutomaticData() MOZ_OVERRIDE { michael@0: return TransmitAutomaticDataForMrowLikeElement(); michael@0: } michael@0: michael@0: virtual nsresult michael@0: Reflow(nsPresContext* aPresContext, michael@0: nsHTMLReflowMetrics& aDesiredSize, michael@0: const nsHTMLReflowState& aReflowState, michael@0: nsReflowStatus& aStatus) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: Place(nsRenderingContext& aRenderingContext, michael@0: bool aPlaceOrigin, michael@0: nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE; michael@0: michael@0: bool michael@0: IsMrowLike() MOZ_OVERRIDE { michael@0: return mFrames.FirstChild() != mFrames.LastChild() || michael@0: !mFrames.FirstChild(); michael@0: } michael@0: michael@0: protected: michael@0: nsMathMLmpaddedFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {} michael@0: virtual ~nsMathMLmpaddedFrame(); michael@0: michael@0: virtual nsresult michael@0: MeasureForWidth(nsRenderingContext& aRenderingContext, michael@0: nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE; michael@0: michael@0: private: michael@0: nsCSSValue mWidth; michael@0: nsCSSValue mHeight; michael@0: nsCSSValue mDepth; michael@0: nsCSSValue mLeadingSpace; michael@0: nsCSSValue mVerticalOffset; michael@0: michael@0: int32_t mWidthSign; michael@0: int32_t mHeightSign; michael@0: int32_t mDepthSign; michael@0: int32_t mLeadingSpaceSign; michael@0: int32_t mVerticalOffsetSign; michael@0: michael@0: int32_t mWidthPseudoUnit; michael@0: int32_t mHeightPseudoUnit; michael@0: int32_t mDepthPseudoUnit; michael@0: int32_t mLeadingSpacePseudoUnit; michael@0: int32_t mVerticalOffsetPseudoUnit; michael@0: michael@0: // helpers to process the attributes michael@0: void michael@0: ProcessAttributes(); michael@0: michael@0: static bool michael@0: ParseAttribute(nsString& aString, michael@0: int32_t& aSign, michael@0: nsCSSValue& aCSSValue, michael@0: int32_t& aPseudoUnit); michael@0: michael@0: void michael@0: UpdateValue(int32_t aSign, michael@0: int32_t aPseudoUnit, michael@0: const nsCSSValue& aCSSValue, michael@0: const nsHTMLReflowMetrics& aDesiredSize, michael@0: nscoord& aValueToUpdate) const; michael@0: }; michael@0: michael@0: #endif /* nsMathMLmpaddedFrame_h___ */