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_FLUTTERCALLBACKCACHE_H_ 6 #define FLUTTER_FLUTTERCALLBACKCACHE_H_ 7 8 #import <Foundation/Foundation.h> 9 10 #include "FlutterMacros.h" 11 12 /** 13 * An object containing the result of `FlutterCallbackCache`'s `lookupCallbackInformation` 14 * method. 15 */ 16 FLUTTER_EXPORT 17 @interface FlutterCallbackInformation : NSObject 18 /** 19 * The name of the callback. 20 */ 21 @property(retain) NSString* callbackName; 22 /** 23 * The class name of the callback. 24 */ 25 @property(retain) NSString* callbackClassName; 26 /** 27 * The library path of the callback. 28 */ 29 @property(retain) NSString* callbackLibraryPath; 30 @end 31 32 /** 33 * The cache containing callback information for spawning a 34 * `FlutterHeadlessDartRunner`. 35 */ 36 FLUTTER_EXPORT 37 @interface FlutterCallbackCache : NSObject 38 /** 39 * Returns the callback information for the given callback handle. 40 * This callback information can be used when spawning a 41 * `FlutterHeadlessDartRunner`. 42 * 43 * @param handle The handle for a callback, provided by the 44 * Dart method `PluginUtilities.getCallbackHandle`. 45 * @return A `FlutterCallbackInformation` object which contains the name of the 46 * callback, the name of the class in which the callback is defined, and the 47 * path of the library which contains the callback. If the provided handle is 48 * invalid, nil is returned. 49 */ 50 + (FlutterCallbackInformation*)lookupCallbackInformation:(int64_t)handle; 51 52 @end 53 54 #endif // FLUTTER_FLUTTERCALLBACKCACHE_H_ 55