| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 VIEWS_EVENT_H_ | 5 #ifndef VIEWS_EVENT_H_ |
| 6 #define VIEWS_EVENT_H_ | 6 #define VIEWS_EVENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "app/keyboard_codes.h" |
| 9 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 10 #include "base/keyboard_codes.h" | |
| 11 #include "gfx/point.h" | 11 #include "gfx/point.h" |
| 12 | 12 |
| 13 #if defined(OS_LINUX) | 13 #if defined(OS_LINUX) |
| 14 typedef struct _GdkEventKey GdkEventKey; | 14 typedef struct _GdkEventKey GdkEventKey; |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 class OSExchangeData; | 17 class OSExchangeData; |
| 18 | 18 |
| 19 namespace views { | 19 namespace views { |
| 20 | 20 |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // KeyEvent class | 302 // KeyEvent class |
| 303 // | 303 // |
| 304 // A key event is used for any input event related to the keyboard. | 304 // A key event is used for any input event related to the keyboard. |
| 305 // Note: this event is about key pressed, not typed characters. | 305 // Note: this event is about key pressed, not typed characters. |
| 306 // | 306 // |
| 307 //////////////////////////////////////////////////////////////////////////////// | 307 //////////////////////////////////////////////////////////////////////////////// |
| 308 class KeyEvent : public Event { | 308 class KeyEvent : public Event { |
| 309 public: | 309 public: |
| 310 // Create a new key event | 310 // Create a new key event |
| 311 KeyEvent(EventType type, | 311 KeyEvent(EventType type, |
| 312 base::KeyboardCode key_code, | 312 app::KeyboardCode key_code, |
| 313 int event_flags, | 313 int event_flags, |
| 314 int repeat_count, | 314 int repeat_count, |
| 315 int message_flags); | 315 int message_flags); |
| 316 #if defined(OS_LINUX) | 316 #if defined(OS_LINUX) |
| 317 explicit KeyEvent(GdkEventKey* event); | 317 explicit KeyEvent(GdkEventKey* event); |
| 318 #endif | 318 #endif |
| 319 | 319 |
| 320 // This returns a VKEY_ value as defined in base/keyboard_codes.h which is | 320 // This returns a VKEY_ value as defined in app/keyboard_codes.h which is |
| 321 // the Windows value. | 321 // the Windows value. |
| 322 // On GTK, you can use the methods in keyboard_code_conversion_gtk.cc to | 322 // On GTK, you can use the methods in keyboard_code_conversion_gtk.cc to |
| 323 // convert this value back to a GDK value if needed. | 323 // convert this value back to a GDK value if needed. |
| 324 base::KeyboardCode GetKeyCode() const { | 324 app::KeyboardCode GetKeyCode() const { |
| 325 return key_code_; | 325 return key_code_; |
| 326 } | 326 } |
| 327 | 327 |
| 328 #if defined(OS_WIN) | 328 #if defined(OS_WIN) |
| 329 bool IsExtendedKey() const; | 329 bool IsExtendedKey() const; |
| 330 #endif | 330 #endif |
| 331 | 331 |
| 332 int GetRepeatCount() const { | 332 int GetRepeatCount() const { |
| 333 return repeat_count_; | 333 return repeat_count_; |
| 334 } | 334 } |
| 335 | 335 |
| 336 #if defined(OS_WIN) | 336 #if defined(OS_WIN) |
| 337 // Returns the current state of the KeyState. | 337 // Returns the current state of the KeyState. |
| 338 static int GetKeyStateFlags(); | 338 static int GetKeyStateFlags(); |
| 339 #endif | 339 #endif |
| 340 | 340 |
| 341 private: | 341 private: |
| 342 | 342 |
| 343 base::KeyboardCode key_code_; | 343 app::KeyboardCode key_code_; |
| 344 int repeat_count_; | 344 int repeat_count_; |
| 345 int message_flags_; | 345 int message_flags_; |
| 346 | 346 |
| 347 DISALLOW_COPY_AND_ASSIGN(KeyEvent); | 347 DISALLOW_COPY_AND_ASSIGN(KeyEvent); |
| 348 }; | 348 }; |
| 349 | 349 |
| 350 //////////////////////////////////////////////////////////////////////////////// | 350 //////////////////////////////////////////////////////////////////////////////// |
| 351 // | 351 // |
| 352 // MouseWheelEvent class | 352 // MouseWheelEvent class |
| 353 // | 353 // |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 private: | 400 private: |
| 401 const OSExchangeData& data_; | 401 const OSExchangeData& data_; |
| 402 int source_operations_; | 402 int source_operations_; |
| 403 | 403 |
| 404 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent); | 404 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent); |
| 405 }; | 405 }; |
| 406 | 406 |
| 407 } // namespace views | 407 } // namespace views |
| 408 | 408 |
| 409 #endif // VIEWS_EVENT_H_ | 409 #endif // VIEWS_EVENT_H_ |
| OLD | NEW |