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.
5 #ifndef UI_BASE_TOUCH_TOUCH_DEVICE_H_
6 #define UI_BASE_TOUCH_TOUCH_DEVICE_H_
8 #include "ui/base/ui_base_export.h"
10 #if defined(OS_ANDROID)
14 // TODO(mustaq@chromium.org): This covers more than just touches. Rename to
15 // input_device? crbug.com/438794
19 // Returns true if a touch device is available.
20 UI_BASE_EXPORT
bool IsTouchDevicePresent();
22 // Returns the maximum number of simultaneous touch contacts supported
23 // by the device. In the case of devices with multiple digitizers (e.g.
24 // multiple touchscreens), the value MUST be the maximum of the set of
25 // maximum supported contacts by each individual digitizer.
26 // For example, suppose a device has 3 touchscreens, which support 2, 5,
27 // and 10 simultaneous touch contacts, respectively. This returns 10.
28 // http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints
29 UI_BASE_EXPORT
int MaxTouchPoints();
31 // Bit field values indicating available pointer types. Identical to
32 // blink::WebSettings::PointerType enums, enforced by compile-time assertions
33 // in content/public/common/web_preferences.cc .
34 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.base
35 // GENERATED_JAVA_PREFIX_TO_STRIP: POINTER_TYPE_
37 POINTER_TYPE_NONE
= 1 << 0,
38 POINTER_TYPE_FIRST
= POINTER_TYPE_NONE
,
39 POINTER_TYPE_COARSE
= 1 << 1,
40 POINTER_TYPE_FINE
= 1 << 2,
41 POINTER_TYPE_LAST
= POINTER_TYPE_FINE
44 // Bit field values indicating available hover types. Identical to
45 // blink::WebSettings::HoverType enums, enforced by compile-time assertions
46 // in content/public/common/web_preferences.cc .
47 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.base
48 // GENERATED_JAVA_PREFIX_TO_STRIP: HOVER_TYPE_
50 HOVER_TYPE_NONE
= 1 << 0,
51 HOVER_TYPE_FIRST
= HOVER_TYPE_NONE
,
52 HOVER_TYPE_ON_DEMAND
= 1 << 1,
53 HOVER_TYPE_HOVER
= 1 << 2,
54 HOVER_TYPE_LAST
= HOVER_TYPE_HOVER
57 UI_BASE_EXPORT
int GetAvailablePointerTypes();
58 UI_BASE_EXPORT PointerType
GetPrimaryPointerType();
59 UI_BASE_EXPORT
int GetAvailableHoverTypes();
60 UI_BASE_EXPORT HoverType
GetPrimaryHoverType();
62 #if defined(OS_ANDROID)
63 bool RegisterTouchDeviceAndroid(JNIEnv
* env
);
68 #endif // UI_BASE_TOUCH_TOUCH_DEVICE_H_