/* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*- * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
class GeckoEditableSupport final
: public TextEventDispatcherListener, public java::GeckoEditableChild::Natives<GeckoEditableSupport> { /* Rules for managing IME between Gecko and Java:
* Gecko controls the text content, and Java shadows the Gecko text through text updates * Gecko and Java maintain separate selections, and synchronize when needed through selection updates and set-selection events * Java controls the composition, and Gecko shadows the Java composition through update composition events
*/
using EditableBase = java::GeckoEditableChild::Natives<GeckoEditableSupport>; using EditableClient = java::SessionTextInput::EditableClient; using EditableListener = java::SessionTextInput::EditableListener;
enum FlushChangesFlag { // Not retrying.
FLUSH_FLAG_NONE, // Retrying due to IME text changes during flush.
FLUSH_FLAG_RETRY, // Retrying due to IME sync exceptions during flush.
FLUSH_FLAG_RECOVER
};
if (!mDisposeBlockCount && mDisposeRunnable) { if (HasIMEFocus()) { // If we have IME focus, GeckoEditableChild is already attached again. // So disposer is unnecessary.
mDisposeRunnable = nullptr; return;
}
// Synchronize Gecko thread with the InputConnection thread. void OnImeSynchronize();
// Replace a range of text with new text. void OnImeReplaceText(int32_t aStart, int32_t aEnd, jni::String::Param aText);
// Add styling for a range within the active composition. void OnImeAddCompositionRange(int32_t aStart, int32_t aEnd,
int32_t aRangeType, int32_t aRangeStyle,
int32_t aRangeLineStyle, bool aRangeBoldLine,
int32_t aRangeForeColor,
int32_t aRangeBackColor,
int32_t aRangeLineColor);
// Update styling for the active composition using previous-added ranges. void OnImeUpdateComposition(int32_t aStart, int32_t aEnd, int32_t aFlags);
// Set cursor mode whether IME requests void OnImeRequestCursorUpdates(int aRequestMode);
// Commit current composition to sync Gecko text state with Java. void OnImeRequestCommit();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.