Flutter Engine
The Flutter Engine
shell
common
platform_message_handler.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_COMMON_PLATFORM_MESSAGE_HANDLER_H_
6
#define FLUTTER_SHELL_COMMON_PLATFORM_MESSAGE_HANDLER_H_
7
8
#include <memory>
9
10
#include "flutter/fml/mapping.h"
11
12
namespace
flutter
{
13
14
class
PlatformMessage
;
15
16
/// An interface over the ability to handle PlatformMessages that are being sent
17
/// from Flutter to the host platform.
18
class
PlatformMessageHandler
{
19
public
:
20
virtual
~PlatformMessageHandler
() =
default
;
21
22
/// Ultimately sends the PlatformMessage to the host platform.
23
/// This method is invoked on the ui thread.
24
virtual
void
HandlePlatformMessage
(
25
std::unique_ptr<PlatformMessage>
message
) = 0;
26
27
/// Returns true if the platform message will ALWAYS be dispatched to the
28
/// platform thread.
29
///
30
/// Platforms that support Background Platform Channels will return
31
/// false.
32
virtual
bool
DoesHandlePlatformMessageOnPlatformThread
()
const
= 0;
33
34
/// Performs the return procedure for an associated call to
35
/// HandlePlatformMessage.
36
/// This method should be thread-safe and able to be invoked on any thread.
37
virtual
void
InvokePlatformMessageResponseCallback
(
38
int
response_id,
39
std::unique_ptr<fml::Mapping> mapping) = 0;
40
41
/// Performs the return procedure for an associated call to
42
/// HandlePlatformMessage where there is no return value.
43
/// This method should be thread-safe and able to be invoked on any thread.
44
virtual
void
InvokePlatformMessageEmptyResponseCallback
(
int
response_id) = 0;
45
};
46
}
// namespace flutter
47
48
#endif
// FLUTTER_SHELL_COMMON_PLATFORM_MESSAGE_HANDLER_H_
flutter::PlatformMessageHandler
Definition:
platform_message_handler.h:18
flutter::PlatformMessageHandler::HandlePlatformMessage
virtual void HandlePlatformMessage(std::unique_ptr< PlatformMessage > message)=0
flutter::PlatformMessageHandler::InvokePlatformMessageEmptyResponseCallback
virtual void InvokePlatformMessageEmptyResponseCallback(int response_id)=0
flutter::PlatformMessageHandler::DoesHandlePlatformMessageOnPlatformThread
virtual bool DoesHandlePlatformMessageOnPlatformThread() const =0
flutter::PlatformMessageHandler::InvokePlatformMessageResponseCallback
virtual void InvokePlatformMessageResponseCallback(int response_id, std::unique_ptr< fml::Mapping > mapping)=0
flutter::PlatformMessageHandler::~PlatformMessageHandler
virtual ~PlatformMessageHandler()=default
flutter::PlatformMessage
Definition:
platform_message.h:17
message
Win32Message message
Definition:
keyboard_unittests.cc:139
flutter
Definition:
asset_manager.cc:10
Generated on Sun Jun 23 2024 21:55:07 for Flutter Engine by
1.9.4