ime: refactoring. delete new_input_method_context event/listener
[platform/core/uifw/libds-tizen.git] / include / libds-tizen / input_method.h
1 #ifndef LIBDS_TIZEN_INPUT_METHOD_H
2 #define LIBDS_TIZEN_INPUT_METHOD_H
3
4 #include <stdint.h>
5 #include <wayland-server.h>
6 #include <libds/seat.h>
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10
11 struct ds_tizen_input_method_manager;
12 struct ds_tizen_input_method_context;
13 struct ds_tizen_input_method;
14
15 struct ds_tizen_input_method_manager_event_set_transient_for
16 {
17     struct ds_tizen_input_method_manager *im_mgr;
18     uint32_t pid_parent, pid_child;
19 };
20
21 struct ds_tizen_input_method_context_event_commit_string
22 {
23     struct ds_tizen_input_method_context *im_context;
24     uint32_t serial;
25     const char *text;
26 };
27
28 struct ds_tizen_input_method_context_event_preedit_string
29 {
30     struct ds_tizen_input_method_context *im_context;
31     uint32_t serial;
32     const char *text, *commit;
33 };
34
35 struct ds_tizen_input_method_context_event_preedit_styling
36 {
37     struct ds_tizen_input_method_context *im_context;
38     uint32_t index, length, style;
39 };
40
41 struct ds_tizen_input_method_context_event_preedit_cursor
42 {
43     struct ds_tizen_input_method_context *im_context;
44     int32_t index;
45 };
46
47 struct ds_tizen_input_method_context_event_delete_surrounding_text
48 {
49     struct ds_tizen_input_method_context *im_context;
50     int32_t index;
51     uint32_t length;
52 };
53
54 struct ds_tizen_input_method_context_event_cursor_position
55 {
56     struct ds_tizen_input_method_context *im_context;
57     int32_t index, anchor;
58 };
59
60 struct ds_tizen_input_method_context_event_modifiers_map
61 {
62     struct ds_tizen_input_method_context *im_context;
63     struct wl_array *map;
64 };
65
66 struct ds_tizen_input_method_context_event_keysym
67 {
68     struct ds_tizen_input_method_context *im_context;
69     uint32_t serial, time, sym, state, modifiers;
70 };
71
72 struct ds_tizen_input_method_context_event_language
73 {
74     struct ds_tizen_input_method_context *im_context;
75     uint32_t serial;
76     const char *language;
77 };
78
79 struct ds_tizen_input_method_context_event_text_direction
80 {
81     struct ds_tizen_input_method_context *im_context;
82     uint32_t serial, direction;
83 };
84
85 //input_method_manager
86 struct ds_tizen_input_method_manager *
87 ds_tizen_input_method_manager_create(struct wl_display *display);
88
89 void
90 ds_tizen_input_method_manager_add_destroy_listener(
91     struct ds_tizen_input_method_manager *im_mgr, struct wl_listener *listener);
92 void
93 ds_tizen_input_method_manager_add_set_transient_for_listener(
94     struct ds_tizen_input_method_manager *im_mgr, struct wl_listener *listener);
95
96 //input_method
97 struct ds_tizen_input_method *
98 ds_tizen_input_method_create(struct wl_display *display);
99
100 struct ds_tizen_input_method_context *
101 ds_tizen_input_method_create_context(struct ds_tizen_input_method *input_method);
102
103 void
104 ds_tizen_input_method_add_destroy_listener(
105     struct ds_tizen_input_method *im, struct wl_listener *listener);
106
107 // events
108 void ds_tizen_input_method_send_activate(struct ds_tizen_input_method *im,
109     struct ds_tizen_input_method_context *context);
110 void ds_tizen_input_method_send_deactivate(struct ds_tizen_input_method *im,
111     struct ds_tizen_input_method_context *context);
112
113 //input_method_context
114 void
115 ds_tizen_input_method_context_add_destroy_listener(
116     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
117 void
118 ds_tizen_input_method_context_add_commit_string_listener(
119     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
120 void
121 ds_tizen_input_method_context_add_preedit_string_listener(
122     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
123 void
124 ds_tizen_input_method_context_add_preedit_styling_listener(
125     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
126 void
127 ds_tizen_input_method_context_add_preedit_cursor_listener(
128     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
129 void
130 ds_tizen_input_method_context_add_delete_surrounding_text_listener(
131     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
132 void
133 ds_tizen_input_method_context_add_cursor_position_listener(
134     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
135 void
136 ds_tizen_input_method_context_add_modifiers_map_listener(
137     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
138 void
139 ds_tizen_input_method_context_add_keysym_listener(
140     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
141 void
142 ds_tizen_input_method_context_add_grab_keyboard_listener(
143     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
144 void
145 ds_tizen_input_method_context_add_key_listener(
146     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
147 void
148 ds_tizen_input_method_context_add_modifiers_listener(
149     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
150 void
151 ds_tizen_input_method_context_add_language_listener(
152     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
153 void
154 ds_tizen_input_method_context_add_text_direction_listener(
155     struct ds_tizen_input_method_context *context, struct wl_listener *listener);
156
157 // events
158 void
159 ds_tizen_input_method_context_send_surrounding_text(struct ds_tizen_input_method_context *context,
160     const char *text, uint32_t cursor, uint32_t anchor);
161 void
162 ds_tizen_input_method_context_send_reset(struct ds_tizen_input_method_context *context);
163 void
164 ds_tizen_input_method_context_send_content_type(
165     struct ds_tizen_input_method_context *context, uint32_t hint, uint32_t purpose);
166 void
167 ds_tizen_input_method_context_send_invoke_action(
168     struct ds_tizen_input_method_context *context, uint32_t button, uint32_t index);
169 void
170 ds_tizen_input_method_context_send_commit_state(
171     struct ds_tizen_input_method_context *context, uint32_t serial);
172 void
173 ds_tizen_input_method_context_send_preferred_language(
174     struct ds_tizen_input_method_context *context, const char *launguage);
175
176 #ifdef __cplusplus
177 }
178 #endif
179
180 #endif