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_EVENTS_EVENT_H_ | 5 #ifndef UI_EVENTS_EVENT_H_ |
6 #define UI_EVENTS_EVENT_H_ | 6 #define UI_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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 int changed_button_flags); | 463 int changed_button_flags); |
464 | 464 |
465 // The amount to scroll. This is in multiples of kWheelDelta. | 465 // The amount to scroll. This is in multiples of kWheelDelta. |
466 // Note: x_offset() > 0/y_offset() > 0 means scroll left/up. | 466 // Note: x_offset() > 0/y_offset() > 0 means scroll left/up. |
467 int x_offset() const { return offset_.x(); } | 467 int x_offset() const { return offset_.x(); } |
468 int y_offset() const { return offset_.y(); } | 468 int y_offset() const { return offset_.y(); } |
469 const gfx::Vector2d& offset() const { return offset_; } | 469 const gfx::Vector2d& offset() const { return offset_; } |
470 | 470 |
471 // Overridden from LocatedEvent. | 471 // Overridden from LocatedEvent. |
472 virtual void UpdateForRootTransform( | 472 virtual void UpdateForRootTransform( |
473 const gfx::Transform& inverted_root_transform) OVERRIDE; | 473 const gfx::Transform& inverted_root_transform) override; |
474 | 474 |
475 private: | 475 private: |
476 gfx::Vector2d offset_; | 476 gfx::Vector2d offset_; |
477 }; | 477 }; |
478 | 478 |
479 class EVENTS_EXPORT TouchEvent : public LocatedEvent { | 479 class EVENTS_EXPORT TouchEvent : public LocatedEvent { |
480 public: | 480 public: |
481 explicit TouchEvent(const base::NativeEvent& native_event); | 481 explicit TouchEvent(const base::NativeEvent& native_event); |
482 | 482 |
483 // Create a new TouchEvent which is identical to the provided model. | 483 // Create a new TouchEvent which is identical to the provided model. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 float radius_y() const { return radius_y_; } | 515 float radius_y() const { return radius_y_; } |
516 float rotation_angle() const { return rotation_angle_; } | 516 float rotation_angle() const { return rotation_angle_; } |
517 float force() const { return force_; } | 517 float force() const { return force_; } |
518 | 518 |
519 // Used for unit tests. | 519 // Used for unit tests. |
520 void set_radius_x(const float r) { radius_x_ = r; } | 520 void set_radius_x(const float r) { radius_x_ = r; } |
521 void set_radius_y(const float r) { radius_y_ = r; } | 521 void set_radius_y(const float r) { radius_y_ = r; } |
522 | 522 |
523 // Overridden from LocatedEvent. | 523 // Overridden from LocatedEvent. |
524 virtual void UpdateForRootTransform( | 524 virtual void UpdateForRootTransform( |
525 const gfx::Transform& inverted_root_transform) OVERRIDE; | 525 const gfx::Transform& inverted_root_transform) override; |
526 | 526 |
527 protected: | 527 protected: |
528 void set_radius(float radius_x, float radius_y) { | 528 void set_radius(float radius_x, float radius_y) { |
529 radius_x_ = radius_x; | 529 radius_x_ = radius_x; |
530 radius_y_ = radius_y; | 530 radius_y_ = radius_y; |
531 } | 531 } |
532 | 532 |
533 void set_rotation_angle(float rotation_angle) { | 533 void set_rotation_angle(float rotation_angle) { |
534 rotation_angle_ = rotation_angle; | 534 rotation_angle_ = rotation_angle; |
535 } | 535 } |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 | 806 |
807 const GestureEventDetails& details() const { return details_; } | 807 const GestureEventDetails& details() const { return details_; } |
808 | 808 |
809 private: | 809 private: |
810 GestureEventDetails details_; | 810 GestureEventDetails details_; |
811 }; | 811 }; |
812 | 812 |
813 } // namespace ui | 813 } // namespace ui |
814 | 814 |
815 #endif // UI_EVENTS_EVENT_H_ | 815 #endif // UI_EVENTS_EVENT_H_ |
OLD | NEW |