Flutter macOS Embedder
FlutterPlatformViewController.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 #import <Cocoa/Cocoa.h>
6 
7 #import "FlutterChannels.h"
8 
10 
11 #include <map>
12 #include <unordered_set>
13 
14 @interface FlutterPlatformViewController : NSViewController
15 @end
16 
18 
19 /**
20  * Creates a platform view of viewType with viewId and arguments passed from
21  * the framework's creationParams constructor parameter.
22  * FlutterResult is updated to contain nil for success or to contain
23  * a FlutterError if there is an error.
24  */
25 - (void)onCreateWithViewIdentifier:(int64_t)viewId
26  viewType:(nonnull NSString*)viewType
27  arguments:(nullable id)args
28  result:(nonnull FlutterResult)result;
29 
30 /**
31  * Disposes the platform view with `viewId`.
32  * FlutterResult is updated to contain nil for success or a FlutterError if there is an error.
33  */
34 - (void)onDisposeWithViewID:(int64_t)viewId result:(nonnull FlutterResult)result;
35 
36 /**
37  * Returns the platform view associated with the viewId.
38  */
39 - (nullable NSView*)platformViewWithID:(int64_t)viewId;
40 
41 /**
42  * Register a view factory by adding an entry into the platformViewFactories map with key factoryId
43  * and value factory.
44  */
45 - (void)registerViewFactory:(nonnull NSObject<FlutterPlatformViewFactory>*)factory
46  withId:(nonnull NSString*)factoryId;
47 
48 /**
49  * Handles platform view related method calls, for example create, dispose, etc.
50  */
51 - (void)handleMethodCall:(nonnull FlutterMethodCall*)call result:(nonnull FlutterResult)result;
52 
53 /**
54  * Removes platform views slated to be disposed via method handler calls.
55  */
56 - (void)disposePlatformViews;
57 
58 @end
FlutterPlatformViews.h
FlutterPlatformViewController
Definition: FlutterPlatformViewController.h:14
FlutterChannels.h
FlutterMethodCall
Definition: FlutterCodecs.h:220
FlutterResult
void(^ FlutterResult)(id _Nullable result)
Definition: FlutterChannels.h:196