diff options
Diffstat (limited to 'java/src/com/android/inputmethod/event/Combiner.java')
-rw-r--r-- | java/src/com/android/inputmethod/event/Combiner.java | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/event/Combiner.java b/java/src/com/android/inputmethod/event/Combiner.java index ab6b70c04..8b808c6b3 100644 --- a/java/src/com/android/inputmethod/event/Combiner.java +++ b/java/src/com/android/inputmethod/event/Combiner.java @@ -16,14 +16,33 @@ package com.android.inputmethod.event; +import java.util.ArrayList; + /** - * A generic interface for combiners. + * A generic interface for combiners. Combiners are objects that transform chains of input events + * into committable strings and manage feedback to show to the user on the combining state. */ public interface Combiner { /** - * Combine an event with the existing state and return the new event. + * Process an event, possibly combining it with the existing state and return the new event. + * + * If this event does not result in any new event getting passed down the chain, this method + * returns null. It may also modify the previous event list if appropriate. + * + * @param previousEvents the previous events in this composition. * @param event the event to combine with the existing state. * @return the resulting event. */ - Event combine(Event event); + Event processEvent(ArrayList<Event> previousEvents, Event event); + + /** + * Get the feedback that should be shown to the user for the current state of this combiner. + * @return A CharSequence representing the feedback to show users. It may include styles. + */ + CharSequence getCombiningStateFeedback(); + + /** + * Reset the state of this combiner, for example when the cursor was moved. + */ + void reset(); } |