#ifndef SVGTextLayoutAttributes_h
#define SVGTextLayoutAttributes_h
#include "core/rendering/svg/SVGTextMetrics.h"
#include "wtf/HashMap.h"
#include "wtf/Noncopyable.h"
#include "wtf/Vector.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
class RenderSVGInlineText;
struct SVGCharacterData {
SVGCharacterData();
float x;
float y;
float dx;
float dy;
float rotate;
};
typedef HashMap<unsigned, SVGCharacterData> SVGCharacterDataMap;
class SVGTextLayoutAttributes {
WTF_MAKE_NONCOPYABLE(SVGTextLayoutAttributes);
public:
SVGTextLayoutAttributes(RenderSVGInlineText*);
void clear();
void dump() const;
static float emptyValue();
RenderSVGInlineText* context() const { return m_context; }
SVGCharacterDataMap& characterDataMap() { return m_characterDataMap; }
const SVGCharacterDataMap& characterDataMap() const { return m_characterDataMap; }
Vector<SVGTextMetrics>& textMetricsValues() { return m_textMetricsValues; }
private:
RenderSVGInlineText* m_context;
SVGCharacterDataMap m_characterDataMap;
Vector<SVGTextMetrics> m_textMetricsValues;
};
inline SVGCharacterData::SVGCharacterData()
: x(SVGTextLayoutAttributes::emptyValue())
, y(SVGTextLayoutAttributes::emptyValue())
, dx(SVGTextLayoutAttributes::emptyValue())
, dy(SVGTextLayoutAttributes::emptyValue())
, rotate(SVGTextLayoutAttributes::emptyValue())
{
}
}
#endif