OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_AURA_EVENT_H_ | 5 #ifndef UI_AURA_EVENT_H_ |
6 #define UI_AURA_EVENT_H_ | 6 #define UI_AURA_EVENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/event_types.h" | 10 #include "base/event_types.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 const base::Time& time_stamp() const { return time_stamp_; } | 32 const base::Time& time_stamp() const { return time_stamp_; } |
33 int flags() const { return flags_; } | 33 int flags() const { return flags_; } |
34 | 34 |
35 // The following methods return true if the respective keys were pressed at | 35 // The following methods return true if the respective keys were pressed at |
36 // the time the event was created. | 36 // the time the event was created. |
37 bool IsShiftDown() const { return (flags_ & ui::EF_SHIFT_DOWN) != 0; } | 37 bool IsShiftDown() const { return (flags_ & ui::EF_SHIFT_DOWN) != 0; } |
38 bool IsControlDown() const { return (flags_ & ui::EF_CONTROL_DOWN) != 0; } | 38 bool IsControlDown() const { return (flags_ & ui::EF_CONTROL_DOWN) != 0; } |
39 bool IsCapsLockDown() const { return (flags_ & ui::EF_CAPS_LOCK_DOWN) != 0; } | 39 bool IsCapsLockDown() const { return (flags_ & ui::EF_CAPS_LOCK_DOWN) != 0; } |
40 bool IsAltDown() const { return (flags_ & ui::EF_ALT_DOWN) != 0; } | 40 bool IsAltDown() const { return (flags_ & ui::EF_ALT_DOWN) != 0; } |
41 | 41 |
| 42 // Returns true if the event has a valid |native_event_|. |
| 43 bool HasNativeEvent() const; |
| 44 |
42 protected: | 45 protected: |
43 Event(ui::EventType type, int flags); | 46 Event(ui::EventType type, int flags); |
44 Event(const base::NativeEvent& native_event, ui::EventType type, int flags); | 47 Event(const base::NativeEvent& native_event, ui::EventType type, int flags); |
45 Event(const Event& copy); | 48 Event(const Event& copy); |
46 void set_type(ui::EventType type) { type_ = type; } | 49 void set_type(ui::EventType type) { type_ = type; } |
47 void set_flags(int flags) { flags_ = flags; } | 50 void set_flags(int flags) { flags_ = flags; } |
48 void set_delete_native_event(bool delete_native_event) { | 51 void set_delete_native_event(bool delete_native_event) { |
49 delete_native_event_ = delete_native_event; | 52 delete_native_event_ = delete_native_event; |
50 } | 53 } |
51 | 54 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 private: | 235 private: |
233 float x_offset_; | 236 float x_offset_; |
234 float y_offset_; | 237 float y_offset_; |
235 | 238 |
236 DISALLOW_COPY_AND_ASSIGN(ScrollEvent); | 239 DISALLOW_COPY_AND_ASSIGN(ScrollEvent); |
237 }; | 240 }; |
238 | 241 |
239 } // namespace aura | 242 } // namespace aura |
240 | 243 |
241 #endif // UI_AURA_EVENT_H_ | 244 #endif // UI_AURA_EVENT_H_ |
OLD | NEW |