-
Notifications
You must be signed in to change notification settings - Fork 247
/
Elementary.cs
463 lines (422 loc) · 15.6 KB
/
Elementary.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.ComponentModel;
using System.IO;
namespace ElmSharp
{
/// <summary>
/// Focus Autoscroll mode.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public enum FocusAutoScrollMode
{
/// <summary>
/// Directly show the focused region or item automatically.
/// </summary>
Show,
/// <summary>
/// Do not show the focused region or item automatically.
/// </summary>
None,
/// <summary>
/// Bring in the focused region or item automatically, which might involve the scrolling.
/// </summary>
BringIn
}
/// <summary>
/// The Elementary is a general elementary, a VERY SIMPLE toolkit.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static class Elementary
{
private const string _themeFilePath = "/usr/share/elm-sharp/elm-sharp-theme.edj";
private const string _tvThemeFilePath = "/usr/share/elm-sharp/vd-elm-sharp-theme.edj";
/// <summary>
/// EvasObjectRealized will be triggered when the EvasObject is realized.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static event EventHandler EvasObjectRealized;
/// <summary>
/// ItemObjectRealized will be triggered when the ItemObject is realized.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static event EventHandler ItemObjectRealized;
internal static void SendEvasObjectRealized(EvasObject obj)
{
EvasObjectRealized?.Invoke(obj, EventArgs.Empty);
}
internal static void SendItemObjectRealized(ItemObject obj)
{
ItemObjectRealized?.Invoke(obj, EventArgs.Empty);
}
/// <summary>
/// Gets or sets the configured finger size.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static int FingerSize
{
get
{
return Interop.Elementary.elm_config_finger_size_get();
}
set
{
Interop.Elementary.elm_config_finger_size_set(value);
}
}
/// <summary>
/// Gets or sets the enable status of the focus highlight animation.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static bool IsFocusHighlightAnimation
{
get
{
return Interop.Elementary.elm_config_focus_highlight_animate_get();
}
set
{
Interop.Elementary.elm_config_focus_highlight_animate_set(value);
}
}
/// <summary>
/// Gets or sets the system mirrored mode.
/// This determines the default mirrored mode of widgets.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static bool IsMirrored
{
get
{
return Interop.Elementary.elm_config_mirrored_get();
}
set
{
Interop.Elementary.elm_config_mirrored_set(value);
}
}
/// <summary>
/// Gets or sets the enable status of the focus highlight.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static bool CanFocusHighlight
{
get
{
return Interop.Elementary.elm_config_focus_highlight_enabled_get();
}
set
{
Interop.Elementary.elm_config_focus_highlight_enabled_set(value);
}
}
/// <summary>
/// Gets or sets the base scale of the application.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static double AppBaseScale
{
get
{
return Interop.Elementary.elm_app_base_scale_get();
}
set
{
Interop.Elementary.elm_app_base_scale_set(value);
}
}
/// <summary>
/// Gets or sets the global scaling factor.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static double Scale
{
get
{
return Interop.Elementary.elm_config_scale_get();
}
set
{
Interop.Elementary.elm_config_scale_set(value);
}
}
/// <summary>
/// Gets or sets the amount of inertia, a scroller imposes during a region to bring animations.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static double BringInScrollFriction
{
get
{
return Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_get();
}
set
{
Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_set(value);
}
}
/// <summary>
/// Gets or sets the focus on autoscroll mode.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static FocusAutoScrollMode FocusAutoScrollMode
{
get
{
return (FocusAutoScrollMode)Interop.Elementary.elm_config_focus_autoscroll_mode_get();
}
set
{
Interop.Elementary.elm_config_focus_autoscroll_mode_set((Interop.Elementary.Elm_Focus_Autoscroll_Mode)value);
}
}
/// <summary>
/// Initializes Elementary.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static void Initialize()
{
if (!Window.IsPreloaded)
Interop.Elementary.elm_init(0, null);
}
/// <summary>
/// Shuts down Elementary.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static void Shutdown()
{
Interop.Elementary.elm_shutdown();
}
/// <summary>
/// Runs the elementary's main loop.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static void Run()
{
Interop.Elementary.elm_run();
}
/// <summary>
/// Prepends a theme overlay to the list of overlays.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void ThemeOverlay()
{
if (!Window.IsPreloaded)
{
if (File.Exists(_themeFilePath))
AddThemeOverlay(_themeFilePath);
if (Elementary.GetProfile() == "tv" && File.Exists(_tvThemeFilePath))
AddThemeOverlay(_tvThemeFilePath);
}
}
/// <summary>
/// Prepends a theme overlay to the list of overlays.
/// </summary>
/// <param name="filePath">The edje file path to be used.</param>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static void AddThemeOverlay(string filePath)
{
Interop.Elementary.elm_theme_overlay_add(IntPtr.Zero, filePath);
}
/// <summary>
/// Deletes a theme overlay from the list of overlays.
/// </summary>
/// <param name="filePath">The name of the theme overlay.</param>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static void DeleteThemeOverlay(string filePath)
{
Interop.Elementary.elm_theme_overlay_del(IntPtr.Zero, filePath);
}
/// <summary>
/// Frees a theme.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static void FreeTheme()
{
Interop.Elementary.elm_theme_free(IntPtr.Zero);
}
/// <summary>
/// Sets the theme search order for the given theme.
/// </summary>
/// <param name="theme">Theme search string.</param>
/// <remarks>This sets the search string for the theme in path-notation from the first theme to search, to last, delimited by the : character. For example, "shiny:/path/to/file.edj:default".</remarks>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static void SetTheme(string theme)
{
Interop.Elementary.elm_theme_set(IntPtr.Zero, theme);
}
/// <summary>
/// Flushes the current theme.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static void FlushTheme()
{
Interop.Elementary.elm_theme_flush(IntPtr.Zero);
}
/// <summary>
/// This flushes all the themes (default and specific ones).
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static void FlushAllThemes()
{
Interop.Elementary.elm_theme_full_flush();
}
/// <summary>
/// Deletes a theme extension from the list of extensions.
/// </summary>
/// <param name="item">The name of the theme extension.</param>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static void DeleteThemeExtention(string item)
{
Interop.Elementary.elm_theme_extension_del(IntPtr.Zero, item);
}
/// <summary>
/// Gets the amount of inertia that a scroller imposes during region to bring animations.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static double GetSystemScrollFriction()
{
return BringInScrollFriction;
}
/// <summary>
/// Sets the amount of inertia that a scroller imposes during the region bring animations.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetSystemScrollFriction(double timeSet)
{
BringInScrollFriction = timeSet;
}
/// <summary>
/// Gets the elementary's profile in use.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static string GetProfile()
{
return Interop.Elementary.elm_config_profile_get();
}
/// <summary>
/// Sets the global scaling factor.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetScale(double scale)
{
Scale = scale;
}
/// <summary>
/// Gets the global scaling factor.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static double GetScale()
{
return Scale;
}
/// <summary>
/// Use FlushAllCache instead.
/// </summary>
[Obsolete("use FlushAllCache instead")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void FlushAllCashe()
{
Interop.Elementary.elm_cache_all_flush();
}
/// <summary>
/// Flushes all the cache.
/// 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.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static void FlushAllCache()
{
Interop.Elementary.elm_cache_all_flush();
}
/// <summary>
/// Changes the language of the current application.
/// </summary>
/// <param name="language">The language to set must be the full name of the locale.</param>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static void SetLanguage(string language)
{
Interop.Elementary.elm_language_set(language);
}
/// <summary>
/// Sets a new policy's value (for a given policy group/identifier).
/// </summary>
/// <param name="policy">The policy identifier.</param>
/// <param name="value">The policy value, which depends on the identifier.</param>
/// <returns></returns>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static bool SetPolicy(uint policy, int value)
{
return Interop.Elementary.elm_policy_set(policy, value);
}
/// <summary>
/// Reloads the elementary's configuration, bounded to the current selected profile.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void ReloadConfig()
{
Interop.Elementary.elm_config_reload();
}
/// <summary>
/// Flushes all the configuration settings, and then applies those settings to all applications using elementary on the current display.
/// </summary>
/// <since_tizen> preview </since_tizen>
[Obsolete("This has been deprecated in API12")]
public static void FlushAllConfig()
{
Interop.Elementary.elm_config_all_flush();
}
}
}