2013-12-02 16:49:27 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* 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/. */
|
|
|
|
|
2014-01-15 14:49:20 +00:00
|
|
|
#ifndef MATHMLTEXTRUNFACTORY_H_
|
|
|
|
#define MATHMLTEXTRUNFACTORY_H_
|
2013-12-02 16:49:27 +00:00
|
|
|
|
|
|
|
#include "nsTextRunTransformations.h"
|
|
|
|
|
|
|
|
/**
|
2014-01-15 14:49:20 +00:00
|
|
|
* Builds textruns that render their text with MathML specific renderings.
|
2013-12-02 16:49:27 +00:00
|
|
|
*/
|
2014-01-15 14:49:20 +00:00
|
|
|
class MathMLTextRunFactory : public nsTransformingTextRunFactory {
|
2013-12-02 16:49:27 +00:00
|
|
|
public:
|
2014-01-15 14:49:20 +00:00
|
|
|
MathMLTextRunFactory(nsTransformingTextRunFactory* aInnerTransformingTextRunFactory,
|
2014-06-25 09:20:00 +00:00
|
|
|
uint32_t aFlags, uint8_t aSSTYScriptLevel)
|
2014-01-15 14:49:20 +00:00
|
|
|
: mInnerTransformingTextRunFactory(aInnerTransformingTextRunFactory),
|
2014-06-25 09:20:00 +00:00
|
|
|
mFlags(aFlags),
|
2014-01-15 14:49:20 +00:00
|
|
|
mSSTYScriptLevel(aSSTYScriptLevel) {}
|
2013-12-02 16:49:27 +00:00
|
|
|
|
|
|
|
virtual void RebuildTextRun(nsTransformedTextRun* aTextRun,
|
|
|
|
gfxContext* aRefContext) MOZ_OVERRIDE;
|
2014-06-25 09:20:00 +00:00
|
|
|
enum {
|
|
|
|
// Style effects which may override single character <mi> behaviour
|
|
|
|
MATH_FONT_STYLING_NORMAL = 0x1, // fontstyle="normal" has been set.
|
|
|
|
MATH_FONT_WEIGHT_BOLD = 0x2, // fontweight="bold" has been set.
|
|
|
|
};
|
|
|
|
|
2013-12-02 16:49:27 +00:00
|
|
|
protected:
|
|
|
|
nsAutoPtr<nsTransformingTextRunFactory> mInnerTransformingTextRunFactory;
|
2014-06-25 09:20:00 +00:00
|
|
|
uint32_t mFlags;
|
2014-01-15 14:49:20 +00:00
|
|
|
uint8_t mSSTYScriptLevel;
|
2013-12-02 16:49:27 +00:00
|
|
|
};
|
|
|
|
|
2014-01-15 14:49:20 +00:00
|
|
|
#endif /*MATHMLTEXTRUNFACTORY_H_*/
|