Finish implementation of IBusInputContext
[profile/ivi/weekeyboard.git] / src / wkb-ibus.h
1 /*
2  * Copyright © 2013 Intel Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef _WKB_IBUS_H_
18 #define _WKB_IBUS_H_
19
20 #include <Eina.h>
21 #include <Eldbus.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 struct wl_input_method_context;
28
29 /* Events */
30 extern int WKB_IBUS_CONNECTED;
31 extern int WKB_IBUS_DISCONNECTED;
32
33 int wkb_ibus_init(void);
34 void wkb_ibus_shutdown(void);
35
36 Eina_Bool wkb_ibus_connect(void);
37 void wkb_ibus_disconnect(void);
38
39 Eina_Bool wkb_ibus_is_connected(void);
40
41 /* IBus Input Context */
42 void wkb_ibus_input_context_create(struct wl_input_method_context *wl_ctx);
43 void wkb_ibus_input_context_destroy(void);
44 void wkb_ibus_input_context_process_key_event(const char *key);
45 void wkb_ibus_input_context_set_surrounding_text(const char *text, unsigned int cursor, unsigned int anchor);
46 unsigned int wkb_ibus_input_context_serial(void);
47 void wkb_ibus_input_context_set_serial(unsigned int serial);
48
49 /* IBus Panel */
50 Eldbus_Service_Interface * wkb_ibus_panel_register(Eldbus_Connection *conn);
51
52 /* IBus Config */
53 Eldbus_Service_Interface * wkb_ibus_config_register(Eldbus_Connection *conn, const char *path);
54 void wkb_ibus_config_unregister(void);
55
56 #ifdef __cplusplus
57 }
58 #endif
59
60 #endif /* _WKB_IBUS_H_ */