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 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 11 matching lines...) Expand all Loading... |
22 class Var; | 22 class Var; |
23 | 23 |
24 /// This class represents an input event resource. Normally you will get passed | 24 /// This class represents an input event resource. Normally you will get passed |
25 /// this object through the HandleInputEvent() function on the | 25 /// this object through the HandleInputEvent() function on the |
26 /// <code>Instance</code> object. | 26 /// <code>Instance</code> object. |
27 /// | 27 /// |
28 /// Typically you would check the type of the event and then create the | 28 /// Typically you would check the type of the event and then create the |
29 /// appropriate event-specific object to query the properties. | 29 /// appropriate event-specific object to query the properties. |
30 /// | 30 /// |
31 /// <strong>Example:</strong> | 31 /// <strong>Example:</strong> |
32 /// <code> | 32 /// @code |
33 /// | 33 /// |
34 /// bool MyInstance::HandleInputEvent(const pp::InputEvent& event) { | 34 /// bool MyInstance::HandleInputEvent(const pp::InputEvent& event) { |
35 /// switch (event.GetType()) { | 35 /// switch (event.GetType()) { |
36 /// case PP_INPUTEVENT_TYPE_MOUSE_DOWN { | 36 /// case PP_INPUTEVENT_TYPE_MOUSE_DOWN { |
37 /// pp::MouseInputEvent mouse_event(event); | 37 /// pp::MouseInputEvent mouse_event(event); |
38 /// return HandleMouseDown(mouse_event.GetMousePosition()); | 38 /// return HandleMouseDown(mouse_event.GetMousePosition()); |
39 /// } | 39 /// } |
40 /// default: | 40 /// default: |
41 /// return false; | 41 /// return false; |
42 /// } | 42 /// } |
43 /// | 43 /// |
44 /// </code> | 44 /// @endcode |
45 class InputEvent : public Resource { | 45 class InputEvent : public Resource { |
46 public: | 46 public: |
47 /// Default constructor that creates an is_null() InputEvent object. | 47 /// Default constructor that creates an is_null() InputEvent object. |
48 InputEvent(); | 48 InputEvent(); |
49 | 49 |
50 /// This constructor constructs an input event from the provided input event | 50 /// This constructor constructs an input event from the provided input event |
51 /// resource ID. The InputEvent object will be is_null() if the given | 51 /// resource ID. The InputEvent object will be is_null() if the given |
52 /// resource is not a valid input event. | 52 /// resource is not a valid input event. |
53 /// | 53 /// |
54 /// @param[in] input_event_resource A input event resource ID. | 54 /// @param[in] input_event_resource A input event resource ID. |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 /// @return The TouchPoint in the given list with the given identifier, or an | 339 /// @return The TouchPoint in the given list with the given identifier, or an |
340 /// empty TouchPoint if the list does not contain a TouchPoint with that | 340 /// empty TouchPoint if the list does not contain a TouchPoint with that |
341 /// identifier. | 341 /// identifier. |
342 TouchPoint GetTouchById(PP_TouchListType list, uint32_t id) const; | 342 TouchPoint GetTouchById(PP_TouchListType list, uint32_t id) const; |
343 }; | 343 }; |
344 | 344 |
345 | 345 |
346 } // namespace pp | 346 } // namespace pp |
347 | 347 |
348 #endif // PPAPI_CPP_INPUT_EVENT_H_ | 348 #endif // PPAPI_CPP_INPUT_EVENT_H_ |
OLD | NEW |