Merge "Fixd handle issue and interop function" into tizen
[platform/core/csapi/tizenfx.git] / src / ElmSharp / Interop / Interop.Elementary.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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 using System;
18 using System.Runtime.InteropServices;
19
20 internal static partial class Interop
21 {
22     internal static partial class Elementary
23     {
24         [DllImport(Libraries.Elementary)]
25         internal static extern void elm_config_scroll_bring_in_scroll_friction_set(double time);
26
27         [DllImport(Libraries.Elementary)]
28         internal static extern double elm_config_scroll_bring_in_scroll_friction_get();
29
30         [DllImport(Libraries.Elementary)]
31         internal static extern IntPtr elm_config_accel_preference_set(string preference);
32
33         [DllImport(Libraries.Elementary)]
34         internal static extern void elm_config_scale_set(double scale);
35
36         [DllImport(Libraries.Elementary)]
37         internal static extern double elm_config_scale_get();
38
39         [DllImport(Libraries.Elementary)]
40         internal static extern string elm_config_profile_get();
41
42         [DllImport(Libraries.Elementary)]
43         internal static extern void elm_object_tree_dump(IntPtr top);
44
45         [DllImport(Libraries.Elementary)]
46         internal static extern bool elm_object_disabled_get(IntPtr obj);
47
48         [DllImport(Libraries.Elementary)]
49         internal static extern void elm_object_disabled_set(IntPtr obj, bool disabled);
50
51         [DllImport(Libraries.Elementary)]
52         internal static extern void elm_init(int argc, string[] argv);
53
54         [DllImport(Libraries.Elementary)]
55         internal static extern bool ecore_main_loop_glib_integrate();
56
57         [DllImport(Libraries.Elementary)]
58         internal static extern void elm_run();
59
60         [DllImport(Libraries.Elementary)]
61         internal static extern void elm_exit();
62
63         [DllImport(Libraries.Elementary)]
64         internal static extern void elm_shutdown();
65
66         [DllImport(Libraries.Elementary)]
67         internal static extern void elm_app_base_scale_set(double base_scale);
68
69         [DllImport(Libraries.Elementary)]
70         internal static extern IntPtr elm_conformant_add(IntPtr obj);
71
72         [DllImport(Libraries.Elementary, EntryPoint = "elm_object_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
73         internal static extern IntPtr _elm_object_part_text_get(IntPtr obj, IntPtr part);
74
75         [DllImport(Libraries.Elementary, EntryPoint = "elm_object_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
76         internal static extern IntPtr _elm_object_part_text_get(IntPtr obj, string part);
77
78         [DllImport(Libraries.Elementary)]
79         internal static extern void elm_object_tooltip_text_set(IntPtr obj, string text);
80
81         [DllImport(Libraries.Elementary)]
82         internal static extern void elm_object_tooltip_unset(IntPtr obj);
83
84         internal static string elm_object_part_text_get(IntPtr obj, string part)
85         {
86             var text = _elm_object_part_text_get(obj, part);
87             return Marshal.PtrToStringAnsi(text);
88         }
89
90         internal static string elm_object_part_text_get(IntPtr obj)
91         {
92             var text = _elm_object_part_text_get(obj, IntPtr.Zero);
93             return Marshal.PtrToStringAnsi(text);
94         }
95
96         [DllImport(Libraries.Elementary)]
97         internal static extern void elm_object_item_part_content_set(IntPtr obj, string part, IntPtr content);
98
99         [DllImport(Libraries.Elementary)]
100         internal static extern IntPtr elm_object_item_part_content_unset(IntPtr obj, string part);
101
102         [DllImport(Libraries.Elementary)]
103         internal static extern void elm_object_item_part_content_set(IntPtr obj, IntPtr part, IntPtr content);
104
105         [DllImport(Libraries.Elementary)]
106         internal static extern IntPtr elm_object_part_content_get(IntPtr obj, string part);
107
108         [DllImport(Libraries.Elementary)]
109         internal static extern void elm_object_part_content_set(IntPtr obj, string part, IntPtr content);
110
111         [DllImport(Libraries.Elementary)]
112         internal static extern void elm_object_part_content_set(IntPtr obj, IntPtr part, IntPtr content);
113
114         internal static void elm_object_content_set(IntPtr obj, IntPtr content)
115         {
116             elm_object_part_content_set(obj, IntPtr.Zero, content);
117         }
118
119         [DllImport(Libraries.Elementary)]
120         internal static extern void elm_object_part_content_unset(IntPtr obj, string part);
121
122         internal static void elm_object_content_unset(IntPtr obj)
123         {
124             elm_object_part_content_unset(obj, null);
125         }
126
127         [DllImport(Libraries.Elementary)]
128         internal static extern IntPtr elm_layout_add(IntPtr obj);
129
130         [DllImport(Libraries.Elementary)]
131         internal static extern IntPtr elm_layout_content_get(IntPtr obj, string swallow);
132
133         [DllImport(Libraries.Elementary)]
134         internal static extern bool elm_layout_content_set(IntPtr obj, string swallow, IntPtr content);
135
136         [DllImport(Libraries.Elementary)]
137         internal static extern IntPtr elm_layout_content_unset(IntPtr obj, string swallow);
138
139         [DllImport(Libraries.Elementary)]
140         internal static extern bool elm_layout_text_set(IntPtr obj, string part, string text);
141
142         [DllImport(Libraries.Elementary, EntryPoint = "elm_layout_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
143         internal static extern IntPtr _elm_layout_text_get(IntPtr obj, string part);
144
145         internal static string elm_layout_text_get(IntPtr obj, string part)
146         {
147             var text = _elm_layout_text_get(obj, part);
148             return Marshal.PtrToStringAnsi(text);
149         }
150
151         [DllImport(Libraries.Elementary)]
152         internal static extern bool elm_layout_theme_set(IntPtr obj, string klass, string group, string style);
153
154         [DllImport(Libraries.Elementary)]
155         internal static extern bool elm_layout_file_set(IntPtr obj, string file, string group);
156
157         [DllImport(Libraries.Elementary)]
158         internal static extern bool elm_object_style_set(IntPtr obj, string style);
159
160         [DllImport(Libraries.Elementary, EntryPoint = "elm_object_style_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
161         internal static extern IntPtr _elm_object_style_get(IntPtr obj);
162
163         internal static string elm_object_style_get(IntPtr obj)
164         {
165             var text = _elm_object_style_get(obj);
166             return Marshal.PtrToStringAnsi(text);
167         }
168
169         [DllImport(Libraries.Elementary)]
170         internal static extern void elm_object_color_class_color_get(IntPtr obj, string colorClass, out int r, out int g, out int b, out int a);
171
172         [DllImport(Libraries.Elementary)]
173         internal static extern void elm_object_color_class_color_set(IntPtr obj, string colorClass, int r, int g, int b, int a);
174
175         [DllImport(Libraries.Elementary)]
176         internal static extern void elm_object_part_text_set(IntPtr obj, string part, string text);
177
178         [DllImport(Libraries.Elementary)]
179         internal static extern void elm_object_part_text_set(IntPtr obj, IntPtr part, string text);
180
181         [DllImport(Libraries.Elementary, EntryPoint = "elm_object_item_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
182         internal static extern IntPtr _elm_object_item_part_text_get(IntPtr obj, string part);
183
184         internal static string elm_object_item_part_text_get(IntPtr obj, string part)
185         {
186             var text = _elm_object_item_part_text_get(obj, part);
187             return Marshal.PtrToStringAnsi(text);
188         }
189
190         [DllImport(Libraries.Elementary)]
191         internal static extern void elm_object_item_color_class_color_set(IntPtr it, string part, int r, int g, int b, int a);
192
193         [DllImport(Libraries.Elementary)]
194         internal static extern void elm_object_item_color_class_color_get(IntPtr obj, string part, out int r, out int g, out int b, out int a);
195
196         [DllImport(Libraries.Elementary)]
197         internal static extern void elm_object_item_color_class_del(IntPtr obj, string part);
198
199         [DllImport(Libraries.Elementary)]
200         internal static extern void elm_object_item_part_text_set(IntPtr obj, string part, string label);
201
202         [DllImport(Libraries.Elementary)]
203         internal static extern void elm_object_item_part_text_set(IntPtr obj, IntPtr part, string label);
204
205         [DllImport(Libraries.Elementary)]
206         internal static extern IntPtr elm_object_item_data_get(IntPtr it);
207
208         [DllImport(Libraries.Elementary)]
209         internal static extern void elm_object_item_data_set(IntPtr it, IntPtr data);
210
211         [DllImport(Libraries.Elementary)]
212         internal static extern void elm_object_item_del(IntPtr obj);
213
214         [DllImport(Libraries.Elementary)]
215         internal static extern void elm_object_item_del_cb_set(IntPtr obj, Interop.Evas.SmartCallback callback);
216
217         [DllImport(Libraries.Elementary)]
218         internal static extern void elm_object_item_disabled_set(IntPtr obj, bool disable);
219
220         [DllImport(Libraries.Elementary)]
221         internal static extern bool elm_object_item_disabled_get(IntPtr obj);
222
223         [DllImport(Libraries.Elementary)]
224         internal static extern bool elm_object_focus_get(IntPtr obj);
225
226         [DllImport(Libraries.Elementary)]
227         internal static extern void elm_object_focus_set(IntPtr obj, bool focus);
228
229         [DllImport(Libraries.Elementary)]
230         internal static extern bool elm_object_focus_allow_get(IntPtr obj);
231
232         [DllImport(Libraries.Elementary)]
233         internal static extern void elm_object_focus_allow_set(IntPtr obj, bool enable);
234
235         [DllImport(Libraries.Elementary)]
236         internal static extern void elm_object_focus_next(IntPtr obj, int direction);
237
238         [DllImport(Libraries.Elementary)]
239         internal static extern void elm_object_focus_next_object_set(IntPtr obj, IntPtr next, int direction);
240
241         [DllImport(Libraries.Elementary)]
242         internal static extern void elm_object_focus_next_item_set(IntPtr obj, IntPtr nextItem, int direction);
243
244         [DllImport(Libraries.Elementary)]
245         internal static extern void elm_theme_extension_add(IntPtr theme, string path);
246
247         [DllImport(Libraries.Elementary)]
248         internal static extern void elm_theme_overlay_add(IntPtr theme, string path);
249
250         [DllImport(Libraries.Elementary)]
251         internal static extern IntPtr elm_theme_new();
252
253         [DllImport(Libraries.Elementary)]
254         internal static extern void elm_object_theme_set(IntPtr obj, IntPtr theme);
255
256         [DllImport(Libraries.Elementary)]
257         internal static extern IntPtr elm_layout_edje_get(IntPtr obj);
258
259         [DllImport(Libraries.Elementary)]
260         internal static extern void edje_object_color_class_del(IntPtr obj, string colorClass);
261
262         [DllImport(Libraries.Elementary)]
263         internal static extern bool edje_object_part_exists(IntPtr obj, string part);
264
265         [DllImport(Libraries.Elementary)]
266         internal static extern IntPtr edje_object_part_object_get(IntPtr obj, string part);
267
268         [DllImport(Libraries.Elementary)]
269         internal static extern bool edje_object_part_geometry_get(IntPtr obj, string part, out int x, out int y, out int w, out int h);
270
271         [DllImport(Libraries.Elementary)]
272         internal static extern bool edje_object_part_text_set(IntPtr obj, string part, string text);
273
274         [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_text_get", CharSet = CharSet.Ansi)]
275         internal static extern IntPtr _edje_object_part_text_get(IntPtr obj, string part);
276
277         internal static string edje_object_part_text_get(IntPtr obj, string part)
278         {
279             var text = _edje_object_part_text_get(obj, part);
280             return Marshal.PtrToStringAnsi(text);
281         }
282
283         [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_text_style_user_peek", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
284         internal static extern IntPtr _edje_object_part_text_style_user_peek(IntPtr obj, string part);
285
286         internal static string edje_object_part_text_style_user_peek(IntPtr obj, string part)
287         {
288             var text = _edje_object_part_text_style_user_peek(obj, part);
289             return Marshal.PtrToStringAnsi(text);
290         }
291
292         [DllImport(Libraries.Elementary)]
293         internal static extern void edje_object_part_text_style_user_push(IntPtr obj, string part, string style);
294
295         [DllImport(Libraries.Elementary)]
296         internal static extern void edje_object_part_text_style_user_pop(IntPtr obj, string part);
297
298         [DllImport(Libraries.Elementary)]
299         internal static extern void edje_object_signal_emit(IntPtr obj, string emission, string source);
300
301         internal static void SetObjectText(IntPtr obj, string text)
302         {
303             elm_object_part_text_set(obj, IntPtr.Zero, text);
304         }
305     }
306 }