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 19 matching lines...) Expand all Loading... |
30 const base::Time& time_stamp() const { return time_stamp_; } | 30 const base::Time& time_stamp() const { return time_stamp_; } |
31 int flags() const { return flags_; } | 31 int flags() const { return flags_; } |
32 | 32 |
33 // The following methods return true if the respective keys were pressed at | 33 // The following methods return true if the respective keys were pressed at |
34 // the time the event was created. | 34 // the time the event was created. |
35 bool IsShiftDown() const { return (flags_ & ui::EF_SHIFT_DOWN) != 0; } | 35 bool IsShiftDown() const { return (flags_ & ui::EF_SHIFT_DOWN) != 0; } |
36 bool IsControlDown() const { return (flags_ & ui::EF_CONTROL_DOWN) != 0; } | 36 bool IsControlDown() const { return (flags_ & ui::EF_CONTROL_DOWN) != 0; } |
37 bool IsCapsLockDown() const { return (flags_ & ui::EF_CAPS_LOCK_DOWN) != 0; } | 37 bool IsCapsLockDown() const { return (flags_ & ui::EF_CAPS_LOCK_DOWN) != 0; } |
38 bool IsAltDown() const { return (flags_ & ui::EF_ALT_DOWN) != 0; } | 38 bool IsAltDown() const { return (flags_ & ui::EF_ALT_DOWN) != 0; } |
39 | 39 |
| 40 // Returns true if the event has a valid |native_event_|. |
| 41 bool HasNativeEvent() const; |
| 42 |
40 protected: | 43 protected: |
41 Event(ui::EventType type, int flags); | 44 Event(ui::EventType type, int flags); |
42 Event(const base::NativeEvent& native_event, ui::EventType type, int flags); | 45 Event(const base::NativeEvent& native_event, ui::EventType type, int flags); |
43 Event(const Event& copy); | 46 Event(const Event& copy); |
44 void set_type(ui::EventType type) { type_ = type; } | 47 void set_type(ui::EventType type) { type_ = type; } |
45 void set_flags(int flags) { flags_ = flags; } | 48 void set_flags(int flags) { flags_ = flags; } |
46 | 49 |
47 private: | 50 private: |
48 void operator=(const Event&); | 51 void operator=(const Event&); |
49 | 52 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 203 |
201 // Bitmask of supported ui::DragDropTypes::DragOperation by the source. | 204 // Bitmask of supported ui::DragDropTypes::DragOperation by the source. |
202 int source_operations_; | 205 int source_operations_; |
203 | 206 |
204 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent); | 207 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent); |
205 }; | 208 }; |
206 | 209 |
207 } // namespace aura | 210 } // namespace aura |
208 | 211 |
209 #endif // UI_AURA_EVENT_H_ | 212 #endif // UI_AURA_EVENT_H_ |
OLD | NEW |