Flutter Linux Embedder
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 
13 G_BEGIN_DECLS
14 
15 G_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  */
37 FlTextInputHandler* 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  */
47 GtkIMContext* 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  */
56 void 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  */
67 GtkWidget* 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  */
78 gboolean fl_text_input_handler_filter_keypress(FlTextInputHandler* handler,
79  FlKeyEvent* event);
80 
81 G_END_DECLS
82 
83 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_TEXT_INPUT_HANDLER_H_
fl_text_input_handler_new
FlTextInputHandler * fl_text_input_handler_new(FlBinaryMessenger *messenger)
Definition: fl_text_input_handler.cc:422
fl_text_input_handler_get_im_context
GtkIMContext * fl_text_input_handler_get_im_context(FlTextInputHandler *handler)
Definition: fl_text_input_handler.cc:459
fl_text_input_handler_set_widget
void fl_text_input_handler_set_widget(FlTextInputHandler *handler, GtkWidget *widget)
Definition: fl_text_input_handler.cc:464
fl_binary_messenger.h
FL
FL
Definition: fl_binary_messenger.cc:27
fl_key_event.h
fl_text_input_handler_get_widget
GtkWidget * fl_text_input_handler_get_widget(FlTextInputHandler *handler)
Definition: fl_text_input_handler.cc:472
fl_text_input_handler_filter_keypress
gboolean fl_text_input_handler_filter_keypress(FlTextInputHandler *handler, FlKeyEvent *event)
Definition: fl_text_input_handler.cc:477
G_DECLARE_FINAL_TYPE
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlTextInputHandler, fl_text_input_handler, FL, TEXT_INPUT_HANDLER, GObject)