Flutter Engine
 
Loading...
Searching...
No Matches
fl_platform_channel.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_PLATFORM_CHANNEL_H_
6#define FLUTTER_SHELL_PLATFORM_LINUX_FL_PLATFORM_CHANNEL_H_
7
10
11G_BEGIN_DECLS
12
17
22
23G_DECLARE_FINAL_TYPE(FlPlatformChannel,
24 fl_platform_channel,
25 FL,
26 PLATFORM_CHANNEL,
27 GObject);
28
29/**
30 * FlPlatformChannel:
31 *
32 * #FlPlatformChannel is a channel that implements the shell side
33 * of SystemChannels.platform from the Flutter services library.
34 */
35
36typedef struct {
37 FlMethodResponse* (*clipboard_set_data)(FlMethodCall* method_call,
38 const gchar* text,
39 gpointer user_data);
40 FlMethodResponse* (*clipboard_get_data)(FlMethodCall* method_call,
41 const gchar* format,
42 gpointer user_data);
43 FlMethodResponse* (*clipboard_has_strings)(FlMethodCall* method_call,
44 gpointer user_data);
45 FlMethodResponse* (*system_exit_application)(FlMethodCall* method_call,
47 gpointer user_data);
49 void (*system_sound_play)(const gchar* type, gpointer user_data);
52
53/**
54 * fl_platform_channel_new:
55 * @messenger: an #FlBinaryMessenger
56 * @vtable: callbacks for incoming method calls.
57 * @user_data: data to pass in callbacks.
58 *
59 * Creates a new channel that implements SystemChannels.platform from the
60 * Flutter services library.
61 *
62 * Returns: a new #FlPlatformChannel
63 */
64FlPlatformChannel* fl_platform_channel_new(FlBinaryMessenger* messenger,
66 gpointer user_data);
67
68/**
69 * fl_platform_channel_system_request_app_exit:
70 * @channel: an #FlPlatformChannel
71 *
72 * Request the application exits (i.e. due to the window being requested to be
73 * closed).
74 *
75 * Calling this will only send an exit request to the framework if the framework
76 * has already indicated that it is ready to receive requests by sending a
77 * "System.initializationComplete" method call on the platform channel. Calls
78 * before initialization is complete will result in an immediate exit.
79 */
82 GCancellable* cancellable,
83 GAsyncReadyCallback callback,
84 gpointer user_data);
85
87 GObject* object,
88 GAsyncResult* result,
89 FlPlatformChannelExitResponse* exit_response,
90 GError** error);
91
93 FlMethodCall* method_call,
94 FlPlatformChannelExitResponse exit_response);
95
97 const gchar* text);
98
100 FlMethodCall* method_call,
101 gboolean has_strings);
102
104 FlPlatformChannelExitResponse exit_response);
105
106G_END_DECLS
107
108#endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_PLATFORM_CHANNEL_H_
GLenum type
G_BEGIN_DECLS G_MODULE_EXPORT FlMethodCall * method_call
const gchar * channel
const uint8_t uint32_t uint32_t GError ** error
static FlMethodResponse * system_initialization_complete(FlPlatformChannel *self)
static FlMethodResponse * system_sound_play(FlPlatformChannel *self, FlValue *args)
static FlMethodResponse * system_navigator_pop(FlPlatformChannel *self)
FlMethodResponse * fl_platform_channel_make_system_request_app_exit_response(FlPlatformChannelExitResponse exit_response)
void fl_platform_channel_system_request_app_exit(FlPlatformChannel *channel, FlPlatformChannelExitType type, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
gboolean fl_platform_channel_system_request_app_exit_finish(GObject *object, GAsyncResult *result, FlPlatformChannelExitResponse *exit_response, GError **error)
void fl_platform_channel_respond_clipboard_get_data(FlMethodCall *method_call, const gchar *text)
FlPlatformChannelExitResponse
@ FL_PLATFORM_CHANNEL_EXIT_RESPONSE_EXIT
@ FL_PLATFORM_CHANNEL_EXIT_RESPONSE_CANCEL
G_DECLARE_FINAL_TYPE(FlPlatformChannel, fl_platform_channel, FL, PLATFORM_CHANNEL, GObject)
void fl_platform_channel_respond_system_exit_application(FlMethodCall *method_call, FlPlatformChannelExitResponse exit_response)
void fl_platform_channel_respond_clipboard_has_strings(FlMethodCall *method_call, gboolean has_strings)
FlPlatformChannel * fl_platform_channel_new(FlBinaryMessenger *messenger, FlPlatformChannelVTable *vtable, gpointer user_data)
FlPlatformChannelExitType
@ FL_PLATFORM_CHANNEL_EXIT_TYPE_CANCELABLE
@ FL_PLATFORM_CHANNEL_EXIT_TYPE_REQUIRED
uint32_t uint32_t * format
FlutterDesktopBinaryReply callback
std::u16string text