~ubuntu-branches/ubuntu/wily/scim/wily-proposed

« back to all changes in this revision

Viewing changes to extras/immodules/agent/utils/scim-bridge-agent-panel-client.h

  • Committer: Package Import Robot
  • Author(s): Rolf Leggewie, Rolf Leggewie, Tz-Huan Huang
  • Date: 2012-06-30 11:21:42 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120630112142-a4cwzsr16dty8dk7
Tags: 1.4.14-1
[ Rolf Leggewie ]
* new upstream release 1.4.14
  - drop 32_scim-1.4.8-fix-dlopen.patch which has landed upstream
* bump compat level to 9
* debian/control: add Toni Mueller as co-maintainer
  Welcome aboard!

[ Tz-Huan Huang ]
* start shipping a couple of newly introduced im-module packages
* debian/rules:
  - simplify dh_auto_install override where upstream changes allow this
  - drop -fpermissive from CXXFLAGS, fixed upstream
* debian/README.*: update the documentation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * SCIM Bridge
 
3
 *
 
4
 * Copyright (c) 2006 Ryo Dairiki <ryo-dairiki@users.sourceforge.net>
 
5
 *
 
6
 *
 
7
 * This library is free software; you can redistribute it and/or
 
8
 * modify it under the terms of the GNU Lesser General Public
 
9
 * License as published by the Free Software Foundation and 
 
10
 * appearing in the file LICENSE.LGPL included in the package of this file.
 
11
 * You can also redistribute it and/or modify it under the terms of 
 
12
 * the GNU General Public License as published by the Free Software Foundation and 
 
13
 * appearing in the file LICENSE.GPL included in the package of this file.
 
14
 *
 
15
 * This library is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
18
 */
 
19
 
 
20
 
 
21
/**
 
22
 * @file
 
23
 * @author Ryo Dairiki <ryo-dairiki@users.sourceforge.net>
 
24
 * @brief This is the header of the panel clients for SCIMBridge.
 
25
 */
 
26
 
 
27
#ifndef SCIMBRIDGEAGENTPANELCLIENT_H
 
28
#define SCIMBRIDGEAGENTPANELCLIENT_H
 
29
 
 
30
#define Uses_SCIM_EVENT
 
31
#define Uses_SCIM_PANEL_CLIENT
 
32
#define Uses_SCIM_SIGNAL
 
33
#define Uses_SCIM_SOCKET
 
34
#define Uses_SCIM_TRANSACTION
 
35
#define Uses_SCIM_TRANS_COMMANDS
 
36
 
 
37
#include <scim.h>
 
38
 
 
39
#include "scim-bridge.h"
 
40
#include "scim-bridge-display.h"
 
41
#include "scim-bridge-imcontext.h"
 
42
 
 
43
typedef scim::Slot1<void, int> ScimBridgeAgentPanelClientSlotVoid;
 
44
typedef scim::Slot2<void, int, int> ScimBridgeAgentPanelClientSlotInt;
 
45
typedef scim::Slot2<void, int, const scim::String&> ScimBridgeAgentPanelClientSlotString;
 
46
typedef scim::Slot2<void, int, const scim::WideString&> ScimBridgeAgentPanelClientSlotWideString;
 
47
typedef scim::Slot4<void, int, const scim::String&, const scim::String&, const scim::Transaction&> ScimBridgeAgentPanelClientSlotStringStringTransaction;
 
48
typedef scim::Slot2<void, int, const scim::KeyEvent&> ScimBridgeAgentPanelClientSlotKeyEvent;
 
49
 
 
50
 
 
51
/**
 
52
 * The class of panel clients.
 
53
 */
 
54
class ScimBridgeAgentPanelClient
 
