| 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 PPAPI_CPP_INPUT_EVENT_H_ | 5 #ifndef PPAPI_CPP_INPUT_EVENT_H_ |
| 6 #define PPAPI_CPP_INPUT_EVENT_H_ | 6 #define PPAPI_CPP_INPUT_EVENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ppapi/c/ppb_input_event.h" | 10 #include "ppapi/c/ppb_input_event.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class Var; | 21 class Var; |
| 22 | 22 |
| 23 /// This class represents an input event resource. Normally you will get passed | 23 /// This class represents an input event resource. Normally you will get passed |
| 24 /// this object through the HandleInputEvent() function on the | 24 /// this object through the HandleInputEvent() function on the |
| 25 /// <code>Instance</code> object. | 25 /// <code>Instance</code> object. |
| 26 /// | 26 /// |
| 27 /// Typically you would check the type of the event and then create the | 27 /// Typically you would check the type of the event and then create the |
| 28 /// appropriate event-specific object to query the properties. | 28 /// appropriate event-specific object to query the properties. |
| 29 /// | 29 /// |
| 30 /// <strong>Example:</strong> | 30 /// <strong>Example:</strong> |
| 31 /// @code | 31 /// <code> |
| 32 /// | 32 /// |
| 33 /// bool MyInstance::HandleInputEvent(const pp::InputEvent& event) { | 33 /// bool MyInstance::HandleInputEvent(const pp::InputEvent& event) { |
| 34 /// switch (event.GetType()) { | 34 /// switch (event.GetType()) { |
| 35 /// case PP_INPUTEVENT_TYPE_MOUSE_DOWN { | 35 /// case PP_INPUTEVENT_TYPE_MOUSE_DOWN { |
| 36 /// pp::MouseInputEvent mouse_event(event); | 36 /// pp::MouseInputEvent mouse_event(event); |
| 37 /// return HandleMouseDown(mouse_event.GetMousePosition()); | 37 /// return HandleMouseDown(mouse_event.GetMousePosition()); |
| 38 /// } | 38 /// } |
| 39 /// default: | 39 /// default: |
| 40 /// return false; | 40 /// return false; |
| 41 /// } | 41 /// } |
| 42 /// | 42 /// |
| 43 /// @endcode | 43 /// </code> |
| 44 class InputEvent : public Resource { | 44 class InputEvent : public Resource { |
| 45 public: | 45 public: |
| 46 /// Default constructor that creates an is_null() InputEvent object. | 46 /// Default constructor that creates an is_null() InputEvent object. |
| 47 InputEvent(); | 47 InputEvent(); |
| 48 | 48 |
| 49 /// This constructor constructs an input event from the provided input event | 49 /// This constructor constructs an input event from the provided input event |
| 50 /// resource ID. The InputEvent object will be is_null() if the given | 50 /// resource ID. The InputEvent object will be is_null() if the given |
| 51 /// resource is not a valid input event. | 51 /// resource is not a valid input event. |
| 52 /// | 52 /// |
| 53 /// @param[in] input_event_resource A input event resource ID. | 53 /// @param[in] input_event_resource A input event resource ID. |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 /// | 282 /// |
| 283 /// @return A string var representing a single typed character for character | 283 /// @return A string var representing a single typed character for character |
| 284 /// input events. For non-character input events the return value will be an | 284 /// input events. For non-character input events the return value will be an |
| 285 /// undefined var. | 285 /// undefined var. |
| 286 Var GetCharacterText() const; | 286 Var GetCharacterText() const; |
| 287 }; | 287 }; |
| 288 | 288 |
| 289 } // namespace pp | 289 } // namespace pp |
| 290 | 290 |
| 291 #endif // PPAPI_CPP_INPUT_EVENT_H_ | 291 #endif // PPAPI_CPP_INPUT_EVENT_H_ |
| OLD | NEW |