- add sources.
[platform/framework/web/crosswalk.git] / src / ui / views / widget / desktop_aura / desktop_native_cursor_manager.h
1 // Copyright (c) 2012 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_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_
7
8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/views/corewm/native_cursor_manager.h"
11 #include "ui/views/views_export.h"
12
13 namespace aura {
14 class RootWindow;
15 }
16
17 namespace ui {
18 class CursorLoader;
19 }
20
21 namespace views {
22 class DesktopCursorLoaderUpdater;
23
24 namespace corewm {
25 class NativeCursorManagerDelegate;
26 }
27
28 // A NativeCursorManager that interacts with only one RootWindow. (Unlike the
29 // one in ash, which interacts with all the RootWindows that ash knows about.)
30 class VIEWS_EXPORT DesktopNativeCursorManager
31     : public views::corewm::NativeCursorManager {
32  public:
33   DesktopNativeCursorManager(
34       aura::RootWindow* window,
35       scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater);
36   virtual ~DesktopNativeCursorManager();
37
38   // Builds a cursor and sets the internal platform representation.
39   gfx::NativeCursor GetInitializedCursor(int type);
40
41  private:
42   // Overridden from views::corewm::NativeCursorManager:
43   virtual void SetDisplay(
44       const gfx::Display& display,
45       views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
46   virtual void SetCursor(
47       gfx::NativeCursor cursor,
48       views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
49   virtual void SetVisibility(
50       bool visible,
51       views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
52   virtual void SetCursorSet(
53       ui::CursorSetType cursor_set,
54       views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
55   virtual void SetScale(
56       float scale,
57       views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
58   virtual void SetMouseEventsEnabled(
59       bool enabled,
60       views::corewm::NativeCursorManagerDelegate* delegate) OVERRIDE;
61
62   aura::RootWindow* root_window_;
63   scoped_ptr<DesktopCursorLoaderUpdater> cursor_loader_updater_;
64   scoped_ptr<ui::CursorLoader> cursor_loader_;
65
66   DISALLOW_COPY_AND_ASSIGN(DesktopNativeCursorManager);
67 };
68
69 }  // namespace views
70
71 #endif  // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_NATIVE_CURSOR_MANAGER_H_
72