| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_VIEWS_EVENTS_EVENT_H_ | 5 #ifndef UI_VIEWS_EVENTS_EVENT_H_ |
| 6 #define UI_VIEWS_EVENTS_EVENT_H_ | 6 #define UI_VIEWS_EVENTS_EVENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 // | 283 // |
| 284 //////////////////////////////////////////////////////////////////////////////// | 284 //////////////////////////////////////////////////////////////////////////////// |
| 285 class VIEWS_EXPORT KeyEvent : public Event { | 285 class VIEWS_EXPORT KeyEvent : public Event { |
| 286 public: | 286 public: |
| 287 explicit KeyEvent(const NativeEvent& native_event); | 287 explicit KeyEvent(const NativeEvent& native_event); |
| 288 | 288 |
| 289 // Creates a new KeyEvent synthetically (i.e. not in response to an input | 289 // Creates a new KeyEvent synthetically (i.e. not in response to an input |
| 290 // event from the host environment). This is typically only used in testing as | 290 // event from the host environment). This is typically only used in testing as |
| 291 // some metadata obtainable from the underlying native event is not present. | 291 // some metadata obtainable from the underlying native event is not present. |
| 292 // It's also used by input methods to fabricate keyboard events. | 292 // It's also used by input methods to fabricate keyboard events. |
| 293 KeyEvent(ui::EventType type, | 293 KeyEvent(ui::EventType type, ui::KeyboardCode key_code, int event_flags); |
| 294 ui::KeyboardCode key_code, | |
| 295 int event_flags); | |
| 296 | 294 |
| 297 ui::KeyboardCode key_code() const { return key_code_; } | 295 ui::KeyboardCode key_code() const { return key_code_; } |
| 298 | 296 |
| 299 // These setters allow an I18N virtual keyboard to fabricate a keyboard event | 297 // These setters allow an I18N virtual keyboard to fabricate a keyboard event |
| 300 // which does not have a corresponding ui::KeyboardCode (example: U+00E1 Latin | 298 // which does not have a corresponding ui::KeyboardCode (example: U+00E1 Latin |
| 301 // small letter A with acute, U+0410 Cyrillic capital letter A.) | 299 // small letter A with acute, U+0410 Cyrillic capital letter A.) |
| 302 // GetCharacter() and GetUnmodifiedCharacter() return the character. | 300 // GetCharacter() and GetUnmodifiedCharacter() return the character. |
| 303 void set_character(uint16 character) { character_ = character; } | 301 void set_character(uint16 character) { character_ = character; } |
| 304 void set_unmodified_character(uint16 unmodified_character) { | 302 void set_unmodified_character(uint16 unmodified_character) { |
| 305 unmodified_character_ = unmodified_character; | 303 unmodified_character_ = unmodified_character; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 DISALLOW_COPY_AND_ASSIGN(GestureEventForTest); | 444 DISALLOW_COPY_AND_ASSIGN(GestureEventForTest); |
| 447 }; | 445 }; |
| 448 | 446 |
| 449 #if defined(OS_WIN) | 447 #if defined(OS_WIN) |
| 450 int GetModifiersFromKeyState(); | 448 int GetModifiersFromKeyState(); |
| 451 #endif | 449 #endif |
| 452 | 450 |
| 453 } // namespace views | 451 } // namespace views |
| 454 | 452 |
| 455 #endif // UI_VIEWS_EVENTS_EVENT_H_ | 453 #endif // UI_VIEWS_EVENTS_EVENT_H_ |
| OLD | NEW |