Flutter Engine
 
Loading...
Searching...
No Matches
fl_text_input_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_PLATFORM_LINUX_FL_TEXT_INPUT_HANDLER_H_
6#define FLUTTER_SHELL_PLATFORM_LINUX_FL_TEXT_INPUT_HANDLER_H_
7
8#include <gtk/gtk.h>
9
12
13G_BEGIN_DECLS
14
15G_DECLARE_FINAL_TYPE(FlTextInputHandler,
16 fl_text_input_handler,
17 FL,
18 TEXT_INPUT_HANDLER,
19 GObject);
20
21/**
22 * FlTextInputHandler:
23 *
24 * #FlTextInputHandler is a handler that implements the shell side
25 * of SystemChannels.textInput from the Flutter services library.
26 */
27
28/**
29 * fl_text_input_handler_new:
30 * @messenger: an #FlBinaryMessenger.
31 *
32 * Creates a new handler that implements SystemChannels.textInput from the
33 * Flutter services library.
34 *
35 * Returns: a new #FlTextInputHandler.
36 */
37FlTextInputHandler* fl_text_input_handler_new(FlBinaryMessenger* messenger);
38
39/**
40 * fl_text_input_handler_get_im_context:
41 * @handler: an #FlTextInputHandler.
42 *
43 * Get the IM context that is being used. Provided for testing purposes.
44 *
45 * Returns: a #GtkIMContext.
46 */
47GtkIMContext* fl_text_input_handler_get_im_context(FlTextInputHandler* handler);
48
49/**
50 * fl_text_input_handler_set_widget:
51 * @handler: an #FlTextInputHandler.
52 * @widget: the widget with keyboard focus.
53 *
54 * Set the widget that has input focus.
55 */
56void fl_text_input_handler_set_widget(FlTextInputHandler* handler,
57 GtkWidget* widget);
58
59/**
60 * fl_text_input_handler_get_widget:
61 * @handler: an #FlTextInputHandler.
62 *
63 * Get the widget that has input focus.
64 *
65 * Returns: a #GtkWidget or %NULL if none active.
66 */
67GtkWidget* fl_text_input_handler_get_widget(FlTextInputHandler* handler);
68
69/**
70 * fl_text_input_handler_filter_keypress
71 * @handler: an #FlTextInputHandler.
72 * @event: a #FlKeyEvent
73 *
74 * Process a key event.
75 *
76 * Returns: %TRUE if the event was used.
77 */
78gboolean fl_text_input_handler_filter_keypress(FlTextInputHandler* handler,
79 FlKeyEvent* event);
80
81G_END_DECLS
82
83#endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_TEXT_INPUT_HANDLER_H_
const gchar FlBinaryMessengerMessageHandler handler
void fl_text_input_handler_set_widget(FlTextInputHandler *handler, GtkWidget *widget)
FlTextInputHandler * fl_text_input_handler_new(FlBinaryMessenger *messenger)
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlTextInputHandler, fl_text_input_handler, FL, TEXT_INPUT_HANDLER, GObject)
GtkWidget * fl_text_input_handler_get_widget(FlTextInputHandler *handler)
GtkIMContext * fl_text_input_handler_get_im_context(FlTextInputHandler *handler)
gboolean fl_text_input_handler_filter_keypress(FlTextInputHandler *handler, FlKeyEvent *event)