Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | List of all members
flutter::testing::MockKeyResponseController Class Reference

#include <test_keyboard.h>

Public Types

using ResponseCallback = std::function< void(bool)>
 
using EmbedderCallbackHandler = std::function< void(const FlutterKeyEvent *, ResponseCallback)>
 
using ChannelCallbackHandler = std::function< void(ResponseCallback)>
 
using TextInputCallbackHandler = std::function< void(std::unique_ptr< rapidjson::Document >)>
 

Public Member Functions

 MockKeyResponseController ()
 
void SetChannelResponse (ChannelCallbackHandler handler)
 
void SetEmbedderResponse (EmbedderCallbackHandler handler)
 
void SetTextInputResponse (TextInputCallbackHandler handler)
 
void HandleChannelMessage (ResponseCallback callback)
 
void HandleEmbedderMessage (const FlutterKeyEvent *event, ResponseCallback callback)
 
void HandleTextInputMessage (std::unique_ptr< rapidjson::Document > document)
 

Detailed Description

Definition at line 50 of file test_keyboard.h.

Member Typedef Documentation

◆ ChannelCallbackHandler

Definition at line 55 of file test_keyboard.h.

◆ EmbedderCallbackHandler

Definition at line 53 of file test_keyboard.h.

◆ ResponseCallback

Definition at line 52 of file test_keyboard.h.

◆ TextInputCallbackHandler

using flutter::testing::MockKeyResponseController::TextInputCallbackHandler = std::function<void(std::unique_ptr<rapidjson::Document>)>

Definition at line 56 of file test_keyboard.h.

Constructor & Destructor Documentation

◆ MockKeyResponseController()

flutter::testing::MockKeyResponseController::MockKeyResponseController ( )
inline

Definition at line 59 of file test_keyboard.h.

60 : channel_response_(ChannelRespondFalse),
61 embedder_response_(EmbedderRespondFalse),
62 text_input_response_(
63 [](std::unique_ptr<rapidjson::Document> document) {}) {}

Member Function Documentation

◆ HandleChannelMessage()

void flutter::testing::MockKeyResponseController::HandleChannelMessage ( ResponseCallback  callback)
inline

Definition at line 77 of file test_keyboard.h.

77 {
78 channel_response_(callback);
79 }
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback

◆ HandleEmbedderMessage()

void flutter::testing::MockKeyResponseController::HandleEmbedderMessage ( const FlutterKeyEvent event,
ResponseCallback  callback 
)
inline

Definition at line 81 of file test_keyboard.h.

82 {
83 embedder_response_(event, std::move(callback));
84 }
FlKeyEvent * event

◆ HandleTextInputMessage()

void flutter::testing::MockKeyResponseController::HandleTextInputMessage ( std::unique_ptr< rapidjson::Document >  document)
inline

Definition at line 86 of file test_keyboard.h.

86 {
87 text_input_response_(std::move(document));
88 }

◆ SetChannelResponse()

void flutter::testing::MockKeyResponseController::SetChannelResponse ( ChannelCallbackHandler  handler)
inline

Definition at line 65 of file test_keyboard.h.

65 {
66 channel_response_ = std::move(handler);
67 }

◆ SetEmbedderResponse()

void flutter::testing::MockKeyResponseController::SetEmbedderResponse ( EmbedderCallbackHandler  handler)
inline

Definition at line 69 of file test_keyboard.h.

69 {
70 embedder_response_ = std::move(handler);
71 }

◆ SetTextInputResponse()

void flutter::testing::MockKeyResponseController::SetTextInputResponse ( TextInputCallbackHandler  handler)
inline

Definition at line 73 of file test_keyboard.h.

73 {
74 text_input_response_ = std::move(handler);
75 }

The documentation for this class was generated from the following file: