AutoscrollController.h [plain text]
#ifndef AutoscrollController_h
#define AutoscrollController_h
#include "IntPoint.h"
#include "Timer.h"
namespace WebCore {
class EventHandler;
class Frame;
class FrameView;
class Node;
class PlatformMouseEvent;
class RenderBox;
class RenderObject;
enum AutoscrollType {
NoAutoscroll,
AutoscrollForDragAndDrop,
AutoscrollForSelection,
#if ENABLE(PAN_SCROLLING)
AutoscrollForPanCanStop,
AutoscrollForPan,
#endif
};
class AutoscrollController {
public:
AutoscrollController();
RenderBox* autoscrollRenderer() const;
bool autoscrollInProgress() const;
bool panScrollInProgress() const;
void startAutoscrollForSelection(RenderObject*);
void stopAutoscrollTimer(bool rendererIsBeingDestroyed = false);
void updateAutoscrollRenderer();
void updateDragAndDrop(Node* targetNode, const IntPoint& eventPosition, double eventTime);
#if ENABLE(PAN_SCROLLING)
void didPanScrollStart();
void didPanScrollStop();
void handleMouseReleaseEvent(const PlatformMouseEvent&);
void setPanScrollInProgress(bool);
void startPanScrolling(RenderBox*, const IntPoint&);
#endif
private:
void autoscrollTimerFired(Timer<AutoscrollController>*);
void startAutoscrollTimer();
#if ENABLE(PAN_SCROLLING)
void updatePanScrollState(FrameView*, const IntPoint&);
#endif
Timer<AutoscrollController> m_autoscrollTimer;
RenderBox* m_autoscrollRenderer;
AutoscrollType m_autoscrollType;
IntPoint m_dragAndDropAutoscrollReferencePosition;
double m_dragAndDropAutoscrollStartTime;
#if ENABLE(PAN_SCROLLING)
IntPoint m_panScrollStartPos;
#endif
};
}
#endif // AutoscrollController_h