Merge "Add Elementary.Get/SetScale()" 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 double 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         internal static string elm_object_part_text_get(IntPtr obj, string part)
79         {
80             var text = _elm_object_part_text_get(obj, part);
81             return Marshal.PtrToStringAnsi(text);
82         }
83
84         internal static string elm_object_part_text_get(IntPtr obj)
85         {
86             var text = _elm_object_part_text_get(obj, IntPtr.Zero);
87             return Marshal.PtrToStringAnsi(text);
88         }
89
90         [DllImport(Libraries.Elementary)]
91         internal static extern void elm_object_item_part_content_set(IntPtr obj, string part, IntPtr content);
92
93         [DllImport(Libraries.Elementary)]
94         internal static extern IntPtr elm_object_item_part_content_unset(IntPtr obj, string part);
95
96         [DllImport(Libraries.Elementary)]
97         internal static extern void elm_object_item_part_content_set(IntPtr obj, IntPtr part, IntPtr content);
98
99         [DllImport(Libraries.Elementary)]
100         internal static extern IntPtr elm_object_part_content_get(IntPtr obj, string part);
101
102         [DllImport(Libraries.Elementary)]
103         internal static extern void elm_object_part_content_set(IntPtr obj, string part, IntPtr content);
104
105         [DllImport(Libraries.Elementary)]
106         internal static extern void elm_object_part_content_set(IntPtr obj, IntPtr part, IntPtr content);
107
108         internal static void elm_object_content_set(IntPtr obj, IntPtr content)
109         {
110             elm_object_part_content_set(obj, IntPtr.Zero, content);
111         }
112
113         [DllImport(Libraries.Elementary)]
114         internal static extern void elm_object_part_content_unset(IntPtr obj, string part);
115
116         internal static void elm_object_content_unset(IntPtr obj)
117         {
118             elm_object_part_content_unset(obj, null);
119         }
120
121         [DllImport(Libraries.Elementary)]
122         internal static extern IntPtr elm_layout_add(IntPtr obj);
123
124         [DllImport(Libraries.Elementary)]
125         internal static extern IntPtr elm_layout_content_get(IntPtr obj, string swallow);
126
127         [DllImport(Libraries.Elementary)]
128         internal static extern bool elm_layout_content_set(IntPtr obj, string swallow, IntPtr content);
129
130         [DllImport(Libraries.Elementary)]
131         internal static extern IntPtr elm_layout_content_unset(IntPtr obj, string swallow);
132
133         [DllImport(Libraries.Elementary)]
134         internal static extern bool elm_layout_text_set(IntPtr obj, string part, string text);
135
136         [DllImport(Libraries.Elementary, EntryPoint = "elm_layout_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
137         internal static extern IntPtr _elm_layout_text_get(IntPtr obj, string part);
138
139         internal static string elm_layout_text_get(IntPtr obj, string part)
140         {
141             var text = _elm_layout_text_get(obj, part);
142             return Marshal.PtrToStringAnsi(text);
143         }
144
145         [DllImport(Libraries.Elementary)]
146         internal static extern bool elm_layout_theme_set(IntPtr obj, string klass, string group, string style);
147
148         [DllImport(Libraries.Elementary)]
149         internal static extern bool elm_layout_file_set(IntPtr obj, string file, string group);
150
151         [DllImport(Libraries.Elementary)]
152         internal static extern bool elm_object_style_set(IntPtr obj, string style);
153
154         [DllImport(Libraries.Elementary, EntryPoint = "elm_object_style_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
155         internal static extern IntPtr _elm_object_style_get(IntPtr obj);
156
157         internal static string elm_object_style_get(IntPtr obj)
158         {
159             var text = _elm_object_style_get(obj);
160             return Marshal.PtrToStringAnsi(text);
161         }
162
163         [DllImport(Libraries.Elementary)]
164         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);
165
166         [DllImport(Libraries.Elementary)]
167         internal static extern void elm_object_color_class_color_set(IntPtr obj, string colorClass, int r, int g, int b, int a);
168
169         [DllImport(Libraries.Elementary)]
170         internal static extern void elm_object_part_text_set(IntPtr obj, string part, string text);
171
172         [DllImport(Libraries.Elementary)]
173         internal static extern void elm_object_part_text_set(IntPtr obj, IntPtr part, string text);
174
175         [DllImport(Libraries.Elementary, EntryPoint = "elm_object_item_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
176         internal static extern IntPtr _elm_object_item_part_text_get(IntPtr obj, string part);
177
178         internal static string elm_object_item_part_text_get(IntPtr obj, string part)
179         {
180             var text = _elm_object_item_part_text_get(obj, part);
181             return Marshal.PtrToStringAnsi(text);
182         }
183
184         [DllImport(Libraries.Elementary)]
185         internal static extern void elm_object_item_color_class_color_set(IntPtr it, string part, int r, int g, int b, int a);
186
187         [DllImport(Libraries.Elementary)]
188         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);
189
190         [DllImport(Libraries.Elementary)]
191         internal static extern void elm_object_item_color_class_del(IntPtr obj, string part);
192
193         [DllImport(Libraries.Elementary)]
194         internal static extern void elm_object_item_part_text_set(IntPtr obj, string part, string label);
195
196         [DllImport(Libraries.Elementary)]
197         internal static extern void elm_object_item_part_text_set(IntPtr obj, IntPtr part, string label);
198
199         [DllImport(Libraries.Elementary)]
200         internal static extern IntPtr elm_object_item_data_get(IntPtr it);
201
202         [DllImport(Libraries.Elementary)]
203         internal static extern void elm_object_item_data_set(IntPtr it, IntPtr data);
204
205         [DllImport(Libraries.Elementary)]
206         internal static extern void elm_object_item_del(IntPtr obj);
207
208         [DllImport(Libraries.Elementary)]
209         internal static extern void elm_object_item_del_cb_set(IntPtr obj, Interop.Evas.SmartCallback callback);
210
211         [DllImport(Libraries.Elementary)]
212         internal static extern void elm_object_item_disabled_set(IntPtr obj, bool disable);
213
214         [DllImport(Libraries.Elementary)]
215         internal static extern bool elm_object_item_disabled_get(IntPtr obj);
216
217         [DllImport(Libraries.Elementary)]
218         internal static extern bool elm_object_focus_get(IntPtr obj);
219
220         [DllImport(Libraries.Elementary)]
221         internal static extern void elm_object_focus_set(IntPtr obj, bool focus);
222
223         [DllImport(Libraries.Elementary)]
224         internal static extern void elm_theme_extension_add(IntPtr theme, string path);
225
226         [DllImport(Libraries.Elementary)]
227         internal static extern void elm_theme_overlay_add(IntPtr theme, string path);
228
229         [DllImport(Libraries.Elementary)]
230         internal static extern IntPtr elm_theme_new();
231
232         [DllImport(Libraries.Elementary)]
233         internal static extern void elm_object_theme_set(IntPtr obj, IntPtr theme);
234
235         [DllImport(Libraries.Elementary)]
236         internal static extern IntPtr elm_layout_edje_get(IntPtr obj);
237
238         [DllImport(Libraries.Elementary)]
239         internal static extern void edje_object_color_class_del(IntPtr obj, string colorClass);
240
241         [DllImport(Libraries.Elementary)]
242         internal static extern bool edje_object_part_exists(IntPtr obj, string part);
243
244         [DllImport(Libraries.Elementary)]
245         internal static extern IntPtr edje_object_part_object_get(IntPtr obj, string part);
246
247         [DllImport(Libraries.Elementary)]
248         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);
249
250         [DllImport(Libraries.Elementary)]
251         internal static extern bool edje_object_part_text_set(IntPtr obj, string part, string text);
252
253         [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_text_get", CharSet = CharSet.Ansi)]
254         internal static extern IntPtr _edje_object_part_text_get(IntPtr obj, string part);
255
256         internal static string edje_object_part_text_get(IntPtr obj, string part)
257         {
258             var text = _edje_object_part_text_get(obj, part);
259             return Marshal.PtrToStringAnsi(text);
260         }
261
262         [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_text_style_user_peek", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
263         internal static extern IntPtr _edje_object_part_text_style_user_peek(IntPtr obj, string part);
264
265         internal static string edje_object_part_text_style_user_peek(IntPtr obj, string part)
266         {
267             var text = _edje_object_part_text_style_user_peek(obj, part);
268             return Marshal.PtrToStringAnsi(text);
269         }
270
271         [DllImport(Libraries.Elementary)]
272         internal static extern void edje_object_part_text_style_user_push(IntPtr obj, string part, string style);
273
274         [DllImport(Libraries.Elementary)]
275         internal static extern void edje_object_part_text_style_user_pop(IntPtr obj, string part);
276
277         [DllImport(Libraries.Elementary)]
278         internal static extern void edje_object_signal_emit(IntPtr obj, string emission, string source);
279
280         internal static void SetObjectText(IntPtr obj, string text)
281         {
282             elm_object_part_text_set(obj, IntPtr.Zero, text);
283         }
284     }
285 }