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_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/time.h" | 10 #include "base/time.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 #if defined(USE_AURA) | 33 #if defined(USE_AURA) |
34 typedef aura::Event* NativeEvent; | 34 typedef aura::Event* NativeEvent; |
35 #else | 35 #else |
36 typedef base::NativeEvent NativeEvent; | 36 typedef base::NativeEvent NativeEvent; |
37 #endif | 37 #endif |
38 | 38 |
39 class View; | 39 class View; |
40 | 40 |
41 namespace internal { | 41 namespace internal { |
42 class NativeWidgetView; | |
43 class RootView; | 42 class RootView; |
44 } | 43 } |
45 | 44 |
46 //////////////////////////////////////////////////////////////////////////////// | 45 //////////////////////////////////////////////////////////////////////////////// |
47 // | 46 // |
48 // Event class | 47 // Event class |
49 // | 48 // |
50 // An event encapsulates an input event that can be propagated into view | 49 // An event encapsulates an input event that can be propagated into view |
51 // hierarchies. An event has a type, some flags and a time stamp. | 50 // hierarchies. An event has a type, some flags and a time stamp. |
52 // | 51 // |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 bool IsRightMouseButton() const { | 218 bool IsRightMouseButton() const { |
220 return (flags() & ui::EF_RIGHT_BUTTON_DOWN) != 0; | 219 return (flags() & ui::EF_RIGHT_BUTTON_DOWN) != 0; |
221 } | 220 } |
222 | 221 |
223 protected: | 222 protected: |
224 MouseEvent(const MouseEvent& model, View* root) | 223 MouseEvent(const MouseEvent& model, View* root) |
225 : LocatedEvent(model, root) { | 224 : LocatedEvent(model, root) { |
226 } | 225 } |
227 | 226 |
228 private: | 227 private: |
229 friend class internal::NativeWidgetView; | |
230 friend class internal::RootView; | 228 friend class internal::RootView; |
231 | 229 |
232 DISALLOW_COPY_AND_ASSIGN(MouseEvent); | 230 DISALLOW_COPY_AND_ASSIGN(MouseEvent); |
233 }; | 231 }; |
234 | 232 |
235 //////////////////////////////////////////////////////////////////////////////// | 233 //////////////////////////////////////////////////////////////////////////////// |
236 // | 234 // |
237 // TouchEvent class | 235 // TouchEvent class |
238 // | 236 // |
239 // A touch event is generated by touch screen and advanced track | 237 // A touch event is generated by touch screen and advanced track |
(...skipping 22 matching lines...) Expand all Loading... |
262 TouchEvent(const TouchEvent& model, View* source, View* target); | 260 TouchEvent(const TouchEvent& model, View* source, View* target); |
263 | 261 |
264 int identity() const { return touch_id_; } | 262 int identity() const { return touch_id_; } |
265 | 263 |
266 float radius_x() const { return radius_x_; } | 264 float radius_x() const { return radius_x_; } |
267 float radius_y() const { return radius_y_; } | 265 float radius_y() const { return radius_y_; } |
268 float rotation_angle() const { return rotation_angle_; } | 266 float rotation_angle() const { return rotation_angle_; } |
269 float force() const { return force_; } | 267 float force() const { return force_; } |
270 | 268 |
271 private: | 269 private: |
272 friend class internal::NativeWidgetView; | |
273 friend class internal::RootView; | 270 friend class internal::RootView; |
274 | 271 |
275 TouchEvent(const TouchEvent& model, View* root); | 272 TouchEvent(const TouchEvent& model, View* root); |
276 | 273 |
277 // The identity (typically finger) of the touch starting at 0 and incrementing | 274 // The identity (typically finger) of the touch starting at 0 and incrementing |
278 // for each separable additional touch that the hardware can detect. | 275 // for each separable additional touch that the hardware can detect. |
279 const int touch_id_; | 276 const int touch_id_; |
280 | 277 |
281 // Radius of the X (major) axis of the touch ellipse. 1.0 if unknown. | 278 // Radius of the X (major) axis of the touch ellipse. 1.0 if unknown. |
282 const float radius_x_; | 279 const float radius_x_; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 explicit MouseWheelEvent(const NativeEvent& native_event); | 355 explicit MouseWheelEvent(const NativeEvent& native_event); |
359 #if defined(TOOLKIT_USES_GTK) | 356 #if defined(TOOLKIT_USES_GTK) |
360 explicit MouseWheelEvent(GdkEvent* gdk_event); | 357 explicit MouseWheelEvent(GdkEvent* gdk_event); |
361 #endif | 358 #endif |
362 | 359 |
363 // The amount to scroll. This is in multiples of kWheelDelta. | 360 // The amount to scroll. This is in multiples of kWheelDelta. |
364 int offset() const { return offset_; } | 361 int offset() const { return offset_; } |
365 | 362 |
366 private: | 363 private: |
367 friend class internal::RootView; | 364 friend class internal::RootView; |
368 friend class internal::NativeWidgetView; | |
369 | 365 |
370 MouseWheelEvent(const MouseWheelEvent& model, View* root) | 366 MouseWheelEvent(const MouseWheelEvent& model, View* root) |
371 : MouseEvent(model, root), | 367 : MouseEvent(model, root), |
372 offset_(model.offset_) { | 368 offset_(model.offset_) { |
373 } | 369 } |
374 | 370 |
375 int offset_; | 371 int offset_; |
376 | 372 |
377 DISALLOW_COPY_AND_ASSIGN(MouseWheelEvent); | 373 DISALLOW_COPY_AND_ASSIGN(MouseWheelEvent); |
378 }; | 374 }; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 private: | 415 private: |
420 float x_offset_; | 416 float x_offset_; |
421 float y_offset_; | 417 float y_offset_; |
422 | 418 |
423 DISALLOW_COPY_AND_ASSIGN(ScrollEvent); | 419 DISALLOW_COPY_AND_ASSIGN(ScrollEvent); |
424 }; | 420 }; |
425 | 421 |
426 } // namespace views | 422 } // namespace views |
427 | 423 |
428 #endif // UI_VIEWS_EVENTS_EVENT_H_ | 424 #endif // UI_VIEWS_EVENTS_EVENT_H_ |
OLD | NEW |