src/api-impl: fix up code style, mainly for code imported from AOSP

used the following (plus manual edits):
`clang-format --style="{BasedOnStyle: LLVM, IndentWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: true, ColumnLimit: 0}`
This commit is contained in:
Mis012
2023-06-22 11:45:46 +02:00
parent 824b821f5a
commit 0a9591c474
208 changed files with 154568 additions and 150150 deletions

View File

@@ -40,187 +40,189 @@ class ComposingText {
*/
public class BaseInputConnection implements InputConnection {
BaseInputConnection(InputMethodManager mgr, boolean fullEditor) {
}
BaseInputConnection(InputMethodManager mgr, boolean fullEditor) {
}
public BaseInputConnection(View targetView, boolean fullEditor) {
}
public BaseInputConnection(View targetView, boolean fullEditor) {
}
public static final void removeComposingSpans(Spannable text) {
}
public static void setComposingSpans(Spannable text) {
setComposingSpans(text, 0, text.length());
}
/** @hide */
public static void setComposingSpans(Spannable text, int start, int end) {
}
public static final void removeComposingSpans(Spannable text) {
}
public static void setComposingSpans(Spannable text) {
setComposingSpans(text, 0, text.length());
}
/**
* @hide
*/
public static void setComposingSpans(Spannable text, int start, int end) {
}
public static int getComposingSpanStart(Spannable text) {
return 0;
}
public static int getComposingSpanStart(Spannable text) {
return 0;
}
public static int getComposingSpanEnd(Spannable text) {
return 0;
}
public static int getComposingSpanEnd(Spannable text) {
return 0;
}
/**
* Return the target of edit operations. The default implementation
* returns its own fake editable that is just used for composing text;
* subclasses that are real text editors should override this and
* supply their own.
*/
public Editable getEditable() {
return new Editable();
}
/**
* Return the target of edit operations. The default implementation
* returns its own fake editable that is just used for composing text;
* subclasses that are real text editors should override this and
* supply their own.
*/
public Editable getEditable() {
return new Editable();
}
/**
* Default implementation does nothing.
*/
public boolean beginBatchEdit() {
return false;
}
/**
* Default implementation does nothing.
*/
public boolean endBatchEdit() {
return false;
}
/**
* Called when this InputConnection is no longer used by the InputMethodManager.
*
* @hide
*/
protected void reportFinish() {
// Intentionaly empty
}
/**
* Default implementation uses
* {@link MetaKeyKeyListener#clearMetaKeyState(long, int)
* MetaKeyKeyListener.clearMetaKeyState(long, int)} to clear the state.
*/
public boolean clearMetaKeyStates(int states) {
return true;
}
/**
* Default implementation does nothing and returns false.
*/
public boolean commitCompletion(CompletionInfo text) {
return false;
}
/**
* Default implementation does nothing and returns false.
*/
public boolean commitCorrection(CorrectionInfo correctionInfo) {
return false;
}
/**
* Default implementation replaces any existing composing text with
* the given text. In addition, only if dummy mode, a key event is
* sent for the new text and the current editable buffer cleared.
*/
public boolean commitText(CharSequence text, int newCursorPosition) {
return true;
}
/**
* The default implementation performs the deletion around the current
* selection position of the editable text.
* @param beforeLength
* @param afterLength
*/
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
return true;
}
/**
* The default implementation removes the composing state from the
* current editable text. In addition, only if dummy mode, a key event is
* sent for the new text and the current editable buffer cleared.
*/
public boolean finishComposingText() {
return true;
}
/**
* The default implementation uses TextUtils.getCapsMode to get the
* cursor caps mode for the current selection position in the editable
* text, unless in dummy mode in which case 0 is always returned.
*/
public int getCursorCapsMode(int reqModes) {
return 0;
}
/**
* The default implementation always returns null.
*/
public ExtractedText getExtractedText(ExtractedTextRequest request, int flags) {
return null;
}
/**
* The default implementation returns the given amount of text from the
* current cursor position in the buffer.
*/
public CharSequence getTextBeforeCursor(int length, int flags) {
return "";
}
/**
* The default implementation returns the text currently selected, or null if none is
* selected.
*/
public CharSequence getSelectedText(int flags) {
return "";
}
/**
* The default implementation returns the given amount of text from the
* current cursor position in the buffer.
*/
public CharSequence getTextAfterCursor(int length, int flags) {
return "";
}
/**
* The default implementation turns this into the enter key.
*/
public boolean performEditorAction(int actionCode) {
return true;
}
/**
* The default implementation does nothing.
*/
public boolean performContextMenuAction(int id) {
return false;
}
/**
* The default implementation does nothing.
*/
public boolean performPrivateCommand(String action, Bundle data) {
return false;
}
/**
* The default implementation places the given text into the editable,
* replacing any existing composing text. The new text is marked as
* in a composing state with the composing style.
*/
public boolean setComposingText(CharSequence text, int newCursorPosition) {
return true;
}
public boolean setComposingRegion(int start, int end) {
return true;
}
/**
* The default implementation changes the selection position in the
* current editable text.
*/
public boolean setSelection(int start, int end) {
return true;
}
/**
* Provides standard implementation for sending a key event to the window
* attached to the input connection's view.
*/
public boolean sendKeyEvent(KeyEvent event) {
return false;
}
/**
* Default implementation does nothing.
*/
public boolean beginBatchEdit() {
return false;
}
/**
* Default implementation does nothing.
*/
public boolean endBatchEdit() {
return false;
}
/**
* Called when this InputConnection is no longer used by the InputMethodManager.
*
* @hide
*/
protected void reportFinish() {
// Intentionaly empty
}
/**
* Default implementation uses
* {@link MetaKeyKeyListener#clearMetaKeyState(long, int)
* MetaKeyKeyListener.clearMetaKeyState(long, int)} to clear the state.
*/
public boolean clearMetaKeyStates(int states) {
return true;
}
/**
* Default implementation does nothing and returns false.
*/
public boolean commitCompletion(CompletionInfo text) {
return false;
}
/**
* Default implementation does nothing and returns false.
*/
public boolean commitCorrection(CorrectionInfo correctionInfo) {
return false;
}
/**
* Default implementation replaces any existing composing text with
* the given text. In addition, only if dummy mode, a key event is
* sent for the new text and the current editable buffer cleared.
*/
public boolean commitText(CharSequence text, int newCursorPosition) {
return true;
}
/**
* The default implementation performs the deletion around the current
* selection position of the editable text.
* @param beforeLength
* @param afterLength
*/
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
return true;
}
/**
* The default implementation removes the composing state from the
* current editable text. In addition, only if dummy mode, a key event is
* sent for the new text and the current editable buffer cleared.
*/
public boolean finishComposingText() {
return true;
}
/**
* The default implementation uses TextUtils.getCapsMode to get the
* cursor caps mode for the current selection position in the editable
* text, unless in dummy mode in which case 0 is always returned.
*/
public int getCursorCapsMode(int reqModes) {
return 0;
}
/**
* The default implementation always returns null.
*/
public ExtractedText getExtractedText(ExtractedTextRequest request, int flags) {
return null;
}
/**
* The default implementation returns the given amount of text from the
* current cursor position in the buffer.
*/
public CharSequence getTextBeforeCursor(int length, int flags) {
return "";
}
/**
* The default implementation returns the text currently selected, or null if none is
* selected.
*/
public CharSequence getSelectedText(int flags) {
return "";
}
/**
* The default implementation returns the given amount of text from the
* current cursor position in the buffer.
*/
public CharSequence getTextAfterCursor(int length, int flags) {
return "";
}
/**
* The default implementation turns this into the enter key.
*/
public boolean performEditorAction(int actionCode) {
return true;
}
/**
* The default implementation does nothing.
*/
public boolean performContextMenuAction(int id) {
return false;
}
/**
* The default implementation does nothing.
*/
public boolean performPrivateCommand(String action, Bundle data) {
return false;
}
/**
* The default implementation places the given text into the editable,
* replacing any existing composing text. The new text is marked as
* in a composing state with the composing style.
*/
public boolean setComposingText(CharSequence text, int newCursorPosition) {
return true;
}
public boolean setComposingRegion(int start, int end) {
return true;
}
/**
* The default implementation changes the selection position in the
* current editable text.
*/
public boolean setSelection(int start, int end) {
return true;
}
/**
* Provides standard implementation for sending a key event to the window
* attached to the input connection's view.
*/
public boolean sendKeyEvent(KeyEvent event) {
return false;
}
/**
* Updates InputMethodManager with the current fullscreen mode.
*/
public boolean reportFullscreenMode(boolean enabled) {
return true;
}
/**
* Updates InputMethodManager with the current fullscreen mode.
*/
public boolean reportFullscreenMode(boolean enabled) {
return true;
}
}

File diff suppressed because it is too large Load Diff