Release 4.0.0-preview1-00213
[platform/core/csapi/tizenfx.git] / src / Tizen.System.SystemSettings / Tizen.System.SystemSettings / SystemSettings.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
19 namespace Tizen.System
20 {
21     /// <summary>
22     /// The System Settings API provides APIs for sharing the configuration over a system.
23     /// </summary>
24     /// <remarks>
25     /// The System Settings API provides functions for getting the system configuration related to user preferences.
26     /// The main features of the System Settings API include accessing system-wide configurations, such as ringtones, wallpapers, and so on.
27     /// </remarks>
28     public static class SystemSettings
29     {
30         /// <summary>
31         /// The file path of the current ringtone.
32         /// </summary>
33         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
34         /// <privlevel>platform</privlevel>
35         public static string IncomingCallRingtone
36         {
37             get
38             {
39                 string filePath;
40                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.IncomingCallRingtone, out filePath);
41                 if (res != SystemSettingsError.None)
42                 {
43                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get IncomingCallRingtone system setting.");
44                 }
45                 return filePath;
46             }
47             set
48             {
49                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.IncomingCallRingtone, value);
50                 if (res != SystemSettingsError.None)
51                 {
52                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set IncomingCallRingtone system setting.");
53                 }
54             }
55         }
56
57         /// <summary>
58         /// The file path of the current home-screen wallpaper.
59         /// </summary>
60         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
61         /// <privlevel>platform</privlevel>
62         public static string WallpaperHomeScreen
63         {
64             get
65             {
66                 string filePath;
67                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.WallpaperHomeScreen, out filePath);
68                 if (res != SystemSettingsError.None)
69                 {
70                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get WallpaperHomeScreen system setting.");
71                 }
72                 return filePath;
73             }
74             set
75             {
76                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.WallpaperHomeScreen, value);
77                 if (res != SystemSettingsError.None)
78                 {
79                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set WallpaperHomeScreen system setting.");
80                 }
81             }
82         }
83
84         /// <summary>
85         /// The file path of the current lock-screen wallpaper.
86         /// </summary>
87         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
88         /// <privlevel>platform</privlevel>
89         public static string WallpaperLockScreen
90         {
91             get
92             {
93                 string filePath;
94                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.WallpaperLockScreen, out filePath);
95                 if (res != SystemSettingsError.None)
96                 {
97                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get WallpaperLockScreen system setting.");
98                 }
99                 return filePath;
100             }
101             set
102             {
103                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.WallpaperLockScreen, value);
104                 if (res != SystemSettingsError.None)
105                 {
106                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set WallpaperLockScreen system setting.");
107                 }
108             }
109         }
110
111         /// <summary>
112         /// The current system font size.
113         /// </summary>
114         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
115         /// <privlevel>platform</privlevel>
116         public static SystemSettingsFontSize FontSize
117         {
118             get
119             {
120                 int fontSize;
121                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.FontSize, out fontSize);
122                 if (res != SystemSettingsError.None)
123                 {
124                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get FontSize system setting.");
125                 }
126                 return (SystemSettingsFontSize)fontSize;
127             }
128             set
129             {
130                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.FontSize, (int)value);
131                 if (res != SystemSettingsError.None)
132                 {
133                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set FontSize system setting.");
134                 }
135             }
136         }
137
138         /// <summary>
139         /// The current system font type.
140         /// </summary>
141         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
142         /// <privlevel>platform</privlevel>
143         public static string FontType
144         {
145             get
146             {
147                 string fontType;
148                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.FontType, out fontType);
149                 if (res != SystemSettingsError.None)
150                 {
151                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get FontType system setting.");
152                 }
153                 return fontType;
154             }
155             set
156             {
157                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.FontType, value);
158                 if (res != SystemSettingsError.None)
159                 {
160                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set FontType system setting.");
161                 }
162             }
163         }
164
165         /// <summary>
166         /// Indicates whether the motion service is activated.
167         /// </summary>
168         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
169         /// <privlevel>platform</privlevel>
170         public static bool MotionActivationEnabled
171         {
172             get
173             {
174                 bool isMotionServiceActivated;
175                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.MotionActivationEnabled, out isMotionServiceActivated);
176                 if (res != SystemSettingsError.None)
177                 {
178                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get MotionActivation system setting.");
179                 }
180                 return isMotionServiceActivated;
181             }
182             set
183             {
184                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.MotionActivationEnabled, value);
185                 if (res != SystemSettingsError.None)
186                 {
187                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set MotionActivation system setting.");
188                 }
189             }
190         }
191
192         /// <summary>
193         /// The file path of the current email alert ringtone.
194         /// </summary>
195         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
196         /// <privlevel>platform</privlevel>
197         public static string EmailAlertRingtone
198         {
199             get
200             {
201                 string filePath;
202                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.EmailAlertRingtone, out filePath);
203                 if (res != SystemSettingsError.None)
204                 {
205                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get EmailAlertRingtone system setting.");
206                 }
207                 return filePath;
208             }
209             set
210             {
211                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.EmailAlertRingtone, value);
212                 if (res != SystemSettingsError.None)
213                 {
214                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set EmailAlertRingtone system setting.");
215                 }
216             }
217         }
218         /// <summary>
219         /// Indicates whether the USB debugging is enabled.
220         /// </summary>
221         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
222         /// <privlevel>platform</privlevel>
223         public static bool UsbDebuggingEnabled
224         {
225             get
226             {
227                 bool isusbDebuggingEnabled;
228                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.UsbDebuggingEnabled, out isusbDebuggingEnabled);
229                 if (res != SystemSettingsError.None)
230                 {
231                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get UsbDebuggingEnabled system setting.");
232                 }
233                 return isusbDebuggingEnabled;
234             }
235             set
236             {
237                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.UsbDebuggingEnabled, value);
238                 if (res != SystemSettingsError.None)
239                 {
240                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set UsbDebuggingEnabled system setting.");
241                 }
242             }
243         }
244
245         /// <summary>
246         /// Indicates whether the 3G data network is enabled.
247         /// </summary>
248         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
249         /// <privlevel>platform</privlevel>
250         public static bool Data3GNetworkEnabled
251         {
252             get
253             {
254                 bool is3GDataEnabled;
255                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.Data3GNetworkEnabled, out is3GDataEnabled);
256                 if (res != SystemSettingsError.None)
257                 {
258                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get Data3GNetworkEnabled system setting.");
259                 }
260                 return is3GDataEnabled;
261             }
262             set
263             {
264                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.Data3GNetworkEnabled, value);
265                 if (res != SystemSettingsError.None)
266                 {
267                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set Data3GNetworkEnabled system setting.");
268                 }
269             }
270         }
271
272         /// <summary>
273         /// Indicates the lock-screen application package name.
274         /// </summary>
275         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
276         /// <privlevel>platform</privlevel>
277         public static string LockscreenApp
278         {
279             get
280             {
281                 string pkgName;
282                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LockscreenApp, out pkgName);
283                 if (res != SystemSettingsError.None)
284                 {
285                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LockscreenApp system setting.");
286                 }
287                 return pkgName;
288             }
289             set
290             {
291                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LockscreenApp, value);
292                 if (res != SystemSettingsError.None)
293                 {
294                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LockscreenApp system setting.");
295                 }
296             }
297         }
298
299         /// <summary>
300         /// The current system default font type (only supports Get).
301         /// </summary>
302         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
303         /// <privlevel>platform</privlevel>
304         public static string DefaultFontType
305         {
306             get
307             {
308                 string defaultFontType;
309                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.DefaultFontType, out defaultFontType);
310                 if (res != SystemSettingsError.None)
311                 {
312                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get DefaultFontType system setting value.");
313                 }
314                 return defaultFontType;
315             }
316         }
317
318         /// <summary>
319         /// Indicates the current country setting in the &lt;LANGUAGE&gt;_&lt;REGION&gt; syntax.
320         /// The country setting is in the ISO 639-2 format,
321         /// and the region setting is in the ISO 3166-1 alpha-2 format.
322         /// </summary>
323         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
324         /// <privlevel>platform</privlevel>
325         public static string LocaleCountry
326         {
327             get
328             {
329                 string countrySetting;
330                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LocaleCountry, out countrySetting);
331                 if (res != SystemSettingsError.None)
332                 {
333                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleCountry system setting.");
334                 }
335                 return countrySetting;
336             }
337             set
338             {
339                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LocaleCountry, value);
340                 if (res != SystemSettingsError.None)
341                 {
342                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleCountry system setting.");
343                 }
344             }
345         }
346
347         /// <summary>
348         /// Indicates the current language setting in the &lt;LANGUAGE&gt;_&lt;REGION&gt; syntax.
349         /// The language setting is in the ISO 639-2 format,
350         /// and the region setting is in the ISO 3166-1 alpha-2 format.
351         /// </summary>
352         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
353         /// <privlevel>platform</privlevel>
354         public static string LocaleLanguage
355         {
356             get
357             {
358                 string languageSetting;
359                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LocaleLanguage, out languageSetting);
360                 if (res != SystemSettingsError.None)
361                 {
362                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleLanguage system setting.");
363                 }
364                 return languageSetting;
365             }
366             set
367             {
368                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LocaleLanguage, value);
369                 if (res != SystemSettingsError.None)
370                 {
371                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleLanguage system setting.");
372                 }
373             }
374         }
375
376         /// <summary>
377         /// Indicates whether the 24-hour clock is used.
378         /// If the value is false, the 12-hour clock is used.
379         /// </summary>
380         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
381         /// <privlevel>platform</privlevel>
382         public static bool LocaleTimeFormat24HourEnabled
383         {
384             get
385             {
386                 bool is24HrFormat;
387                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, out is24HrFormat);
388                 if (res != SystemSettingsError.None)
389                 {
390                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleTimeFormat24Hour system setting.");
391                 }
392                 return is24HrFormat;
393             }
394             set
395             {
396                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, value);
397                 if (res != SystemSettingsError.None)
398                 {
399                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleTimeFormat24Hour system setting.");
400                 }
401             }
402         }
403
404         /// <summary>
405         /// Indicates the current time zone, for example, Pacific/Tahiti.
406         /// </summary>
407         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
408         /// <privlevel>platform</privlevel>
409         public static string LocaleTimeZone
410         {
411             get
412             {
413                 string timeZone;
414                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LocaleTimeZone, out timeZone);
415                 if (res != SystemSettingsError.None)
416                 {
417                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleTimeZone system setting.");
418                 }
419                 return timeZone;
420             }
421             set
422             {
423                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LocaleTimeZone, value);
424                 if (res != SystemSettingsError.None)
425                 {
426                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleTimeZone system setting.");
427                 }
428             }
429         }
430
431         /// <summary>
432         /// Once the system changes time, this event occurs to notify the time change.
433         /// </summary>
434         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
435         /// <privlevel>platform</privlevel>
436         public static int Time
437         {
438             get
439             {
440                 int time;
441                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.Time, out time);
442                 if (res != SystemSettingsError.None)
443                 {
444                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get Time system setting.");
445                 }
446                 return time;
447             }
448         }
449         /// <summary>
450         /// Indicates whether the screen lock sound is enabled on the device, for example, the LCD on or off sound.
451         /// </summary>
452         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
453         /// <privlevel>platform</privlevel>
454         public static bool SoundLockEnabled
455         {
456             get
457             {
458                 bool isSoundLockEnabled;
459                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.SoundLockEnabled, out isSoundLockEnabled);
460                 if (res != SystemSettingsError.None)
461                 {
462                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundLock system setting.");
463                 }
464                 return isSoundLockEnabled;
465             }
466         }
467
468         /// <summary>
469         /// Indicates whether the device is in the silent mode.
470         /// </summary>
471         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
472         /// <privlevel>platform</privlevel>
473         public static bool SoundSilentModeEnabled
474         {
475             get
476             {
477                 bool isSilent;
478                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.SoundSilentModeEnabled, out isSilent);
479                 if (res != SystemSettingsError.None)
480                 {
481                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundSilentMode system setting.");
482                 }
483                 return isSilent;
484             }
485         }
486
487         /// <summary>
488         /// Indicates whether the screen touch sound is enabled on the device.
489         /// </summary>
490         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
491         /// <privlevel>platform</privlevel>
492         public static bool SoundTouchEnabled
493         {
494             get
495             {
496                 bool isTouchSoundEnabled;
497                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.SoundTouchEnabled, out isTouchSoundEnabled);
498                 if (res != SystemSettingsError.None)
499                 {
500                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundTouch system setting value.");
501                 }
502                 return isTouchSoundEnabled;
503             }
504         }
505
506         /// <summary>
507         /// Indicates whether the rotation control is automatic.
508         /// </summary>
509         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
510         /// <privlevel>platform</privlevel>
511         public static bool DisplayScreenRotationAutoEnabled
512         {
513             get
514             {
515                 bool isRotationAutomatic;
516                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.DisplayScreenRotationAutoEnabled, out isRotationAutomatic);
517                 if (res != SystemSettingsError.None)
518                 {
519                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get DisplayScreenRotationAuto system setting.");
520                 }
521                 return isRotationAutomatic;
522             }
523         }
524
525         /// <summary>
526         /// Indicates the device name.
527         /// </summary>
528         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
529         /// <privlevel>platform</privlevel>
530         public static string DeviceName
531         {
532             get
533             {
534                 string deviceName;
535                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.DeviceName, out deviceName);
536                 if (res != SystemSettingsError.None)
537                 {
538                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get DeviceName system setting value.");
539                 }
540                 return deviceName;
541             }
542         }
543         /// <summary>
544         /// Indicates whether the device user has enabled the motion feature.
545         /// </summary>
546         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
547         /// <privlevel>platform</privlevel>
548         public static bool MotionEnabled
549         {
550             get
551             {
552                 bool isMotionEnabled;
553                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.MotionEnabled, out isMotionEnabled);
554                 if (res != SystemSettingsError.None)
555                 {
556                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get MotionEnabled system setting value.");
557                 }
558                 return isMotionEnabled;
559             }
560         }
561
562         /// <summary>
563         /// Indicates whether Wi-Fi related notifications are enabled on the device.
564         /// </summary>
565         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
566         /// <privlevel>platform</privlevel>
567         public static bool NetworkWifiNotificationEnabled
568         {
569             get
570             {
571                 bool isWifiNotificationEnabled;
572                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.NetworkWifiNotificationEnabled, out isWifiNotificationEnabled);
573                 if (res != SystemSettingsError.None)
574                 {
575                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get NetworkWifiNotification system setting.");
576                 }
577                 return isWifiNotificationEnabled;
578             }
579         }
580
581         /// <summary>
582         /// Indicates whether the device is in the flight mode.
583         /// </summary>
584         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
585         /// <privlevel>platform</privlevel>
586         public static bool NetworkFlightModeEnabled
587         {
588             get
589             {
590                 bool isFlightModeEnabled;
591                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.NetworkFlightModeEnabled, out isFlightModeEnabled);
592                 if (res != SystemSettingsError.None)
593                 {
594                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get NetworkFlightMode system setting.");
595                 }
596                 return isFlightModeEnabled;
597             }
598         }
599
600         /// <summary>
601         /// Indicates the backlight time (in seconds). The following values can be used: 15, 30, 60, 120, 300, and 600.
602         /// </summary>
603         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
604         /// <privlevel>platform</privlevel>
605         public static int ScreenBacklightTime
606         {
607             get
608             {
609                 int backlightTime;
610                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.ScreenBacklightTime, out backlightTime);
611                 if (res != SystemSettingsError.None)
612                 {
613                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get ScreenBacklightTime system setting.");
614                 }
615                 return backlightTime;
616             }
617             set
618             {
619                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.ScreenBacklightTime, value);
620                 if (res != SystemSettingsError.None)
621                 {
622                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set ScreenBacklightTime system setting.");
623                 }
624             }
625         }
626
627         /// <summary>
628         /// Indicates the file path of the current notification tone set by the user.
629         /// </summary>
630         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
631         /// <privlevel>platform</privlevel>
632         public static string SoundNotification
633         {
634             get
635             {
636                 string filePath;
637                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.SoundNotification, out filePath);
638                 if (res != SystemSettingsError.None)
639                 {
640                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundNotification system setting.");
641                 }
642                 return filePath;
643             }
644             set
645             {
646                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.SoundNotification, value);
647                 if (res != SystemSettingsError.None)
648                 {
649                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set SoundNotification system setting.");
650                 }
651             }
652         }
653
654         /// <summary>
655         /// Indicates the time period for notification repetitions.
656         /// </summary>
657         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
658         /// <privlevel>platform</privlevel>
659         public static int SoundNotificationRepetitionPeriod
660         {
661             get
662             {
663                 int notificationRepetitionPeriod;
664                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.SoundNotificationRepetitionPeriod, out notificationRepetitionPeriod);
665                 if (res != SystemSettingsError.None)
666                 {
667                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundNotificationRepetitionPeriod system setting.");
668                 }
669                 return notificationRepetitionPeriod;
670             }
671             set
672             {
673                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.SoundNotificationRepetitionPeriod, value);
674                 if (res != SystemSettingsError.None)
675                 {
676                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set SoundNotificationRepetitionPeriod system setting.");
677                 }
678             }
679         }
680
681         /// <summary>
682         /// Indicates the current lock state.
683         /// </summary>
684         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
685         /// <privlevel>platform</privlevel>
686         public static SystemSettingsIdleLockState LockState
687         {
688             get
689             {
690                 int LockState;
691                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.LockState, out LockState);
692                 if (res != SystemSettingsError.None)
693                 {
694                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LockState system setting.");
695                 }
696                 return (SystemSettingsIdleLockState)LockState;
697             }
698             set
699             {
700                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.LockState, (int)value);
701                 if (res != SystemSettingsError.None)
702                 {
703                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LockState system setting.");
704                 }
705             }
706         }
707
708         /// <summary>
709         /// The current system ADS ID.
710         /// </summary>
711         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
712         /// <privlevel>platform</privlevel>
713         public static string AdsId
714         {
715             get
716             {
717                 string adsId;
718                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.AdsId, out adsId);
719                 if (res != SystemSettingsError.None)
720                 {
721                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get AdsId system setting.");
722                 }
723                 return adsId;
724             }
725             set
726             {
727                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.AdsId, value);
728                 if (res != SystemSettingsError.None)
729                 {
730                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set AdsId system setting.");
731                 }
732             }
733         }
734
735
736         /// <summary>
737         /// Indicates the time period for notification repetitions.
738         /// </summary>
739         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
740         /// <privlevel>platform</privlevel>
741         public static SystemSettingsUdsState UltraDataSave
742         {
743             get
744             {
745                 int UltraDataSave;
746                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.UltraDataSave, out UltraDataSave);
747                 if (res != SystemSettingsError.None)
748                 {
749                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get UltraDataSave system setting.");
750                 }
751                 return (SystemSettingsUdsState)UltraDataSave;
752             }
753         }
754
755
756
757         private static readonly Interop.Settings.SystemSettingsChangedCallback s_incomingCallRingtoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
758         {
759             string path = SystemSettings.IncomingCallRingtone;
760             IncomingCallRingtoneChangedEventArgs eventArgs = new IncomingCallRingtoneChangedEventArgs(path);
761             s_incomingCallRingtoneChanged?.Invoke(null, eventArgs);
762         };
763         private static event EventHandler<IncomingCallRingtoneChangedEventArgs> s_incomingCallRingtoneChanged;
764         /// <summary>
765         /// The IncomingCallRingtoneChanged event is triggered when the file path of the incoming ringtone is changed.
766         /// </summary>
767         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
768         /// <privlevel>platform</privlevel>
769         public static event EventHandler<IncomingCallRingtoneChangedEventArgs> IncomingCallRingtoneChanged
770         {
771             add
772             {
773                 if (s_incomingCallRingtoneChanged == null)
774                 {
775                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.IncomingCallRingtone, s_incomingCallRingtoneChangedCallback, IntPtr.Zero);
776                     if (ret != SystemSettingsError.None)
777                     {
778                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
779                     }
780                 }
781                 s_incomingCallRingtoneChanged += value;
782             }
783
784             remove
785             {
786                 s_incomingCallRingtoneChanged -= value;
787                 if (s_incomingCallRingtoneChanged == null)
788                 {
789                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.IncomingCallRingtone);
790                     if (ret != SystemSettingsError.None)
791                     {
792                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
793                     }
794                 }
795             }
796         }
797
798         private static readonly Interop.Settings.SystemSettingsChangedCallback s_wallpaperHomeScreenChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
799         {
800             string path = SystemSettings.WallpaperHomeScreen;
801             WallpaperHomeScreenChangedEventArgs eventArgs = new WallpaperHomeScreenChangedEventArgs(path);
802             s_wallpaperHomeScreenChanged?.Invoke(null, eventArgs);
803         };
804         private static event EventHandler<WallpaperHomeScreenChangedEventArgs> s_wallpaperHomeScreenChanged;
805         /// <summary>
806         /// THe WallpaperHomeScreenChanged event is triggered when the file path of the current home screen wallpaper is changed.
807         /// </summary>
808         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
809         /// <privlevel>platform</privlevel>
810         public static event EventHandler<WallpaperHomeScreenChangedEventArgs> WallpaperHomeScreenChanged
811         {
812             add
813             {
814                 if (s_wallpaperHomeScreenChanged == null)
815                 {
816                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.WallpaperHomeScreen, s_wallpaperHomeScreenChangedCallback, IntPtr.Zero);
817                     if (ret != SystemSettingsError.None)
818                     {
819                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
820                     }
821                 }
822                 s_wallpaperHomeScreenChanged += value;
823             }
824
825             remove
826             {
827                 s_wallpaperHomeScreenChanged -= value;
828                 if (s_wallpaperHomeScreenChanged == null)
829                 {
830                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.WallpaperHomeScreen);
831                     if (ret != SystemSettingsError.None)
832                     {
833                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
834                     }
835                 }
836             }
837         }
838
839         private static readonly Interop.Settings.SystemSettingsChangedCallback s_wallpaperLockScreenChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
840         {
841             string path = SystemSettings.WallpaperLockScreen;
842             WallpaperLockScreenChangedEventArgs eventArgs = new WallpaperLockScreenChangedEventArgs(path);
843             s_wallpaperLockScreenChanged?.Invoke(null, eventArgs);
844         };
845         private static event EventHandler<WallpaperLockScreenChangedEventArgs> s_wallpaperLockScreenChanged;
846         /// <summary>
847         /// The WallpaperLockScreenChanged event is triggered when the file path of the current lock screen wallpaper is changed.
848         /// </summary>
849         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
850         /// <privlevel>platform</privlevel>
851         public static event EventHandler<WallpaperLockScreenChangedEventArgs> WallpaperLockScreenChanged
852         {
853             add
854             {
855                 if (s_wallpaperLockScreenChanged == null)
856                 {
857                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.WallpaperLockScreen, s_wallpaperLockScreenChangedCallback, IntPtr.Zero);
858                     if (ret != SystemSettingsError.None)
859                     {
860                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
861                     }
862                 }
863                 s_wallpaperLockScreenChanged += value;
864             }
865
866             remove
867             {
868                 s_wallpaperLockScreenChanged -= value;
869                 if (s_wallpaperLockScreenChanged == null)
870                 {
871                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.WallpaperLockScreen);
872                     if (ret != SystemSettingsError.None)
873                     {
874                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
875                     }
876                 }
877             }
878         }
879
880         private static readonly Interop.Settings.SystemSettingsChangedCallback s_fontSizeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
881         {
882             SystemSettingsFontSize fontSize = SystemSettings.FontSize;
883             FontSizeChangedEventArgs eventArgs = new FontSizeChangedEventArgs(fontSize);
884             s_fontSizeChanged?.Invoke(null, eventArgs);
885         };
886         private static event EventHandler<FontSizeChangedEventArgs> s_fontSizeChanged;
887         /// <summary>
888         /// The FontSizeChanged event is triggered when the current system font size is changed.
889         /// </summary>
890         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
891         /// <privlevel>platform</privlevel>
892         public static event EventHandler<FontSizeChangedEventArgs> FontSizeChanged
893         {
894             add
895             {
896                 if (s_fontSizeChanged == null)
897                 {
898                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.FontSize, s_fontSizeChangedCallback, IntPtr.Zero);
899                     if (ret != SystemSettingsError.None)
900                     {
901                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
902                     }
903                 }
904                 s_fontSizeChanged += value;
905             }
906
907             remove
908             {
909                 s_fontSizeChanged -= value;
910                 if (s_fontSizeChanged == null)
911                 {
912                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.FontSize);
913                     if (ret != SystemSettingsError.None)
914                     {
915                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
916                     }
917                 }
918             }
919         }
920
921         private static readonly Interop.Settings.SystemSettingsChangedCallback s_fontTypeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
922         {
923             string fontType = SystemSettings.FontType;
924             FontTypeChangedEventArgs eventArgs = new FontTypeChangedEventArgs(fontType);
925             s_fontTypeChanged?.Invoke(null, eventArgs);
926         };
927         private static event EventHandler<FontTypeChangedEventArgs> s_fontTypeChanged;
928         /// <summary>
929         /// The FontTypeChanged event is triggered when the current system font type is changed.
930         /// </summary>
931         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
932         /// <privlevel>platform</privlevel>
933         public static event EventHandler<FontTypeChangedEventArgs> FontTypeChanged
934         {
935             add
936             {
937                 if (s_fontTypeChanged == null)
938                 {
939                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.FontType, s_fontTypeChangedCallback, IntPtr.Zero);
940                     if (ret != SystemSettingsError.None)
941                     {
942                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
943                     }
944                 }
945                 s_fontTypeChanged += value;
946             }
947
948             remove
949             {
950                 s_fontTypeChanged -= value;
951                 if (s_fontTypeChanged == null)
952                 {
953                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.FontType);
954                     if (ret != SystemSettingsError.None)
955                     {
956                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
957                     }
958                 }
959             }
960         }
961
962         private static readonly Interop.Settings.SystemSettingsChangedCallback s_motionActivationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
963         {
964             bool motionActivation = SystemSettings.MotionActivationEnabled;
965             MotionActivationSettingChangedEventArgs eventArgs = new MotionActivationSettingChangedEventArgs(motionActivation);
966             s_motionActivationChanged?.Invoke(null, eventArgs);
967         };
968         private static event EventHandler<MotionActivationSettingChangedEventArgs> s_motionActivationChanged;
969         /// <summary>
970         /// The MotionActivationChanged event is triggered when the motion service status is changed.
971         /// </summary>
972         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
973         /// <privlevel>platform</privlevel>
974         public static event EventHandler<MotionActivationSettingChangedEventArgs> MotionActivationSettingChanged
975         {
976             add
977             {
978                 if (s_motionActivationChanged == null)
979                 {
980                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.MotionActivationEnabled, s_motionActivationChangedCallback, IntPtr.Zero);
981                     if (ret != SystemSettingsError.None)
982                     {
983                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
984                     }
985                 }
986                 s_motionActivationChanged += value;
987             }
988
989             remove
990             {
991                 s_motionActivationChanged -= value;
992                 if (s_motionActivationChanged == null)
993                 {
994                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.MotionActivationEnabled);
995                     if (ret != SystemSettingsError.None)
996                     {
997                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
998                     }
999                 }
1000             }
1001         }
1002
1003         private static readonly Interop.Settings.SystemSettingsChangedCallback s_emailAlertRingtoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1004         {
1005             string emailAlertRingtone = SystemSettings.EmailAlertRingtone;
1006             EmailAlertRingtoneChangedEventArgs eventArgs = new EmailAlertRingtoneChangedEventArgs(emailAlertRingtone);
1007             s_emailAlertRingtoneChanged?.Invoke(null, eventArgs);
1008         };
1009         private static event EventHandler<EmailAlertRingtoneChangedEventArgs> s_emailAlertRingtoneChanged;
1010         /// <summary>
1011         /// The EmailAlertRingtoneChanged event is triggered when the file path of the current email alert ringtone is changed.
1012         /// </summary>
1013         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1014         /// <privlevel>platform</privlevel>
1015         public static event EventHandler<EmailAlertRingtoneChangedEventArgs> EmailAlertRingtoneChanged
1016         {
1017             add
1018             {
1019                 if (s_emailAlertRingtoneChanged == null)
1020                 {
1021                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.EmailAlertRingtone, s_emailAlertRingtoneChangedCallback, IntPtr.Zero);
1022                     if (ret != SystemSettingsError.None)
1023                     {
1024                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1025                     }
1026                 }
1027                 s_emailAlertRingtoneChanged += value;
1028             }
1029
1030             remove
1031             {
1032                 s_emailAlertRingtoneChanged -= value;
1033                 if (s_emailAlertRingtoneChanged == null)
1034                 {
1035                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.EmailAlertRingtone);
1036                     if (ret != SystemSettingsError.None)
1037                     {
1038                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1039                     }
1040                 }
1041             }
1042         }
1043
1044         private static readonly Interop.Settings.SystemSettingsChangedCallback s_usbDebuggingSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1045         {
1046             bool usbDebuggingEnabled = SystemSettings.UsbDebuggingEnabled;
1047             UsbDebuggingSettingChangedEventArgs eventArgs = new UsbDebuggingSettingChangedEventArgs(usbDebuggingEnabled);
1048             s_usbDebuggingSettingChanged?.Invoke(null, eventArgs);
1049         };
1050         private static event EventHandler<UsbDebuggingSettingChangedEventArgs> s_usbDebuggingSettingChanged;
1051         /// <summary>
1052         /// The UsbDebuggingSettingChangedEventArgs event is triggered when the USB debugging status is changed.
1053         /// </summary>
1054         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1055         /// <privlevel>platform</privlevel>
1056         public static event EventHandler<UsbDebuggingSettingChangedEventArgs> UsbDebuggingSettingChanged
1057         {
1058             add
1059             {
1060                 if (s_usbDebuggingSettingChanged == null)
1061                 {
1062                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UsbDebuggingEnabled, s_usbDebuggingSettingChangedCallback, IntPtr.Zero);
1063                     if (ret != SystemSettingsError.None)
1064                     {
1065                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1066                     }
1067                 }
1068                 s_usbDebuggingSettingChanged += value;
1069             }
1070
1071             remove
1072             {
1073                 s_usbDebuggingSettingChanged -= value;
1074                 if (s_usbDebuggingSettingChanged == null)
1075                 {
1076                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UsbDebuggingEnabled);
1077                     if (ret != SystemSettingsError.None)
1078                     {
1079                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1080                     }
1081                 }
1082             }
1083         }
1084
1085         private static readonly Interop.Settings.SystemSettingsChangedCallback s_data3GNetworkSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1086         {
1087             bool data3GEnabled = SystemSettings.Data3GNetworkEnabled;
1088             Data3GNetworkSettingChangedEventArgs eventArgs = new Data3GNetworkSettingChangedEventArgs(data3GEnabled);
1089             s_data3GNetworkSettingChanged?.Invoke(null, eventArgs);
1090         };
1091         private static event EventHandler<Data3GNetworkSettingChangedEventArgs> s_data3GNetworkSettingChanged;
1092         /// <summary>
1093         /// The Data3GNetworkSettingChanged event is triggered when the 3G data network status is changed.
1094         /// </summary>
1095         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1096         /// <privlevel>platform</privlevel>
1097         public static event EventHandler<Data3GNetworkSettingChangedEventArgs> Data3GNetworkSettingChanged
1098         {
1099             add
1100             {
1101                 if (s_data3GNetworkSettingChanged == null)
1102                 {
1103                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.Data3GNetworkEnabled, s_data3GNetworkSettingChangedCallback, IntPtr.Zero);
1104                     if (ret != SystemSettingsError.None)
1105                     {
1106                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1107                     }
1108                 }
1109                 s_data3GNetworkSettingChanged += value;
1110             }
1111
1112             remove
1113             {
1114                 s_data3GNetworkSettingChanged -= value;
1115                 if (s_data3GNetworkSettingChanged == null)
1116                 {
1117                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.Data3GNetworkEnabled);
1118                     if (ret != SystemSettingsError.None)
1119                     {
1120                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1121                     }
1122                 }
1123             }
1124         }
1125
1126         private static readonly Interop.Settings.SystemSettingsChangedCallback s_lockscreenAppChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1127         {
1128             string lockScreenApp = SystemSettings.LockscreenApp;
1129             LockscreenAppChangedEventArgs eventArgs = new LockscreenAppChangedEventArgs(lockScreenApp);
1130             s_lockscreenAppChanged?.Invoke(null, eventArgs);
1131         };
1132         private static event EventHandler<LockscreenAppChangedEventArgs> s_lockscreenAppChanged;
1133         /// <summary>
1134         /// The LockscreenAppChanged event is triggered when the lockscreen application package name is changed.
1135         /// </summary>
1136         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1137         /// <privlevel>platform</privlevel>
1138         public static event EventHandler<LockscreenAppChangedEventArgs> LockscreenAppChanged
1139         {
1140             add
1141             {
1142                 if (s_lockscreenAppChanged == null)
1143                 {
1144                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LockscreenApp, s_lockscreenAppChangedCallback, IntPtr.Zero);
1145                     if (ret != SystemSettingsError.None)
1146                     {
1147                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1148                     }
1149                 }
1150                 s_lockscreenAppChanged += value;
1151             }
1152
1153             remove
1154             {
1155                 s_lockscreenAppChanged -= value;
1156                 if (s_lockscreenAppChanged == null)
1157                 {
1158                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LockscreenApp);
1159                     if (ret != SystemSettingsError.None)
1160                     {
1161                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1162                     }
1163                 }
1164             }
1165         }
1166
1167         private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeCountryChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1168         {
1169             string localeCountry = SystemSettings.LocaleCountry;
1170             LocaleCountryChangedEventArgs eventArgs = new LocaleCountryChangedEventArgs(localeCountry);
1171             s_localeCountryChanged?.Invoke(null, eventArgs);
1172         };
1173         private static event EventHandler<LocaleCountryChangedEventArgs> s_localeCountryChanged;
1174         /// <summary>
1175         /// The LocaleCountryChanged event is triggered when the current country setting in the &lt;LANGUAGE&gt;_&lt;REGION&gt; syntax, is changed.
1176         /// </summary>
1177         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1178         /// <privlevel>platform</privlevel>
1179         public static event EventHandler<LocaleCountryChangedEventArgs> LocaleCountryChanged
1180         {
1181             add
1182             {
1183                 if (s_localeCountryChanged == null)
1184                 {
1185                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleCountry, s_localeCountryChangedCallback, IntPtr.Zero);
1186                     if (ret != SystemSettingsError.None)
1187                     {
1188                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1189                     }
1190                 }
1191                 s_localeCountryChanged += value;
1192             }
1193
1194             remove
1195             {
1196                 s_localeCountryChanged -= value;
1197                 if (s_localeCountryChanged == null)
1198                 {
1199                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleCountry);
1200                     if (ret != SystemSettingsError.None)
1201                     {
1202                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1203                     }
1204                 }
1205             }
1206         }
1207
1208         private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeLanguageChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1209         {
1210             string localeLanguage = SystemSettings.LocaleLanguage;
1211             LocaleLanguageChangedEventArgs eventArgs = new LocaleLanguageChangedEventArgs(localeLanguage);
1212             s_localeLanguageChanged?.Invoke(null, eventArgs);
1213         };
1214         private static event EventHandler<LocaleLanguageChangedEventArgs> s_localeLanguageChanged;
1215         /// <summary>
1216         /// The LocaleLanguageChanged event is triggered when the current language setting in the &lt;LANGUAGE&gt;_&lt;REGION&gt; syntax, is changed.
1217         /// </summary>
1218         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1219         /// <privlevel>platform</privlevel>
1220         public static event EventHandler<LocaleLanguageChangedEventArgs> LocaleLanguageChanged
1221         {
1222             add
1223             {
1224                 if (s_localeLanguageChanged == null)
1225                 {
1226                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleLanguage, s_localeLanguageChangedCallback, IntPtr.Zero);
1227                     if (ret != SystemSettingsError.None)
1228                     {
1229                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1230                     }
1231                 }
1232                 s_localeLanguageChanged += value;
1233             }
1234
1235             remove
1236             {
1237                 s_localeLanguageChanged -= value;
1238                 if (s_localeLanguageChanged == null)
1239                 {
1240                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleLanguage);
1241                     if (ret != SystemSettingsError.None)
1242                     {
1243                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1244                     }
1245                 }
1246             }
1247         }
1248
1249         private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeTimeFormat24HourChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1250         {
1251             bool localeTimeFormat24Hour = SystemSettings.LocaleTimeFormat24HourEnabled;
1252             LocaleTimeFormat24HourSettingChangedEventArgs eventArgs = new LocaleTimeFormat24HourSettingChangedEventArgs(localeTimeFormat24Hour);
1253             s_localeTimeFormat24HourChanged?.Invoke(null, eventArgs);
1254         };
1255         private static event EventHandler<LocaleTimeFormat24HourSettingChangedEventArgs> s_localeTimeFormat24HourChanged;
1256         /// <summary>
1257         /// The LocaleTimeFormat24HourChanged event is triggered when the time format is changed.
1258         /// </summary>
1259         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1260         /// <privlevel>platform</privlevel>
1261         public static event EventHandler<LocaleTimeFormat24HourSettingChangedEventArgs> LocaleTimeFormat24HourSettingChanged
1262         {
1263             add
1264             {
1265                 if (s_localeTimeFormat24HourChanged == null)
1266                 {
1267                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, s_localeTimeFormat24HourChangedCallback, IntPtr.Zero);
1268                     if (ret != SystemSettingsError.None)
1269                     {
1270                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1271                     }
1272                 }
1273                 s_localeTimeFormat24HourChanged += value;
1274             }
1275
1276             remove
1277             {
1278                 s_localeTimeFormat24HourChanged -= value;
1279                 if (s_localeTimeFormat24HourChanged == null)
1280                 {
1281                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleTimeFormat24HourEnabled);
1282                     if (ret != SystemSettingsError.None)
1283                     {
1284                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1285                     }
1286                 }
1287             }
1288         }
1289
1290         private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeTimeZoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1291         {
1292             string localeTimeZone = SystemSettings.LocaleTimeZone;
1293             LocaleTimeZoneChangedEventArgs eventArgs = new LocaleTimeZoneChangedEventArgs(localeTimeZone);
1294             s_localeTimeZoneChanged?.Invoke(null, eventArgs);
1295         };
1296         private static event EventHandler<LocaleTimeZoneChangedEventArgs> s_localeTimeZoneChanged;
1297         /// <summary>
1298         /// The LocaleTimeZoneChanged event is triggered when the current time zone is changed.
1299         /// </summary>
1300         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1301         /// <privlevel>platform</privlevel>
1302         public static event EventHandler<LocaleTimeZoneChangedEventArgs> LocaleTimeZoneChanged
1303         {
1304             add
1305             {
1306                 if (s_localeTimeZoneChanged == null)
1307                 {
1308                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleTimeZone, s_localeTimeZoneChangedCallback, IntPtr.Zero);
1309                     if (ret != SystemSettingsError.None)
1310                     {
1311                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1312                     }
1313                 }
1314                 s_localeTimeZoneChanged += value;
1315             }
1316
1317             remove
1318             {
1319                 s_localeTimeZoneChanged -= value;
1320                 if (s_localeTimeZoneChanged == null)
1321                 {
1322                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleTimeZone);
1323                     if (ret != SystemSettingsError.None)
1324                     {
1325                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1326                     }
1327                 }
1328             }
1329         }
1330
1331         private static readonly Interop.Settings.SystemSettingsChangedCallback s_timeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1332         {
1333             
1334             int time = SystemSettings.Time;
1335             TimeChangedEventArgs eventArgs = new TimeChangedEventArgs(time);
1336             s_timeChanged?.Invoke(null, eventArgs);
1337         };
1338         private static event EventHandler<TimeChangedEventArgs> s_timeChanged;
1339         /// <summary>
1340         /// The TimeChanged event is triggered when the system time is changed.
1341         /// </summary>
1342         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1343         /// <privlevel>platform</privlevel>
1344         public static event EventHandler<TimeChangedEventArgs> TimeChanged
1345         {
1346             add
1347             {
1348                 if (s_timeChanged == null)
1349                 {
1350                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.Time, s_timeChangedCallback, IntPtr.Zero);
1351                     if (ret != SystemSettingsError.None)
1352                     {
1353                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1354                     }
1355                 }
1356                 s_timeChanged += value;
1357             }
1358
1359             remove
1360             {
1361                 s_timeChanged -= value;
1362                 if (s_timeChanged == null)
1363                 {
1364                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.Time);
1365                     if (ret != SystemSettingsError.None)
1366                     {
1367                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1368                     }
1369                 }
1370             }
1371         }
1372
1373         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundLockChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1374         {
1375             bool soundLock = SystemSettings.SoundLockEnabled;
1376             SoundLockSettingChangedEventArgs eventArgs = new SoundLockSettingChangedEventArgs(soundLock);
1377             s_soundLockChanged?.Invoke(null, eventArgs);
1378         };
1379         private static event EventHandler<SoundLockSettingChangedEventArgs> s_soundLockChanged;
1380         /// <summary>
1381         /// The SoundLockChanged event is triggered when the screen lock sound enabled status is changed.
1382         /// </summary>
1383         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1384         /// <privlevel>platform</privlevel>
1385         public static event EventHandler<SoundLockSettingChangedEventArgs> SoundLockSettingChanged
1386         {
1387             add
1388             {
1389                 if (s_soundLockChanged == null)
1390                 {
1391                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundLockEnabled, s_soundLockChangedCallback, IntPtr.Zero);
1392                     if (ret != SystemSettingsError.None)
1393                     {
1394                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1395                     }
1396                 }
1397                 s_soundLockChanged += value;
1398             }
1399
1400             remove
1401             {
1402                 s_soundLockChanged -= value;
1403                 if (s_soundLockChanged == null)
1404                 {
1405                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundLockEnabled);
1406                     if (ret != SystemSettingsError.None)
1407                     {
1408                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1409                     }
1410                 }
1411             }
1412         }
1413
1414         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundSilentModeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1415         {
1416             bool soundSilentMode = SystemSettings.SoundSilentModeEnabled;
1417             SoundSilentModeSettingChangedEventArgs eventArgs = new SoundSilentModeSettingChangedEventArgs(soundSilentMode);
1418             s_soundSilentModeChanged?.Invoke(null, eventArgs);
1419         };
1420         private static event EventHandler<SoundSilentModeSettingChangedEventArgs> s_soundSilentModeChanged;
1421         /// <summary>
1422         /// The SoundSilentModeChanged event is triggered when the silent mode status is changed.
1423         /// </summary>
1424         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1425         /// <privlevel>platform</privlevel>
1426         public static event EventHandler<SoundSilentModeSettingChangedEventArgs> SoundSilentModeSettingChanged
1427         {
1428             add
1429             {
1430                 if (s_soundSilentModeChanged == null)
1431                 {
1432                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundSilentModeEnabled, s_soundSilentModeChangedCallback, IntPtr.Zero);
1433                     if (ret != SystemSettingsError.None)
1434                     {
1435                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1436                     }
1437                 }
1438                 s_soundSilentModeChanged += value;
1439             }
1440
1441             remove
1442             {
1443                 s_soundSilentModeChanged -= value;
1444                 if (s_soundSilentModeChanged == null)
1445                 {
1446                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundSilentModeEnabled);
1447                     if (ret != SystemSettingsError.None)
1448                     {
1449                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1450                     }
1451                 }
1452             }
1453         }
1454
1455         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundTouchChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1456         {
1457             bool soundTouch = SystemSettings.SoundTouchEnabled;
1458             SoundTouchSettingChangedEventArgs eventArgs = new SoundTouchSettingChangedEventArgs(soundTouch);
1459             s_soundTouchChanged?.Invoke(null, eventArgs);
1460         };
1461         private static event EventHandler<SoundTouchSettingChangedEventArgs> s_soundTouchChanged;
1462         /// <summary>
1463         /// THe SoundTouchChanged event is triggered when the screen touch sound enabled status is changed.
1464         /// </summary>
1465         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1466         /// <privlevel>platform</privlevel>
1467         public static event EventHandler<SoundTouchSettingChangedEventArgs> SoundTouchSettingChanged
1468         {
1469             add
1470             {
1471                 if (s_soundTouchChanged == null)
1472                 {
1473                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundTouchEnabled, s_soundTouchChangedCallback, IntPtr.Zero);
1474                     if (ret != SystemSettingsError.None)
1475                     {
1476                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1477                     }
1478                 }
1479                 s_soundTouchChanged += value;
1480             }
1481
1482             remove
1483             {
1484                 s_soundTouchChanged -= value;
1485                 if (s_soundTouchChanged == null)
1486                 {
1487                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundTouchEnabled);
1488                     if (ret != SystemSettingsError.None)
1489                     {
1490                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1491                     }
1492                 }
1493             }
1494         }
1495
1496         private static readonly Interop.Settings.SystemSettingsChangedCallback s_displayScreenRotationAutoChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1497         {
1498             bool displayScreenRotationAuto = SystemSettings.DisplayScreenRotationAutoEnabled;
1499             DisplayScreenRotationAutoSettingChangedEventArgs eventArgs = new DisplayScreenRotationAutoSettingChangedEventArgs(displayScreenRotationAuto);
1500             s_displayScreenRotationAutoChanged?.Invoke(null, eventArgs);
1501         };
1502         private static event EventHandler<DisplayScreenRotationAutoSettingChangedEventArgs> s_displayScreenRotationAutoChanged;
1503         /// <summary>
1504         /// The DisplayScreenRotationAutoChanged event is triggered when the automatic rotation control status is changed.
1505         /// </summary>
1506         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1507         /// <privlevel>platform</privlevel>
1508         public static event EventHandler<DisplayScreenRotationAutoSettingChangedEventArgs> DisplayScreenRotationAutoSettingChanged
1509         {
1510             add
1511             {
1512                 if (s_displayScreenRotationAutoChanged == null)
1513                 {
1514                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.DisplayScreenRotationAutoEnabled, s_displayScreenRotationAutoChangedCallback, IntPtr.Zero);
1515                     if (ret != SystemSettingsError.None)
1516                     {
1517                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1518                     }
1519                 }
1520                 s_displayScreenRotationAutoChanged += value;
1521             }
1522
1523             remove
1524             {
1525                 s_displayScreenRotationAutoChanged -= value;
1526                 if (s_displayScreenRotationAutoChanged == null)
1527                 {
1528                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.DisplayScreenRotationAutoEnabled);
1529                     if (ret != SystemSettingsError.None)
1530                     {
1531                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1532                     }
1533                 }
1534             }
1535         }
1536
1537         private static readonly Interop.Settings.SystemSettingsChangedCallback s_deviceNameChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1538         {
1539             string deviceName = SystemSettings.DeviceName;
1540             DeviceNameChangedEventArgs eventArgs = new DeviceNameChangedEventArgs(deviceName);
1541             s_deviceNameChanged?.Invoke(null, eventArgs);
1542         };
1543         private static event EventHandler<DeviceNameChangedEventArgs> s_deviceNameChanged;
1544         /// <summary>
1545         /// The DeviceNameChanged event is triggered when the device name is changed.
1546         /// </summary>
1547         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1548         /// <privlevel>platform</privlevel>
1549         public static event EventHandler<DeviceNameChangedEventArgs> DeviceNameChanged
1550         {
1551             add
1552             {
1553                 if (s_deviceNameChanged == null)
1554                 {
1555                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.DeviceName, s_deviceNameChangedCallback, IntPtr.Zero);
1556                     if (ret != SystemSettingsError.None)
1557                     {
1558                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1559                     }
1560                 }
1561                 s_deviceNameChanged += value;
1562             }
1563
1564             remove
1565             {
1566                 s_deviceNameChanged -= value;
1567                 if (s_deviceNameChanged == null)
1568                 {
1569                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.DeviceName);
1570                     if (ret != SystemSettingsError.None)
1571                     {
1572                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1573                     }
1574                 }
1575             }
1576         }
1577
1578         private static readonly Interop.Settings.SystemSettingsChangedCallback s_motionSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1579         {
1580             bool motionEnabled = SystemSettings.MotionEnabled;
1581             MotionSettingChangedEventArgs eventArgs = new MotionSettingChangedEventArgs(motionEnabled);
1582             s_motionSettingChanged?.Invoke(null, eventArgs);
1583         };
1584         private static event EventHandler<MotionSettingChangedEventArgs> s_motionSettingChanged;
1585         /// <summary>
1586         /// The MotionSettingChanged event is triggered when the motion feature enabled status is changed.
1587         /// </summary>
1588         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1589         /// <privlevel>platform</privlevel>
1590         public static event EventHandler<MotionSettingChangedEventArgs> MotionSettingChanged
1591         {
1592             add
1593             {
1594                 if (s_motionSettingChanged == null)
1595                 {
1596                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.MotionEnabled, s_motionSettingChangedCallback, IntPtr.Zero);
1597                     if (ret != SystemSettingsError.None)
1598                     {
1599                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1600                     }
1601                 }
1602                 s_motionSettingChanged += value;
1603             }
1604
1605             remove
1606             {
1607                 s_motionSettingChanged -= value;
1608                 if (s_motionSettingChanged == null)
1609                 {
1610                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.MotionEnabled);
1611                     if (ret != SystemSettingsError.None)
1612                     {
1613                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1614                     }
1615                 }
1616             }
1617         }
1618
1619         private static readonly Interop.Settings.SystemSettingsChangedCallback s_networkWifiNotificationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1620         {
1621             bool networkWifiNotification = SystemSettings.NetworkWifiNotificationEnabled;
1622             NetworkWifiNotificationSettingChangedEventArgs eventArgs = new NetworkWifiNotificationSettingChangedEventArgs(networkWifiNotification);
1623             s_networkWifiNotificationChanged?.Invoke(null, eventArgs);
1624         };
1625         private static event EventHandler<NetworkWifiNotificationSettingChangedEventArgs> s_networkWifiNotificationChanged;
1626         /// <summary>
1627         /// The NetworkWifiNotificationChanged event is triggered when the WiFi-related notifications enabled status is changed.
1628         /// </summary>
1629         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1630         /// <privlevel>platform</privlevel>
1631         public static event EventHandler<NetworkWifiNotificationSettingChangedEventArgs> NetworkWifiNotificationSettingChanged
1632         {
1633             add
1634             {
1635                 if (s_networkWifiNotificationChanged == null)
1636                 {
1637                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.NetworkWifiNotificationEnabled, s_networkWifiNotificationChangedCallback, IntPtr.Zero);
1638                     if (ret != SystemSettingsError.None)
1639                     {
1640                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1641                     }
1642                 }
1643                 s_networkWifiNotificationChanged += value;
1644             }
1645
1646             remove
1647             {
1648                 s_networkWifiNotificationChanged -= value;
1649                 if (s_networkWifiNotificationChanged == null)
1650                 {
1651                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.NetworkWifiNotificationEnabled);
1652                     if (ret != SystemSettingsError.None)
1653                     {
1654                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1655                     }
1656                 }
1657             }
1658         }
1659
1660         private static readonly Interop.Settings.SystemSettingsChangedCallback s_networkFlightModeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1661         {
1662             bool networkFlightMode = SystemSettings.NetworkFlightModeEnabled;
1663             NetworkFlightModeSettingChangedEventArgs eventArgs = new NetworkFlightModeSettingChangedEventArgs(networkFlightMode);
1664             s_networkFlightModeChanged?.Invoke(null, eventArgs);
1665         };
1666         private static event EventHandler<NetworkFlightModeSettingChangedEventArgs> s_networkFlightModeChanged;
1667         /// <summary>
1668         /// The NetworkFlightModeChanged event is triggered when the flight mode status is changed.
1669         /// </summary>
1670         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1671         /// <privlevel>platform</privlevel>
1672         public static event EventHandler<NetworkFlightModeSettingChangedEventArgs> NetworkFlightModeSettingChanged
1673         {
1674             add
1675             {
1676                 if (s_networkFlightModeChanged == null)
1677                 {
1678                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.NetworkFlightModeEnabled, s_networkFlightModeChangedCallback, IntPtr.Zero);
1679                     if (ret != SystemSettingsError.None)
1680                     {
1681                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1682                     }
1683                 }
1684                 s_networkFlightModeChanged += value;
1685             }
1686
1687             remove
1688             {
1689                 s_networkFlightModeChanged -= value;
1690                 if (s_networkFlightModeChanged == null)
1691                 {
1692                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.NetworkFlightModeEnabled);
1693                     if (ret != SystemSettingsError.None)
1694                     {
1695                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1696                     }
1697                 }
1698             }
1699         }
1700
1701         private static readonly Interop.Settings.SystemSettingsChangedCallback s_screenBacklightTimeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1702         {
1703             int screenBacklightTime = SystemSettings.ScreenBacklightTime;
1704             ScreenBacklightTimeChangedEventArgs eventArgs = new ScreenBacklightTimeChangedEventArgs(screenBacklightTime);
1705             s_screenBacklightTimeChanged?.Invoke(null, eventArgs);
1706         };
1707         private static event EventHandler<ScreenBacklightTimeChangedEventArgs> s_screenBacklightTimeChanged;
1708         /// <summary>
1709         /// THe ScreenBacklightTimeChanged event is triggered when the backlight time is changed.
1710         /// </summary>
1711         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1712         /// <privlevel>platform</privlevel>
1713         public static event EventHandler<ScreenBacklightTimeChangedEventArgs> ScreenBacklightTimeChanged
1714         {
1715             add
1716             {
1717                 if (s_screenBacklightTimeChanged == null)
1718                 {
1719                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.ScreenBacklightTime, s_screenBacklightTimeChangedCallback, IntPtr.Zero);
1720                     if (ret != SystemSettingsError.None)
1721                     {
1722                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1723                     }
1724                 }
1725                 s_screenBacklightTimeChanged += value;
1726             }
1727
1728             remove
1729             {
1730                 s_screenBacklightTimeChanged -= value;
1731                 if (s_screenBacklightTimeChanged == null)
1732                 {
1733                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.ScreenBacklightTime);
1734                     if (ret != SystemSettingsError.None)
1735                     {
1736                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1737                     }
1738                 }
1739             }
1740         }
1741
1742         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundNotificationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1743         {
1744             string soundNotification = SystemSettings.SoundNotification;
1745             SoundNotificationChangedEventArgs eventArgs = new SoundNotificationChangedEventArgs(soundNotification);
1746             s_soundNotificationChanged?.Invoke(null, eventArgs);
1747         };
1748         private static event EventHandler<SoundNotificationChangedEventArgs> s_soundNotificationChanged;
1749         /// <summary>
1750         /// The SoundNotificationChanged event is triggered when the file path of the current notification tone set by the user is changed.
1751         /// </summary>
1752         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1753         /// <privlevel>platform</privlevel>
1754         public static event EventHandler<SoundNotificationChangedEventArgs> SoundNotificationChanged
1755         {
1756             add
1757             {
1758                 if (s_soundNotificationChanged == null)
1759                 {
1760                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundNotification, s_soundNotificationChangedCallback, IntPtr.Zero);
1761                     if (ret != SystemSettingsError.None)
1762                     {
1763                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1764                     }
1765                 }
1766                 s_soundNotificationChanged += value;
1767             }
1768
1769             remove
1770             {
1771                 s_soundNotificationChanged -= value;
1772                 if (s_soundNotificationChanged == null)
1773                 {
1774                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundNotification);
1775                     if (ret != SystemSettingsError.None)
1776                     {
1777                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1778                     }
1779                 }
1780             }
1781         }
1782
1783         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundNotificationRepetitionPeriodChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1784         {
1785             int soundNotificationRepetitionPeriod = SystemSettings.SoundNotificationRepetitionPeriod;
1786             SoundNotificationRepetitionPeriodChangedEventArgs eventArgs = new SoundNotificationRepetitionPeriodChangedEventArgs(soundNotificationRepetitionPeriod);
1787             s_soundNotificationRepetitionPeriodChanged?.Invoke(null, eventArgs);
1788         };
1789         private static event EventHandler<SoundNotificationRepetitionPeriodChangedEventArgs> s_soundNotificationRepetitionPeriodChanged;
1790         /// <summary>
1791         /// The SoundNotificationRepetitionPeriodChanged event is triggered when the time period for notification repetitions is changed.
1792         /// </summary>
1793         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1794         /// <privlevel>platform</privlevel>
1795         public static event EventHandler<SoundNotificationRepetitionPeriodChangedEventArgs> SoundNotificationRepetitionPeriodChanged
1796         {
1797             add
1798             {
1799                 if (s_soundNotificationRepetitionPeriodChanged == null)
1800                 {
1801                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundNotificationRepetitionPeriod, s_soundNotificationRepetitionPeriodChangedCallback, IntPtr.Zero);
1802                     if (ret != SystemSettingsError.None)
1803                     {
1804                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1805                     }
1806                 }
1807                 s_soundNotificationRepetitionPeriodChanged += value;
1808             }
1809
1810             remove
1811             {
1812                 s_soundNotificationRepetitionPeriodChanged -= value;
1813                 if (s_soundNotificationRepetitionPeriodChanged == null)
1814                 {
1815                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundNotificationRepetitionPeriod);
1816                     if (ret != SystemSettingsError.None)
1817                     {
1818                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1819                     }
1820                 }
1821             }
1822         }
1823
1824         private static readonly Interop.Settings.SystemSettingsChangedCallback s_lockStateChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1825         {
1826             SystemSettingsIdleLockState lockState = SystemSettings.LockState;
1827             LockStateChangedEventArgs eventArgs = new LockStateChangedEventArgs(lockState);
1828             s_lockStateChanged?.Invoke(null, eventArgs);
1829         };
1830         private static event EventHandler<LockStateChangedEventArgs> s_lockStateChanged;
1831         /// <summary>
1832         /// The LockStateChanged event is triggered when the current lock state is changed.
1833         /// </summary>
1834         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1835         /// <privlevel>platform</privlevel>
1836         public static event EventHandler<LockStateChangedEventArgs> LockStateChanged
1837         {
1838             add
1839             {
1840                 if (s_lockStateChanged == null)
1841                 {
1842                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LockState, s_lockStateChangedCallback, IntPtr.Zero);
1843                     if (ret != SystemSettingsError.None)
1844                     {
1845                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1846                     }
1847                 }
1848                 s_lockStateChanged += value;
1849             }
1850
1851             remove
1852             {
1853                 s_lockStateChanged -= value;
1854                 if (s_lockStateChanged == null)
1855                 {
1856                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LockState);
1857                     if (ret != SystemSettingsError.None)
1858                     {
1859                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1860                     }
1861                 }
1862             }
1863         }
1864
1865         private static readonly Interop.Settings.SystemSettingsChangedCallback s_adsIdChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1866         {
1867             string adsId = SystemSettings.AdsId;
1868             AdsIdChangedEventArgs eventArgs = new AdsIdChangedEventArgs(adsId);
1869             s_adsIdChanged?.Invoke(null, eventArgs);
1870         };
1871         private static event EventHandler<AdsIdChangedEventArgs> s_adsIdChanged;
1872         /// <summary>
1873         /// The AdsIdChanged event is triggered when the current ADS ID state is changed.
1874         /// </summary>
1875         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1876         /// <privlevel>platform</privlevel>
1877         public static event EventHandler<AdsIdChangedEventArgs> AdsIdChanged
1878         {
1879             add
1880             {
1881                 if (s_adsIdChanged == null)
1882                 {
1883                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.AdsId, s_adsIdChangedCallback, IntPtr.Zero);
1884                     if (ret != SystemSettingsError.None)
1885                     {
1886                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1887                     }
1888                 }
1889                 s_adsIdChanged += value;
1890             }
1891
1892             remove
1893             {
1894                 s_adsIdChanged -= value;
1895                 if (s_adsIdChanged == null)
1896                 {
1897                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.AdsId);
1898                     if (ret != SystemSettingsError.None)
1899                     {
1900                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1901                     }
1902                 }
1903             }
1904         }
1905
1906         private static readonly Interop.Settings.SystemSettingsChangedCallback s_ultraDataSaveChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1907         {
1908             SystemSettingsUdsState ultraDataSave = SystemSettings.UltraDataSave;
1909             UltraDataSaveChangedEventArgs eventArgs = new UltraDataSaveChangedEventArgs(ultraDataSave);
1910             s_ultraDataSaveChanged?.Invoke(null, eventArgs);
1911         };
1912         private static event EventHandler<UltraDataSaveChangedEventArgs> s_ultraDataSaveChanged;
1913         /// <summary>
1914         /// The UltraDataSaveChanged event is triggered when the current Ultra Data Save state is changed.
1915         /// </summary>
1916         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1917         /// <privlevel>platform</privlevel>
1918         public static event EventHandler<UltraDataSaveChangedEventArgs> UltraDataSaveChanged
1919         {
1920             add
1921             {
1922                 if (s_ultraDataSaveChanged == null)
1923                 {
1924                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UltraDataSave, s_ultraDataSaveChangedCallback, IntPtr.Zero);
1925                     if (ret != SystemSettingsError.None)
1926                     {
1927                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1928                     }
1929                 }
1930                 s_ultraDataSaveChanged += value;
1931             }
1932
1933             remove
1934             {
1935                 s_ultraDataSaveChanged -= value;
1936                 if (s_ultraDataSaveChanged == null)
1937                 {
1938                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UltraDataSave);
1939                     if (ret != SystemSettingsError.None)
1940                     {
1941                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1942                     }
1943                 }
1944             }
1945         }
1946
1947         private static readonly Interop.Settings.SystemSettingsChangedCallback s_ultraDataSavePackageListChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1948         {
1949             string ultraDataSavePackageList = "None";
1950             UltraDataSavePackageListChangedEventArgs eventArgs = new UltraDataSavePackageListChangedEventArgs(ultraDataSavePackageList);
1951             s_ultraDataSavePackageListChanged?.Invoke(null, eventArgs);
1952         };
1953         private static event EventHandler<UltraDataSavePackageListChangedEventArgs> s_ultraDataSavePackageListChanged;
1954         /// <summary>
1955         /// The UltraDataSavePackageListChanged event is triggered when the current ADS ID state is changed.
1956         /// </summary>
1957         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1958         /// <privlevel>platform</privlevel>
1959         public static event EventHandler<UltraDataSavePackageListChangedEventArgs> UltraDataSavePackageListChanged
1960         {
1961             add
1962             {
1963                 if (s_ultraDataSavePackageListChanged == null)
1964                 {
1965                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UltraDataSavePackageList, s_ultraDataSavePackageListChangedCallback, IntPtr.Zero);
1966                     if (ret != SystemSettingsError.None)
1967                     {
1968                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1969                     }
1970                 }
1971                 s_ultraDataSavePackageListChanged += value;
1972             }
1973
1974             remove
1975             {
1976                 s_ultraDataSavePackageListChanged -= value;
1977                 if (s_ultraDataSavePackageListChanged == null)
1978                 {
1979                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UltraDataSavePackageList);
1980                     if (ret != SystemSettingsError.None)
1981                     {
1982                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1983                     }
1984                 }
1985             }
1986         }
1987     }
1988 }
1989