Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: ppapi/cpp/input_event.h

Issue 7621010: Never submit: tentative Pepper IME. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: snapshot. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/dev/text_input_dev.cc ('k') | ppapi/cpp/input_event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/input_event.h
diff --git a/ppapi/cpp/input_event.h b/ppapi/cpp/input_event.h
index da92742c3b026bcfe934a2fcdb572520c40c536a..788aa046d8f9afb4d39614242d58ec0a98731d65 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,46 @@ 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 an empty vector.
+ std::vector< std::pair<uint32_t, uint32_t> > GetSegments() const;
+
+ /// Returns the index in the array retrieved by GetSegments indicating the
+ /// segment currently under composition.
+ ///
+ /// @return An integer indicating the index of the target segment. When there
+ /// is no active target segment, or the event is not COMPOSITION_UPDATE,
+ /// returns -1.
+ int32_t GetTargetSegment() const;
+
+ /// Returns the selection (caret) position in the current composition text.
+ ///
+ /// @return A pair of integers indicating the selection range.
+ std::pair<uint32_t, uint32_t> GetSelection() const;
+};
+
} // namespace pp
#endif // PPAPI_CPP_INPUT_EVENT_H_
« no previous file with comments | « ppapi/cpp/dev/text_input_dev.cc ('k') | ppapi/cpp/input_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698