~ubuntu-branches/ubuntu/karmic/ibus/karmic-updates

« back to all changes in this revision

Viewing changes to src/ibusinputcontext.h

  • Committer: Bazaar Package Importer
  • Author(s): LI Daobing
  • Date: 2009-07-23 20:22:09 UTC
  • mfrom: (1.1.4 upstream) (6.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090723202209-bmgqa80g1umg8l2p
Tags: 1.2.0.20090723-1
new upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 * @short_description: IBus input context proxy object.
23
23
 * @stability: Stable
24
24
 *
25
 
 * An IBusInputContext is a proxy object of InputContext.
26
 
 * Clients call the IBusInputContext to invoke InputContext,
27
 
 * through which invoke IBusEngine.
 
25
 * An IBusInputContext is a proxy object of BusInputContext,
 
26
 * which manages the context for input methods that supports
 
27
 * text input in various natural languages.
 
28
 *
 
29
 * Clients call the IBusInputContext to invoke BusInputContext,
 
30
 * through which invokes IBusEngine.
28
31
 */
29
32
#ifndef __IBUS_INPUT_CONTEXT_H_
30
33
#define __IBUS_INPUT_CONTEXT_H_
54
57
typedef struct _IBusInputContext IBusInputContext;
55
58
typedef struct _IBusInputContextClass IBusInputContextClass;
56
59
 
 
60
/**
 
61
 * IBusInputContext:
 
62
 *
 
63
 * An opaque data type representing an IBusInputContext.
 
64
 */
57
65
struct _IBusInputContext {
58
66
  IBusProxy parent;
59
67
  /* instance members */
69
77
};
70
78
 
71
79
GType        ibus_input_context_get_type    (void);
 
80
 
 
81
/**
 
82
 * ibus_input_context_new:
 
83
 * @path: The path to the object that emitting the signal.
 
84
 * @connection: An IBusConnection.
 
85
 * @returns: A newly allocated IBusInputContext.
 
86
 *
 
87
 * New an IBusInputContext.
 
88
 */
72
89
IBusInputContext
73
90
            *ibus_input_context_new         (const gchar        *path,
74
91
                                             IBusConnection     *connection);
 
92
/**
 
93
 * ibus_input_context_process_key_event:
 
94
 * @context: An IBusInputContext.
 
95
 * @keyval: Key symbol of a key event.
 
96
 * @keycode: Keycode of a key event.
 
97
 * @state: Key modifier flags.
 
98
 * @returns: TRUE for successfully process the key; FALSE otherwise.
 
99
 *
 
100
 * Pass the key event to input method engine.
 
101
 *
 
102
 * Key symbols are characters/symbols produced by key press, for example,
 
103
 * pressing "s" generates key symbol "s"; pressing shift-"s" generates key symbol "S".
 
104
 * Same key on keyboard may produce different key symbols on different keyboard layout.
 
105
 * e.g., "s" key on QWERTY keyboard produces "o" in DVORAK layout.
 
106
 *
 
107
 * Unlike key symbol, keycode is only determined by the location of the key, and
 
108
 * irrelevant of the keyboard layout.
 
109
 *
 
110
 * Briefly speaking, input methods that expect certain keyboard layout should use
 
111
 * keycode; otherwise keyval is sufficient.
 
112
 * For example, Chewing, Cangjie, Wubi expect an en-US QWERTY keyboard, these should
 
113
 * use keycode; while pinyin can rely on keyval only, as it is less sensitive to
 
114
 * the keyboard layout change, DVORAK users can still use DVORAK layout to input pinyin.
 
115
 *
 
116
 * Use ibus_keymap_lookup_keysym() to convert keycode to keysym in given keyboard layout.
 
117
 *
 
118
 * @see_also: #IBusEngine::process-key-event
 
119
 */
75
120
gboolean     ibus_input_context_process_key_event
76
121
                                            (IBusInputContext   *context,
77
122
                                             guint32             keyval,
 
123
                                             guint32             keycode,
78
124
                                             guint32             state);
 
125
 
 
126
/**
 
127
 * ibus_input_context_set_cursor_location:
 
128
 * @context: An IBusInputContext.
 
129
 * @x: X coordinate of the cursor.
 
130
 * @y: Y coordinate of the cursor.
 
131
 * @w: Width of the cursor.
 
132
 * @h: Height of the cursor.
 
133
 *
 
134
 * Set the cursor location of IBus input context.
 
135
 *
 
136
 * @see_also: #IBusEngine::set-cursor-location
 
137
 */
79
138
void         ibus_input_context_set_cursor_location
80
139
                                            (IBusInputContext   *context,
81
140
                                             gint32              x,
82
141
                                             gint32              y,
83
142
                                             gint32              w,
84
143
                                             gint32              h);
 
144
/**
 
145
 * ibus_input_context_set_capabilities:
 
146
 * @context: An IBusInputContext.
 
147
 * @capabilities: Capabilities flags of IBusEngine, see #IBusCapabilite
 
148
 *
 
149
 * Set the capabilities flags of client application.
 
150
 *
 
151
 * @see_also: #IBusEngine::set-capabilities
 
152
 */
85
153
void         ibus_input_context_set_capabilities
86
154
                                            (IBusInputContext   *context,
87
 
                                             guint32             capabilites);
 
155
                                             guint32             capabilities);
 
156
 
 
157
/**
 
158
 * ibus_input_context_focus_in:
 
159
 * @context: An IBusInputContext.
 
160
 *
 
161
 * Invoked when the client application get focus.
 
162
 *
 
163
 * @see_also: #IBusEngine::focus_in.
 
164
 */
88
165
void         ibus_input_context_focus_in    (IBusInputContext   *context);
 
166
 
 
167
/**
 
168
 * ibus_input_context_focus_out:
 
169
 * @context: An IBusInputContext.
 
170
 *
 
171
 * Invoked when the client application get focus.
 
172
 *
 
173
 * @see_also: #IBusEngine::focus_out.
 
174
 */
89
175
void         ibus_input_context_focus_out   (IBusInputContext   *context);
 
176
 
 
177
 
 
178
/**
 
179
 * ibus_input_context_reset:
 
180
 * @context: An IBusInputContext.
 
181
 *
 
182
 * Invoked when the IME is reset.
 
183
 *
 
184
 * @see_also: #IBusEngine::reset
 
185
 */
90
186
void         ibus_input_context_reset       (IBusInputContext   *context);
 
187
 
 
188
/**
 
189
 * ibus_input_context_enable:
 
190
 * @context: An IBusInputContext.
 
191
 *
 
192
 * Invoked when the IME is enabled, either by IME switch hotkey or select from the menu.
 
193
 *
 
194
 * @see_also: #IBusEngine::enable
 
195
 */
91
196
void         ibus_input_context_enable      (IBusInputContext   *context);
 
197
 
 
198
/**
 
199
 * ibus_input_context_disable:
 
200
 * @context: An IBusInputContext.
 
201
 *
 
202
 * Invoked when the IME is disabled, either by IME switch hotkey or select from the menu.
 
203
 *
 
204
 * @see_also: #IBusEngine::disable
 
205
 */
92
206
void         ibus_input_context_disable     (IBusInputContext   *context);
93
207
 
94
208
G_END_DECLS