• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef UI_WM_CORE_NATIVE_CURSOR_MANAGER_H_
6 #define UI_WM_CORE_NATIVE_CURSOR_MANAGER_H_
7 
8 #include "base/strings/string16.h"
9 #include "ui/base/cursor/cursor.h"
10 #include "ui/wm/core/native_cursor_manager_delegate.h"
11 #include "ui/wm/wm_export.h"
12 
13 namespace gfx {
14 class Display;
15 }
16 
17 namespace wm {
18 
19 // Interface where platforms such as Ash or Desktop aura are notified of
20 // requested changes to cursor state. When requested, implementer should tell
21 // the CursorManager of any actual state changes performed through the
22 // delegate.
23 class WM_EXPORT NativeCursorManager {
24  public:
~NativeCursorManager()25   virtual ~NativeCursorManager() {}
26 
27   // A request to set the screen DPI. Can cause changes in the current cursor.
28   virtual void SetDisplay(
29       const gfx::Display& display,
30       NativeCursorManagerDelegate* delegate) = 0;
31 
32   // A request to set the cursor to |cursor|. At minimum, implementer should
33   // call NativeCursorManagerDelegate::CommitCursor() with whatever cursor is
34   // actually used.
35   virtual void SetCursor(
36       gfx::NativeCursor cursor,
37       NativeCursorManagerDelegate* delegate) = 0;
38 
39   // A request to set the visibility of the cursor. At minimum, implementer
40   // should call NativeCursorManagerDelegate::CommitVisibility() with whatever
41   // the visibility is.
42   virtual void SetVisibility(
43     bool visible,
44     NativeCursorManagerDelegate* delegate) = 0;
45 
46   // A request to set the cursor set.
47   virtual void SetCursorSet(
48       ui::CursorSetType cursor_set,
49       NativeCursorManagerDelegate* delegate) = 0;
50 
51   // A request to set whether mouse events are disabled. At minimum,
52   // implementer should call NativeCursorManagerDelegate::
53   // CommitMouseEventsEnabled() with whether mouse events are actually enabled.
54   virtual void SetMouseEventsEnabled(
55       bool enabled,
56       NativeCursorManagerDelegate* delegate) = 0;
57 };
58 
59 }  // namespace wm
60 
61 #endif  // UI_WM_CORE_NATIVE_CURSOR_MANAGER_H_
62