#ifndef SVGViewSpec_h
#define SVGViewSpec_h
#include "bindings/v8/ScriptWrappable.h"
#include "core/svg/SVGFitToViewBox.h"
#include "core/svg/SVGSVGElement.h"
#include "core/svg/SVGZoomAndPan.h"
#include "wtf/WeakPtr.h"
namespace WebCore {
class SVGViewSpec FINAL : public RefCounted<SVGViewSpec>, public ScriptWrappable, public SVGZoomAndPan, public SVGFitToViewBox {
public:
using RefCounted<SVGViewSpec>::ref;
using RefCounted<SVGViewSpec>::deref;
static PassRefPtr<SVGViewSpec> create(SVGSVGElement* contextElement)
{
return adoptRef(new SVGViewSpec(contextElement));
}
bool parseViewSpec(const String&);
void reset();
SVGElement* viewTarget() const;
String viewBoxString() const;
String preserveAspectRatioString() const;
String transformString() const;
String viewTargetString() const { return m_viewTargetString; }
void detachContextElement();
SVGTransformList* transform() { return m_transform ? m_transform->baseValue() : 0; }
PassRefPtr<SVGTransformListTearOff> transformFromJavascript() { return m_transform ? m_transform->baseVal() : 0; }
private:
explicit SVGViewSpec(SVGSVGElement*);
template<typename CharType>
bool parseViewSpecInternal(const CharType* ptr, const CharType* end);
SVGSVGElement* m_contextElement;
RefPtr<SVGAnimatedTransformList> m_transform;
String m_viewTargetString;
};
}
#endif