OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 // Returns true if the converter is used for a mouse device; | 49 // Returns true if the converter is used for a mouse device; |
50 virtual bool HasMouse() const; | 50 virtual bool HasMouse() const; |
51 | 51 |
52 // Returns true if the converter is used for a touchpad device. | 52 // Returns true if the converter is used for a touchpad device. |
53 virtual bool HasTouchpad() const; | 53 virtual bool HasTouchpad() const; |
54 | 54 |
55 // Returns true if the converter is used for a touchscreen device. | 55 // Returns true if the converter is used for a touchscreen device. |
56 virtual bool HasTouchscreen() const; | 56 virtual bool HasTouchscreen() const; |
57 | 57 |
| 58 // Returns true if the converter is used for a device with a caps lock LED. |
| 59 virtual bool HasCapsLockLed() const; |
| 60 |
58 // Returns the size of the touchscreen device if the converter is used for a | 61 // Returns the size of the touchscreen device if the converter is used for a |
59 // touchscreen device. | 62 // touchscreen device. |
60 virtual gfx::Size GetTouchscreenSize() const; | 63 virtual gfx::Size GetTouchscreenSize() const; |
61 | 64 |
62 // Returns the number of touch points this device supports. Should not be | 65 // Returns the number of touch points this device supports. Should not be |
63 // called unless HasTouchscreen() returns true | 66 // called unless HasTouchscreen() returns true |
64 virtual int GetTouchPoints() const; | 67 virtual int GetTouchPoints() const; |
65 | 68 |
66 // Sets which keyboard keys should be processed. | 69 // Sets which keyboard keys should be processed. |
67 virtual void SetAllowedKeys(scoped_ptr<std::set<DomCode>> allowed_keys); | 70 virtual void SetAllowedKeys(scoped_ptr<std::set<DomCode>> allowed_keys); |
68 | 71 |
69 // Allows all keys to be processed. | 72 // Allows all keys to be processed. |
70 virtual void AllowAllKeys(); | 73 virtual void AllowAllKeys(); |
71 | 74 |
| 75 // Update caps lock LED state. |
| 76 virtual void SetCapsLockLed(bool enabled); |
| 77 |
72 // Helper to generate a base::TimeDelta from an input_event's time | 78 // Helper to generate a base::TimeDelta from an input_event's time |
73 static base::TimeDelta TimeDeltaFromInputEvent(const input_event& event); | 79 static base::TimeDelta TimeDeltaFromInputEvent(const input_event& event); |
74 | 80 |
75 protected: | 81 protected: |
76 // base::MessagePumpLibevent::Watcher: | 82 // base::MessagePumpLibevent::Watcher: |
77 void OnFileCanWriteWithoutBlocking(int fd) override; | 83 void OnFileCanWriteWithoutBlocking(int fd) override; |
78 | 84 |
79 // File descriptor to read. | 85 // File descriptor to read. |
80 int fd_; | 86 int fd_; |
81 | 87 |
(...skipping 12 matching lines...) Expand all Loading... |
94 // Controller for watching the input fd. | 100 // Controller for watching the input fd. |
95 base::MessagePumpLibevent::FileDescriptorWatcher controller_; | 101 base::MessagePumpLibevent::FileDescriptorWatcher controller_; |
96 | 102 |
97 private: | 103 private: |
98 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev); | 104 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev); |
99 }; | 105 }; |
100 | 106 |
101 } // namespace ui | 107 } // namespace ui |
102 | 108 |
103 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ | 109 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ |
OLD | NEW |