diff options
author | 2014-09-04 13:42:10 -0700 | |
---|---|---|
committer | 2014-10-03 15:01:34 +0900 | |
commit | c92c883fdf2287b49392692fa2e8d109dc26f785 (patch) | |
tree | b0d06a34d277a958522bf7d66ebf89990ad92ba9 /java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | |
parent | 61a1e46dd1b065eb1e13ab44fb446ee6e705d626 (diff) | |
download | latinime-c92c883fdf2287b49392692fa2e8d109dc26f785.tar.gz latinime-c92c883fdf2287b49392692fa2e8d109dc26f785.tar.xz latinime-c92c883fdf2287b49392692fa2e8d109dc26f785.zip |
Add calls to stub for API to consume gesture data.
Bug: 17400259
Change-Id: Ib3511afffe1d14662e7dd14611f384689516e664
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index b4a1c3e65..1b1d5e7e5 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -2263,6 +2263,47 @@ public final class InputLogic { mConnection.setComposingText(composingTextToBeSet, newCursorPosition); } + /** + * Gets an object allowing private IME commands to be sent to the + * underlying editor. + * @return An object for sending private commands to the underlying editor. + */ + public PrivateCommandPerformer getPrivateCommandPerformer() { + return mConnection; + } + + /** + * Gets the expected index of the first char of the composing span within the editor's text. + * Returns a negative value in case there appears to be no valid composing span. + * + * @see #getComposingLength() + * @see RichInputConnection#hasSelection() + * @see RichInputConnection#isCursorPositionKnown() + * @see RichInputConnection#getExpectedSelectionStart() + * @see RichInputConnection#getExpectedSelectionEnd() + * @return The expected index in Java chars of the first char of the composing span. + */ + // TODO: try and see if we can get rid of this method. Ideally the users of this class should + // never need to know this. + public int getComposingStart() { + if (!mConnection.isCursorPositionKnown() || mConnection.hasSelection()) { + return -1; + } + return mConnection.getExpectedSelectionStart() - mWordComposer.size(); + } + + /** + * Gets the expected length in Java chars of the composing span. + * May be 0 if there is no valid composing span. + * @see #getComposingStart() + * @return The expected length of the composing span. + */ + // TODO: try and see if we can get rid of this method. Ideally the users of this class should + // never need to know this. + public int getComposingLength() { + return mWordComposer.size(); + } + ////////////////////////////////////////////////////////////////////////////////////////////// // Following methods are tentatively placed in this class for the integration with // TextDecorator. |