| Flutter iOS Embedder |

platform_message_response_darwin.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_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_
7
8 #include <Foundation/Foundation.h>
9
10 #include "flutter/fml/macros.h"
11 #include "flutter/fml/make_copyable.h"
12 #include "flutter/fml/task_runner.h"
13 #include "flutter/lib/ui/window/platform_message_response.h"
14 #import "flutter/shell/platform/darwin/common/buffer_conversions.h"
15
16 typedef void (^PlatformMessageResponseCallback)(NSData*);
17
18 namespace flutter {
19
20 class PlatformMessageResponseDarwin : public flutter::PlatformMessageResponse {
21 public:
22 void Complete(std::unique_ptr<fml::Mapping> data) override;
23
24 void CompleteEmpty() override;
25
26 private:
27 explicit PlatformMessageResponseDarwin(PlatformMessageResponseCallback callback,
28 fml::RefPtr<fml::TaskRunner> platform_task_runner);
29
30 ~PlatformMessageResponseDarwin() override;
31
32 PlatformMessageResponseCallback callback_;
33 fml::RefPtr<fml::TaskRunner> platform_task_runner_;
34
35 FML_FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseDarwin);
36 };
37
38 } // namespace flutter
39
40 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_
buffer_conversions.h
flutter::PlatformMessageResponseDarwin
Definition: platform_message_response_darwin.h:20
flutter::PlatformMessageResponseDarwin::Complete
void Complete(std::unique_ptr< fml::Mapping > data) override
Definition: platform_message_response_darwin.mm:20
flutter::PlatformMessageResponseDarwin::CompleteEmpty
void CompleteEmpty() override
Definition: platform_message_response_darwin.mm:27
flutter
Definition: accessibility_bridge.h:27
PlatformMessageResponseCallback
void(^ PlatformMessageResponseCallback)(NSData *)
Definition: platform_message_response_darwin.h:16