2007-06-11 23:10:23 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsMathMLmoFrame_h___
|
|
|
|
#define nsMathMLmoFrame_h___
|
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsMathMLTokenFrame.h"
|
|
|
|
|
|
|
|
//
|
|
|
|
// <mo> -- operator, fence, or separator
|
|
|
|
//
|
|
|
|
|
|
|
|
class nsMathMLmoFrame : public nsMathMLTokenFrame {
|
|
|
|
public:
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
friend nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
|
|
|
|
virtual eMathMLFrameType GetMathMLFrameType();
|
|
|
|
|
|
|
|
virtual void
|
2012-08-22 08:56:38 -07:00
|
|
|
SetAdditionalStyleContext(int32_t aIndex,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsStyleContext* aStyleContext);
|
|
|
|
virtual nsStyleContext*
|
2012-08-22 08:56:38 -07:00
|
|
|
GetAdditionalStyleContext(int32_t aIndex) const;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists);
|
|
|
|
|
|
|
|
NS_IMETHOD
|
2012-09-14 09:10:08 -07:00
|
|
|
InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD
|
2012-09-14 09:10:08 -07:00
|
|
|
TransmitAutomaticData() MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD
|
|
|
|
Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
2012-09-14 09:10:08 -07:00
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-02-27 02:47:43 -08:00
|
|
|
virtual nscoord
|
2012-09-14 09:10:08 -07:00
|
|
|
GetIntrinsicWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
2008-02-27 02:47:43 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD
|
2012-08-22 08:56:38 -07:00
|
|
|
AttributeChanged(int32_t aNameSpaceID,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIAtom* aAttribute,
|
2012-09-14 09:10:08 -07:00
|
|
|
int32_t aModType) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// This method is called by the parent frame to ask <mo>
|
|
|
|
// to stretch itself.
|
|
|
|
NS_IMETHOD
|
2011-04-07 18:04:40 -07:00
|
|
|
Stretch(nsRenderingContext& aRenderingContext,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsStretchDirection aStretchDirection,
|
|
|
|
nsBoundingMetrics& aContainerSize,
|
2012-09-14 09:10:08 -07:00
|
|
|
nsHTMLReflowMetrics& aDesiredStretchSize) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
nsMathMLmoFrame(nsStyleContext* aContext) : nsMathMLTokenFrame(aContext) {}
|
|
|
|
virtual ~nsMathMLmoFrame();
|
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual int GetSkipSides() const MOZ_OVERRIDE { return 0; }
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsMathMLChar mMathMLChar; // Here is the MathMLChar that will deal with the operator.
|
|
|
|
nsOperatorFlags mFlags;
|
|
|
|
float mMinSize;
|
|
|
|
float mMaxSize;
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool UseMathMLChar();
|
2008-03-13 21:05:43 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// overload the base method so that we can setup our nsMathMLChar
|
2012-09-14 09:10:08 -07:00
|
|
|
virtual void ProcessTextData() MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// helper to get our 'form' and lookup in the Operator Dictionary to fetch
|
|
|
|
// our default data that may come from there, and to complete the setup
|
|
|
|
// using attributes that we may have
|
|
|
|
void
|
|
|
|
ProcessOperatorData();
|
|
|
|
|
|
|
|
// helper to double check thar our char should be rendered as a selected char
|
2011-09-28 23:19:26 -07:00
|
|
|
bool
|
2007-03-22 10:30:00 -07:00
|
|
|
IsFrameInSelection(nsIFrame* aFrame);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsMathMLmoFrame_h___ */
|