#ifndef UI_WM_CORE_CURSOR_MANAGER_H_
#define UI_WM_CORE_CURSOR_MANAGER_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "ui/aura/client/cursor_client.h"
#include "ui/base/cursor/cursor.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/point.h"
#include "ui/wm/core/native_cursor_manager_delegate.h"
#include "ui/wm/core/wm_core_export.h"
namespace gfx {
class Display;
}
namespace wm {
namespace internal {
class CursorState;
}
class NativeCursorManager;
class WM_CORE_EXPORT CursorManager : public aura::client::CursorClient,
public NativeCursorManagerDelegate {
public:
CursorManager(scoped_ptr<NativeCursorManager> delegate);
virtual ~CursorManager();
virtual void SetCursor(gfx::NativeCursor) OVERRIDE;
virtual gfx::NativeCursor GetCursor() const OVERRIDE;
virtual void ShowCursor() OVERRIDE;
virtual void HideCursor() OVERRIDE;
virtual bool IsCursorVisible() const OVERRIDE;
virtual void SetScale(float scale) OVERRIDE;
virtual float GetScale() const OVERRIDE;
virtual void SetCursorSet(ui::CursorSetType cursor_set) OVERRIDE;
virtual ui::CursorSetType GetCursorSet() const OVERRIDE;
virtual void EnableMouseEvents() OVERRIDE;
virtual void DisableMouseEvents() OVERRIDE;
virtual bool IsMouseEventsEnabled() const OVERRIDE;
virtual void SetDisplay(const gfx::Display& display) OVERRIDE;
virtual void LockCursor() OVERRIDE;
virtual void UnlockCursor() OVERRIDE;
virtual bool IsCursorLocked() const OVERRIDE;
virtual void AddObserver(
aura::client::CursorClientObserver* observer) OVERRIDE;
virtual void RemoveObserver(
aura::client::CursorClientObserver* observer) OVERRIDE;
private:
virtual void CommitCursor(gfx::NativeCursor cursor) OVERRIDE;
virtual void CommitVisibility(bool visible) OVERRIDE;
virtual void CommitScale(float scale) OVERRIDE;
virtual void CommitCursorSet(ui::CursorSetType cursor_set) OVERRIDE;
virtual void CommitMouseEventsEnabled(bool enabled) OVERRIDE;
scoped_ptr<NativeCursorManager> delegate_;
int cursor_lock_count_;
scoped_ptr<internal::CursorState> current_state_;
scoped_ptr<internal::CursorState> state_on_unlock_;
ObserverList<aura::client::CursorClientObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(CursorManager);
};
}
#endif