Release 4.0.0-preview1-00130
[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         /// <param name="sender"></param>
768         /// <param name="e">The IncomingCallRingtoneChangedEventArgs object that contains the key and the changed value.</param>
769         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
770         /// <privlevel>platform</privlevel>
771         public static event EventHandler<IncomingCallRingtoneChangedEventArgs> IncomingCallRingtoneChanged
772         {
773             add
774             {
775                 if (s_incomingCallRingtoneChanged == null)
776                 {
777                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.IncomingCallRingtone, s_incomingCallRingtoneChangedCallback, IntPtr.Zero);
778                     if (ret != SystemSettingsError.None)
779                     {
780                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
781                     }
782                 }
783                 s_incomingCallRingtoneChanged += value;
784             }
785
786             remove
787             {
788                 s_incomingCallRingtoneChanged -= value;
789                 if (s_incomingCallRingtoneChanged == null)
790                 {
791                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.IncomingCallRingtone);
792                     if (ret != SystemSettingsError.None)
793                     {
794                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
795                     }
796                 }
797             }
798         }
799
800         private static readonly Interop.Settings.SystemSettingsChangedCallback s_wallpaperHomeScreenChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
801         {
802             string path = SystemSettings.WallpaperHomeScreen;
803             WallpaperHomeScreenChangedEventArgs eventArgs = new WallpaperHomeScreenChangedEventArgs(path);
804             s_wallpaperHomeScreenChanged?.Invoke(null, eventArgs);
805         };
806         private static event EventHandler<WallpaperHomeScreenChangedEventArgs> s_wallpaperHomeScreenChanged;
807         /// <summary>
808         /// THe WallpaperHomeScreenChanged event is triggered when the file path of the current home screen wallpaper is changed.
809         /// </summary>
810         /// <param name="sender"></param>
811         /// <param name="e">The WallpaperHomeScreenChangedEventArgs object that contains the key and the changed value.</param>
812         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
813         /// <privlevel>platform</privlevel>
814         public static event EventHandler<WallpaperHomeScreenChangedEventArgs> WallpaperHomeScreenChanged
815         {
816             add
817             {
818                 if (s_wallpaperHomeScreenChanged == null)
819                 {
820                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.WallpaperHomeScreen, s_wallpaperHomeScreenChangedCallback, IntPtr.Zero);
821                     if (ret != SystemSettingsError.None)
822                     {
823                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
824                     }
825                 }
826                 s_wallpaperHomeScreenChanged += value;
827             }
828
829             remove
830             {
831                 s_wallpaperHomeScreenChanged -= value;
832                 if (s_wallpaperHomeScreenChanged == null)
833                 {
834                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.WallpaperHomeScreen);
835                     if (ret != SystemSettingsError.None)
836                     {
837                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
838                     }
839                 }
840             }
841         }
842
843         private static readonly Interop.Settings.SystemSettingsChangedCallback s_wallpaperLockScreenChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
844         {
845             string path = SystemSettings.WallpaperLockScreen;
846             WallpaperLockScreenChangedEventArgs eventArgs = new WallpaperLockScreenChangedEventArgs(path);
847             s_wallpaperLockScreenChanged?.Invoke(null, eventArgs);
848         };
849         private static event EventHandler<WallpaperLockScreenChangedEventArgs> s_wallpaperLockScreenChanged;
850         /// <summary>
851         /// The WallpaperLockScreenChanged event is triggered when the file path of the current lock screen wallpaper is changed.
852         /// </summary>
853         /// <param name="sender"></param>
854         /// <param name="e">The WallpaperLockScreenChangedEventArgs object that contains the key and the changed value.</param>
855         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
856         /// <privlevel>platform</privlevel>
857         public static event EventHandler<WallpaperLockScreenChangedEventArgs> WallpaperLockScreenChanged
858         {
859             add
860             {
861                 if (s_wallpaperLockScreenChanged == null)
862                 {
863                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.WallpaperLockScreen, s_wallpaperLockScreenChangedCallback, IntPtr.Zero);
864                     if (ret != SystemSettingsError.None)
865                     {
866                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
867                     }
868                 }
869                 s_wallpaperLockScreenChanged += value;
870             }
871
872             remove
873             {
874                 s_wallpaperLockScreenChanged -= value;
875                 if (s_wallpaperLockScreenChanged == null)
876                 {
877                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.WallpaperLockScreen);
878                     if (ret != SystemSettingsError.None)
879                     {
880                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
881                     }
882                 }
883             }
884         }
885
886         private static readonly Interop.Settings.SystemSettingsChangedCallback s_fontSizeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
887         {
888             SystemSettingsFontSize fontSize = SystemSettings.FontSize;
889             FontSizeChangedEventArgs eventArgs = new FontSizeChangedEventArgs(fontSize);
890             s_fontSizeChanged?.Invoke(null, eventArgs);
891         };
892         private static event EventHandler<FontSizeChangedEventArgs> s_fontSizeChanged;
893         /// <summary>
894         /// The FontSizeChanged event is triggered when the current system font size is changed.
895         /// </summary>
896         /// <param name="sender"></param>
897         /// <param name="e">The FontSizeChangedEventArgs object that contains the key and the changed value.</param>
898         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
899         /// <privlevel>platform</privlevel>
900         public static event EventHandler<FontSizeChangedEventArgs> FontSizeChanged
901         {
902             add
903             {
904                 if (s_fontSizeChanged == null)
905                 {
906                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.FontSize, s_fontSizeChangedCallback, IntPtr.Zero);
907                     if (ret != SystemSettingsError.None)
908                     {
909                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
910                     }
911                 }
912                 s_fontSizeChanged += value;
913             }
914
915             remove
916             {
917                 s_fontSizeChanged -= value;
918                 if (s_fontSizeChanged == null)
919                 {
920                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.FontSize);
921                     if (ret != SystemSettingsError.None)
922                     {
923                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
924                     }
925                 }
926             }
927         }
928
929         private static readonly Interop.Settings.SystemSettingsChangedCallback s_fontTypeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
930         {
931             string fontType = SystemSettings.FontType;
932             FontTypeChangedEventArgs eventArgs = new FontTypeChangedEventArgs(fontType);
933             s_fontTypeChanged?.Invoke(null, eventArgs);
934         };
935         private static event EventHandler<FontTypeChangedEventArgs> s_fontTypeChanged;
936         /// <summary>
937         /// The FontTypeChanged event is triggered when the current system font type is changed.
938         /// </summary>
939         /// <param name="sender"></param>
940         /// <param name="e">The FontTypeChangedEventArgs object that contains the key and the changed value.</param>
941         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
942         /// <privlevel>platform</privlevel>
943         public static event EventHandler<FontTypeChangedEventArgs> FontTypeChanged
944         {
945             add
946             {
947                 if (s_fontTypeChanged == null)
948                 {
949                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.FontType, s_fontTypeChangedCallback, IntPtr.Zero);
950                     if (ret != SystemSettingsError.None)
951                     {
952                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
953                     }
954                 }
955                 s_fontTypeChanged += value;
956             }
957
958             remove
959             {
960                 s_fontTypeChanged -= value;
961                 if (s_fontTypeChanged == null)
962                 {
963                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.FontType);
964                     if (ret != SystemSettingsError.None)
965                     {
966                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
967                     }
968                 }
969             }
970         }
971
972         private static readonly Interop.Settings.SystemSettingsChangedCallback s_motionActivationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
973         {
974             bool motionActivation = SystemSettings.MotionActivationEnabled;
975             MotionActivationSettingChangedEventArgs eventArgs = new MotionActivationSettingChangedEventArgs(motionActivation);
976             s_motionActivationChanged?.Invoke(null, eventArgs);
977         };
978         private static event EventHandler<MotionActivationSettingChangedEventArgs> s_motionActivationChanged;
979         /// <summary>
980         /// The MotionActivationChanged event is triggered when the motion service status is changed.
981         /// </summary>
982         /// <param name="sender"></param>
983         /// <param name="e">The MotionActivationChangedEventArgs object that contains the key and the changed value.</param>
984         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
985         /// <privlevel>platform</privlevel>
986         public static event EventHandler<MotionActivationSettingChangedEventArgs> MotionActivationSettingChanged
987         {
988             add
989             {
990                 if (s_motionActivationChanged == null)
991                 {
992                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.MotionActivationEnabled, s_motionActivationChangedCallback, IntPtr.Zero);
993                     if (ret != SystemSettingsError.None)
994                     {
995                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
996                     }
997                 }
998                 s_motionActivationChanged += value;
999             }
1000
1001             remove
1002             {
1003                 s_motionActivationChanged -= value;
1004                 if (s_motionActivationChanged == null)
1005                 {
1006                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.MotionActivationEnabled);
1007                     if (ret != SystemSettingsError.None)
1008                     {
1009                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1010                     }
1011                 }
1012             }
1013         }
1014
1015         private static readonly Interop.Settings.SystemSettingsChangedCallback s_emailAlertRingtoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1016         {
1017             string emailAlertRingtone = SystemSettings.EmailAlertRingtone;
1018             EmailAlertRingtoneChangedEventArgs eventArgs = new EmailAlertRingtoneChangedEventArgs(emailAlertRingtone);
1019             s_emailAlertRingtoneChanged?.Invoke(null, eventArgs);
1020         };
1021         private static event EventHandler<EmailAlertRingtoneChangedEventArgs> s_emailAlertRingtoneChanged;
1022         /// <summary>
1023         /// The EmailAlertRingtoneChanged event is triggered when the file path of the current email alert ringtone is changed.
1024         /// </summary>
1025         /// <param name="sender"></param>
1026         /// <param name="e">The EmailAlertRingtoneChangedEventArgs object that contains the key and the changed value.</param>
1027         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1028         /// <privlevel>platform</privlevel>
1029         public static event EventHandler<EmailAlertRingtoneChangedEventArgs> EmailAlertRingtoneChanged
1030         {
1031             add
1032             {
1033                 if (s_emailAlertRingtoneChanged == null)
1034                 {
1035                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.EmailAlertRingtone, s_emailAlertRingtoneChangedCallback, IntPtr.Zero);
1036                     if (ret != SystemSettingsError.None)
1037                     {
1038                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1039                     }
1040                 }
1041                 s_emailAlertRingtoneChanged += value;
1042             }
1043
1044             remove
1045             {
1046                 s_emailAlertRingtoneChanged -= value;
1047                 if (s_emailAlertRingtoneChanged == null)
1048                 {
1049                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.EmailAlertRingtone);
1050                     if (ret != SystemSettingsError.None)
1051                     {
1052                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1053                     }
1054                 }
1055             }
1056         }
1057
1058         private static readonly Interop.Settings.SystemSettingsChangedCallback s_usbDebuggingSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1059         {
1060             bool usbDebuggingEnabled = SystemSettings.UsbDebuggingEnabled;
1061             UsbDebuggingSettingChangedEventArgs eventArgs = new UsbDebuggingSettingChangedEventArgs(usbDebuggingEnabled);
1062             s_usbDebuggingSettingChanged?.Invoke(null, eventArgs);
1063         };
1064         private static event EventHandler<UsbDebuggingSettingChangedEventArgs> s_usbDebuggingSettingChanged;
1065         /// <summary>
1066         /// The UsbDebuggingSettingChangedEventArgs event is triggered when the USB debugging status is changed.
1067         /// </summary>
1068         /// <param name="sender"></param>
1069         /// <param name="e">The UsbDebuggingSettingChangedEventArgs object that contains the key and the changed value.</param>
1070         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1071         /// <privlevel>platform</privlevel>
1072         public static event EventHandler<UsbDebuggingSettingChangedEventArgs> UsbDebuggingSettingChanged
1073         {
1074             add
1075             {
1076                 if (s_usbDebuggingSettingChanged == null)
1077                 {
1078                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UsbDebuggingEnabled, s_usbDebuggingSettingChangedCallback, IntPtr.Zero);
1079                     if (ret != SystemSettingsError.None)
1080                     {
1081                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1082                     }
1083                 }
1084                 s_usbDebuggingSettingChanged += value;
1085             }
1086
1087             remove
1088             {
1089                 s_usbDebuggingSettingChanged -= value;
1090                 if (s_usbDebuggingSettingChanged == null)
1091                 {
1092                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UsbDebuggingEnabled);
1093                     if (ret != SystemSettingsError.None)
1094                     {
1095                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1096                     }
1097                 }
1098             }
1099         }
1100
1101         private static readonly Interop.Settings.SystemSettingsChangedCallback s_data3GNetworkSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1102         {
1103             bool data3GEnabled = SystemSettings.Data3GNetworkEnabled;
1104             Data3GNetworkSettingChangedEventArgs eventArgs = new Data3GNetworkSettingChangedEventArgs(data3GEnabled);
1105             s_data3GNetworkSettingChanged?.Invoke(null, eventArgs);
1106         };
1107         private static event EventHandler<Data3GNetworkSettingChangedEventArgs> s_data3GNetworkSettingChanged;
1108         /// <summary>
1109         /// The Data3GNetworkSettingChanged event is triggered when the 3G data network status is changed.
1110         /// </summary>
1111         /// <param name="sender"></param>
1112         /// <param name="e">The Data3GNetworkSettingChangedEventArgs object that contains the key and the changed value.</param>
1113         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1114         /// <privlevel>platform</privlevel>
1115         public static event EventHandler<Data3GNetworkSettingChangedEventArgs> Data3GNetworkSettingChanged
1116         {
1117             add
1118             {
1119                 if (s_data3GNetworkSettingChanged == null)
1120                 {
1121                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.Data3GNetworkEnabled, s_data3GNetworkSettingChangedCallback, IntPtr.Zero);
1122                     if (ret != SystemSettingsError.None)
1123                     {
1124                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1125                     }
1126                 }
1127                 s_data3GNetworkSettingChanged += value;
1128             }
1129
1130             remove
1131             {
1132                 s_data3GNetworkSettingChanged -= value;
1133                 if (s_data3GNetworkSettingChanged == null)
1134                 {
1135                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.Data3GNetworkEnabled);
1136                     if (ret != SystemSettingsError.None)
1137                     {
1138                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1139                     }
1140                 }
1141             }
1142         }
1143
1144         private static readonly Interop.Settings.SystemSettingsChangedCallback s_lockscreenAppChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1145         {
1146             string lockScreenApp = SystemSettings.LockscreenApp;
1147             LockscreenAppChangedEventArgs eventArgs = new LockscreenAppChangedEventArgs(lockScreenApp);
1148             s_lockscreenAppChanged?.Invoke(null, eventArgs);
1149         };
1150         private static event EventHandler<LockscreenAppChangedEventArgs> s_lockscreenAppChanged;
1151         /// <summary>
1152         /// The LockscreenAppChanged event is triggered when the lockscreen application package name is changed.
1153         /// </summary>
1154         /// <param name="sender"></param>
1155         /// <param name="e">The LockscreenAppChangedEventArgs object that contains the key and the changed value.</param>
1156         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1157         /// <privlevel>platform</privlevel>
1158         public static event EventHandler<LockscreenAppChangedEventArgs> LockscreenAppChanged
1159         {
1160             add
1161             {
1162                 if (s_lockscreenAppChanged == null)
1163                 {
1164                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LockscreenApp, s_lockscreenAppChangedCallback, IntPtr.Zero);
1165                     if (ret != SystemSettingsError.None)
1166                     {
1167                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1168                     }
1169                 }
1170                 s_lockscreenAppChanged += value;
1171             }
1172
1173             remove
1174             {
1175                 s_lockscreenAppChanged -= value;
1176                 if (s_lockscreenAppChanged == null)
1177                 {
1178                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LockscreenApp);
1179                     if (ret != SystemSettingsError.None)
1180                     {
1181                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1182                     }
1183                 }
1184             }
1185         }
1186
1187         private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeCountryChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1188         {
1189             string localeCountry = SystemSettings.LocaleCountry;
1190             LocaleCountryChangedEventArgs eventArgs = new LocaleCountryChangedEventArgs(localeCountry);
1191             s_localeCountryChanged?.Invoke(null, eventArgs);
1192         };
1193         private static event EventHandler<LocaleCountryChangedEventArgs> s_localeCountryChanged;
1194         /// <summary>
1195         /// The LocaleCountryChanged event is triggered when the current country setting in the &lt;LANGUAGE&gt;_&lt;REGION&gt; syntax, is changed.
1196         /// </summary>
1197         /// <param name="sender"></param>
1198         /// <param name="e">The LocaleCountryChangedEventArgs object that contains the key and the changed value.</param>
1199         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1200         /// <privlevel>platform</privlevel>
1201         public static event EventHandler<LocaleCountryChangedEventArgs> LocaleCountryChanged
1202         {
1203             add
1204             {
1205                 if (s_localeCountryChanged == null)
1206                 {
1207                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleCountry, s_localeCountryChangedCallback, IntPtr.Zero);
1208                     if (ret != SystemSettingsError.None)
1209                     {
1210                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1211                     }
1212                 }
1213                 s_localeCountryChanged += value;
1214             }
1215
1216             remove
1217             {
1218                 s_localeCountryChanged -= value;
1219                 if (s_localeCountryChanged == null)
1220                 {
1221                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleCountry);
1222                     if (ret != SystemSettingsError.None)
1223                     {
1224                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1225                     }
1226                 }
1227             }
1228         }
1229
1230         private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeLanguageChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1231         {
1232             string localeLanguage = SystemSettings.LocaleLanguage;
1233             LocaleLanguageChangedEventArgs eventArgs = new LocaleLanguageChangedEventArgs(localeLanguage);
1234             s_localeLanguageChanged?.Invoke(null, eventArgs);
1235         };
1236         private static event EventHandler<LocaleLanguageChangedEventArgs> s_localeLanguageChanged;
1237         /// <summary>
1238         /// The LocaleLanguageChanged event is triggered when the current language setting in the &lt;LANGUAGE&gt;_&lt;REGION&gt; syntax, is changed.
1239         /// </summary>
1240         /// <param name="sender"></param>
1241         /// <param name="e">The LocaleLanguageChangedEventArgs object that contains the key and the changed value.</param>
1242         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1243         /// <privlevel>platform</privlevel>
1244         public static event EventHandler<LocaleLanguageChangedEventArgs> LocaleLanguageChanged
1245         {
1246             add
1247             {
1248                 if (s_localeLanguageChanged == null)
1249                 {
1250                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleLanguage, s_localeLanguageChangedCallback, IntPtr.Zero);
1251                     if (ret != SystemSettingsError.None)
1252                     {
1253                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1254                     }
1255                 }
1256                 s_localeLanguageChanged += value;
1257             }
1258
1259             remove
1260             {
1261                 s_localeLanguageChanged -= value;
1262                 if (s_localeLanguageChanged == null)
1263                 {
1264                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleLanguage);
1265                     if (ret != SystemSettingsError.None)
1266                     {
1267                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1268                     }
1269                 }
1270             }
1271         }
1272
1273         private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeTimeFormat24HourChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1274         {
1275             bool localeTimeFormat24Hour = SystemSettings.LocaleTimeFormat24HourEnabled;
1276             LocaleTimeFormat24HourSettingChangedEventArgs eventArgs = new LocaleTimeFormat24HourSettingChangedEventArgs(localeTimeFormat24Hour);
1277             s_localeTimeFormat24HourChanged?.Invoke(null, eventArgs);
1278         };
1279         private static event EventHandler<LocaleTimeFormat24HourSettingChangedEventArgs> s_localeTimeFormat24HourChanged;
1280         /// <summary>
1281         /// The LocaleTimeFormat24HourChanged event is triggered when the time format is changed.
1282         /// </summary>
1283         /// <param name="sender"></param>
1284         /// <param name="e">The LocaleTimeFormat24HourChangedEventArgs object that contains the key and the changed value.</param>
1285         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1286         /// <privlevel>platform</privlevel>
1287         public static event EventHandler<LocaleTimeFormat24HourSettingChangedEventArgs> LocaleTimeFormat24HourSettingChanged
1288         {
1289             add
1290             {
1291                 if (s_localeTimeFormat24HourChanged == null)
1292                 {
1293                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, s_localeTimeFormat24HourChangedCallback, IntPtr.Zero);
1294                     if (ret != SystemSettingsError.None)
1295                     {
1296                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1297                     }
1298                 }
1299                 s_localeTimeFormat24HourChanged += value;
1300             }
1301
1302             remove
1303             {
1304                 s_localeTimeFormat24HourChanged -= value;
1305                 if (s_localeTimeFormat24HourChanged == null)
1306                 {
1307                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleTimeFormat24HourEnabled);
1308                     if (ret != SystemSettingsError.None)
1309                     {
1310                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1311                     }
1312                 }
1313             }
1314         }
1315
1316         private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeTimeZoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1317         {
1318             string localeTimeZone = SystemSettings.LocaleTimeZone;
1319             LocaleTimeZoneChangedEventArgs eventArgs = new LocaleTimeZoneChangedEventArgs(localeTimeZone);
1320             s_localeTimeZoneChanged?.Invoke(null, eventArgs);
1321         };
1322         private static event EventHandler<LocaleTimeZoneChangedEventArgs> s_localeTimeZoneChanged;
1323         /// <summary>
1324         /// The LocaleTimeZoneChanged event is triggered when the current time zone is changed.
1325         /// </summary>
1326         /// <param name="sender"></param>
1327         /// <param name="e">The LocaleTimeZoneChangedEventArgs object that contains the key and the changed value.</param>
1328         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1329         /// <privlevel>platform</privlevel>
1330         public static event EventHandler<LocaleTimeZoneChangedEventArgs> LocaleTimeZoneChanged
1331         {
1332             add
1333             {
1334                 if (s_localeTimeZoneChanged == null)
1335                 {
1336                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleTimeZone, s_localeTimeZoneChangedCallback, IntPtr.Zero);
1337                     if (ret != SystemSettingsError.None)
1338                     {
1339                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1340                     }
1341                 }
1342                 s_localeTimeZoneChanged += value;
1343             }
1344
1345             remove
1346             {
1347                 s_localeTimeZoneChanged -= value;
1348                 if (s_localeTimeZoneChanged == null)
1349                 {
1350                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleTimeZone);
1351                     if (ret != SystemSettingsError.None)
1352                     {
1353                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1354                     }
1355                 }
1356             }
1357         }
1358
1359         private static readonly Interop.Settings.SystemSettingsChangedCallback s_timeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1360         {
1361             
1362             int time = SystemSettings.Time;
1363             TimeChangedEventArgs eventArgs = new TimeChangedEventArgs(time);
1364             s_timeChanged?.Invoke(null, eventArgs);
1365         };
1366         private static event EventHandler<TimeChangedEventArgs> s_timeChanged;
1367         /// <summary>
1368         /// The TimeChanged event is triggered when the system time is changed.
1369         /// </summary>
1370         /// <param name="sender"></param>
1371         /// <param name="e">The TimeChangedEventArgs object that contains the key and the changed value.</param>
1372         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1373         /// <privlevel>platform</privlevel>
1374         public static event EventHandler<TimeChangedEventArgs> TimeChanged
1375         {
1376             add
1377             {
1378                 if (s_timeChanged == null)
1379                 {
1380                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.Time, s_timeChangedCallback, IntPtr.Zero);
1381                     if (ret != SystemSettingsError.None)
1382                     {
1383                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1384                     }
1385                 }
1386                 s_timeChanged += value;
1387             }
1388
1389             remove
1390             {
1391                 s_timeChanged -= value;
1392                 if (s_timeChanged == null)
1393                 {
1394                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.Time);
1395                     if (ret != SystemSettingsError.None)
1396                     {
1397                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1398                     }
1399                 }
1400             }
1401         }
1402
1403         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundLockChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1404         {
1405             bool soundLock = SystemSettings.SoundLockEnabled;
1406             SoundLockSettingChangedEventArgs eventArgs = new SoundLockSettingChangedEventArgs(soundLock);
1407             s_soundLockChanged?.Invoke(null, eventArgs);
1408         };
1409         private static event EventHandler<SoundLockSettingChangedEventArgs> s_soundLockChanged;
1410         /// <summary>
1411         /// The SoundLockChanged event is triggered when the screen lock sound enabled status is changed.
1412         /// </summary>
1413         /// <param name="sender"></param>
1414         /// <param name="e">The SoundLockChangedEventArgs object that contains the key and the changed value.</param>
1415         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1416         /// <privlevel>platform</privlevel>
1417         public static event EventHandler<SoundLockSettingChangedEventArgs> SoundLockSettingChanged
1418         {
1419             add
1420             {
1421                 if (s_soundLockChanged == null)
1422                 {
1423                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundLockEnabled, s_soundLockChangedCallback, IntPtr.Zero);
1424                     if (ret != SystemSettingsError.None)
1425                     {
1426                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1427                     }
1428                 }
1429                 s_soundLockChanged += value;
1430             }
1431
1432             remove
1433             {
1434                 s_soundLockChanged -= value;
1435                 if (s_soundLockChanged == null)
1436                 {
1437                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundLockEnabled);
1438                     if (ret != SystemSettingsError.None)
1439                     {
1440                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1441                     }
1442                 }
1443             }
1444         }
1445
1446         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundSilentModeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1447         {
1448             bool soundSilentMode = SystemSettings.SoundSilentModeEnabled;
1449             SoundSilentModeSettingChangedEventArgs eventArgs = new SoundSilentModeSettingChangedEventArgs(soundSilentMode);
1450             s_soundSilentModeChanged?.Invoke(null, eventArgs);
1451         };
1452         private static event EventHandler<SoundSilentModeSettingChangedEventArgs> s_soundSilentModeChanged;
1453         /// <summary>
1454         /// The SoundSilentModeChanged event is triggered when the silent mode status is changed.
1455         /// </summary>
1456         /// <param name="sender"></param>
1457         /// <param name="e">The SoundSilentModeChangedEventArgs object that contains the key and the changed value.</param>
1458         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1459         /// <privlevel>platform</privlevel>
1460         public static event EventHandler<SoundSilentModeSettingChangedEventArgs> SoundSilentModeSettingChanged
1461         {
1462             add
1463             {
1464                 if (s_soundSilentModeChanged == null)
1465                 {
1466                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundSilentModeEnabled, s_soundSilentModeChangedCallback, IntPtr.Zero);
1467                     if (ret != SystemSettingsError.None)
1468                     {
1469                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1470                     }
1471                 }
1472                 s_soundSilentModeChanged += value;
1473             }
1474
1475             remove
1476             {
1477                 s_soundSilentModeChanged -= value;
1478                 if (s_soundSilentModeChanged == null)
1479                 {
1480                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundSilentModeEnabled);
1481                     if (ret != SystemSettingsError.None)
1482                     {
1483                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1484                     }
1485                 }
1486             }
1487         }
1488
1489         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundTouchChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1490         {
1491             bool soundTouch = SystemSettings.SoundTouchEnabled;
1492             SoundTouchSettingChangedEventArgs eventArgs = new SoundTouchSettingChangedEventArgs(soundTouch);
1493             s_soundTouchChanged?.Invoke(null, eventArgs);
1494         };
1495         private static event EventHandler<SoundTouchSettingChangedEventArgs> s_soundTouchChanged;
1496         /// <summary>
1497         /// THe SoundTouchChanged event is triggered when the screen touch sound enabled status is changed.
1498         /// </summary>
1499         /// <param name="sender"></param>
1500         /// <param name="e">The SoundTouchChangedEventArgs object that contains the key and the changed value.</param>
1501         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1502         /// <privlevel>platform</privlevel>
1503         public static event EventHandler<SoundTouchSettingChangedEventArgs> SoundTouchSettingChanged
1504         {
1505             add
1506             {
1507                 if (s_soundTouchChanged == null)
1508                 {
1509                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundTouchEnabled, s_soundTouchChangedCallback, IntPtr.Zero);
1510                     if (ret != SystemSettingsError.None)
1511                     {
1512                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1513                     }
1514                 }
1515                 s_soundTouchChanged += value;
1516             }
1517
1518             remove
1519             {
1520                 s_soundTouchChanged -= value;
1521                 if (s_soundTouchChanged == null)
1522                 {
1523                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundTouchEnabled);
1524                     if (ret != SystemSettingsError.None)
1525                     {
1526                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1527                     }
1528                 }
1529             }
1530         }
1531
1532         private static readonly Interop.Settings.SystemSettingsChangedCallback s_displayScreenRotationAutoChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1533         {
1534             bool displayScreenRotationAuto = SystemSettings.DisplayScreenRotationAutoEnabled;
1535             DisplayScreenRotationAutoSettingChangedEventArgs eventArgs = new DisplayScreenRotationAutoSettingChangedEventArgs(displayScreenRotationAuto);
1536             s_displayScreenRotationAutoChanged?.Invoke(null, eventArgs);
1537         };
1538         private static event EventHandler<DisplayScreenRotationAutoSettingChangedEventArgs> s_displayScreenRotationAutoChanged;
1539         /// <summary>
1540         /// The DisplayScreenRotationAutoChanged event is triggered when the automatic rotation control status is changed.
1541         /// </summary>
1542         /// <param name="sender"></param>
1543         /// <param name="e">The DisplayScreenRotationAutoChangedEventArgs object that contains the key and the changed value.</param>
1544         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1545         /// <privlevel>platform</privlevel>
1546         public static event EventHandler<DisplayScreenRotationAutoSettingChangedEventArgs> DisplayScreenRotationAutoSettingChanged
1547         {
1548             add
1549             {
1550                 if (s_displayScreenRotationAutoChanged == null)
1551                 {
1552                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.DisplayScreenRotationAutoEnabled, s_displayScreenRotationAutoChangedCallback, IntPtr.Zero);
1553                     if (ret != SystemSettingsError.None)
1554                     {
1555                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1556                     }
1557                 }
1558                 s_displayScreenRotationAutoChanged += value;
1559             }
1560
1561             remove
1562             {
1563                 s_displayScreenRotationAutoChanged -= value;
1564                 if (s_displayScreenRotationAutoChanged == null)
1565                 {
1566                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.DisplayScreenRotationAutoEnabled);
1567                     if (ret != SystemSettingsError.None)
1568                     {
1569                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1570                     }
1571                 }
1572             }
1573         }
1574
1575         private static readonly Interop.Settings.SystemSettingsChangedCallback s_deviceNameChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1576         {
1577             string deviceName = SystemSettings.DeviceName;
1578             DeviceNameChangedEventArgs eventArgs = new DeviceNameChangedEventArgs(deviceName);
1579             s_deviceNameChanged?.Invoke(null, eventArgs);
1580         };
1581         private static event EventHandler<DeviceNameChangedEventArgs> s_deviceNameChanged;
1582         /// <summary>
1583         /// The DeviceNameChanged event is triggered when the device name is changed.
1584         /// </summary>
1585         /// <param name="sender"></param>
1586         /// <param name="e">The DeviceNameChangedEventArgs object that contains the key and the changed value.</param>
1587         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1588         /// <privlevel>platform</privlevel>
1589         public static event EventHandler<DeviceNameChangedEventArgs> DeviceNameChanged
1590         {
1591             add
1592             {
1593                 if (s_deviceNameChanged == null)
1594                 {
1595                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.DeviceName, s_deviceNameChangedCallback, IntPtr.Zero);
1596                     if (ret != SystemSettingsError.None)
1597                     {
1598                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1599                     }
1600                 }
1601                 s_deviceNameChanged += value;
1602             }
1603
1604             remove
1605             {
1606                 s_deviceNameChanged -= value;
1607                 if (s_deviceNameChanged == null)
1608                 {
1609                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.DeviceName);
1610                     if (ret != SystemSettingsError.None)
1611                     {
1612                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1613                     }
1614                 }
1615             }
1616         }
1617
1618         private static readonly Interop.Settings.SystemSettingsChangedCallback s_motionSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1619         {
1620             bool motionEnabled = SystemSettings.MotionEnabled;
1621             MotionSettingChangedEventArgs eventArgs = new MotionSettingChangedEventArgs(motionEnabled);
1622             s_motionSettingChanged?.Invoke(null, eventArgs);
1623         };
1624         private static event EventHandler<MotionSettingChangedEventArgs> s_motionSettingChanged;
1625         /// <summary>
1626         /// The MotionSettingChanged event is triggered when the motion feature enabled status is changed.
1627         /// </summary>
1628         /// <param name="sender"></param>
1629         /// <param name="e">The MotionSettingChangedEventArgs object that contains the key and the changed value.</param>
1630         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1631         /// <privlevel>platform</privlevel>
1632         public static event EventHandler<MotionSettingChangedEventArgs> MotionSettingChanged
1633         {
1634             add
1635             {
1636                 if (s_motionSettingChanged == null)
1637                 {
1638                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.MotionEnabled, s_motionSettingChangedCallback, IntPtr.Zero);
1639                     if (ret != SystemSettingsError.None)
1640                     {
1641                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1642                     }
1643                 }
1644                 s_motionSettingChanged += value;
1645             }
1646
1647             remove
1648             {
1649                 s_motionSettingChanged -= value;
1650                 if (s_motionSettingChanged == null)
1651                 {
1652                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.MotionEnabled);
1653                     if (ret != SystemSettingsError.None)
1654                     {
1655                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1656                     }
1657                 }
1658             }
1659         }
1660
1661         private static readonly Interop.Settings.SystemSettingsChangedCallback s_networkWifiNotificationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1662         {
1663             bool networkWifiNotification = SystemSettings.NetworkWifiNotificationEnabled;
1664             NetworkWifiNotificationSettingChangedEventArgs eventArgs = new NetworkWifiNotificationSettingChangedEventArgs(networkWifiNotification);
1665             s_networkWifiNotificationChanged?.Invoke(null, eventArgs);
1666         };
1667         private static event EventHandler<NetworkWifiNotificationSettingChangedEventArgs> s_networkWifiNotificationChanged;
1668         /// <summary>
1669         /// The NetworkWifiNotificationChanged event is triggered when the WiFi-related notifications enabled status is changed.
1670         /// </summary>
1671         /// <param name="sender"></param>
1672         /// <param name="e">The NetworkWifiNotificationChangedEventArgs object that contains the key and the changed value.</param>
1673         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1674         /// <privlevel>platform</privlevel>
1675         public static event EventHandler<NetworkWifiNotificationSettingChangedEventArgs> NetworkWifiNotificationSettingChanged
1676         {
1677             add
1678             {
1679                 if (s_networkWifiNotificationChanged == null)
1680                 {
1681                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.NetworkWifiNotificationEnabled, s_networkWifiNotificationChangedCallback, IntPtr.Zero);
1682                     if (ret != SystemSettingsError.None)
1683                     {
1684                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1685                     }
1686                 }
1687                 s_networkWifiNotificationChanged += value;
1688             }
1689
1690             remove
1691             {
1692                 s_networkWifiNotificationChanged -= value;
1693                 if (s_networkWifiNotificationChanged == null)
1694                 {
1695                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.NetworkWifiNotificationEnabled);
1696                     if (ret != SystemSettingsError.None)
1697                     {
1698                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1699                     }
1700                 }
1701             }
1702         }
1703
1704         private static readonly Interop.Settings.SystemSettingsChangedCallback s_networkFlightModeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1705         {
1706             bool networkFlightMode = SystemSettings.NetworkFlightModeEnabled;
1707             NetworkFlightModeSettingChangedEventArgs eventArgs = new NetworkFlightModeSettingChangedEventArgs(networkFlightMode);
1708             s_networkFlightModeChanged?.Invoke(null, eventArgs);
1709         };
1710         private static event EventHandler<NetworkFlightModeSettingChangedEventArgs> s_networkFlightModeChanged;
1711         /// <summary>
1712         /// The NetworkFlightModeChanged event is triggered when the flight mode status is changed.
1713         /// </summary>
1714         /// <param name="sender"></param>
1715         /// <param name="e">The NetworkFlightModeChangedEventArgs object that contains the key and the changed value.</param>
1716         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1717         /// <privlevel>platform</privlevel>
1718         public static event EventHandler<NetworkFlightModeSettingChangedEventArgs> NetworkFlightModeSettingChanged
1719         {
1720             add
1721             {
1722                 if (s_networkFlightModeChanged == null)
1723                 {
1724                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.NetworkFlightModeEnabled, s_networkFlightModeChangedCallback, IntPtr.Zero);
1725                     if (ret != SystemSettingsError.None)
1726                     {
1727                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1728                     }
1729                 }
1730                 s_networkFlightModeChanged += value;
1731             }
1732
1733             remove
1734             {
1735                 s_networkFlightModeChanged -= value;
1736                 if (s_networkFlightModeChanged == null)
1737                 {
1738                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.NetworkFlightModeEnabled);
1739                     if (ret != SystemSettingsError.None)
1740                     {
1741                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1742                     }
1743                 }
1744             }
1745         }
1746
1747         private static readonly Interop.Settings.SystemSettingsChangedCallback s_screenBacklightTimeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1748         {
1749             int screenBacklightTime = SystemSettings.ScreenBacklightTime;
1750             ScreenBacklightTimeChangedEventArgs eventArgs = new ScreenBacklightTimeChangedEventArgs(screenBacklightTime);
1751             s_screenBacklightTimeChanged?.Invoke(null, eventArgs);
1752         };
1753         private static event EventHandler<ScreenBacklightTimeChangedEventArgs> s_screenBacklightTimeChanged;
1754         /// <summary>
1755         /// THe ScreenBacklightTimeChanged event is triggered when the backlight time is changed.
1756         /// </summary>
1757         /// <param name="sender"></param>
1758         /// <param name="e">The ScreenBacklightTimeChangedEventArgs object that contains the key and the changed value.</param>
1759         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1760         /// <privlevel>platform</privlevel>
1761         public static event EventHandler<ScreenBacklightTimeChangedEventArgs> ScreenBacklightTimeChanged
1762         {
1763             add
1764             {
1765                 if (s_screenBacklightTimeChanged == null)
1766                 {
1767                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.ScreenBacklightTime, s_screenBacklightTimeChangedCallback, IntPtr.Zero);
1768                     if (ret != SystemSettingsError.None)
1769                     {
1770                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1771                     }
1772                 }
1773                 s_screenBacklightTimeChanged += value;
1774             }
1775
1776             remove
1777             {
1778                 s_screenBacklightTimeChanged -= value;
1779                 if (s_screenBacklightTimeChanged == null)
1780                 {
1781                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.ScreenBacklightTime);
1782                     if (ret != SystemSettingsError.None)
1783                     {
1784                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1785                     }
1786                 }
1787             }
1788         }
1789
1790         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundNotificationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1791         {
1792             string soundNotification = SystemSettings.SoundNotification;
1793             SoundNotificationChangedEventArgs eventArgs = new SoundNotificationChangedEventArgs(soundNotification);
1794             s_soundNotificationChanged?.Invoke(null, eventArgs);
1795         };
1796         private static event EventHandler<SoundNotificationChangedEventArgs> s_soundNotificationChanged;
1797         /// <summary>
1798         /// The SoundNotificationChanged event is triggered when the file path of the current notification tone set by the user is changed.
1799         /// </summary>
1800         /// <param name="sender"></param>
1801         /// <param name="e">The SoundNotificationChangedEventArgs object that contains the key and the changed value.</param>
1802         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1803         /// <privlevel>platform</privlevel>
1804         public static event EventHandler<SoundNotificationChangedEventArgs> SoundNotificationChanged
1805         {
1806             add
1807             {
1808                 if (s_soundNotificationChanged == null)
1809                 {
1810                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundNotification, s_soundNotificationChangedCallback, IntPtr.Zero);
1811                     if (ret != SystemSettingsError.None)
1812                     {
1813                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1814                     }
1815                 }
1816                 s_soundNotificationChanged += value;
1817             }
1818
1819             remove
1820             {
1821                 s_soundNotificationChanged -= value;
1822                 if (s_soundNotificationChanged == null)
1823                 {
1824                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundNotification);
1825                     if (ret != SystemSettingsError.None)
1826                     {
1827                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1828                     }
1829                 }
1830             }
1831         }
1832
1833         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundNotificationRepetitionPeriodChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1834         {
1835             int soundNotificationRepetitionPeriod = SystemSettings.SoundNotificationRepetitionPeriod;
1836             SoundNotificationRepetitionPeriodChangedEventArgs eventArgs = new SoundNotificationRepetitionPeriodChangedEventArgs(soundNotificationRepetitionPeriod);
1837             s_soundNotificationRepetitionPeriodChanged?.Invoke(null, eventArgs);
1838         };
1839         private static event EventHandler<SoundNotificationRepetitionPeriodChangedEventArgs> s_soundNotificationRepetitionPeriodChanged;
1840         /// <summary>
1841         /// The SoundNotificationRepetitionPeriodChanged event is triggered when the time period for notification repetitions is changed.
1842         /// </summary>
1843         /// <param name="sender"></param>
1844         /// <param name="e">The SoundNotificationRepetitionPeriodChangedEventArgs object that contains the key and the changed value.</param>
1845         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1846         /// <privlevel>platform</privlevel>
1847         public static event EventHandler<SoundNotificationRepetitionPeriodChangedEventArgs> SoundNotificationRepetitionPeriodChanged
1848         {
1849             add
1850             {
1851                 if (s_soundNotificationRepetitionPeriodChanged == null)
1852                 {
1853                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundNotificationRepetitionPeriod, s_soundNotificationRepetitionPeriodChangedCallback, IntPtr.Zero);
1854                     if (ret != SystemSettingsError.None)
1855                     {
1856                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1857                     }
1858                 }
1859                 s_soundNotificationRepetitionPeriodChanged += value;
1860             }
1861
1862             remove
1863             {
1864                 s_soundNotificationRepetitionPeriodChanged -= value;
1865                 if (s_soundNotificationRepetitionPeriodChanged == null)
1866                 {
1867                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundNotificationRepetitionPeriod);
1868                     if (ret != SystemSettingsError.None)
1869                     {
1870                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1871                     }
1872                 }
1873             }
1874         }
1875
1876         private static readonly Interop.Settings.SystemSettingsChangedCallback s_lockStateChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1877         {
1878             SystemSettingsIdleLockState lockState = SystemSettings.LockState;
1879             LockStateChangedEventArgs eventArgs = new LockStateChangedEventArgs(lockState);
1880             s_lockStateChanged?.Invoke(null, eventArgs);
1881         };
1882         private static event EventHandler<LockStateChangedEventArgs> s_lockStateChanged;
1883         /// <summary>
1884         /// The LockStateChanged event is triggered when the current lock state is changed.
1885         /// </summary>
1886         /// <param name="sender"></param>
1887         /// <param name="e">The LockStateChangedEventArgs object that contains the key and the changed value.</param>
1888         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1889         /// <privlevel>platform</privlevel>
1890         public static event EventHandler<LockStateChangedEventArgs> LockStateChanged
1891         {
1892             add
1893             {
1894                 if (s_lockStateChanged == null)
1895                 {
1896                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LockState, s_lockStateChangedCallback, IntPtr.Zero);
1897                     if (ret != SystemSettingsError.None)
1898                     {
1899                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1900                     }
1901                 }
1902                 s_lockStateChanged += value;
1903             }
1904
1905             remove
1906             {
1907                 s_lockStateChanged -= value;
1908                 if (s_lockStateChanged == null)
1909                 {
1910                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LockState);
1911                     if (ret != SystemSettingsError.None)
1912                     {
1913                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1914                     }
1915                 }
1916             }
1917         }
1918
1919         private static readonly Interop.Settings.SystemSettingsChangedCallback s_adsIdChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1920         {
1921             string adsId = SystemSettings.AdsId;
1922             AdsIdChangedEventArgs eventArgs = new AdsIdChangedEventArgs(adsId);
1923             s_adsIdChanged?.Invoke(null, eventArgs);
1924         };
1925         private static event EventHandler<AdsIdChangedEventArgs> s_adsIdChanged;
1926         /// <summary>
1927         /// The AdsIdChanged event is triggered when the current ADS ID state is changed.
1928         /// </summary>
1929         /// <param name="sender"></param>
1930         /// <param name="e">The AdsIdChangedEventArgs object that contains the key and the changed value.</param>
1931         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1932         /// <privlevel>platform</privlevel>
1933         public static event EventHandler<AdsIdChangedEventArgs> AdsIdChanged
1934         {
1935             add
1936             {
1937                 if (s_adsIdChanged == null)
1938                 {
1939                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.AdsId, s_adsIdChangedCallback, IntPtr.Zero);
1940                     if (ret != SystemSettingsError.None)
1941                     {
1942                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1943                     }
1944                 }
1945                 s_adsIdChanged += value;
1946             }
1947
1948             remove
1949             {
1950                 s_adsIdChanged -= value;
1951                 if (s_adsIdChanged == null)
1952                 {
1953                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.AdsId);
1954                     if (ret != SystemSettingsError.None)
1955                     {
1956                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1957                     }
1958                 }
1959             }
1960         }
1961
1962         private static readonly Interop.Settings.SystemSettingsChangedCallback s_ultraDataSaveChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1963         {
1964             SystemSettingsUdsState ultraDataSave = SystemSettings.UltraDataSave;
1965             UltraDataSaveChangedEventArgs eventArgs = new UltraDataSaveChangedEventArgs(ultraDataSave);
1966             s_ultraDataSaveChanged?.Invoke(null, eventArgs);
1967         };
1968         private static event EventHandler<UltraDataSaveChangedEventArgs> s_ultraDataSaveChanged;
1969         /// <summary>
1970         /// The UltraDataSaveChanged event is triggered when the current Ultra Data Save state is changed.
1971         /// </summary>
1972         /// <param name="sender"></param>
1973         /// <param name="e">The UltraDataSaveChangedEventArgs object that contains the key and the changed value.</param>
1974         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1975         /// <privlevel>platform</privlevel>
1976         public static event EventHandler<UltraDataSaveChangedEventArgs> UltraDataSaveChanged
1977         {
1978             add
1979             {
1980                 if (s_ultraDataSaveChanged == null)
1981                 {
1982                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UltraDataSave, s_ultraDataSaveChangedCallback, IntPtr.Zero);
1983                     if (ret != SystemSettingsError.None)
1984                     {
1985                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1986                     }
1987                 }
1988                 s_ultraDataSaveChanged += value;
1989             }
1990
1991             remove
1992             {
1993                 s_ultraDataSaveChanged -= value;
1994                 if (s_ultraDataSaveChanged == null)
1995                 {
1996                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UltraDataSave);
1997                     if (ret != SystemSettingsError.None)
1998                     {
1999                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2000                     }
2001                 }
2002             }
2003         }
2004
2005         private static readonly Interop.Settings.SystemSettingsChangedCallback s_ultraDataSavePackageListChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
2006         {
2007             string ultraDataSavePackageList = "None";
2008             UltraDataSavePackageListChangedEventArgs eventArgs = new UltraDataSavePackageListChangedEventArgs(ultraDataSavePackageList);
2009             s_ultraDataSavePackageListChanged?.Invoke(null, eventArgs);
2010         };
2011         private static event EventHandler<UltraDataSavePackageListChangedEventArgs> s_ultraDataSavePackageListChanged;
2012         /// <summary>
2013         /// The UltraDataSavePackageListChanged event is triggered when the current ADS ID state is changed.
2014         /// </summary>
2015         /// <param name="sender"></param>
2016         /// <param name="e">The UltraDataSavePackageListChangedEventArgs object that contains the key and the changed value.</param>
2017         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
2018         /// <privlevel>platform</privlevel>
2019         public static event EventHandler<UltraDataSavePackageListChangedEventArgs> UltraDataSavePackageListChanged
2020         {
2021             add
2022             {
2023                 if (s_ultraDataSavePackageListChanged == null)
2024                 {
2025                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UltraDataSavePackageList, s_ultraDataSavePackageListChangedCallback, IntPtr.Zero);
2026                     if (ret != SystemSettingsError.None)
2027                     {
2028                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2029                     }
2030                 }
2031                 s_ultraDataSavePackageListChanged += value;
2032             }
2033
2034             remove
2035             {
2036                 s_ultraDataSavePackageListChanged -= value;
2037                 if (s_ultraDataSavePackageListChanged == null)
2038                 {
2039                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UltraDataSavePackageList);
2040                     if (ret != SystemSettingsError.None)
2041                     {
2042                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2043                     }
2044                 }
2045             }
2046         }
2047     }
2048 }
2049