Flutter Engine
The Flutter Engine
fl_key_channel_responder.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_LINUX_FL_KEY_CHANNEL_RESPONDER_H_
6#define FLUTTER_SHELL_PLATFORM_LINUX_FL_KEY_CHANNEL_RESPONDER_H_
7
8#include <gdk/gdk.h>
9
10#include "flutter/shell/platform/linux/fl_key_responder.h"
11#include "flutter/shell/platform/linux/fl_keyboard_manager.h"
12#include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"
13#include "flutter/shell/platform/linux/public/flutter_linux/fl_value.h"
14
15typedef FlValue* (*FlValueConverter)(FlValue*);
16
17/**
18 * FlKeyChannelResponderMock:
19 *
20 * Allows mocking of FlKeyChannelResponder methods and values. Only used in
21 * unittests.
22 */
24 /**
25 * FlKeyChannelResponderMock::value_converter:
26 * If #value_converter is not nullptr, then this function is applied to the
27 * reply of the message, whose return value is taken as the message reply.
28 */
30
31 /**
32 * FlKeyChannelResponderMock::channel_name:
33 * Mocks the channel name to send the message.
34 */
35 const char* channel_name;
37
38G_BEGIN_DECLS
39
40#define FL_TYPE_KEY_CHANNEL_RESPONDER fl_key_channel_responder_get_type()
41G_DECLARE_FINAL_TYPE(FlKeyChannelResponder,
42 fl_key_channel_responder,
43 FL,
44 KEY_CHANNEL_RESPONDER,
45 GObject);
46
47/**
48 * FlKeyChannelResponder:
49 *
50 * A #FlKeyResponder that handles events by sending the raw event data
51 * in JSON through the message channel.
52 *
53 * This class communicates with the RawKeyboard API in the framework.
54 */
55
56/**
57 * fl_key_channel_responder_new:
58 * @messenger: the messenger that the message channel should be built on.
59 * @mock: options to mock several functionalities. Only used in unittests.
60 *
61 * Creates a new #FlKeyChannelResponder.
62 *
63 * Returns: a new #FlKeyChannelResponder.
64 */
65FlKeyChannelResponder* fl_key_channel_responder_new(
66 FlBinaryMessenger* messenger,
67 FlKeyChannelResponderMock* mock = nullptr);
68
69G_END_DECLS
70
71#endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_KEY_CHANNEL_RESPONDER_H_
FlKeyChannelResponder * fl_key_channel_responder_new(FlBinaryMessenger *messenger, FlKeyChannelResponderMock *mock=nullptr)
G_DECLARE_FINAL_TYPE(FlKeyChannelResponder, fl_key_channel_responder, FL, KEY_CHANNEL_RESPONDER, GObject)
struct _FlKeyChannelResponderMock FlKeyChannelResponderMock
FlValue *(* FlValueConverter)(FlValue *)
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:42