[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / ui / base / cursor / image_cursors.h
blob25676ca462f4985fa55679a94db9340f6252a15d
1 // Copyright 2014 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.
5 #ifndef UI_BASE_CURSOR_IMAGE_CURSORS_H_
6 #define UI_BASE_CURSOR_IMAGE_CURSORS_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string16.h"
10 #include "ui/base/cursor/cursor.h"
11 #include "ui/base/ui_base_export.h"
12 #include "ui/gfx/display.h"
13 #include "ui/gfx/native_widget_types.h"
15 namespace ui {
17 class CursorLoader;
19 // A utility class that provides cursors for NativeCursors for which we have
20 // image resources.
21 class UI_BASE_EXPORT ImageCursors {
22 public:
23 ImageCursors();
24 ~ImageCursors();
26 // Returns the scale and rotation of the currently loaded cursor.
27 float GetScale() const;
28 gfx::Display::Rotation GetRotation() const;
30 // Sets the display the cursors are loaded for. |scale_factor| determines the
31 // size of the image to load. Returns true if the cursor image is reloaded.
32 bool SetDisplay(const gfx::Display& display, float scale_factor);
34 // Sets the type of the mouse cursor icon.
35 void SetCursorSet(CursorSetType cursor_set);
37 // Sets the platform cursor based on the native type of |cursor|.
38 void SetPlatformCursor(gfx::NativeCursor* cursor);
40 private:
41 // Reloads the all loaded cursors in the cursor loader.
42 void ReloadCursors();
44 scoped_ptr<CursorLoader> cursor_loader_;
45 CursorSetType cursor_set_;
47 DISALLOW_COPY_AND_ASSIGN(ImageCursors);
50 } // namespace ui
52 #endif // UI_BASE_CURSOR_IMAGE_CURSORS_H_