1 /* vim:set et sts=4: */
2 /* ibus - The Input Bus
3 * Copyright (C) 2008-2009 Huang Peng <shawn.p.huang@gmail.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
20 #ifndef __IBUS_ENGINE_H_
21 #define __IBUS_ENGINE_H_
23 #include <dbus/dbus.h>
24 #include "ibusservice.h"
25 #include "ibusattribute.h"
26 #include "ibuslookuptable.h"
27 #include "ibusproperty.h"
33 /* define GOBJECT macros */
34 #define IBUS_TYPE_ENGINE \
35 (ibus_engine_get_type ())
36 #define IBUS_ENGINE(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_ENGINE, IBusEngine))
38 #define IBUS_ENGINE_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_ENGINE, IBusEngineClass))
40 #define IBUS_IS_ENGINE(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_ENGINE))
42 #define IBUS_IS_ENGINE_CLASS(klass) \
43 (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_ENGINE))
44 #define IBUS_ENGINE_GET_CLASS(obj) \
45 (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_ENGINE, IBusEngineClass))
49 typedef struct _IBusEngine IBusEngine;
50 typedef struct _IBusEngineClass IBusEngineClass;
54 /* instance members */
59 IBusRectangle cursor_area;
60 guint client_capabilities;
63 struct _IBusEngineClass {
64 IBusServiceClass parent;
67 gboolean (* process_key_event)
71 void (* focus_in) (IBusEngine *engine);
72 void (* focus_out) (IBusEngine *engine);
73 void (* reset) (IBusEngine *engine);
74 void (* enable) (IBusEngine *engine);
75 void (* disable) (IBusEngine *engine);
76 void (* set_cursor_location)
82 void (* set_capabilities)
86 void (* page_up) (IBusEngine *engine);
87 void (* page_down) (IBusEngine *engine);
88 void (* cursor_up) (IBusEngine *engine);
89 void (* cursor_down) (IBusEngine *engine);
91 void (* property_activate)
93 const gchar *prop_name,
95 void (* property_show) (IBusEngine *engine,
96 const gchar *prop_name);
97 void (* property_hide) (IBusEngine *engine,
98 const gchar *prop_name);
105 GType ibus_engine_get_type (void);
106 IBusEngine *ibus_engine_new (const gchar *name,
108 IBusConnection *connection);
109 void ibus_engine_commit_text (IBusEngine *engine,
111 void ibus_engine_update_preedit_text
116 void ibus_engine_show_preedit_text
117 (IBusEngine *engine);
118 void ibus_engine_hide_preedit_text
119 (IBusEngine *engine);
120 void ibus_engine_update_auxiliary_text
124 void ibus_engine_show_auxiliary_text
125 (IBusEngine *engine);
126 void ibus_engine_hide_auxiliary_text
127 (IBusEngine *engine);
128 void ibus_engine_update_lookup_table
130 IBusLookupTable *lookup_table,
132 void ibus_engine_show_lookup_table
133 (IBusEngine *engine);
134 void ibus_engine_hide_lookup_table
135 (IBusEngine *engine);
137 void ibus_engine_forward_key_event
143 void ibus_engine_register_properties
145 IBusPropList *prop_list);
146 void ibus_engine_update_property(IBusEngine *engine,
148 const gchar *ibus_engine_get_name (IBusEngine *engine);