1 /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
2 /* vim:set et sts=4: */
3 /* ibus - The Input Bus
4  * Copyright (C) 2008-2014 Peng Huang <shawn.p.huang@gmail.com>
5  * Copyright (C) 2017-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
6  * Copyright (C) 2008-2018 Red Hat, Inc.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
21  * USA
22  */
23 #ifndef __BUS_PANEL_PROXY_H_
24 #define __BUS_PANEL_PROXY_H_
25 
26 #include <ibus.h>
27 #include "connection.h"
28 #include "inputcontext.h"
29 
30 /*
31  * Type macros.
32  */
33 
34 /* define GOBJECT macros */
35 #define BUS_TYPE_PANEL_PROXY             \
36     (bus_panel_proxy_get_type ())
37 #define BUS_PANEL_PROXY(obj)             \
38     (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUS_TYPE_PANEL_PROXY, BusPanelProxy))
39 #define BUS_PANEL_PROXY_CLASS(klass)     \
40     (G_TYPE_CHECK_CLASS_CAST ((klass),   \
41                               BUS_TYPE_PANEL_PROXY, \
42                               BusPanelProxyClass))
43 #define BUS_IS_PANEL_PROXY(obj)          \
44     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUS_TYPE_PANEL_PROXY))
45 #define BUS_IS_PANEL_PROXY_CLASS(klass)  \
46     (G_TYPE_CHECK_CLASS_TYPE ((klass), BUS_TYPE_PANEL_PROXY))
47 #define BUS_PANEL_PROXY_GET_CLASS(obj)   \
48     (G_TYPE_INSTANCE_GET_CLASS ((obj),   \
49                                 BUS_TYPE_PANEL_PROXY, \
50                                 BusPanelProxyClass))
51 
52 G_BEGIN_DECLS
53 
54 typedef enum
55 {
56     PANEL_TYPE_NONE,
57     PANEL_TYPE_PANEL,
58     PANEL_TYPE_EXTENSION_EMOJI
59 } PanelType;
60 
61 typedef struct _BusPanelProxy BusPanelProxy;
62 typedef struct _BusPanelProxyClass BusPanelProxyClass;
63 
64 GType            bus_panel_proxy_get_type      (void);
65 BusPanelProxy   *bus_panel_proxy_new           (BusConnection     *connection,
66                                                 PanelType          panel_type);
67 
68 gboolean         bus_panel_proxy_send_signal   (BusPanelProxy   *panel,
69                                                 const gchar     *interface_name,
70                                                 const gchar     *signal_name,
71                                                 GVariant        *parameters,
72                                                 GError         **error);
73 /* functions that invoke D-Bus methods of the panel component. */
74 void             bus_panel_proxy_focus_in      (BusPanelProxy     *panel,
75                                                 BusInputContext   *context);
76 void             bus_panel_proxy_focus_out     (BusPanelProxy     *panel,
77                                                 BusInputContext   *context);
78 void             bus_panel_proxy_destroy_context
79                                                (BusPanelProxy     *panel,
80                                                 BusInputContext   *context);
81 void             bus_panel_proxy_set_cursor_location
82                                                (BusPanelProxy     *panel,
83                                                 gint32             x,
84                                                 gint32             y,
85                                                 gint32             w,
86                                                 gint32             h);
87 void             bus_panel_proxy_set_cursor_location_relative
88                                                (BusPanelProxy     *panel,
89                                                 gint32             x,
90                                                 gint32             y,
91                                                 gint32             w,
92                                                 gint32             h);
93 void             bus_panel_proxy_update_preedit_text
94                                                (BusPanelProxy     *panel,
95                                                 IBusText          *text,
96                                                 guint              cursor_pos,
97                                                 gboolean           visible);
98 void             bus_panel_proxy_show_preedit_text
99                                                (BusPanelProxy     *panel);
100 void             bus_panel_proxy_hide_preedit_text
101                                                (BusPanelProxy     *panel);
102 void             bus_panel_proxy_update_auxiliary_text
103                                                (BusPanelProxy     *panel,
104                                                 IBusText          *text,
105                                                 gboolean           visible);
106 void             bus_panel_proxy_show_auxiliary_text
107                                                (BusPanelProxy     *panel);
108 void             bus_panel_proxy_hide_auxiliary_text
109                                                (BusPanelProxy     *panel);
110 void             bus_panel_proxy_update_lookup_table
111                                                (BusPanelProxy     *panel,
112                                                 IBusLookupTable   *table,
113                                                 gboolean           visible);
114 void             bus_panel_proxy_show_lookup_table
115                                                (BusPanelProxy     *panel);
116 void             bus_panel_proxy_hide_lookup_table
117                                                (BusPanelProxy     *panel);
118 void             bus_panel_proxy_page_up_lookup_table
119                                                (BusPanelProxy     *panel);
120 void             bus_panel_proxy_page_down_lookup_table
121                                                (BusPanelProxy     *panel);
122 void             bus_panel_proxy_cursor_up_lookup_table
123                                                (BusPanelProxy     *panel);
124 void             bus_panel_proxy_cursor_down_lookup_table
125                                                (BusPanelProxy     *panel);
126 void             bus_panel_proxy_register_properties
127                                                (BusPanelProxy     *panel,
128                                                 IBusPropList      *prop_list);
129 void             bus_panel_proxy_update_property
130                                                (BusPanelProxy     *panel,
131                                                 IBusProperty      *prop);
132 void             bus_panel_proxy_set_content_type
133                                                (BusPanelProxy     *panel,
134                                                 guint              purpose,
135                                                 guint              hints);
136 PanelType        bus_panel_proxy_get_panel_type
137                                                (BusPanelProxy     *panel);
138 void             bus_panel_proxy_panel_extension_received
139                                                (BusPanelProxy     *panel,
140                                                 IBusExtensionEvent
141                                                                   *event);
142 void             bus_panel_proxy_process_key_event
143                                                (BusPanelProxy     *panel,
144                                                 guint              keyval,
145                                                 guint              keycode,
146                                                 guint              state,
147                                                 GAsyncReadyCallback
148                                                                    callback,
149                                                 gpointer           user_data);
150 void             bus_panel_proxy_commit_text_received
151                                                (BusPanelProxy     *panel,
152                                                 IBusText          *text);
153 void             bus_panel_proxy_candidate_clicked_lookup_table
154                                                (BusPanelProxy     *panel,
155                                                 guint              index,
156                                                 guint              button,
157                                                 guint              state);
158 
159 G_END_DECLS
160 #endif
161 
162