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) 2009-2013 Google Inc. All rights reserved.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
22 #if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
23 #error "Only <ibus.h> can be included directly"
26 #ifndef __IBUS_PANEL_SERVICE_H_
27 #define __IBUS_PANEL_SERVICE_H_
30 * SECTION: ibuspanelservice
31 * @short_description: Panel service back-end.
34 * An IBusPanelService is a base class for UI services.
35 * Developers can "extend" this class for panel UI development.
37 #include "ibuslookuptable.h"
38 #include "ibusservice.h"
39 #include "ibusproplist.h"
45 /* define GOBJECT macros */
46 #define IBUS_TYPE_PANEL_SERVICE \
47 (ibus_panel_service_get_type ())
48 #define IBUS_PANEL_SERVICE(obj) \
49 (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_PANEL_SERVICE, IBusPanelService))
50 #define IBUS_PANEL_SERVICE_CLASS(klass) \
51 (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_PANEL_SERVICE, IBusPanelServiceClass))
52 #define IBUS_IS_PANEL_SERVICE(obj) \
53 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_PANEL_SERVICE))
54 #define IBUS_IS_PANEL_SERVICE_CLASS(klass) \
55 (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_PANEL_SERVICE))
56 #define IBUS_PANEL_SERVICE_GET_CLASS(obj) \
57 (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_PANEL_SERVICE, IBusPanelServiceClass))
61 typedef struct _IBusPanelService IBusPanelService;
62 typedef struct _IBusPanelServiceClass IBusPanelServiceClass;
67 * An opaque data type representing an IBusPanelService.
69 struct _IBusPanelService {
71 /* instance members */
74 struct _IBusPanelServiceClass {
75 IBusServiceClass parent;
78 void (* focus_in) (IBusPanelService *panel,
81 void (* focus_out) (IBusPanelService *panel,
84 void (* register_properties) (IBusPanelService *panel,
85 IBusPropList *prop_list);
86 void (* set_cursor_location) (IBusPanelService *panel,
91 void (* update_auxiliary_text) (IBusPanelService *panel,
94 void (* update_lookup_table) (IBusPanelService *panel,
95 IBusLookupTable *lookup_table,
97 void (* update_preedit_text) (IBusPanelService *panel,
101 void (* update_property) (IBusPanelService *panel,
103 void (* cursor_down_lookup_table) (IBusPanelService *panel);
104 void (* cursor_up_lookup_table) (IBusPanelService *panel);
105 void (* hide_auxiliary_text) (IBusPanelService *panel);
106 void (* hide_language_bar) (IBusPanelService *panel);
107 void (* hide_lookup_table) (IBusPanelService *panel);
108 void (* hide_preedit_text) (IBusPanelService *panel);
109 void (* page_down_lookup_table) (IBusPanelService *panel);
110 void (* page_up_lookup_table) (IBusPanelService *panel);
111 void (* reset) (IBusPanelService *panel);
112 void (* show_auxiliary_text) (IBusPanelService *panel);
113 void (* show_language_bar) (IBusPanelService *panel);
114 void (* show_lookup_table) (IBusPanelService *panel);
115 void (* show_preedit_text) (IBusPanelService *panel);
116 void (* start_setup) (IBusPanelService *panel);
117 void (* state_changed) (IBusPanelService *panel);
118 void (* destroy_context) (IBusPanelService *panel,
120 *input_context_path);
124 gpointer pdummy[7]; // We can add 8 pointers without breaking the ABI.
127 GType ibus_panel_service_get_type (void);
130 * ibus_panel_service_new:
131 * @connection: An GDBusConnection.
132 * @returns: A newly allocated IBusPanelService.
134 * New an IBusPanelService from an GDBusConnection.
136 IBusPanelService *ibus_panel_service_new (GDBusConnection *connection);
139 * ibus_panel_service_candidate_clicked:
140 * @panel: An IBusPanelService
141 * @index: Index in the Lookup table
142 * @button: GdkEventButton::button (1: left button, etc.)
143 * @state: GdkEventButton::state (key modifier flags)
145 * Notify that a candidate is clicked
146 * by sending a "CandidateClicked" to IBus service.
148 void ibus_panel_service_candidate_clicked (IBusPanelService *panel,
154 * ibus_panel_service_cursor_down:
155 * @panel: An IBusPanelService
157 * Notify that the cursor is down
158 * by sending a "CursorDown" to IBus service.
160 void ibus_panel_service_cursor_down (IBusPanelService *panel);
163 * ibus_panel_service_cursor_up:
164 * @panel: An IBusPanelService
166 * Notify that the cursor is up
167 * by sending a "CursorUp" to IBus service.
169 void ibus_panel_service_cursor_up (IBusPanelService *panel);
172 * ibus_panel_service_page_down:
173 * @panel: An IBusPanelService
175 * Notify that the page is down
176 * by sending a "PageDown" to IBus service.
178 void ibus_panel_service_page_down (IBusPanelService *panel);
181 * ibus_panel_service_page_up:
182 * @panel: An IBusPanelService
184 * Notify that the page is up
185 * by sending a "PageUp" to IBus service.
187 void ibus_panel_service_page_up (IBusPanelService *panel);
190 * ibus_panel_service_property_activate:
191 * @panel: An IBusPanelService
192 * @prop_name: A property name
193 * @prop_state: State of the property
195 * Notify that a property is active
196 * by sending a "PropertyActivate" message to IBus service.
198 void ibus_panel_service_property_activate (IBusPanelService *panel,
199 const gchar *prop_name,
202 * ibus_panel_service_property_show:
203 * @panel: An IBusPanelService
204 * @prop_name: A property name
206 * Notify that a property is shown
207 * by sending a "ValueChanged" message to IBus service.
209 void ibus_panel_service_property_show (IBusPanelService *panel,
210 const gchar *prop_name);
213 * ibus_panel_service_property_hide:
214 * @panel: An IBusPanelService
215 * @prop_name: A property name
217 * Notify that a property is hidden
218 * by sending a "ValueChanged" message to IBus service.
220 void ibus_panel_service_property_hide (IBusPanelService *panel,
221 const gchar *prop_name);