CSSCursorImageValue.h [plain text]
#ifndef CSSCursorImageValue_h
#define CSSCursorImageValue_h
#include "CSSImageValue.h"
#include "IntPoint.h"
#include <wtf/HashSet.h>
namespace WebCore {
class Document;
class Element;
class SVGElement;
class CSSCursorImageValue : public CSSValue {
public:
static PassRefPtr<CSSCursorImageValue> create(PassRefPtr<CSSValue> imageValue, bool hasHotSpot, const IntPoint& hotSpot)
{
return adoptRef(new CSSCursorImageValue(imageValue, hasHotSpot, hotSpot));
}
~CSSCursorImageValue();
bool hasHotSpot() const { return m_hasHotSpot; }
IntPoint hotSpot() const
{
if (m_hasHotSpot)
return m_hotSpot;
return IntPoint(-1, -1);
}
String customCssText() const;
bool updateIfSVGCursorIsUsed(Element*);
StyleImage* cachedImage(CachedResourceLoader*);
StyleImage* cachedOrPendingImage(Document*);
#if ENABLE(SVG)
void removeReferencedElement(SVGElement*);
#endif
bool equals(const CSSCursorImageValue&) const;
private:
CSSCursorImageValue(PassRefPtr<CSSValue> imageValue, bool hasHotSpot, const IntPoint& hotSpot);
void detachPendingImage();
#if ENABLE(SVG)
bool isSVGCursor() const;
String cachedImageURL();
void clearCachedImage();
#endif
RefPtr<CSSValue> m_imageValue;
bool m_hasHotSpot;
IntPoint m_hotSpot;
RefPtr<StyleImage> m_image;
bool m_accessedImage;
#if ENABLE(SVG)
HashSet<SVGElement*> m_referencedElements;
#endif
};
}
#endif // CSSCursorImageValue_h