#ifndef SVGLocatable_h
#define SVGLocatable_h
#if ENABLE(SVG)
#include "AffineTransform.h"
namespace WebCore {
class FloatRect;
class SVGElement;
typedef int ExceptionCode;
class SVGLocatable {
public:
virtual ~SVGLocatable() { }
virtual SVGElement* nearestViewportElement() const = 0;
virtual SVGElement* farthestViewportElement() const = 0;
enum StyleUpdateStrategy { AllowStyleUpdate, DisallowStyleUpdate };
virtual FloatRect getBBox(StyleUpdateStrategy) = 0;
virtual AffineTransform getCTM(StyleUpdateStrategy) = 0;
virtual AffineTransform getScreenCTM(StyleUpdateStrategy) = 0;
AffineTransform getTransformToElement(SVGElement*, ExceptionCode&, StyleUpdateStrategy = AllowStyleUpdate);
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(SVGElement*, StyleUpdateStrategy);
static AffineTransform computeCTM(SVGElement*, CTMScope, StyleUpdateStrategy);
};
}
#endif // ENABLE(SVG)
#endif // SVGLocatable_h