IInputContext.aidl revision 0023d0e0c4f5339b299d1eacbd4e7181c2fd271f
1/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.internal.view;
18
19import android.os.Bundle;
20import android.view.KeyEvent;
21import android.view.inputmethod.CompletionInfo;
22import android.view.inputmethod.CorrectionInfo;
23import android.view.inputmethod.CursorAnchorInfoRequest;
24import android.view.inputmethod.ExtractedTextRequest;
25
26import com.android.internal.view.IInputContextCallback;
27
28/**
29 * Interface from an input method to the application, allowing it to perform
30 * edits on the current input field and other interactions with the application.
31 * {@hide}
32 */
33 oneway interface IInputContext {
34    void getTextBeforeCursor(int length, int flags, int seq, IInputContextCallback callback);
35
36    void getTextAfterCursor(int length, int flags, int seq, IInputContextCallback callback);
37
38    void getCursorCapsMode(int reqModes, int seq, IInputContextCallback callback);
39
40    void getExtractedText(in ExtractedTextRequest request, int flags, int seq,
41            IInputContextCallback callback);
42
43    void deleteSurroundingText(int leftLength, int rightLength);
44
45    void setComposingText(CharSequence text, int newCursorPosition);
46
47    void finishComposingText();
48
49    void commitText(CharSequence text, int newCursorPosition);
50
51    void commitCompletion(in CompletionInfo completion);
52
53    void commitCorrection(in CorrectionInfo correction);
54
55    void setSelection(int start, int end);
56
57    void performEditorAction(int actionCode);
58
59    void performContextMenuAction(int id);
60
61    void beginBatchEdit();
62
63    void endBatchEdit();
64
65    void reportFullscreenMode(boolean enabled);
66
67    void sendKeyEvent(in KeyEvent event);
68
69    void clearMetaKeyStates(int states);
70
71    void performPrivateCommand(String action, in Bundle data);
72
73    void setComposingRegion(int start, int end);
74
75    void getSelectedText(int flags, int seq, IInputContextCallback callback);
76
77    void requestCursorAnchorInfo(in CursorAnchorInfoRequest request, int seq,
78            IInputContextCallback callback);
79}
80