Chromium Code Reviews| Index: ppapi/cpp/input_event.h |
| diff --git a/ppapi/cpp/input_event.h b/ppapi/cpp/input_event.h |
| index da92742c3b026bcfe934a2fcdb572520c40c536a..2dfef80ac904a48808c70ce964678bd07c40a791 100644 |
| --- a/ppapi/cpp/input_event.h |
| +++ b/ppapi/cpp/input_event.h |
| @@ -6,6 +6,7 @@ |
| #define PPAPI_CPP_INPUT_EVENT_H_ |
| #include <string> |
| +#include <vector> |
| #include "ppapi/c/ppb_input_event.h" |
| #include "ppapi/cpp/resource.h" |
| @@ -302,6 +303,40 @@ class KeyboardInputEvent : public InputEvent { |
| Var GetCharacterText() const; |
| }; |
| +class CompositionInputEvent : public InputEvent { |
| + public: |
| + /// Constructs an is_null() keyboard input event object. |
| + CompositionInputEvent(); |
| + |
| + /// Constructs a composition input event object from the provided generic |
| + /// input event. If the given event is itself is_null() or is not a |
| + /// composition input event, the composition object will be is_null(). |
| + /// |
| + /// @param[in] event A generic input event. |
| + explicit CompositionInputEvent(const InputEvent& event); |
| + |
| + /// Returns the composition text as a UTF-8 string for the given composition |
| + /// event. |
| + /// |
| + /// @return A string var representing the composition text. For non- |
| + /// composition input events the return value will be an undefined var. |
| + Var GetText() const; |
| + |
| + /// Returns the segmentation information by a list of indices of |
| + /// a UTF-8 string returned by GetText. |
| + /// |
| + /// @return A vector representing segmentation information. For events other |
| + /// than COMPOSITION_UPDATE, it returns empty vector. |
| + std::vector<uint32_t> GetSegments() const; |
| + |
| + /// Returns the index in the array retrieved by GetSegments indicating the |
| + /// segment currently under composition. |
| + /// |
| + /// @return An integer representing the index of the target segment. |
| + /// For events other than COMPOSITION_UPDATE, it returns 0. |
| + uint32_t GetTargetSegment() const; |
|
kochi
2011/09/09 07:58:59
std::pair<uint32_t> GetSelectionRange() const;
or
|
| +}; |
| + |
| } // namespace pp |
| #endif // PPAPI_CPP_INPUT_EVENT_H_ |