Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / public / platform / WebPointerProperties.h
bloba8c168089cb8d570a08f12f68e556054caebedba
1 // Copyright (c) 2015 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 WebPointerProperties_h
6 #define WebPointerProperties_h
8 namespace blink {
10 // This class encapsulates the properties that are common between mouse and
11 // pointer events and touch points as we transition towards the unified pointer
12 // event model.
13 // TODO(e_hakkinen): Replace WebTouchEvent with WebPointerEvent, remove
14 // WebTouchEvent and WebTouchPoint and merge this into WebPointerEvent.
15 class WebPointerProperties {
16 public:
17 WebPointerProperties()
18 : button(ButtonNone)
19 , id(0)
20 , force(0.f)
21 , tiltX(0)
22 , tiltY(0)
23 , pointerType(PointerTypeUnknown)
27 enum Button {
28 ButtonNone = -1,
29 ButtonLeft,
30 ButtonMiddle,
31 ButtonRight
34 enum PointerType {
35 PointerTypeUnknown,
36 PointerTypeMouse,
37 PointerTypePen,
38 PointerTypeTouch
41 Button button;
43 int id;
44 float force;
46 // Tilt of a pen stylus from surface normal as plane angles in degrees,
47 // Values lie in [-90,90]. A positive tiltX is to the right and a positive
48 // tiltY is towards the user.
49 int tiltX;
50 int tiltY;
52 PointerType pointerType;
55 } // namespace blink
57 #endif