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 nsMathMLmoFrame_h___ michael@0: #define nsMathMLmoFrame_h___ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsMathMLTokenFrame.h" michael@0: #include "nsMathMLChar.h" michael@0: michael@0: // michael@0: // -- operator, fence, or separator michael@0: // michael@0: michael@0: class nsMathMLmoFrame : public nsMathMLTokenFrame { michael@0: public: michael@0: NS_DECL_FRAMEARENA_HELPERS michael@0: michael@0: friend nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); michael@0: michael@0: virtual eMathMLFrameType GetMathMLFrameType() MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: SetAdditionalStyleContext(int32_t aIndex, michael@0: nsStyleContext* aStyleContext) MOZ_OVERRIDE; michael@0: virtual nsStyleContext* michael@0: GetAdditionalStyleContext(int32_t aIndex) const MOZ_OVERRIDE; michael@0: michael@0: virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, michael@0: const nsRect& aDirtyRect, michael@0: const nsDisplayListSet& aLists) MOZ_OVERRIDE; 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: michael@0: virtual nsresult michael@0: SetInitialChildList(ChildListID aListID, michael@0: nsFrameList& aChildList) MOZ_OVERRIDE; 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 void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: GetIntrinsicWidthMetrics(nsRenderingContext* aRenderingContext, michael@0: nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: AttributeChanged(int32_t aNameSpaceID, michael@0: nsIAtom* aAttribute, michael@0: int32_t aModType) MOZ_OVERRIDE; michael@0: michael@0: // This method is called by the parent frame to ask michael@0: // to stretch itself. michael@0: NS_IMETHOD michael@0: Stretch(nsRenderingContext& aRenderingContext, michael@0: nsStretchDirection aStretchDirection, michael@0: nsBoundingMetrics& aContainerSize, michael@0: nsHTMLReflowMetrics& aDesiredStretchSize) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: ChildListChanged(int32_t aModType) MOZ_OVERRIDE michael@0: { michael@0: ProcessTextData(); michael@0: return nsMathMLContainerFrame::ChildListChanged(aModType); michael@0: } michael@0: michael@0: protected: michael@0: nsMathMLmoFrame(nsStyleContext* aContext) : nsMathMLTokenFrame(aContext) {} michael@0: virtual ~nsMathMLmoFrame(); michael@0: michael@0: nsMathMLChar mMathMLChar; // Here is the MathMLChar that will deal with the operator. michael@0: nsOperatorFlags mFlags; michael@0: float mMinSize; michael@0: float mMaxSize; michael@0: michael@0: bool UseMathMLChar(); michael@0: michael@0: // overload the base method so that we can setup our nsMathMLChar michael@0: void ProcessTextData(); michael@0: michael@0: // helper to get our 'form' and lookup in the Operator Dictionary to fetch michael@0: // our default data that may come from there, and to complete the setup michael@0: // using attributes that we may have michael@0: void michael@0: ProcessOperatorData(); michael@0: michael@0: // helper to double check thar our char should be rendered as a selected char michael@0: bool michael@0: IsFrameInSelection(nsIFrame* aFrame); michael@0: }; michael@0: michael@0: #endif /* nsMathMLmoFrame_h___ */