| Flutter iOS Embedder |

FlutterSceneLifeCycle_Internal.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_FLUTTERSCENELIFECYCLE_INTERNAL_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERSCENELIFECYCLE_INTERNAL_H_
7
8 #import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterSceneLifeCycle.h"
9 #import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h"
10
11 /**
12 * Forwards `UIWindowSceneDelegate` callbacks to the `FlutterEngine`'s
13 * `FlutterPluginSceneLifeCycleDelegate` to then be forwarded to registered plugins.
14 */
15 @interface FlutterPluginSceneLifeCycleDelegate ()
16
17 /**
18 * Associates the `FlutterEngine` with the `FlutterPluginSceneLifeCycleDelegate` so that it will
19 * forward scene events to the plugins within the engine.
20 *
21 * Returns NO if the engine is already associated with the delegate.
22 */
23 - (BOOL)addFlutterManagedEngine:(FlutterEngine*)engine;
24
25 /**
26 * Removes the `FlutterEngine` from the `FlutterPluginSceneLifeCycleDelegate` so that it will no
27 * longer forward scene events to the plugins within the engine.
28 *
29 * Returns NO if the engine is not associated with the delegate.
30 */
31 - (BOOL)removeFlutterManagedEngine:(FlutterEngine*)engine;
32
33 - (void)engine:(FlutterEngine*)engine receivedConnectNotificationFor:(UIScene*)scene;
34
35 - (NSUserActivity*)stateRestorationActivityForScene:(UIScene*)scene;
36
37 - (void)scene:(UIScene*)scene
38 restoreInteractionStateWithUserActivity:(NSUserActivity*)stateRestorationActivity;
39
40 + (FlutterPluginSceneLifeCycleDelegate*)fromScene:(UIScene*)scene;
41
42 @end
43
44 /**
45 * Forwards callbacks to registered plugins.
46 */
47 @interface FlutterEnginePluginSceneLifeCycleDelegate : NSObject
48
49 - (void)addDelegate:(NSObject<FlutterSceneLifeCycleDelegate>*)delegate;
50
51 #pragma mark - Connecting and disconnecting the scene
52
53 - (BOOL)scene:(UIScene*)scene
54 willConnectToSession:(UISceneSession*)session
55 options:(UISceneConnectionOptions*)connectionOptions;
56
57 - (void)sceneDidDisconnect:(UIScene*)scene;
58
59 #pragma mark - Transitioning to the foreground
60
61 - (void)sceneWillEnterForeground:(UIScene*)scene;
62
63 - (void)sceneDidBecomeActive:(UIScene*)scene;
64
65 #pragma mark - Transitioning to the background
66
67 - (void)sceneWillResignActive:(UIScene*)scene;
68
69 - (void)sceneDidEnterBackground:(UIScene*)scene;
70
71 #pragma mark - Opening URLs
72
73 - (BOOL)scene:(UIScene*)scene openURLContexts:(NSSet<UIOpenURLContext*>*)URLContexts;
74
75 #pragma mark - Continuing user activities
76
77 - (BOOL)scene:(UIScene*)scene continueUserActivity:(NSUserActivity*)userActivity;
78
79 #pragma mark - Performing tasks
80
81 - (BOOL)windowScene:(UIWindowScene*)windowScene
82 performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem
83 completionHandler:(void (^)(BOOL succeeded))completionHandler;
84
85 @end
86
87 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERSCENELIFECYCLE_INTERNAL_H_
FlutterSceneLifeCycle.h
engine
id engine
Definition: FlutterTextInputPluginTest.mm:137
FlutterViewController.h
FlutterEnginePluginSceneLifeCycleDelegate
Definition: FlutterSceneLifeCycle.mm:511
FlutterEngine
Definition: FlutterEngine.h:61
FlutterPluginSceneLifeCycleDelegate
Definition: FlutterSceneLifeCycle.h:149
FlutterSceneLifeCycleDelegate-p
Definition: FlutterSceneLifeCycle.h:31