1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
/*
* Copyright (C) 2010 Intel Corporation
*
* Author: Raymond Liu <raymond.liu@intel.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef _MEEGO_IMCONTEXT_DBUS_H
#define _MEEGO_IMCONTEXT_DBUS_H
#include <dbus/dbus-glib.h>
#include "meego-im-defs.h"
typedef struct {
GObject parent;
DBusGConnection *connection;
} MeegoIMContextDbusObj;
typedef struct {
GObjectClass parent;
} MeegoIMContextDbusObjClass;
GType meego_imcontext_dbusobj_get_type(void);
#define MEEGO_IMCONTEXT_TYPE_DBUSOBJ (meego_imcontext_dbusobj_get_type())
#define MEEGO_IMCONTEXT_DBUSOBJ(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), MEEGO_IMCONTEXT_TYPE_DBUSOBJ, MeegoIMContextDbusObj))
#define MEEGO_IMCONTEXT_DBUSOBJ_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), MEEGO_IMCONTEXT_TYPE_DBUSOBJ, MeegoIMContextDbusObjClass))
#define MEEGO_IMCONTEXT_IS_DBUSOBJ(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), MEEGO_IMCONTEXT_TYPE_DBUSOBJ))
#define MEEGO_IMCONTEXT_IS_DBUSOBJ_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), MEEGO_IMCONTEXT_TYPE_DBUSOBJ))
#define MEEGO_IMCONTEXT_DBUSOBJ_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj), MEEGO_IMCONTEXT_TYPE_DBUSOBJ, MeegoIMContextDbusObjClass))
MeegoIMContextDbusObj *meego_imcontext_dbusobj_get_singleton(void);
void meego_imcontext_dbusobj_connect(MeegoIMContextDbusObj *obj, DBusGConnection *connection);
// Call back functions for dbus obj, need to be implemented in imcontext client side
gboolean meego_imcontext_client_activation_lost_event(MeegoIMContextDbusObj *obj);
gboolean meego_imcontext_client_im_initiated_hide(MeegoIMContextDbusObj *obj);
gboolean meego_imcontext_client_commit_string(MeegoIMContextDbusObj *obj, const char *string,
int replace_start, int replace_length, int cursor_pos);
gboolean meego_imcontext_client_update_preedit(MeegoIMContextDbusObj *obj, const char *string,
int preedit_format_count, const MeegoImPreeditFormat *preedit_formats,
int replace_start, int replace_length, int cursor_pos);
gboolean meego_imcontext_client_key_event(MeegoIMContextDbusObj *obj, int type, int key, int modifiers, char *text,
gboolean auto_repeat, int count);
gboolean meego_imcontext_client_update_input_method_area(MeegoIMContextDbusObj *obj, GPtrArray *data);
gboolean meego_imcontext_client_set_global_correction_enabled(MeegoIMContextDbusObj *obj, gboolean correction);
gboolean meego_imcontext_client_copy(MeegoIMContextDbusObj *obj);
gboolean meego_imcontext_client_paste(MeegoIMContextDbusObj *obj);
gboolean meego_imcontext_client_set_redirect_keys(MeegoIMContextDbusObj *obj, gboolean enabled);
gboolean meego_imcontext_client_preedit_rectangle(MeegoIMContextDbusObj *obj, GValueArray **rect, gboolean *valid);
gboolean meego_imcontext_dbus_set_detectable_auto_repeat(MeegoIMContextDbusObj *obj, gboolean enabled, GError **error);
gboolean meego_imcontext_dbus_set_selection(MeegoIMContextDbusObj *obj, int start, int length, GError **error);
gboolean meego_imcontext_dbus_selection(MeegoIMContextDbusObj *obj, gboolean *valid, gchar **gdata, GError **error);
#endif /* _MEEGO_IMCONTEXT_DBUS_H */
|