Flutter Engine
The Flutter Engine
FlutterFakeKeyEvents.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERFAKEKEYEVENTS_H_
6#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERFAKEKEYEVENTS_H_
7
8#import <Foundation/Foundation.h>
9#import <OCMock/OCMock.h>
10#import <UIKit/UIKit.h>
11
12#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterUIPressProxy.h"
13
14API_AVAILABLE(ios(13.4))
16- (instancetype)initWithData:(UIPressPhase)phase
17 key:(UIKey*)key
18 type:(UIEventType)type
19 timestamp:(NSTimeInterval)timestamp API_AVAILABLE(ios(13.4));
20
21- (UIPressPhase)phase API_AVAILABLE(ios(13.4));
22- (UIKey*)key API_AVAILABLE(ios(13.4));
23- (UIEventType)type API_AVAILABLE(ios(13.4));
24- (NSTimeInterval)timestamp API_AVAILABLE(ios(13.4));
25
26@property(nonatomic, readonly) UIPressPhase dataPhase;
27@property(nonatomic, readonly) UIKey* dataKey;
28@property(nonatomic, readonly) UIEventType dataType;
29@property(nonatomic, readonly) NSTimeInterval dataTimestamp;
30@end
31
32API_AVAILABLE(ios(13.4))
33@interface FakeUIKey : UIKey
34- (instancetype)initWithData:(UIKeyboardHIDUsage)keyCode
35 modifierFlags:(UIKeyModifierFlags)modifierFlags
36 characters:(NSString*)characters
37 charactersIgnoringModifiers:(NSString*)charactersIgnoringModifiers API_AVAILABLE(ios(13.4));
38
39- (UIKeyboardHIDUsage)keyCode;
40- (UIKeyModifierFlags)modifierFlags;
41- (NSString*)characters;
43
44@property(assign, nonatomic) UIKeyboardHIDUsage dataKeyCode;
45@property(assign, nonatomic) UIKeyModifierFlags dataModifierFlags;
46@property(readwrite, nonatomic) NSString* dataCharacters;
47@property(readwrite, nonatomic) NSString* dataCharactersIgnoringModifiers;
48@end
49
50namespace flutter {
51namespace testing {
52extern FlutterUIPressProxy* keyDownEvent(UIKeyboardHIDUsage keyCode,
53 UIKeyModifierFlags modifierFlags = 0x0,
54 NSTimeInterval timestamp = 0.0f,
55 const char* characters = "",
56 const char* charactersIgnoringModifiers = "")
57 API_AVAILABLE(ios(13.4));
58
59extern FlutterUIPressProxy* keyUpEvent(UIKeyboardHIDUsage keyCode,
60 UIKeyModifierFlags modifierFlags = 0x0,
61 NSTimeInterval timestamp = 0.0f,
62 const char* characters = "",
63 const char* charactersIgnoringModifiers = "")
64 API_AVAILABLE(ios(13.4));
65
66extern FlutterUIPressProxy* keyEventWithPhase(UIPressPhase phase,
67 UIKeyboardHIDUsage keyCode,
68 UIKeyModifierFlags modifierFlags = 0x0,
69 NSTimeInterval timestamp = 0.0f,
70 const char* characters = "",
71 const char* charactersIgnoringModifiers = "")
72 API_AVAILABLE(ios(13.4));
73} // namespace testing
74} // namespace flutter
75#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERFAKEKEYEVENTS_H_
GLenum type
UIKeyModifierFlags dataModifierFlags
NSString * dataCharacters
UIKeyboardHIDUsage keyCode()
UIKeyModifierFlags modifierFlags()
NSString * dataCharactersIgnoringModifiers
UIKeyboardHIDUsage dataKeyCode
NSString * characters()
NSString * charactersIgnoringModifiers()
NSTimeInterval dataTimestamp
SK_API sk_sp< SkSurface > ios(9.0)
FlutterUIPressProxy * keyEventWithPhase(UIPressPhase phase, UIKeyboardHIDUsage keyCode, UIKeyModifierFlags modifierFlags=0x0, NSTimeInterval timestamp=0.0f, const char *characters="", const char *charactersIgnoringModifiers="") API_AVAILABLE(ios(13.4))
FlutterUIPressProxy * keyUpEvent(UIKeyboardHIDUsage keyCode, UIKeyModifierFlags modifierFlags=0x0, NSTimeInterval timestamp=0.0f, const char *characters="", const char *charactersIgnoringModifiers="") API_AVAILABLE(ios(13.4))
FlutterUIPressProxy * keyDownEvent(UIKeyboardHIDUsage keyCode, UIKeyModifierFlags modifierFlags=0x0, NSTimeInterval timestamp=0.0f, const char *characters="", const char *charactersIgnoringModifiers="") API_AVAILABLE(ios(13.4))
API_AVAILABLE(ios(14.0), macos(11.0)) static NSString *MTLCommandEncoderErrorStateToString(MTLCommandEncoderErrorState state)