55
{
 
56
 
 
57
    public:
 
58
 
 
59
        /**
 
60
         * Alloc an panel client.
 
61
         *
 
62
         * @param config_name The name of the configuration.
 
63
         * @param display The display.
 
64
         * @return The new panel client.
 
65
         */
 
66
        static ScimBridgeAgentPanelClient *alloc (const scim::String &config_name, const ScimBridgeDisplay *display);
 
67
 
 
68
 
 
69
        /**
 
70
         * Destructor.
 
71
         */
 
72
        virtual ~ScimBridgeAgentPanelClient ();
 
73
 
 
74
 
 
75
        /**
 
76
         * Open a connection with the panel.
 
77
         */
 
78
        virtual int open_connection () = 0;
 
79
        
 
80
 
 
81
        /**
 
82
         * Close a connection with the panel.
 
83
         */
 
84
        virtual void close_connection () = 0;
 
85
 
 
86
 
 
87
        /**
 
88
         * Get the connection number with the panel.
 
89
         *
 
90
         * @return The connection number with the panel.
 
91
         */
 
92
        virtual int get_connection_number () const = 0;
 
93
 
 
94
 
 
95
        /**
 
96
         * See if the connection with the panel is active.
 
97
         *
 
98
         * @return true if the connection is active.
 
99
         */
 
100
        virtual bool is_connected () const = 0;
 
101
 
 
102
 
 
103
        /**
 
104
         * See if there is pending events.
 
105
         *
 
106
         * @return true if there is pending events.
 
107
         */
 
108
        virtual bool has_pending_event () const = 0;
 
109
        
 
110
 
 
111
        /**
 
112
         * Filter events from the panel.
 
113
         *
 
114
         * @return RETVAL_FAILED if errors have occurred.
 
115
         */
 
116
        virtual retval_t filter_event () = 0;
 
117
 
 
118
 
 
119
        /**
 
120
         * Prepare the panel to do some actions.
 
121
         *
 
122
         * @param imcontext_id.
 
123
         * @return RETVAL_FAILED if errors have occurred.
 
124
         */
 
125
        virtual retval_t prepare (scim_bridge_imcontext_id_t imcontext_id) = 0;
 
126
        
 
127
 
 
128
        /**
 
129
         * Send stored commands to the panel.
 
130
         *
 
131
         * @return RETVAL_FAILED if errors have occurred.
 
132
         */
 
133
        virtual retval_t send () = 0;
 
134
 
 
135
 
 
136
        /**
 
137
         * Turn on the IME on the panel.
 
138
         */
 
139
        virtual void turn_on () = 0;
 
140
 
 
141
        /**
 
142
         * Turn off the IME on the panel.
 
143
         */
 
144
        virtual void turn_off () = 0;
 
145
 
 
146
 
 
147
        /**
 
148
         * Update specific screen of the panel.
 
149
         */
 
150
        virtual void update_screen () = 0;
 
151
 
 
152
 
 
153
        /**
 
154
         * Show the help text.
 
155
         *
 
156
         * @param help_text The text to show.
 
157
         */
 
158
        virtual void show_help (const scim::String &help_text) = 0;
 
159
 
 
160
 
 
161
        /**
 
162
         * Show the factory menu.
 
163
         *
 
164
         * @param menu The menu items.
 
165
         */
 
166
        virtual void show_factory_menu (const std::vector<scim::PanelFactoryInfo> &menu) = 0;
 
167
        
 
168
 
 
169
        /**
 
170
         * Focus in the specific IME.
 
171
         *
 
172
         * @param uuid The uuid of the IME.
 
173
         */
 
174
        virtual void focus_in (const scim::String &uuid) = 0;
 
175
 
 
176
 
 
177
        /**
 
178
         * Focus out the current IME.
 
179
         */
 
180
        virtual void focus_out () = 0;
 
181
 
 
182
 
 
183
        /**
 
184
         * Update the status information of the IME on the panel.
 
185
         *
 
186
         * @param info The infomation of the IME.
 
187
         */
 
188
        virtual void update_factory_info (const scim::PanelFactoryInfo &info) = 0;
 
189
        
 
190
 
 
191
        /**
 
192
         * Update the cursor location.
 
193
         *
 
194
         * @param x The X location of the cursor.
 
195
         * @param y The Y location of the cursor.
 
196
         */
 
197
        virtual void update_spot_location (int x, int y) = 0;
 
198
 
 
199
 
 
200
        /**
 
201
         * Show the floating preedit string.
 
202
         */
 
203
        virtual void show_preedit_string () = 0;
 
204
 
 
205
 
 
206
        /**
 
207
         * Show the aux string.
 
208
         */
 
209
        virtual void show_aux_string () = 0;
 
210
 
 
211
        /**
 
212
         * Show the lookup table.
 
213
         */
 
214
        virtual void show_lookup_table () = 0;
 
215
 
 
216
 
 
217
        /**
 
218
         * Hide the floating preedit string.
 
219
         */
 
220
        virtual void hide_preedit_string () = 0;
 
221
 
 
222
 
 
223
        /**
 
224
         * Hide the aux string.
 
225
         */
 
226
        virtual void hide_aux_string () = 0;
 
227
 
 
228
 
 
229
        /**
 
230
         * Hide the lookup table.
 
231
         */
 
232
        virtual void hide_lookup_table () = 0;
 
233
 
 
234
        
 
235
        /**
 
236
         * Update the string in the flaoting preedit.
 
237
         *
 
238
         * @param str The string to show.
 
239
         * @param attrs The attributes of the string.
 
240
         */
 
241
        virtual void update_preedit_string (const scim::WideString &str, const scim::AttributeList &attrs) = 0;
 
242
        
 
243
        /**
 
244
         * Update the cursor position in the flaoting preedit.
 
245
         *
 
246
         * @param cursor_position The cursor position.
 
247
         */
 
248
        virtual void update_preedit_caret (int cursor_position) = 0;
 
249
        
 
250
        /**
 
251
         * Update the aux string.
 
252
         *
 
253
         * @param str The string to show.
 
254
         * @param attrs The attributes of the string.
 
255
         */
 
256
        virtual void update_aux_string (const scim::WideString &str, const scim::AttributeList &attrs) = 0;
 
257
 
 
258
 
 
259
        /**
 
260
         * Update the lookup table.
 
261
         *
 
262
         * @param table The lookup table.
 
263
         */
 
264
        virtual void update_lookup_table (const scim::LookupTable &table) = 0;
 
265
 
 
266
        /**
 
267
         * Register properties into the panel.
 
268
         *
 
269
         * @param properties The properties.
 
270
         */
 
271
        virtual void register_properties (const scim::PropertyList &properties) = 0;
 
272
 
 
273
        /**
 
274
         * Update property.
 
275
         *
 
276
         * @param property The property.
 
277
         */
 
278
        virtual void update_property (const scim::Property &property) = 0;
 
279
 
 
280
 
 
281
        /**
 
282
         * Launch a helper process.
 
283
         *
 
284
         * @param helper_uuid The uuid of the helper.
 
285
         */
 
286
        virtual void start_helper (const scim::String &helper_uuid) = 0;
 
287
 
 
288
 
 
289
        /**
 
290
         * Shutdown a helper process.
 
291
         *
 
292
         * @param helper_uuid The uuid of the helper.
 
293
         */
 
294
        virtual void stop_helper (const scim::String &helper_uuid) = 0;
 
295
 
 
296
 
 
297
        /**
 
298
         * Send a message to a helper.
 
299
         *
 
300
         * @param helper_uuid The uuid of the helper.
 
301
         * @param trans The transaction with the helper process.
 
302
         */
 
303
        virtual void send_helper_event (const scim::String &helper_uuid, const scim::Transaction &trans) = 0;
 
304
 
 
305
 
 
306
        /**
 
307
         * Register a input context (IMContext).
 
308
         *
 
309
         * @param uuid The uuid of the IME.
 
310
         */
 
311
        virtual void register_input_context (const scim::String &uuid) = 0;
 
312
 
 
313
 
 
314
        /**
 
315
         * Deregister the current input context (IMContext).
 
316
         */
 
317
        virtual void remove_input_context () = 0;
 
318
 
 
319
 
 
320
        /**
 
321
         * Connect the signal of reload_config.
 
322
         *
 
323
         * @param slot The slot to connect the signal.
 
324
         * @return The new connection.
 
325
         */
 
326
        virtual scim::Connection signal_connect_reload_config (ScimBridgeAgentPanelClientSlotVoid *slot) = 0;
 
327
 
 
328
 
 
329
        /**
 
330
         * Connect the signal of exit.
 
331
         *
 
332
         * @param slot The slot to connect the signal.
 
333
         * @return The new connection.
 
334
         */
 
335
        virtual scim::Connection signal_connect_exit (ScimBridgeAgentPanelClientSlotVoid *slot) = 0;
 
336
 
 
337
 
 
338
        /**
 
339
         * Connect the signal of update_lookup_table_page_size.
 
340
         *
 
341
         * @param slot The slot to connect the signal.
 
342
         * @return The new connection.
 
343
         */
 
344
        virtual scim::Connection signal_connect_update_lookup_table_page_size (ScimBridgeAgentPanelClientSlotInt *slot) = 0;
 
345
 
 
346
 
 
347
        /**
 
348
         * Connect the signal of lookup_table_page_up.
 
349
         *
 
350
         * @param slot The slot to connect the signal.
 
351
         * @return The new connection.
 
352
         */
 
353
        virtual scim::Connection signal_connect_lookup_table_page_up (ScimBridgeAgentPanelClientSlotVoid *slot) = 0;
 
354
 
 
355
 
 
356
        /**
 
357
         * Connect the signal of lookup_table_page_down.
 
358
         *
 
359
         * @param slot The slot to connect the signal.
 
360
         * @return The new connection.
 
361
         */
 
362
        virtual scim::Connection signal_connect_lookup_table_page_down (ScimBridgeAgentPanelClientSlotVoid *slot) = 0;
 
363
 
 
364
 
 
365
        /**
 
366
         * Connect the signal of trigger_property.
 
367
         *
 
368
         * @param slot The slot to connect the signal.
 
369
         * @return The new connection.
 
370
         */
 
371
        virtual scim::Connection signal_connect_trigger_property (ScimBridgeAgentPanelClientSlotString *slot) = 0;
 
372
 
 
373
 
 
374
        /**
 
375
         * Connect the signal of process_helper_event.
 
376
         *
 
377
         * @param slot The slot to connect the signal.
 
378
         * @return The new connection.
 
379
         */
 
380
        virtual scim::Connection signal_connect_process_helper_event (ScimBridgeAgentPanelClientSlotStringStringTransaction *slot) = 0;
 
381
 
 
382
 
 
383
        /**
 
384
         * Connect the signal of move_preedit_caret.
 
385
         *
 
386
         * @param slot The slot to connect the signal.
 
387
         * @return The new connection.
 
388
         */
 
389
        virtual scim::Connection signal_connect_move_preedit_caret (ScimBridgeAgentPanelClientSlotInt *slot) = 0;
 
390
 
 
391
 
 
392
        /**
 
393
         * Connect the signal of select_candidate.
 
394
         *
 
395
         * @param slot The slot to connect the signal.
 
396
         * @return The new connection.
 
397
         */
 
398
        virtual scim::Connection signal_connect_select_candidate (ScimBridgeAgentPanelClientSlotInt *slot) = 0;
 
399
 
 
400
 
 
401
        /**
 
402
         * Connect the signal of process_key_event.
 
403
         *
 
404
         * @param slot The slot to connect the signal.
 
405
         * @return The new connection.
 
406
         */
 
407
        virtual scim::Connection signal_connect_process_key_event (ScimBridgeAgentPanelClientSlotKeyEvent *slot) = 0;
 
408
 
 
409
 
 
410
        /**
 
411
         * Connect the signal of commit_string.
 
412
         *
 
413
         * @param slot The slot to connect the signal.
 
414
         * @return The new connection.
 
415
         */
 
416
        virtual scim::Connection signal_connect_commit_string (ScimBridgeAgentPanelClientSlotWideString *slot) = 0;
 
417
 
 
418
 
 
419
        /**
 
420
         * Connect the signal of forward_key_event.
 
421
         *
 
422
         * @param slot The slot to connect the signal.
 
423
         * @return The new connection.
 
424
         */
 
425
        virtual scim::Connection signal_connect_forward_key_event (ScimBridgeAgentPanelClientSlotKeyEvent *slot) = 0;
 
426
 
 
427
 
 
428
        /**
 
429
         * Connect the signal of request_help.
 
430
         *
 
431
         * @param slot The slot to connect the signal.
 
432
         * @return The new connection.
 
433
         */
 
434
        virtual scim::Connection signal_connect_request_help (ScimBridgeAgentPanelClientSlotVoid *slot) = 0;
 
435
 
 
436
 
 
437
        /**
 
438
         * Connect the signal of request_factory_menu.
 
439
         *
 
440
         * @param slot The slot to connect the signal.
 
441
         * @return The new connection.
 
442
         */
 
443
        virtual scim::Connection signal_connect_request_factory_menu (ScimBridgeAgentPanelClientSlotVoid *slot) = 0;
 
444
 
 
445
 
 
446
        /**
 
447
         * Connect the signal of change_factory.
 
448
         *
 
449
         * @param slot The slot to connect the signal.
 
450
         * @return The new connection.
 
451
         */
 
452
        virtual scim::Connection signal_connect_change_factory (ScimBridgeAgentPanelClientSlotString *slot) = 0;
 
453
 
 
454
    protected:
 
455
 
 
456
        ScimBridgeAgentPanelClient ();
 
457
};
 
458
#endif                                            /*SCIMBRIDGEAGENTPANELCLIENT_H*/