text_input: implement wl_text_input and manager
[platform/core/uifw/libds-tizen.git] / include / libds-tizen / text_input.h
1 #ifndef LIBDS_TIZEN_TEXT_INPUT_H
2 #define LIBDS_TIZEN_TEXT_INPUT_H
3
4 #include <stdint.h>
5 #include <wayland-server.h>
6 #include <libds/surface.h>
7 #include <libds/seat.h>
8
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12
13 struct ds_tizen_text_input;
14 struct ds_tizen_text_input_manager;
15
16 struct ds_tizen_text_input_event_activate
17 {
18     struct ds_tizen_text_input *text_input;
19     struct ds_seat *seat;
20     struct ds_surface *surface;
21 };
22
23 struct ds_tizen_text_input_event_deactivate
24 {
25     struct ds_tizen_text_input *text_input;
26     struct ds_seat *seat;
27 };
28
29 struct ds_tizen_text_input_event_set_content_type
30 {
31     struct ds_tizen_text_input *text_input;
32     uint32_t hint, purpose;
33 };
34
35 struct ds_tizen_text_input_event_set_preferred_language
36 {
37     struct ds_tizen_text_input *text_input;
38     const char *language;
39 };
40
41 struct ds_tizen_text_input_event_commit_state
42 {
43     struct ds_tizen_text_input *text_input;
44     uint32_t serial;
45 };
46
47 struct ds_tizen_text_input_event_invoke_action
48 {
49     struct ds_tizen_text_input *text_input;
50     uint32_t button, index;
51 };
52
53 struct ds_tizen_text_input_manager *
54 ds_tizen_text_input_manager_create(struct wl_display *display);
55
56 void
57 ds_tizen_text_input_manager_add_destroy_listener(
58     struct ds_tizen_text_input_manager *ti_mgr, struct wl_listener *listener);
59 void
60 ds_tizen_text_input_manager_add_new_text_input_listener(
61     struct ds_tizen_text_input_manager *ti_mgr, struct wl_listener *listener);
62
63 void
64 ds_tizen_text_input_add_destroy_listener(
65     struct ds_tizen_text_input *ti, struct wl_listener *listener);
66 void
67 ds_tizen_text_input_add_activate_listener(
68     struct ds_tizen_text_input *ti, struct wl_listener *listener);
69 void
70 ds_tizen_text_input_add_deactivate_listener(
71     struct ds_tizen_text_input *ti, struct wl_listener *listener);
72 void
73 ds_tizen_text_input_add_reset_listener(
74     struct ds_tizen_text_input *ti, struct wl_listener *listener);
75 void
76 ds_tizen_text_input_add_set_content_type_listener(
77     struct ds_tizen_text_input *ti, struct wl_listener *listener);
78 void
79 ds_tizen_text_input_add_set_preferred_language_listener(
80     struct ds_tizen_text_input *ti, struct wl_listener *listener);
81 void
82 ds_tizen_text_input_add_commit_state_listener(
83     struct ds_tizen_text_input *ti, struct wl_listener *listener);
84 void
85 ds_tizen_text_input_add_invoke_action_listener(
86     struct ds_tizen_text_input *ti, struct wl_listener *listener);
87
88 void
89 ds_tizen_text_input_send_enter(struct ds_tizen_text_input *ti, struct ds_surface *surface);
90 void
91 ds_tizen_text_input_send_leave(struct ds_tizen_text_input *ti);
92 void
93 ds_tizen_text_input_send_modifiers_map(struct ds_tizen_text_input *ti,
94     struct wl_array *map);
95 void
96 ds_tizen_text_input_send_input_panel_state(struct ds_tizen_text_input *ti,
97     uint32_t input_panel_state);
98 void
99 ds_tizen_text_input_send_preedit_string(struct ds_tizen_text_input *ti,
100     uint32_t serial, const char *text, const char *commit);
101 void
102 ds_tizen_text_input_send_preedit_styling(struct ds_tizen_text_input *ti,
103     uint32_t index, uint32_t length, uint32_t style);
104 void
105 ds_tizen_text_input_send_preedit_cursor(struct ds_tizen_text_input *ti,
106     uint32_t index);
107 void
108 ds_tizen_text_input_send_commit_string(struct ds_tizen_text_input *ti,
109     uint32_t serial, const char *text);
110 void
111 ds_tizen_text_input_send_cursor_position(struct ds_tizen_text_input *ti,
112     int32_t index, int32_t anchor);
113 void
114 ds_tizen_text_input_send_delete_surrounding_text(struct ds_tizen_text_input *ti,
115     int32_t index, uint32_t length);
116 void
117 ds_tizen_text_input_send_keysym(struct ds_tizen_text_input *ti,
118     uint32_t serial, uint32_t time, uint32_t sym, uint32_t state,
119     uint32_t modifiers);
120 void
121 ds_tizen_text_input_send_language(struct ds_tizen_text_input *ti,
122     uint32_t serial, const char *language);
123 void
124 ds_tizen_text_input_send_text_direction(struct ds_tizen_text_input *ti,
125     uint32_t serial, uint32_t direction);
126
127 #ifdef __cplusplus
128 }
129 #endif
130
131 #endif