Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Instance Methods | Properties | List of all members
FlutterTextInputPlugin(TestMethods) Category Reference

#include <FlutterTextInputPlugin.h>

Instance Methods

(void) - handleMethodCall:result:
 
(NSRect) - firstRectForCharacterRange:actualRange:
 
(NSDictionary *) - editingState
 

Properties

NSTextInputContext * textInputContext
 
NSString * customRunLoopMode
 

Detailed Description

Definition at line 66 of file FlutterTextInputPlugin.h.

Method Documentation

◆ editingState

- (NSDictionary *) editingState

Extends class FlutterTextInputPlugin.

Definition at line 339 of file FlutterTextInputPlugin.mm.

521 {
522 if (_activeModel == nullptr) {
523 return nil;
524 }
525
526 NSString* const textAffinity = [self textAffinityString];
527
528 int composingBase = _activeModel->composing() ? _activeModel->composing_range().base() : -1;
529 int composingExtent = _activeModel->composing() ? _activeModel->composing_range().extent() : -1;
530
531 return @{
532 kSelectionBaseKey : @(_activeModel->selection().base()),
533 kSelectionExtentKey : @(_activeModel->selection().extent()),
534 kSelectionAffinityKey : textAffinity,
536 kComposingBaseKey : @(composingBase),
537 kComposingExtentKey : @(composingExtent),
538 kTextKey : [NSString stringWithUTF8String:_activeModel->GetText().c_str()] ?: [NSNull null],
539 };
540}
static NSString *const kTextKey
static NSString *const kSelectionBaseKey
static NSString *const kSelectionAffinityKey
static NSString *const kComposingExtentKey
static NSString *const kSelectionExtentKey
static NSString *const kComposingBaseKey
static NSString *const kSelectionIsDirectionalKey

◆ firstRectForCharacterRange:actualRange:

- (NSRect) firstRectForCharacterRange: (NSRange)  range
actualRange: (NSRangePointer)  actualRange 

Extends class FlutterTextInputPlugin.

Definition at line 339 of file FlutterTextInputPlugin.mm.

960 :(NSRange)range actualRange:(NSRangePointer)actualRange {
961 // This only determines position of caret instead of any arbitrary range, but it's enough
962 // to properly position accent selection popup
963 return !self.flutterViewController.viewLoaded || CGRectEqualToRect(_caretRect, CGRectNull)
964 ? CGRectZero
965 : [self screenRectFromFrameworkTransform:_caretRect];
966}
CGRect _caretRect

◆ handleMethodCall:result:

- (void) handleMethodCall: (FlutterMethodCall *)  call
result: (FlutterResult result 

Handles a Flutter system message on the text input channel.

Extends class FlutterTextInputPlugin.

Definition at line 39 of file FlutterTextInputPlugin.mm.

2390 NSString* method = call.method;
2391 id args = call.arguments;
2392 if ([method isEqualToString:kShowMethod]) {
2393 [self showTextInput];
2394 result(nil);
2395 } else if ([method isEqualToString:kHideMethod]) {
2396 [self hideTextInput];
2397 result(nil);
2398 } else if ([method isEqualToString:kSetClientMethod]) {
2399 [self setTextInputClient:[args[0] intValue] withConfiguration:args[1]];
2400 result(nil);
2401 } else if ([method isEqualToString:kSetPlatformViewClientMethod]) {
2402 // This method call has a `platformViewId` argument, but we do not need it for iOS for now.
2403 [self setPlatformViewTextInputClient];
2404 result(nil);
2405 } else if ([method isEqualToString:kSetEditingStateMethod]) {
2406 [self setTextInputEditingState:args];
2407 result(nil);
2408 } else if ([method isEqualToString:kClearClientMethod]) {
2409 [self clearTextInputClient];
2410 result(nil);
2411 } else if ([method isEqualToString:kSetEditableSizeAndTransformMethod]) {
2412 [self setEditableSizeAndTransform:args];
2413 result(nil);
2414 } else if ([method isEqualToString:kSetMarkedTextRectMethod]) {
2415 [self updateMarkedRect:args];
2416 result(nil);
2417 } else if ([method isEqualToString:kFinishAutofillContextMethod]) {
2418 [self triggerAutofillSave:[args boolValue]];
2419 result(nil);
2420 // TODO(justinmc): Remove the TextInput method constant when the framework has
2421 // finished transitioning to using the Scribble channel.
2422 // https://github.com/flutter/flutter/pull/104128
2423 } else if ([method isEqualToString:kDeprecatedSetSelectionRectsMethod]) {
2424 [self setSelectionRects:args];
2425 result(nil);
2426 } else if ([method isEqualToString:kSetSelectionRectsMethod]) {
2427 [self setSelectionRects:args];
2428 result(nil);
2429 } else if ([method isEqualToString:kStartLiveTextInputMethod]) {
2430 [self startLiveTextInput];
2431 result(nil);
2432 } else if ([method isEqualToString:kUpdateConfigMethod]) {
2433 [self updateConfig:args];
2434 result(nil);
2435 } else if ([method isEqualToString:kOnInteractiveKeyboardPointerMoveMethod]) {
2436 CGFloat pointerY = (CGFloat)[args[@"pointerY"] doubleValue];
2437 [self handlePointerMove:pointerY];
2438 result(nil);
2439 } else if ([method isEqualToString:kOnInteractiveKeyboardPointerUpMethod]) {
2440 CGFloat pointerY = (CGFloat)[args[@"pointerY"] doubleValue];
2441 [self handlePointerUp:pointerY];
2442 result(nil);
2443 } else {
2445 }
2446}
void(^ FlutterResult)(id _Nullable result)
FLUTTER_DARWIN_EXPORT NSObject const * FlutterMethodNotImplemented
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
GAsyncResult * result
static NSString *const kSetMarkedTextRectMethod
static NSString *const kFinishAutofillContextMethod
static NSString *const kShowMethod
static NSString *const kUpdateConfigMethod
static NSString *const kSetSelectionRectsMethod
static NSString *const kSetPlatformViewClientMethod
static NSString *const kSetEditingStateMethod
static NSString *const kOnInteractiveKeyboardPointerUpMethod
static NSString *const kClearClientMethod
static NSString *const kSetClientMethod
static NSString *const kStartLiveTextInputMethod
static NSString *const kDeprecatedSetSelectionRectsMethod
static NSString *const kHideMethod
static NSString *const kSetEditableSizeAndTransformMethod
static NSString *const kOnInteractiveKeyboardPointerMoveMethod
call(args)
Definition dom.py:159

Property Documentation

◆ customRunLoopMode

- (NSString*) customRunLoopMode
readwritenonatomicassign

Extends class FlutterTextInputPlugin.

Definition at line 71 of file FlutterTextInputPlugin.h.

◆ textInputContext

- (NSTextInputContext*) textInputContext
readwritenonatomicassign

Extends class FlutterTextInputPlugin.

Definition at line 70 of file FlutterTextInputPlugin.h.


The documentation for this category was generated from the following file: