Flutter iOS Embedder
FlutterView.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 SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_VIEW_H_
6 #define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_VIEW_H_
7 
8 #import <UIKit/UIKit.h>
9 
10 #include <memory>
11 
12 #include "flutter/fml/memory/weak_ptr.h"
13 #include "flutter/shell/common/shell.h"
17 
18 @protocol FlutterViewEngineDelegate <NSObject>
19 
20 @property(nonatomic, readonly) BOOL isUsingImpeller;
21 
22 - (flutter::Rasterizer::Screenshot)takeScreenshot:(flutter::Rasterizer::ScreenshotType)type
23  asBase64Encoded:(BOOL)base64Encode;
24 
25 - (std::shared_ptr<flutter::FlutterPlatformViewsController>&)platformViewsController;
26 
27 /**
28  * A callback that is called when iOS queries accessibility information of the Flutter view.
29  *
30  * This is useful to predict the current iOS accessibility status. For example, there is
31  * no API to listen whether voice control is turned on or off. The Flutter engine uses
32  * this callback to enable semantics in order to catch the case that voice control is
33  * on.
34  */
36 @end
37 
38 @interface FlutterView : UIView
39 
40 - (instancetype)init NS_UNAVAILABLE;
41 + (instancetype)new NS_UNAVAILABLE;
42 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
43 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE;
44 
45 - (instancetype)initWithDelegate:(id<FlutterViewEngineDelegate>)delegate
46  opaque:(BOOL)opaque
47  enableWideGamut:(BOOL)isWideGamutEnabled NS_DESIGNATED_INITIALIZER;
48 
49 // Set by FlutterEngine or FlutterViewController to override software rendering.
50 @property(class, nonatomic) BOOL forceSoftwareRendering;
51 @end
52 
53 #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_VIEW_H_
FlutterView::forceSoftwareRendering
BOOL forceSoftwareRendering
Definition: FlutterView.h:50
FlutterViewEngineDelegate-p::isUsingImpeller
BOOL isUsingImpeller
Definition: FlutterView.h:20
-[FlutterViewEngineDelegate-p flutterViewAccessibilityDidCall]
void flutterViewAccessibilityDidCall()
FlutterViewEngineDelegate-p
Definition: FlutterView.h:18
initWithFrame
instancetype initWithFrame
Definition: FlutterTextInputPlugin.h:164
ios_surface.h
flutter
Definition: accessibility_bridge.h:28
FlutterPlatformViews_Internal.h
initWithCoder
instancetype initWithCoder
Definition: FlutterTextInputPlugin.h:163
NS_UNAVAILABLE
instancetype init NS_UNAVAILABLE
Definition: FlutterTextInputPlugin.h:161
FlutterView
Definition: FlutterView.h:38
ios_context.h