Remove the summary for non-browserble API
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / 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.ComponentModel;
19 using System.IO;
20
21 namespace ElmSharp
22 {
23     /// <summary>
24     /// The Elementary is a General Elementary,a VERY SIMPLE toolkit.
25     /// </summary>
26     public static class Elementary
27     {
28         private static readonly string _themeFilePath = "/usr/share/elm-sharp/elm-sharp-theme.edj";
29
30         /// <summary>
31         /// Gets or sets the configured finger size.
32         /// </summary>
33         public static int FingerSize
34         {
35             get
36             {
37                 return Interop.Elementary.elm_config_finger_size_get();
38             }
39             set
40             {
41                 Interop.Elementary.elm_config_finger_size_set(value);
42             }
43         }
44
45         /// <summary>
46         /// Gets or sets the enable status of the focus highlight animation
47         /// </summary>
48         public static bool IsFocusHighlightAnimation
49         {
50             get
51             {
52                 return Interop.Elementary.elm_config_focus_highlight_animate_get();
53             }
54             set
55             {
56                 Interop.Elementary.elm_config_focus_highlight_animate_set(value);
57             }
58         }
59
60         /// <summary>
61         /// Gets or sets the system mirrored mode.
62         /// This determines the default mirrored mode of widgets.
63         /// </summary>
64         public static bool IsMirrored
65         {
66             get
67             {
68                 return Interop.Elementary.elm_config_mirrored_get();
69             }
70             set
71             {
72                 Interop.Elementary.elm_config_mirrored_set(value);
73             }
74         }
75
76         /// <summary>
77         /// Gets or sets the enable status of the focus highlight.
78         /// </summary>
79         public static bool CanFocusHighlight
80         {
81             get
82             {
83                 return Interop.Elementary.elm_config_focus_highlight_enabled_get();
84             }
85             set
86             {
87                 Interop.Elementary.elm_config_focus_highlight_enabled_set(value);
88             }
89         }
90
91         /// <summary>
92         /// Gets or sets the base scale of the application.
93         /// </summary>
94         public static double AppBaseScale
95         {
96             get
97             {
98                 return Interop.Elementary.elm_app_base_scale_get();
99             }
100             set
101             {
102                 Interop.Elementary.elm_app_base_scale_set(value);
103             }
104         }
105
106         /// <summary>
107         /// Gets or sets the global scaling factor.
108         /// </summary>
109         public static double Scale
110         {
111             get
112             {
113                 return Interop.Elementary.elm_config_scale_get();
114             }
115             set
116             {
117                 Interop.Elementary.elm_config_scale_set(value);
118             }
119         }
120
121         /// <summary>
122         /// Gets or sets the amount of inertia a scroller imposes during region bring animations.
123         /// </summary>
124         public static double BringInScrollFriction
125         {
126             get
127             {
128                 return Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_get();
129             }
130             set
131             {
132                 Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_set(value);
133             }
134         }
135
136         /// <summary>
137         /// Initializes Elementary.
138         /// </summary>
139         public static void Initialize()
140         {
141             Interop.Elementary.elm_init(0, null);
142         }
143
144         /// <summary>
145         /// Shuts down Elementary.
146         /// </summary>
147         public static void Shutdown()
148         {
149             Interop.Elementary.elm_shutdown();
150         }
151
152         /// <summary>
153         /// Runs Elementary's main loop.
154         /// </summary>
155         public static void Run()
156         {
157             Interop.Elementary.elm_run();
158         }
159
160         [EditorBrowsable(EditorBrowsableState.Never)]
161         public static void ThemeOverlay()
162         {
163             if (File.Exists(_themeFilePath))
164             {
165                 AddThemeOverlay(_themeFilePath);
166             }
167         }
168
169         /// <summary>
170         /// Prepends a theme overlay to the list of overlays
171         /// </summary>
172         /// <param name="filePath">The Edje file path to be used.</param>
173         public static void AddThemeOverlay(string filePath)
174         {
175             Interop.Elementary.elm_theme_overlay_add(IntPtr.Zero, filePath);
176         }
177
178         /// <summary>
179         /// Delete a theme overlay from the list of overlays
180         /// </summary>
181         /// <param name="filePath">The name of the theme overlay.</param>
182         public static void DeleteThemeOverlay(string filePath)
183         {
184             Interop.Elementary.elm_theme_overlay_del(IntPtr.Zero, filePath);
185         }
186
187         /// <summary>
188         /// Free a theme
189         /// </summary>
190         public static void FreeTheme()
191         {
192             Interop.Elementary.elm_theme_free(IntPtr.Zero);
193         }
194
195         /// <summary>
196         /// Set the theme search order for the given theme
197         /// </summary>
198         /// <param name="theme">Theme search string</param>
199         /// <remarks>This sets the search string for the theme in path-notation from first theme to search, to last, delimited by the : character. Example:"shiny:/path/to/file.edj:default"</remarks>
200         public static void SetTheme(string theme)
201         {
202             Interop.Elementary.elm_theme_set(IntPtr.Zero, theme);
203         }
204
205         /// <summary>
206         /// Flush the current theme.
207         /// </summary>
208         public static void FlushTheme()
209         {
210             Interop.Elementary.elm_theme_flush(IntPtr.Zero);
211         }
212
213         /// <summary>
214         /// This flushes all themes (default and specific ones).
215         /// </summary>
216         public static void FlushAllThemes()
217         {
218             Interop.Elementary.elm_theme_full_flush();
219         }
220
221         /// <summary>
222         /// Deletes a theme extension from the list of extensions.
223         /// </summary>
224         /// <param name="item">The name of the theme extension.</param>
225         public static void DeleteThemeExtention(string item)
226         {
227             Interop.Elementary.elm_theme_extension_del(IntPtr.Zero, item);
228         }
229
230         [EditorBrowsable(EditorBrowsableState.Never)]
231         public static double GetSystemScrollFriction()
232         {
233             return BringInScrollFriction;
234         }
235
236         [EditorBrowsable(EditorBrowsableState.Never)]
237         public static void SetSystemScrollFriction(double timeSet)
238         {
239             BringInScrollFriction = timeSet;
240         }
241
242         [EditorBrowsable(EditorBrowsableState.Never)]
243         public static string GetProfile()
244         {
245             return Interop.Elementary.elm_config_profile_get();
246         }
247
248         [EditorBrowsable(EditorBrowsableState.Never)]
249         public static void SetScale(double scale)
250         {
251             Scale = scale;
252         }
253
254         [EditorBrowsable(EditorBrowsableState.Never)]
255         public static double GetScale()
256         {
257             return Scale;
258         }
259
260         /// <summary>
261         /// Flush all caches.
262         /// Frees all data that was in cache and is not currently being used to reduce memory usage. This frees Edje's, Evas' and Eet's cache.
263         /// </summary>
264         public static void FlushAllCashe()
265         {
266             Interop.Elementary.elm_cache_all_flush();
267         }
268
269         /// <summary>
270         /// Changes the language of the current application.
271         /// </summary>
272         /// <param name="language">The language to set, must be the full name of the locale.</param>
273         public static void SetLanguage(string language)
274         {
275             Interop.Elementary.elm_language_set(language);
276         }
277
278         /// <summary>
279         /// Sets a new policy's value (for a given policy group/identifier).
280         /// </summary>
281         /// <param name="policy">The policy identifier</param>
282         /// <param name="value">The policy value, which depends on the identifier</param>
283         /// <returns></returns>
284         public static bool SetPolicy(uint policy, int value)
285         {
286             return Interop.Elementary.elm_policy_set(policy, value);
287         }
288
289         /// <summary>
290         /// Reloads Elementary's configuration, bounded to the current selected profile.
291         /// </summary>
292         public static void ReloadConfig()
293         {
294             Interop.Elementary.elm_config_reload();
295         }
296
297         /// <summary>
298         /// Flushes all config settings and then applies those settings to all applications using elementary on the current display.
299         /// </summary>
300         public static void FlushAllConfig()
301         {
302             Interop.Elementary.elm_config_all_flush();
303         }
304     }
305 }