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, 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 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
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
23 #error "Only <ibus.h> can be included directly"
27 * SECTION: ibuspanelservice
28 * @short_description: Panel service back-end.
31 * An IBusPanelService is a base class for UI services.
32 * Developers can "extend" this class for panel UI development.
34 #ifndef __IBUS_PANEL_SERVICE_H_
35 #define __IBUS_PANEL_SERVICE_H_
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,
79 const gchar *input_context_path);
80 void (* focus_out) (IBusPanelService *panel,
81 const gchar *input_context_path);
82 void (* register_properties) (IBusPanelService *panel,
83 IBusPropList *prop_list);
84 void (* set_cursor_location) (IBusPanelService *panel,
89 void (* update_auxiliary_text) (IBusPanelService *panel,
92 void (* update_lookup_table) (IBusPanelService *panel,
93 IBusLookupTable *lookup_table,
95 void (* update_preedit_text) (IBusPanelService *panel,
99 void (* update_property) (IBusPanelService *panel,
101 void (* cursor_down_lookup_table) (IBusPanelService *panel);
102 void (* cursor_up_lookup_table) (IBusPanelService *panel);
103 void (* hide_auxiliary_text) (IBusPanelService *panel);
104 void (* hide_language_bar) (IBusPanelService *panel);
105 void (* hide_lookup_table) (IBusPanelService *panel);
106 void (* hide_preedit_text) (IBusPanelService *panel);
107 void (* page_down_lookup_table) (IBusPanelService *panel);
108 void (* page_up_lookup_table) (IBusPanelService *panel);
109 void (* reset) (IBusPanelService *panel);
110 void (* show_auxiliary_text) (IBusPanelService *panel);
111 void (* show_language_bar) (IBusPanelService *panel);
112 void (* show_lookup_table) (IBusPanelService *panel);
113 void (* show_preedit_text) (IBusPanelService *panel);
114 void (* start_setup) (IBusPanelService *panel);
115 void (* state_changed) (IBusPanelService *panel);
119 gpointer pdummy[8]; // We can add 8 pointers without breaking the ABI.
122 GType ibus_panel_service_get_type (void);
125 * ibus_panel_service_new:
126 * @connection: An GDBusConnection.
127 * @returns: A newly allocated IBusPanelService.
129 * New an IBusPanelService from an GDBusConnection.
131 IBusPanelService *ibus_panel_service_new (GDBusConnection *connection);
134 * ibus_panel_service_candidate_clicked
135 * @panel: An IBusPanelService
136 * @index: Index in the Lookup table
137 * @button: GdkEventButton::button (1: left button, etc.)
138 * @state: GdkEventButton::state (key modifier flags)
140 * Notify that a candidate is clicked
141 * by sending a "CandidateClicked" to IBus service.
143 void ibus_panel_service_candidate_clicked (IBusPanelService *panel,
149 * ibus_panel_service_cursor_down
150 * @panel: An IBusPanelService
152 * Notify that the cursor is down
153 * by sending a "CursorDown" to IBus service.
155 void ibus_panel_service_cursor_down (IBusPanelService *panel);
158 * ibus_panel_service_cursor_up
159 * @panel: An IBusPanelService
161 * Notify that the cursor is up
162 * by sending a "CursorUp" to IBus service.
164 void ibus_panel_service_cursor_up (IBusPanelService *panel);
167 * ibus_panel_service_page_down
168 * @panel: An IBusPanelService
170 * Notify that the page is down
171 * by sending a "PageDown" to IBus service.
173 void ibus_panel_service_page_down (IBusPanelService *panel);
176 * ibus_panel_service_page_up
177 * @panel: An IBusPanelService
179 * Notify that the page is up
180 * by sending a "PageUp" to IBus service.
182 void ibus_panel_service_page_up (IBusPanelService *panel);
185 * ibus_panel_service_property_activate
186 * @panel: An IBusPanelService
187 * @prop_name: A property name
188 * @prop_state: State of the property
190 * Notify that a property is active
191 * by sending a "PropertyActivate" message to IBus service.
193 void ibus_panel_service_property_activate (IBusPanelService *panel,
194 const gchar *prop_name,
197 * ibus_panel_service_property_show
198 * @panel: An IBusPanelService
199 * @prop_name: A property name
201 * Notify that a property is shown
202 * by sending a "ValueChanged" message to IBus service.
204 void ibus_panel_service_property_show (IBusPanelService *panel,
205 const gchar *prop_name);
208 * ibus_panel_service_property_hide
209 * @panel: An IBusPanelService
210 * @prop_name: A property name
212 * Notify that a property is hidden
213 * by sending a "ValueChanged" message to IBus service.
215 void ibus_panel_service_property_hide (IBusPanelService *panel,
216 const gchar *prop_name);