1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 package org.mozilla.gecko;
6 
7 import android.os.IBinder;
8 import android.view.KeyEvent;
9 
10 import org.mozilla.gecko.IGeckoEditableChild;
11 
12 // Interface for GeckoEditable calls from child to parent
13 interface IGeckoEditableParent {
14     // Set the default child to forward events to, when there is no focused child.
setDefaultChild(IGeckoEditableChild child)15     void setDefaultChild(IGeckoEditableChild child);
16 
17     // Notify an IME event of a type defined in GeckoEditableListener.
notifyIME(IGeckoEditableChild child, int type)18     void notifyIME(IGeckoEditableChild child, int type);
19 
20     // Notify a change in editor state or type.
notifyIMEContext(IBinder token, int state, String typeHint, String modeHint, String actionHint, int flags)21     void notifyIMEContext(IBinder token, int state, String typeHint, String modeHint,
22                           String actionHint, int flags);
23 
24     // Notify a change in editor selection.
onSelectionChange(IBinder token, int start, int end)25     void onSelectionChange(IBinder token, int start, int end);
26 
27     // Notify a change in editor text.
onTextChange(IBinder token, in CharSequence text, int start, int unboundedOldEnd)28     void onTextChange(IBinder token, in CharSequence text,
29                       int start, int unboundedOldEnd);
30 
31     // Perform the default action associated with a key event.
onDefaultKeyEvent(IBinder token, in KeyEvent event)32     void onDefaultKeyEvent(IBinder token, in KeyEvent event);
33 
34     // Update the screen location of current composition.
updateCompositionRects(IBinder token, in RectF[] rects)35     void updateCompositionRects(IBinder token, in RectF[] rects);
36 }
37