2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using System.ComponentModel;
24 /// Focus Autoscroll Mode
26 /// <since_tizen> preview </since_tizen>
27 public enum FocusAutoScrollMode
30 /// Directly show the focused region or item automatically
35 /// Do not show the focused region or item automatically
40 /// Bring in the focused region or item automatically which might invole the scrolling
46 /// The Elementary is a General Elementary,a VERY SIMPLE toolkit.
48 /// <since_tizen> preview </since_tizen>
49 public static class Elementary
51 private static readonly string _themeFilePath = "/usr/share/elm-sharp/elm-sharp-theme.edj";
54 /// Gets or sets the configured finger size.
56 /// <since_tizen> preview </since_tizen>
57 public static int FingerSize
61 return Interop.Elementary.elm_config_finger_size_get();
65 Interop.Elementary.elm_config_finger_size_set(value);
70 /// Gets or sets the enable status of the focus highlight animation
72 /// <since_tizen> preview </since_tizen>
73 public static bool IsFocusHighlightAnimation
77 return Interop.Elementary.elm_config_focus_highlight_animate_get();
81 Interop.Elementary.elm_config_focus_highlight_animate_set(value);
86 /// Gets or sets the system mirrored mode.
87 /// This determines the default mirrored mode of widgets.
89 /// <since_tizen> preview </since_tizen>
90 public static bool IsMirrored
94 return Interop.Elementary.elm_config_mirrored_get();
98 Interop.Elementary.elm_config_mirrored_set(value);
103 /// Gets or sets the enable status of the focus highlight.
105 /// <since_tizen> preview </since_tizen>
106 public static bool CanFocusHighlight
110 return Interop.Elementary.elm_config_focus_highlight_enabled_get();
114 Interop.Elementary.elm_config_focus_highlight_enabled_set(value);
119 /// Gets or sets the base scale of the application.
121 /// <since_tizen> preview </since_tizen>
122 public static double AppBaseScale
126 return Interop.Elementary.elm_app_base_scale_get();
130 Interop.Elementary.elm_app_base_scale_set(value);
135 /// Gets or sets the global scaling factor.
137 /// <since_tizen> preview </since_tizen>
138 public static double Scale
142 return Interop.Elementary.elm_config_scale_get();
146 Interop.Elementary.elm_config_scale_set(value);
151 /// Gets or sets the amount of inertia a scroller imposes during region bring animations.
153 /// <since_tizen> preview </since_tizen>
154 public static double BringInScrollFriction
158 return Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_get();
162 Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_set(value);
167 /// Gets of sets focus auto scroll mode.
169 /// <since_tizen> preview </since_tizen>
170 public static FocusAutoScrollMode FocusAutoScrollMode
174 return (FocusAutoScrollMode)Interop.Elementary.elm_config_focus_autoscroll_mode_get();
178 Interop.Elementary.elm_config_focus_autoscroll_mode_set((Interop.Elementary.Elm_Focus_Autoscroll_Mode)value);
183 /// Initializes Elementary.
185 /// <since_tizen> preview </since_tizen>
186 public static void Initialize()
188 Interop.Elementary.elm_init(0, null);
192 /// Shuts down Elementary.
194 /// <since_tizen> preview </since_tizen>
195 public static void Shutdown()
197 Interop.Elementary.elm_shutdown();
201 /// Runs Elementary's main loop.
203 /// <since_tizen> preview </since_tizen>
204 public static void Run()
206 Interop.Elementary.elm_run();
210 /// Prepends a theme overlay to the list of overlays
212 /// <since_tizen> preview </since_tizen>
213 [EditorBrowsable(EditorBrowsableState.Never)]
214 public static void ThemeOverlay()
216 if (File.Exists(_themeFilePath))
218 AddThemeOverlay(_themeFilePath);
223 /// Prepends a theme overlay to the list of overlays
225 /// <param name="filePath">The Edje file path to be used.</param>
226 /// <since_tizen> preview </since_tizen>
227 public static void AddThemeOverlay(string filePath)
229 Interop.Elementary.elm_theme_overlay_add(IntPtr.Zero, filePath);
233 /// Delete a theme overlay from the list of overlays
235 /// <param name="filePath">The name of the theme overlay.</param>
236 /// <since_tizen> preview </since_tizen>
237 public static void DeleteThemeOverlay(string filePath)
239 Interop.Elementary.elm_theme_overlay_del(IntPtr.Zero, filePath);
245 /// <since_tizen> preview </since_tizen>
246 public static void FreeTheme()
248 Interop.Elementary.elm_theme_free(IntPtr.Zero);
252 /// Set the theme search order for the given theme
254 /// <param name="theme">Theme search string</param>
255 /// <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>
256 /// <since_tizen> preview </since_tizen>
257 public static void SetTheme(string theme)
259 Interop.Elementary.elm_theme_set(IntPtr.Zero, theme);
263 /// Flush the current theme.
265 /// <since_tizen> preview </since_tizen>
266 public static void FlushTheme()
268 Interop.Elementary.elm_theme_flush(IntPtr.Zero);
272 /// This flushes all themes (default and specific ones).
274 /// <since_tizen> preview </since_tizen>
275 public static void FlushAllThemes()
277 Interop.Elementary.elm_theme_full_flush();
281 /// Deletes a theme extension from the list of extensions.
283 /// <param name="item">The name of the theme extension.</param>
284 /// <since_tizen> preview </since_tizen>
285 public static void DeleteThemeExtention(string item)
287 Interop.Elementary.elm_theme_extension_del(IntPtr.Zero, item);
291 /// Gets the amount of inertia a scroller imposes during region bring animations.
293 /// <since_tizen> preview </since_tizen>
294 [EditorBrowsable(EditorBrowsableState.Never)]
295 public static double GetSystemScrollFriction()
297 return BringInScrollFriction;
301 /// Sets the amount of inertia a scroller imposes during region bring animations.
303 /// <since_tizen> preview </since_tizen>
304 [EditorBrowsable(EditorBrowsableState.Never)]
305 public static void SetSystemScrollFriction(double timeSet)
308 BringInScrollFriction = timeSet;
312 /// Get Elementary's profile in use
314 /// <since_tizen> preview </since_tizen>
315 [EditorBrowsable(EditorBrowsableState.Never)]
316 public static string GetProfile()
318 return Interop.Elementary.elm_config_profile_get();
322 /// Set the global scaling factor
324 /// <since_tizen> preview </since_tizen>
325 [EditorBrowsable(EditorBrowsableState.Never)]
326 public static void SetScale(double scale)
332 /// Get the global scaling factor
334 /// <since_tizen> preview </since_tizen>
335 [EditorBrowsable(EditorBrowsableState.Never)]
336 public static double GetScale()
342 /// Flush all caches.
343 /// 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.
345 /// <since_tizen> preview </since_tizen>
346 public static void FlushAllCashe()
348 Interop.Elementary.elm_cache_all_flush();
352 /// Changes the language of the current application.
354 /// <param name="language">The language to set, must be the full name of the locale.</param>
355 /// <since_tizen> preview </since_tizen>
356 public static void SetLanguage(string language)
358 Interop.Elementary.elm_language_set(language);
362 /// Sets a new policy's value (for a given policy group/identifier).
364 /// <param name="policy">The policy identifier</param>
365 /// <param name="value">The policy value, which depends on the identifier</param>
366 /// <returns></returns>
367 /// <since_tizen> preview </since_tizen>
368 public static bool SetPolicy(uint policy, int value)
370 return Interop.Elementary.elm_policy_set(policy, value);
374 /// Reload Elementary's configuration, bounded to current selected profile.
376 /// <since_tizen> preview </since_tizen>
377 [EditorBrowsable(EditorBrowsableState.Never)]
378 public static void ReloadConfig()
380 Interop.Elementary.elm_config_reload();
384 /// Flushes all config settings and then applies those settings to all applications using elementary on the current display.
386 /// <since_tizen> preview </since_tizen>
387 public static void FlushAllConfig()
389 Interop.Elementary.elm_config_all_flush();