Blame layout/mathml/nsMathMLmoFrame.h

Packit f0b94e
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
Packit f0b94e
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
Packit f0b94e
/* This Source Code Form is subject to the terms of the Mozilla Public
Packit f0b94e
 * License, v. 2.0. If a copy of the MPL was not distributed with this
Packit f0b94e
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Packit f0b94e
Packit f0b94e
#ifndef nsMathMLmoFrame_h___
Packit f0b94e
#define nsMathMLmoFrame_h___
Packit f0b94e
Packit f0b94e
#include "mozilla/Attributes.h"
Packit f0b94e
#include "nsMathMLTokenFrame.h"
Packit f0b94e
#include "nsMathMLChar.h"
Packit f0b94e
Packit f0b94e
//
Packit f0b94e
// <mo> -- operator, fence, or separator
Packit f0b94e
//
Packit f0b94e
Packit f0b94e
class nsMathMLmoFrame : public nsMathMLTokenFrame {
Packit f0b94e
 public:
Packit f0b94e
  NS_DECL_FRAMEARENA_HELPERS(nsMathMLmoFrame)
Packit f0b94e
Packit f0b94e
  friend nsIFrame* NS_NewMathMLmoFrame(nsIPresShell* aPresShell,
Packit f0b94e
                                       nsStyleContext* aContext);
Packit f0b94e
Packit f0b94e
  virtual eMathMLFrameType GetMathMLFrameType() override;
Packit f0b94e
Packit f0b94e
  virtual void SetAdditionalStyleContext(
Packit f0b94e
      int32_t aIndex, nsStyleContext* aStyleContext) override;
Packit f0b94e
  virtual nsStyleContext* GetAdditionalStyleContext(
Packit f0b94e
      int32_t aIndex) const override;
Packit f0b94e
Packit f0b94e
  virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
Packit f0b94e
                                const nsDisplayListSet& aLists) override;
Packit f0b94e
Packit f0b94e
  NS_IMETHOD
Packit f0b94e
  InheritAutomaticData(nsIFrame* aParent) override;
Packit f0b94e
Packit f0b94e
  NS_IMETHOD
Packit f0b94e
  TransmitAutomaticData() override;
Packit f0b94e
Packit f0b94e
  virtual void SetInitialChildList(ChildListID aListID,
Packit f0b94e
                                   nsFrameList& aChildList) override;
Packit f0b94e
Packit f0b94e
  virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
Packit f0b94e
                      const ReflowInput& aReflowInput,
Packit f0b94e
                      nsReflowStatus& aStatus) override;
Packit f0b94e
Packit f0b94e
  virtual nsresult Place(DrawTarget* aDrawTarget, bool aPlaceOrigin,
Packit f0b94e
                         ReflowOutput& aDesiredSize) override;
Packit f0b94e
Packit f0b94e
  virtual void MarkIntrinsicISizesDirty() override;
Packit f0b94e
Packit f0b94e
  virtual void GetIntrinsicISizeMetrics(gfxContext* aRenderingContext,
Packit f0b94e
                                        ReflowOutput& aDesiredSize) override;
Packit f0b94e
Packit f0b94e
  virtual nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
Packit f0b94e
                                    int32_t aModType) override;
Packit f0b94e
Packit f0b94e
  // This method is called by the parent frame to ask <mo>
Packit f0b94e
  // to stretch itself.
Packit f0b94e
  NS_IMETHOD
Packit f0b94e
  Stretch(DrawTarget* aDrawTarget, nsStretchDirection aStretchDirection,
Packit f0b94e
          nsBoundingMetrics& aContainerSize,
Packit f0b94e
          ReflowOutput& aDesiredStretchSize) override;
Packit f0b94e
Packit f0b94e
  virtual nsresult ChildListChanged(int32_t aModType) override {
Packit f0b94e
    ProcessTextData();
Packit f0b94e
    return nsMathMLContainerFrame::ChildListChanged(aModType);
Packit f0b94e
  }
Packit f0b94e
Packit f0b94e
 protected:
Packit f0b94e
  explicit nsMathMLmoFrame(nsStyleContext* aContext)
Packit f0b94e
      : nsMathMLTokenFrame(aContext, kClassID),
Packit f0b94e
        mFlags(0),
Packit f0b94e
        mMinSize(0),
Packit f0b94e
        mMaxSize(0) {}
Packit f0b94e
  virtual ~nsMathMLmoFrame();
Packit f0b94e
Packit f0b94e
  nsMathMLChar
Packit f0b94e
      mMathMLChar;  // Here is the MathMLChar that will deal with the operator.
Packit f0b94e
  nsOperatorFlags mFlags;
Packit f0b94e
  float mMinSize;
Packit f0b94e
  float mMaxSize;
Packit f0b94e
Packit f0b94e
  bool UseMathMLChar();
Packit f0b94e
Packit f0b94e
  // overload the base method so that we can setup our nsMathMLChar
Packit f0b94e
  void ProcessTextData();
Packit f0b94e
Packit f0b94e
  // helper to get our 'form' and lookup in the Operator Dictionary to fetch
Packit f0b94e
  // our default data that may come from there, and to complete the setup
Packit f0b94e
  // using attributes that we may have
Packit f0b94e
  void ProcessOperatorData();
Packit f0b94e
Packit f0b94e
  // helper to double check thar our char should be rendered as a selected char
Packit f0b94e
  bool IsFrameInSelection(nsIFrame* aFrame);
Packit f0b94e
};
Packit f0b94e
Packit f0b94e
#endif /* nsMathMLmoFrame_h___ */