1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/mathml/nsMathMLmoFrame.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,102 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsMathMLmoFrame_h___ 1.10 +#define nsMathMLmoFrame_h___ 1.11 + 1.12 +#include "mozilla/Attributes.h" 1.13 +#include "nsMathMLTokenFrame.h" 1.14 +#include "nsMathMLChar.h" 1.15 + 1.16 +// 1.17 +// <mo> -- operator, fence, or separator 1.18 +// 1.19 + 1.20 +class nsMathMLmoFrame : public nsMathMLTokenFrame { 1.21 +public: 1.22 + NS_DECL_FRAMEARENA_HELPERS 1.23 + 1.24 + friend nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.25 + 1.26 + virtual eMathMLFrameType GetMathMLFrameType() MOZ_OVERRIDE; 1.27 + 1.28 + virtual void 1.29 + SetAdditionalStyleContext(int32_t aIndex, 1.30 + nsStyleContext* aStyleContext) MOZ_OVERRIDE; 1.31 + virtual nsStyleContext* 1.32 + GetAdditionalStyleContext(int32_t aIndex) const MOZ_OVERRIDE; 1.33 + 1.34 + virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, 1.35 + const nsRect& aDirtyRect, 1.36 + const nsDisplayListSet& aLists) MOZ_OVERRIDE; 1.37 + 1.38 + NS_IMETHOD 1.39 + InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE; 1.40 + 1.41 + NS_IMETHOD 1.42 + TransmitAutomaticData() MOZ_OVERRIDE; 1.43 + 1.44 + virtual nsresult 1.45 + SetInitialChildList(ChildListID aListID, 1.46 + nsFrameList& aChildList) MOZ_OVERRIDE; 1.47 + 1.48 + virtual nsresult 1.49 + Reflow(nsPresContext* aPresContext, 1.50 + nsHTMLReflowMetrics& aDesiredSize, 1.51 + const nsHTMLReflowState& aReflowState, 1.52 + nsReflowStatus& aStatus) MOZ_OVERRIDE; 1.53 + 1.54 + virtual void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE; 1.55 + 1.56 + virtual void 1.57 + GetIntrinsicWidthMetrics(nsRenderingContext* aRenderingContext, 1.58 + nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE; 1.59 + 1.60 + virtual nsresult 1.61 + AttributeChanged(int32_t aNameSpaceID, 1.62 + nsIAtom* aAttribute, 1.63 + int32_t aModType) MOZ_OVERRIDE; 1.64 + 1.65 + // This method is called by the parent frame to ask <mo> 1.66 + // to stretch itself. 1.67 + NS_IMETHOD 1.68 + Stretch(nsRenderingContext& aRenderingContext, 1.69 + nsStretchDirection aStretchDirection, 1.70 + nsBoundingMetrics& aContainerSize, 1.71 + nsHTMLReflowMetrics& aDesiredStretchSize) MOZ_OVERRIDE; 1.72 + 1.73 + virtual nsresult 1.74 + ChildListChanged(int32_t aModType) MOZ_OVERRIDE 1.75 + { 1.76 + ProcessTextData(); 1.77 + return nsMathMLContainerFrame::ChildListChanged(aModType); 1.78 + } 1.79 + 1.80 +protected: 1.81 + nsMathMLmoFrame(nsStyleContext* aContext) : nsMathMLTokenFrame(aContext) {} 1.82 + virtual ~nsMathMLmoFrame(); 1.83 + 1.84 + nsMathMLChar mMathMLChar; // Here is the MathMLChar that will deal with the operator. 1.85 + nsOperatorFlags mFlags; 1.86 + float mMinSize; 1.87 + float mMaxSize; 1.88 + 1.89 + bool UseMathMLChar(); 1.90 + 1.91 + // overload the base method so that we can setup our nsMathMLChar 1.92 + void ProcessTextData(); 1.93 + 1.94 + // helper to get our 'form' and lookup in the Operator Dictionary to fetch 1.95 + // our default data that may come from there, and to complete the setup 1.96 + // using attributes that we may have 1.97 + void 1.98 + ProcessOperatorData(); 1.99 + 1.100 + // helper to double check thar our char should be rendered as a selected char 1.101 + bool 1.102 + IsFrameInSelection(nsIFrame* aFrame); 1.103 +}; 1.104 + 1.105 +#endif /* nsMathMLmoFrame_h___ */