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_BASE_EVENTS_EVENT_H_ | 5 #ifndef UI_BASE_EVENTS_EVENT_H_ |
6 #define UI_BASE_EVENTS_EVENT_H_ | 6 #define UI_BASE_EVENTS_EVENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/event_types.h" | 10 #include "base/event_types.h" |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 radius_y_(model.radius_y_), | 403 radius_y_(model.radius_y_), |
404 rotation_angle_(model.rotation_angle_), | 404 rotation_angle_(model.rotation_angle_), |
405 force_(model.force_) { | 405 force_(model.force_) { |
406 } | 406 } |
407 | 407 |
408 TouchEvent(EventType type, | 408 TouchEvent(EventType type, |
409 const gfx::Point& root_location, | 409 const gfx::Point& root_location, |
410 int touch_id, | 410 int touch_id, |
411 base::TimeDelta time_stamp); | 411 base::TimeDelta time_stamp); |
412 | 412 |
| 413 TouchEvent(EventType type, |
| 414 const gfx::Point& location, |
| 415 int flags, |
| 416 int touch_id, |
| 417 base::TimeDelta timestamp, |
| 418 float radius_x, |
| 419 float radius_y, |
| 420 float angle, |
| 421 float force); |
| 422 |
413 virtual ~TouchEvent(); | 423 virtual ~TouchEvent(); |
414 | 424 |
415 int touch_id() const { return touch_id_; } | 425 int touch_id() const { return touch_id_; } |
416 float radius_x() const { return radius_x_; } | 426 float radius_x() const { return radius_x_; } |
417 float radius_y() const { return radius_y_; } | 427 float radius_y() const { return radius_y_; } |
418 float rotation_angle() const { return rotation_angle_; } | 428 float rotation_angle() const { return rotation_angle_; } |
419 float force() const { return force_; } | 429 float force() const { return force_; } |
420 | 430 |
421 // Calibrate the touch-point. This is useful when the touch-surface that | 431 // Calibrate the touch-point. This is useful when the touch-surface that |
422 // generates the events need to be remapped to a surface of a different | 432 // generates the events need to be remapped to a surface of a different |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 | 467 |
458 // Angle of the major axis away from the X axis. Default 0.0. | 468 // Angle of the major axis away from the X axis. Default 0.0. |
459 float rotation_angle_; | 469 float rotation_angle_; |
460 | 470 |
461 // Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0. | 471 // Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0. |
462 float force_; | 472 float force_; |
463 | 473 |
464 DISALLOW_COPY_AND_ASSIGN(TouchEvent); | 474 DISALLOW_COPY_AND_ASSIGN(TouchEvent); |
465 }; | 475 }; |
466 | 476 |
467 class UI_EXPORT TestTouchEvent : public TouchEvent { | |
468 public: | |
469 // Create a new touch event. | |
470 TestTouchEvent(EventType type, | |
471 int x, | |
472 int y, | |
473 int flags, | |
474 int touch_id, | |
475 float radius_x, | |
476 float radius_y, | |
477 float angle, | |
478 float force); | |
479 private: | |
480 DISALLOW_COPY_AND_ASSIGN(TestTouchEvent); | |
481 }; | |
482 | |
483 class UI_EXPORT KeyEvent : public Event { | 477 class UI_EXPORT KeyEvent : public Event { |
484 public: | 478 public: |
485 KeyEvent(const base::NativeEvent& native_event, bool is_char); | 479 KeyEvent(const base::NativeEvent& native_event, bool is_char); |
486 | 480 |
487 // Used for synthetic events in testing. | 481 // Used for synthetic events in testing. |
488 KeyEvent(EventType type, KeyboardCode key_code, int flags); | 482 KeyEvent(EventType type, KeyboardCode key_code, int flags); |
489 | 483 |
490 // These setters allow an I18N virtual keyboard to fabricate a keyboard event | 484 // These setters allow an I18N virtual keyboard to fabricate a keyboard event |
491 // which does not have a corresponding KeyboardCode (example: U+00E1 Latin | 485 // which does not have a corresponding KeyboardCode (example: U+00E1 Latin |
492 // small letter A with acute, U+0410 Cyrillic capital letter A.) | 486 // small letter A with acute, U+0410 Cyrillic capital letter A.) |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 // This value is stored as a bitfield because the number of touch ids varies, | 631 // This value is stored as a bitfield because the number of touch ids varies, |
638 // but we currently don't need more than 32 touches at a time. | 632 // but we currently don't need more than 32 touches at a time. |
639 const unsigned int touch_ids_bitfield_; | 633 const unsigned int touch_ids_bitfield_; |
640 | 634 |
641 DISALLOW_COPY_AND_ASSIGN(GestureEvent); | 635 DISALLOW_COPY_AND_ASSIGN(GestureEvent); |
642 }; | 636 }; |
643 | 637 |
644 } // namespace ui | 638 } // namespace ui |
645 | 639 |
646 #endif // UI_BASE_EVENTS_EVENT_H_ | 640 #endif // UI_BASE_EVENTS_EVENT_H_ |
OLD | NEW |