#ifndef SVGLocatable_h
#define SVGLocatable_h
#if ENABLE(SVG)
#include "AffineTransform.h"
#include "ExceptionCode.h"
namespace WebCore {
class FloatRect;
class SVGElement;
class SVGLocatable {
public:
SVGLocatable();
virtual ~SVGLocatable();
virtual SVGElement* nearestViewportElement() const = 0;
virtual SVGElement* farthestViewportElement() const = 0;
virtual FloatRect getBBox() const = 0;
virtual AffineTransform getCTM() const = 0;
virtual AffineTransform getScreenCTM() const = 0;
AffineTransform getTransformToElement(SVGElement*, ExceptionCode&) const;
static SVGElement* nearestViewportElement(const SVGElement*);
static SVGElement* farthestViewportElement(const SVGElement*);
enum CTMScope {
NearestViewportScope, ScreenScope };
protected:
virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const { return AffineTransform(); }
static FloatRect getBBox(const SVGElement*);
static AffineTransform computeCTM(const SVGElement*, CTMScope);
};
}
#endif // ENABLE(SVG)
#endif // SVGLocatable_h