#ifndef Cursor_h
#define Cursor_h
#include "platform/PlatformExport.h"
#include "platform/geometry/IntPoint.h"
#include "platform/graphics/Image.h"
#include "wtf/Assertions.h"
#include "wtf/RefPtr.h"
namespace WebCore {
class PLATFORM_EXPORT Cursor {
WTF_MAKE_FAST_ALLOCATED;
public:
enum Type {
Pointer = 0,
Cross,
Hand,
IBeam,
Wait,
Help,
EastResize,
NorthResize,
NorthEastResize,
NorthWestResize,
SouthResize,
SouthEastResize,
SouthWestResize,
WestResize,
NorthSouthResize,
EastWestResize,
NorthEastSouthWestResize,
NorthWestSouthEastResize,
ColumnResize,
RowResize,
MiddlePanning,
EastPanning,
NorthPanning,
NorthEastPanning,
NorthWestPanning,
SouthPanning,
SouthEastPanning,
SouthWestPanning,
WestPanning,
Move,
VerticalText,
Cell,
ContextMenu,
Alias,
Progress,
NoDrop,
Copy,
None,
NotAllowed,
ZoomIn,
ZoomOut,
Grab,
Grabbing,
Custom
};
static const Cursor& fromType(Cursor::Type);
Cursor()
: m_type(static_cast<Type>(-1))
{
}
Cursor(Image*, const IntPoint& hotSpot);
Cursor(Image*, const IntPoint& hotSpot, float imageScaleFactor);
Cursor(const Cursor&);
~Cursor();
Cursor& operator=(const Cursor&);
explicit Cursor(Type);
Type type() const
{
ASSERT(m_type >= 0 && m_type <= Custom);
return m_type;
}
Image* image() const { return m_image.get(); }
const IntPoint& hotSpot() const { return m_hotSpot; }
float imageScaleFactor() const { return m_imageScaleFactor; }
private:
Type m_type;
RefPtr<Image> m_image;
IntPoint m_hotSpot;
float m_imageScaleFactor;
};
PLATFORM_EXPORT IntPoint determineHotSpot(Image*, const IntPoint& specifiedHotSpot);
PLATFORM_EXPORT const Cursor& pointerCursor();
PLATFORM_EXPORT const Cursor& crossCursor();
PLATFORM_EXPORT const Cursor& handCursor();
PLATFORM_EXPORT const Cursor& moveCursor();
PLATFORM_EXPORT const Cursor& iBeamCursor();
PLATFORM_EXPORT const Cursor& waitCursor();
PLATFORM_EXPORT const Cursor& helpCursor();
PLATFORM_EXPORT const Cursor& eastResizeCursor();
PLATFORM_EXPORT const Cursor& northResizeCursor();
PLATFORM_EXPORT const Cursor& northEastResizeCursor();
PLATFORM_EXPORT const Cursor& northWestResizeCursor();
PLATFORM_EXPORT const Cursor& southResizeCursor();
PLATFORM_EXPORT const Cursor& southEastResizeCursor();
PLATFORM_EXPORT const Cursor& southWestResizeCursor();
PLATFORM_EXPORT const Cursor& westResizeCursor();
PLATFORM_EXPORT const Cursor& northSouthResizeCursor();
PLATFORM_EXPORT const Cursor& eastWestResizeCursor();
PLATFORM_EXPORT const Cursor& northEastSouthWestResizeCursor();
PLATFORM_EXPORT const Cursor& northWestSouthEastResizeCursor();
PLATFORM_EXPORT const Cursor& columnResizeCursor();
PLATFORM_EXPORT const Cursor& rowResizeCursor();
PLATFORM_EXPORT const Cursor& middlePanningCursor();
PLATFORM_EXPORT const Cursor& eastPanningCursor();
PLATFORM_EXPORT const Cursor& northPanningCursor();
PLATFORM_EXPORT const Cursor& northEastPanningCursor();
PLATFORM_EXPORT const Cursor& northWestPanningCursor();
PLATFORM_EXPORT const Cursor& southPanningCursor();
PLATFORM_EXPORT const Cursor& southEastPanningCursor();
PLATFORM_EXPORT const Cursor& southWestPanningCursor();
PLATFORM_EXPORT const Cursor& westPanningCursor();
PLATFORM_EXPORT const Cursor& verticalTextCursor();
PLATFORM_EXPORT const Cursor& cellCursor();
PLATFORM_EXPORT const Cursor& contextMenuCursor();
PLATFORM_EXPORT const Cursor& noDropCursor();
PLATFORM_EXPORT const Cursor& notAllowedCursor();
PLATFORM_EXPORT const Cursor& progressCursor();
PLATFORM_EXPORT const Cursor& aliasCursor();
PLATFORM_EXPORT const Cursor& zoomInCursor();
PLATFORM_EXPORT const Cursor& zoomOutCursor();
PLATFORM_EXPORT const Cursor& copyCursor();
PLATFORM_EXPORT const Cursor& noneCursor();
PLATFORM_EXPORT const Cursor& grabCursor();
PLATFORM_EXPORT const Cursor& grabbingCursor();
}
#endif