blob: 4b0e86540c33fd6f1a67d7cc201c3e0f00b2e2ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_MAGNIFIER_MAGNIFICATION_CONTROLLER_H_
#define ASH_MAGNIFIER_MAGNIFICATION_CONTROLLER_H_
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "ui/aura/event_filter.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
namespace aura {
class RootWindow;
}
namespace ash {
namespace internal {
class MagnificationController {
public:
virtual ~MagnificationController() {}
// Creates a new MagnificationController. The caller takes ownership of the
// returned object.
static MagnificationController* CreateInstance();
// Enables (or disables if |enabled| is false) screen magnifier feature.
virtual void SetEnabled(bool enabled) = 0;
// Sets the magnification ratio. 1.0f means no magnification.
virtual void SetScale(float scale, bool animate) = 0;
// Returns the current magnification ratio.
virtual float GetScale() const = 0;
// Set the top-left point of the magnification window.
virtual void MoveWindow(int x, int y, bool animate) = 0;
virtual void MoveWindow(const gfx::Point& point, bool animate) = 0;
// Returns the current top-left point of the magnification window.
virtual gfx::Point GetWindowPosition() const = 0;
// Ensures that the given point/rect is inside the magnification window. If
// not, the controller moves the window to contain the given point/rect.
virtual void EnsureRectIsVisible(const gfx::Rect& rect, bool animate) = 0;
virtual void EnsurePointIsVisible(const gfx::Point& point, bool animate) = 0;
protected:
MagnificationController() {}
};
} // namespace internal
} // namespace ash
#endif // ASH_MAGNIFIER_MAGNIFICATION_CONTROLLER_H_
|