[SystemSettings] Changed event handler routine. (#22)
[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     /// <since_tizen> 3 </since_tizen>
29     public static class SystemSettings
30     {
31         /// <summary>
32         /// The file path of the current ringtone.
33         /// </summary>
34         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
35         /// <privlevel>platform</privlevel>
36         /// <feature>http://tizen.org/feature/systemsetting</feature>
37         /// <feature>http://tizen.org/feature/systemsetting.incoming_call</feature>
38         /// <exception cref="ArgumentException">Invalid Argument</exception>
39         /// <exception cref="NotSupportedException">Not Supported feature</exception>
40         /// <exception cref="InvalidOperationException">Invalid operation</exception>
41         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
42         /// <since_tizen> 3 </since_tizen>
43         public static string IncomingCallRingtone
44         {
45             get
46             {
47                 string filePath;
48                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.IncomingCallRingtone, out filePath);
49                 if (res != SystemSettingsError.None)
50                 {
51                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get IncomingCallRingtone system setting.");
52                 }
53                 return filePath;
54             }
55             set
56             {
57                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.IncomingCallRingtone, value);
58                 if (res != SystemSettingsError.None)
59                 {
60                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set IncomingCallRingtone system setting.");
61                 }
62             }
63         }
64
65         /// <summary>
66         /// The file path of the current home-screen wallpaper.
67         /// </summary>
68         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
69         /// <privlevel>platform</privlevel>
70         /// <feature>http://tizen.org/feature/systemsetting</feature>
71         /// <feature>http://tizen.org/feature/systemsetting.home_screen</feature>
72         /// <exception cref="ArgumentException">Invalid Argument</exception>
73         /// <exception cref="NotSupportedException">Not Supported feature</exception>
74         /// <exception cref="InvalidOperationException">Invalid operation</exception>
75         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
76         /// <since_tizen> 3 </since_tizen>
77         public static string WallpaperHomeScreen
78         {
79             get
80             {
81                 string filePath;
82                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.WallpaperHomeScreen, out filePath);
83                 if (res != SystemSettingsError.None)
84                 {
85                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get WallpaperHomeScreen system setting.");
86                 }
87                 return filePath;
88             }
89             set
90             {
91                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.WallpaperHomeScreen, value);
92                 if (res != SystemSettingsError.None)
93                 {
94                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set WallpaperHomeScreen system setting.");
95                 }
96             }
97         }
98
99         /// <summary>
100         /// The file path of the current lock-screen wallpaper.
101         /// </summary>
102         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
103         /// <privlevel>platform</privlevel>
104         /// <feature>http://tizen.org/feature/systemsetting</feature>
105         /// <feature>http://tizen.org/feature/systemsetting.lock_screen</feature>
106         /// <exception cref="ArgumentException">Invalid Argument</exception>
107         /// <exception cref="NotSupportedException">Not Supported feature</exception>
108         /// <exception cref="InvalidOperationException">Invalid operation</exception>
109         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
110         /// <since_tizen> 3 </since_tizen>
111         public static string WallpaperLockScreen
112         {
113             get
114             {
115                 string filePath;
116                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.WallpaperLockScreen, out filePath);
117                 if (res != SystemSettingsError.None)
118                 {
119                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get WallpaperLockScreen system setting.");
120                 }
121                 return filePath;
122             }
123             set
124             {
125                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.WallpaperLockScreen, value);
126                 if (res != SystemSettingsError.None)
127                 {
128                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set WallpaperLockScreen system setting.");
129                 }
130             }
131         }
132
133         /// <summary>
134         /// The current system font size.
135         /// </summary>
136         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
137         /// <privlevel>platform</privlevel>
138         /// <feature>http://tizen.org/feature/systemsetting</feature>
139         /// <exception cref="ArgumentException">Invalid Argument</exception>
140         /// <exception cref="NotSupportedException">Not Supported feature</exception>
141         /// <exception cref="InvalidOperationException">Invalid operation</exception>
142         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
143         /// <since_tizen> 3 </since_tizen>
144         public static SystemSettingsFontSize FontSize
145         {
146             get
147             {
148                 int fontSize;
149                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.FontSize, out fontSize);
150                 if (res != SystemSettingsError.None)
151                 {
152                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get FontSize system setting.");
153                 }
154                 return (SystemSettingsFontSize)fontSize;
155             }
156             set
157             {
158                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.FontSize, (int)value);
159                 if (res != SystemSettingsError.None)
160                 {
161                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set FontSize system setting.");
162                 }
163             }
164         }
165
166         /// <summary>
167         /// The current system font type.
168         /// </summary>
169         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
170         /// <privlevel>platform</privlevel>
171         /// <feature>http://tizen.org/feature/systemsetting</feature>
172         /// <exception cref="ArgumentException">Invalid Argument</exception>
173         /// <exception cref="NotSupportedException">Not Supported feature</exception>
174         /// <exception cref="InvalidOperationException">Invalid operation</exception>
175         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
176         /// <since_tizen> 3 </since_tizen>
177         public static string FontType
178         {
179             get
180             {
181                 string fontType;
182                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.FontType, out fontType);
183                 if (res != SystemSettingsError.None)
184                 {
185                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get FontType system setting.");
186                 }
187                 return fontType;
188             }
189             set
190             {
191                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.FontType, value);
192                 if (res != SystemSettingsError.None)
193                 {
194                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set FontType system setting.");
195                 }
196             }
197         }
198
199         /// <summary>
200         /// Indicates whether the motion service is activated.
201         /// </summary>
202         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
203         /// <privlevel>platform</privlevel>
204         /// <feature>http://tizen.org/feature/systemsetting</feature>
205         /// <exception cref="ArgumentException">Invalid Argument</exception>
206         /// <exception cref="NotSupportedException">Not Supported feature</exception>
207         /// <exception cref="InvalidOperationException">Invalid operation</exception>
208         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
209         /// <since_tizen> 3 </since_tizen>
210         public static bool MotionActivationEnabled
211         {
212             get
213             {
214                 bool isMotionServiceActivated;
215                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.MotionActivationEnabled, out isMotionServiceActivated);
216                 if (res != SystemSettingsError.None)
217                 {
218                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get MotionActivation system setting.");
219                 }
220                 return isMotionServiceActivated;
221             }
222             set
223             {
224                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.MotionActivationEnabled, value);
225                 if (res != SystemSettingsError.None)
226                 {
227                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set MotionActivation system setting.");
228                 }
229             }
230         }
231
232         /// <summary>
233         /// The file path of the current email alert ringtone.
234         /// </summary>
235         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
236         /// <privlevel>platform</privlevel>
237         /// <feature>http://tizen.org/feature/systemsetting</feature>
238         /// <feature>http://tizen.org/feature/systemsetting.notification_email</feature>
239         /// <exception cref="ArgumentException">Invalid Argument</exception>
240         /// <exception cref="NotSupportedException">Not Supported feature</exception>
241         /// <exception cref="InvalidOperationException">Invalid operation</exception>
242         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
243         /// <since_tizen> 3 </since_tizen>
244         public static string EmailAlertRingtone
245         {
246             get
247             {
248                 string filePath;
249                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.EmailAlertRingtone, out filePath);
250                 if (res != SystemSettingsError.None)
251                 {
252                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get EmailAlertRingtone system setting.");
253                 }
254                 return filePath;
255             }
256             set
257             {
258                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.EmailAlertRingtone, value);
259                 if (res != SystemSettingsError.None)
260                 {
261                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set EmailAlertRingtone system setting.");
262                 }
263             }
264         }
265         /// <summary>
266         /// Indicates whether the USB debugging is enabled.
267         /// </summary>
268         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
269         /// <privlevel>platform</privlevel>
270         /// <feature>http://tizen.org/feature/systemsetting</feature>
271         /// <exception cref="ArgumentException">Invalid Argument</exception>
272         /// <exception cref="NotSupportedException">Not Supported feature</exception>
273         /// <exception cref="InvalidOperationException">Invalid operation</exception>
274         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
275         /// <since_tizen> 3 </since_tizen>
276         public static bool UsbDebuggingEnabled
277         {
278             get
279             {
280                 bool isusbDebuggingEnabled;
281                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.UsbDebuggingEnabled, out isusbDebuggingEnabled);
282                 if (res != SystemSettingsError.None)
283                 {
284                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get UsbDebuggingEnabled system setting.");
285                 }
286                 return isusbDebuggingEnabled;
287             }
288             set
289             {
290                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.UsbDebuggingEnabled, value);
291                 if (res != SystemSettingsError.None)
292                 {
293                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set UsbDebuggingEnabled system setting.");
294                 }
295             }
296         }
297
298         /// <summary>
299         /// Indicates whether the 3G data network is enabled.
300         /// </summary>
301         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
302         /// <privlevel>platform</privlevel>
303         /// <feature>http://tizen.org/feature/systemsetting</feature>
304         /// <exception cref="ArgumentException">Invalid Argument</exception>
305         /// <exception cref="NotSupportedException">Not Supported feature</exception>
306         /// <exception cref="InvalidOperationException">Invalid operation</exception>
307         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
308         /// <since_tizen> 3 </since_tizen>
309         public static bool Data3GNetworkEnabled
310         {
311             get
312             {
313                 bool is3GDataEnabled;
314                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.Data3GNetworkEnabled, out is3GDataEnabled);
315                 if (res != SystemSettingsError.None)
316                 {
317                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get Data3GNetworkEnabled system setting.");
318                 }
319                 return is3GDataEnabled;
320             }
321             set
322             {
323                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.Data3GNetworkEnabled, value);
324                 if (res != SystemSettingsError.None)
325                 {
326                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set Data3GNetworkEnabled system setting.");
327                 }
328             }
329         }
330
331         /// <summary>
332         /// Indicates the lock-screen application package name.
333         /// </summary>
334         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
335         /// <privlevel>platform</privlevel>
336         /// <feature>http://tizen.org/feature/systemsetting</feature>
337         /// <feature>http://tizen.org/feature/systemsetting.lock_screen</feature>
338         /// <exception cref="ArgumentException">Invalid Argument</exception>
339         /// <exception cref="NotSupportedException">Not Supported feature</exception>
340         /// <exception cref="InvalidOperationException">Invalid operation</exception>
341         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
342         /// <since_tizen> 4 </since_tizen>
343         public static string LockScreenApp
344         {
345             get
346             {
347                 string pkgName;
348                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LockScreenApp, out pkgName);
349                 if (res != SystemSettingsError.None)
350                 {
351                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LockScreenApp system setting.");
352                 }
353                 return pkgName;
354             }
355             set
356             {
357                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LockScreenApp, value);
358                 if (res != SystemSettingsError.None)
359                 {
360                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LockScreenApp system setting.");
361                 }
362             }
363         }
364
365         /// <summary>
366         /// The current system default font type (only supports Get).
367         /// </summary>
368         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
369         /// <privlevel>platform</privlevel>
370         /// <feature>http://tizen.org/feature/systemsetting</feature>
371         /// <exception cref="ArgumentException">Invalid Argument</exception>
372         /// <exception cref="NotSupportedException">Not Supported feature</exception>
373         /// <exception cref="InvalidOperationException">Invalid operation</exception>
374         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
375         /// <since_tizen> 3 </since_tizen>
376         public static string DefaultFontType
377         {
378             get
379             {
380                 string defaultFontType;
381                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.DefaultFontType, out defaultFontType);
382                 if (res != SystemSettingsError.None)
383                 {
384                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get DefaultFontType system setting value.");
385                 }
386                 return defaultFontType;
387             }
388         }
389
390         /// <summary>
391         /// Indicates the current country setting in the &lt;LANGUAGE&gt;_&lt;REGION&gt; syntax.
392         /// The country setting is in the ISO 639-2 format,
393         /// and the region setting is in the ISO 3166-1 alpha-2 format.
394         /// </summary>
395         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
396         /// <privlevel>platform</privlevel>
397         /// <feature>http://tizen.org/feature/systemsetting</feature>
398         /// <exception cref="ArgumentException">Invalid Argument</exception>
399         /// <exception cref="NotSupportedException">Not Supported feature</exception>
400         /// <exception cref="InvalidOperationException">Invalid operation</exception>
401         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
402         /// <since_tizen> 3 </since_tizen>
403         public static string LocaleCountry
404         {
405             get
406             {
407                 string countrySetting;
408                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LocaleCountry, out countrySetting);
409                 if (res != SystemSettingsError.None)
410                 {
411                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleCountry system setting.");
412                 }
413                 return countrySetting;
414             }
415             set
416             {
417                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LocaleCountry, value);
418                 if (res != SystemSettingsError.None)
419                 {
420                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleCountry system setting.");
421                 }
422             }
423         }
424
425         /// <summary>
426         /// Indicates the current language setting in the &lt;LANGUAGE&gt;_&lt;REGION&gt; syntax.
427         /// The language setting is in the ISO 639-2 format,
428         /// and the region setting is in the ISO 3166-1 alpha-2 format.
429         /// </summary>
430         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
431         /// <privlevel>platform</privlevel>
432         /// <feature>http://tizen.org/feature/systemsetting</feature>
433         /// <exception cref="ArgumentException">Invalid Argument</exception>
434         /// <exception cref="NotSupportedException">Not Supported feature</exception>
435         /// <exception cref="InvalidOperationException">Invalid operation</exception>
436         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
437         /// <since_tizen> 3 </since_tizen>
438         public static string LocaleLanguage
439         {
440             get
441             {
442                 string languageSetting;
443                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LocaleLanguage, out languageSetting);
444                 if (res != SystemSettingsError.None)
445                 {
446                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleLanguage system setting.");
447                 }
448                 return languageSetting;
449             }
450             set
451             {
452                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LocaleLanguage, value);
453                 if (res != SystemSettingsError.None)
454                 {
455                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleLanguage system setting.");
456                 }
457             }
458         }
459
460         /// <summary>
461         /// Indicates whether the 24-hour clock is used.
462         /// If the value is false, the 12-hour clock is used.
463         /// </summary>
464         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
465         /// <privlevel>platform</privlevel>
466         /// <feature>http://tizen.org/feature/systemsetting</feature>
467         /// <exception cref="ArgumentException">Invalid Argument</exception>
468         /// <exception cref="NotSupportedException">Not Supported feature</exception>
469         /// <exception cref="InvalidOperationException">Invalid operation</exception>
470         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
471         /// <since_tizen> 3 </since_tizen>
472         public static bool LocaleTimeFormat24HourEnabled
473         {
474             get
475             {
476                 bool is24HrFormat;
477                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, out is24HrFormat);
478                 if (res != SystemSettingsError.None)
479                 {
480                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleTimeFormat24Hour system setting.");
481                 }
482                 return is24HrFormat;
483             }
484             set
485             {
486                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, value);
487                 if (res != SystemSettingsError.None)
488                 {
489                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleTimeFormat24Hour system setting.");
490                 }
491             }
492         }
493
494         /// <summary>
495         /// Indicates the current time zone, for example, Pacific/Tahiti.
496         /// </summary>
497         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
498         /// <privlevel>platform</privlevel>
499         /// <feature>http://tizen.org/feature/systemsetting</feature>
500         /// <exception cref="ArgumentException">Invalid Argument</exception>
501         /// <exception cref="NotSupportedException">Not Supported feature</exception>
502         /// <exception cref="InvalidOperationException">Invalid operation</exception>
503         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
504         /// <since_tizen> 3 </since_tizen>
505         public static string LocaleTimeZone
506         {
507             get
508             {
509                 string timeZone;
510                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LocaleTimeZone, out timeZone);
511                 if (res != SystemSettingsError.None)
512                 {
513                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleTimeZone system setting.");
514                 }
515                 return timeZone;
516             }
517             set
518             {
519                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LocaleTimeZone, value);
520                 if (res != SystemSettingsError.None)
521                 {
522                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleTimeZone system setting.");
523                 }
524             }
525         }
526
527         /// <summary>
528         /// Once the system changes time, this event occurs to notify the time change.
529         /// </summary>
530         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
531         /// <privlevel>platform</privlevel>
532         /// <feature>http://tizen.org/feature/systemsetting</feature>
533         /// <exception cref="ArgumentException">Invalid Argument</exception>
534         /// <exception cref="NotSupportedException">Not Supported feature</exception>
535         /// <exception cref="InvalidOperationException">Invalid operation</exception>
536         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
537         /// <since_tizen> 3 </since_tizen>
538         public static int Time
539         {
540             get
541             {
542                 int time;
543                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.Time, out time);
544                 if (res != SystemSettingsError.None)
545                 {
546                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get Time system setting.");
547                 }
548                 return time;
549             }
550         }
551         /// <summary>
552         /// Indicates whether the screen lock sound is enabled on the device, for example, the LCD on or off sound.
553         /// </summary>
554         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
555         /// <privlevel>platform</privlevel>
556         /// <feature>http://tizen.org/feature/systemsetting</feature>
557         /// <exception cref="ArgumentException">Invalid Argument</exception>
558         /// <exception cref="NotSupportedException">Not Supported feature</exception>
559         /// <exception cref="InvalidOperationException">Invalid operation</exception>
560         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
561         /// <since_tizen> 3 </since_tizen>
562         public static bool SoundLockEnabled
563         {
564             get
565             {
566                 bool isSoundLockEnabled;
567                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.SoundLockEnabled, out isSoundLockEnabled);
568                 if (res != SystemSettingsError.None)
569                 {
570                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundLock system setting.");
571                 }
572                 return isSoundLockEnabled;
573             }
574         }
575
576         /// <summary>
577         /// Indicates whether the device is in the silent mode.
578         /// </summary>
579         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
580         /// <privlevel>platform</privlevel>
581         /// <feature>http://tizen.org/feature/systemsetting</feature>
582         /// <exception cref="ArgumentException">Invalid Argument</exception>
583         /// <exception cref="NotSupportedException">Not Supported feature</exception>
584         /// <exception cref="InvalidOperationException">Invalid operation</exception>
585         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
586         /// <since_tizen> 3 </since_tizen>
587         public static bool SoundSilentModeEnabled
588         {
589             get
590             {
591                 bool isSilent;
592                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.SoundSilentModeEnabled, out isSilent);
593                 if (res != SystemSettingsError.None)
594                 {
595                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundSilentMode system setting.");
596                 }
597                 return isSilent;
598             }
599         }
600
601         /// <summary>
602         /// Indicates whether the screen touch sound is enabled on the device.
603         /// </summary>
604         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
605         /// <privlevel>platform</privlevel>
606         /// <feature>http://tizen.org/feature/systemsetting</feature>
607         /// <exception cref="ArgumentException">Invalid Argument</exception>
608         /// <exception cref="NotSupportedException">Not Supported feature</exception>
609         /// <exception cref="InvalidOperationException">Invalid operation</exception>
610         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
611         /// <since_tizen> 3 </since_tizen>
612         public static bool SoundTouchEnabled
613         {
614             get
615             {
616                 bool isTouchSoundEnabled;
617                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.SoundTouchEnabled, out isTouchSoundEnabled);
618                 if (res != SystemSettingsError.None)
619                 {
620                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundTouch system setting value.");
621                 }
622                 return isTouchSoundEnabled;
623             }
624         }
625
626         /// <summary>
627         /// Indicates whether the rotation control is automatic.
628         /// </summary>
629         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
630         /// <privlevel>platform</privlevel>
631         /// <feature>http://tizen.org/feature/systemsetting</feature>
632         /// <exception cref="ArgumentException">Invalid Argument</exception>
633         /// <exception cref="NotSupportedException">Not Supported feature</exception>
634         /// <exception cref="InvalidOperationException">Invalid operation</exception>
635         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
636         /// <since_tizen> 3 </since_tizen>
637         public static bool DisplayScreenRotationAutoEnabled
638         {
639             get
640             {
641                 bool isRotationAutomatic;
642                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.DisplayScreenRotationAutoEnabled, out isRotationAutomatic);
643                 if (res != SystemSettingsError.None)
644                 {
645                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get DisplayScreenRotationAuto system setting.");
646                 }
647                 return isRotationAutomatic;
648             }
649         }
650
651         /// <summary>
652         /// Indicates the device name.
653         /// </summary>
654         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
655         /// <privlevel>platform</privlevel>
656         /// <feature>http://tizen.org/feature/systemsetting</feature>
657         /// <exception cref="ArgumentException">Invalid Argument</exception>
658         /// <exception cref="NotSupportedException">Not Supported feature</exception>
659         /// <exception cref="InvalidOperationException">Invalid operation</exception>
660         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
661         /// <since_tizen> 3 </since_tizen>
662         public static string DeviceName
663         {
664             get
665             {
666                 string deviceName;
667                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.DeviceName, out deviceName);
668                 if (res != SystemSettingsError.None)
669                 {
670                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get DeviceName system setting value.");
671                 }
672                 return deviceName;
673             }
674         }
675         /// <summary>
676         /// Indicates whether the device user has enabled the motion feature.
677         /// </summary>
678         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
679         /// <privlevel>platform</privlevel>
680         /// <feature>http://tizen.org/feature/systemsetting</feature>
681         /// <exception cref="ArgumentException">Invalid Argument</exception>
682         /// <exception cref="NotSupportedException">Not Supported feature</exception>
683         /// <exception cref="InvalidOperationException">Invalid operation</exception>
684         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
685         /// <since_tizen> 3 </since_tizen>
686         public static bool MotionEnabled
687         {
688             get
689             {
690                 bool isMotionEnabled;
691                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.MotionEnabled, out isMotionEnabled);
692                 if (res != SystemSettingsError.None)
693                 {
694                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get MotionEnabled system setting value.");
695                 }
696                 return isMotionEnabled;
697             }
698         }
699
700         /// <summary>
701         /// Indicates whether Wi-Fi related notifications are enabled on the device.
702         /// </summary>
703         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
704         /// <privlevel>platform</privlevel>
705         /// <feature>http://tizen.org/feature/systemsetting</feature>
706         /// <feature>http://tizen.org/feature/network.wifi</feature>
707         /// <exception cref="ArgumentException">Invalid Argument</exception>
708         /// <exception cref="NotSupportedException">Not Supported feature</exception>
709         /// <exception cref="InvalidOperationException">Invalid operation</exception>
710         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
711         /// <since_tizen> 3 </since_tizen>
712         public static bool NetworkWifiNotificationEnabled
713         {
714             get
715             {
716                 bool isWifiNotificationEnabled;
717                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.NetworkWifiNotificationEnabled, out isWifiNotificationEnabled);
718                 if (res != SystemSettingsError.None)
719                 {
720                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get NetworkWifiNotification system setting.");
721                 }
722                 return isWifiNotificationEnabled;
723             }
724         }
725
726         /// <summary>
727         /// Indicates whether the device is in the flight mode.
728         /// </summary>
729         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
730         /// <privlevel>platform</privlevel>
731         /// <feature>http://tizen.org/feature/systemsetting</feature>
732         /// <exception cref="ArgumentException">Invalid Argument</exception>
733         /// <exception cref="NotSupportedException">Not Supported feature</exception>
734         /// <exception cref="InvalidOperationException">Invalid operation</exception>
735         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
736         /// <since_tizen> 3 </since_tizen>
737         public static bool NetworkFlightModeEnabled
738         {
739             get
740             {
741                 bool isFlightModeEnabled;
742                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.NetworkFlightModeEnabled, out isFlightModeEnabled);
743                 if (res != SystemSettingsError.None)
744                 {
745                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get NetworkFlightMode system setting.");
746                 }
747                 return isFlightModeEnabled;
748             }
749         }
750
751         /// <summary>
752         /// Indicates the backlight time (in seconds). The following values can be used: 15, 30, 60, 120, 300, and 600.
753         /// </summary>
754         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
755         /// <privlevel>platform</privlevel>
756         /// <feature>http://tizen.org/feature/systemsetting</feature>
757         /// <exception cref="ArgumentException">Invalid Argument</exception>
758         /// <exception cref="NotSupportedException">Not Supported feature</exception>
759         /// <exception cref="InvalidOperationException">Invalid operation</exception>
760         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
761         /// <since_tizen> 3 </since_tizen>
762         public static int ScreenBacklightTime
763         {
764             get
765             {
766                 int backlightTime;
767                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.ScreenBacklightTime, out backlightTime);
768                 if (res != SystemSettingsError.None)
769                 {
770                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get ScreenBacklightTime system setting.");
771                 }
772                 return backlightTime;
773             }
774             set
775             {
776                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.ScreenBacklightTime, value);
777                 if (res != SystemSettingsError.None)
778                 {
779                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set ScreenBacklightTime system setting.");
780                 }
781             }
782         }
783
784         /// <summary>
785         /// Indicates the file path of the current notification tone set by the user.
786         /// </summary>
787         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
788         /// <privlevel>platform</privlevel>
789         /// <feature>http://tizen.org/feature/systemsetting</feature>
790         /// <feature>http://tizen.org/feature/systemsetting.incoming_call</feature>
791         /// <exception cref="ArgumentException">Invalid Argument</exception>
792         /// <exception cref="NotSupportedException">Not Supported feature</exception>
793         /// <exception cref="InvalidOperationException">Invalid operation</exception>
794         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
795         /// <since_tizen> 3 </since_tizen>
796         public static string SoundNotification
797         {
798             get
799             {
800                 string filePath;
801                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.SoundNotification, out filePath);
802                 if (res != SystemSettingsError.None)
803                 {
804                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundNotification system setting.");
805                 }
806                 return filePath;
807             }
808             set
809             {
810                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.SoundNotification, value);
811                 if (res != SystemSettingsError.None)
812                 {
813                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set SoundNotification system setting.");
814                 }
815             }
816         }
817
818         /// <summary>
819         /// Indicates the time period for notification repetitions.
820         /// </summary>
821         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
822         /// <privlevel>platform</privlevel>
823         /// <feature>http://tizen.org/feature/systemsetting</feature>
824         /// <exception cref="ArgumentException">Invalid Argument</exception>
825         /// <exception cref="NotSupportedException">Not Supported feature</exception>
826         /// <exception cref="InvalidOperationException">Invalid operation</exception>
827         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
828         /// <since_tizen> 3 </since_tizen>
829         public static int SoundNotificationRepetitionPeriod
830         {
831             get
832             {
833                 int notificationRepetitionPeriod;
834                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.SoundNotificationRepetitionPeriod, out notificationRepetitionPeriod);
835                 if (res != SystemSettingsError.None)
836                 {
837                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundNotificationRepetitionPeriod system setting.");
838                 }
839                 return notificationRepetitionPeriod;
840             }
841             set
842             {
843                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.SoundNotificationRepetitionPeriod, value);
844                 if (res != SystemSettingsError.None)
845                 {
846                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set SoundNotificationRepetitionPeriod system setting.");
847                 }
848             }
849         }
850
851         /// <summary>
852         /// Indicates the current lock state.
853         /// </summary>
854         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
855         /// <privlevel>platform</privlevel>
856         /// <feature>http://tizen.org/feature/systemsetting</feature>
857         /// <exception cref="ArgumentException">Invalid Argument</exception>
858         /// <exception cref="NotSupportedException">Not Supported feature</exception>
859         /// <exception cref="InvalidOperationException">Invalid operation</exception>
860         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
861         /// <since_tizen> 3 </since_tizen>
862         public static SystemSettingsIdleLockState LockState
863         {
864             get
865             {
866                 int LockState;
867                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.LockState, out LockState);
868                 if (res != SystemSettingsError.None)
869                 {
870                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LockState system setting.");
871                 }
872                 return (SystemSettingsIdleLockState)LockState;
873             }
874             set
875             {
876                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.LockState, (int)value);
877                 if (res != SystemSettingsError.None)
878                 {
879                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LockState system setting.");
880                 }
881             }
882         }
883
884         /// <summary>
885         /// The current system ADS ID.
886         /// </summary>
887         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
888         /// <privlevel>platform</privlevel>
889         /// <feature>http://tizen.org/feature/systemsetting</feature>
890         /// <exception cref="ArgumentException">Invalid Argument</exception>
891         /// <exception cref="NotSupportedException">Not Supported feature</exception>
892         /// <exception cref="InvalidOperationException">Invalid operation</exception>
893         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
894         /// <since_tizen> 3 </since_tizen>
895         public static string AdsId
896         {
897             get
898             {
899                 string adsId;
900                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.AdsId, out adsId);
901                 if (res != SystemSettingsError.None)
902                 {
903                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get AdsId system setting.");
904                 }
905                 return adsId;
906             }
907             set
908             {
909                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.AdsId, value);
910                 if (res != SystemSettingsError.None)
911                 {
912                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to set AdsId system setting.");
913                 }
914             }
915         }
916
917
918         /// <summary>
919         /// Indicates the time period for notification repetitions.
920         /// </summary>
921         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
922         /// <privlevel>platform</privlevel>
923         /// <feature>http://tizen.org/feature/systemsetting</feature>
924         /// <feature>http://tizen.org/feature/network.telephony</feature>
925         /// <exception cref="ArgumentException">Invalid Argument</exception>
926         /// <exception cref="NotSupportedException">Not Supported feature</exception>
927         /// <exception cref="InvalidOperationException">Invalid operation</exception>
928         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
929         /// <since_tizen> 3 </since_tizen>
930         public static SystemSettingsUdsState UltraDataSave
931         {
932             get
933             {
934                 int UltraDataSave;
935                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.UltraDataSave, out UltraDataSave);
936                 if (res != SystemSettingsError.None)
937                 {
938                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get UltraDataSave system setting.");
939                 }
940                 return (SystemSettingsUdsState)UltraDataSave;
941             }
942         }
943
944         /// <summary>
945         /// Indicates whether the accessibility TTS is enabled on the device.
946         /// </summary>
947         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
948         /// <privlevel>platform</privlevel>
949         /// <feature>http://tizen.org/feature/systemsetting</feature>
950         /// <exception cref="ArgumentException">Invalid Argument</exception>
951         /// <exception cref="NotSupportedException">Not Supported feature</exception>
952         /// <exception cref="InvalidOperationException">Invalid operation</exception>
953         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
954         /// <since_tizen> 4 </since_tizen>
955         public static bool AccessibilityTtsEnabled
956         {
957             get
958             {
959                 bool isAccessibilityTTSEnabled;
960                 SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.AccessibilityTtsEnabled, out isAccessibilityTTSEnabled);
961                 if (res != SystemSettingsError.None)
962                 {
963                     throw SystemSettingsExceptionFactory.CreateException(res, "unable to get AccessibilityTTS system setting value.");
964                 }
965                 return isAccessibilityTTSEnabled;
966             }
967         }
968
969
970         private static readonly Interop.Settings.SystemSettingsChangedCallback s_incomingCallRingtoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
971         {
972             string path = SystemSettings.IncomingCallRingtone;
973             IncomingCallRingtoneChangedEventArgs eventArgs = new IncomingCallRingtoneChangedEventArgs(path);
974             s_incomingCallRingtoneChanged?.Invoke(null, eventArgs);
975         };
976         private static event EventHandler<IncomingCallRingtoneChangedEventArgs> s_incomingCallRingtoneChanged;
977         /// <summary>
978         /// The IncomingCallRingtoneChanged event is triggered when the file path of the incoming ringtone is changed.
979         /// </summary>
980         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
981         /// <privlevel>platform</privlevel>
982         /// <feature>http://tizen.org/feature/systemsetting</feature>
983         /// <feature>http://tizen.org/feature/systemsetting.incoming_call</feature>
984         /// <exception cref="ArgumentException">Invalid Argument</exception>
985         /// <exception cref="NotSupportedException">Not Supported feature</exception>
986         /// <exception cref="InvalidOperationException">Invalid operation</exception>
987         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
988         /// <since_tizen> 3 </since_tizen>
989         public static event EventHandler<IncomingCallRingtoneChangedEventArgs> IncomingCallRingtoneChanged
990         {
991             add
992             {
993                 if (s_incomingCallRingtoneChanged == null)
994                 {
995                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.IncomingCallRingtone, s_incomingCallRingtoneChangedCallback, IntPtr.Zero);
996                     if (ret != SystemSettingsError.None)
997                     {
998                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
999                     }
1000                 }
1001                 s_incomingCallRingtoneChanged += value;
1002             }
1003
1004             remove
1005             {
1006                 if (s_incomingCallRingtoneChanged == null)
1007                     return;
1008
1009                 s_incomingCallRingtoneChanged -= value;
1010                 if (s_incomingCallRingtoneChanged == null)
1011                 {
1012                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.IncomingCallRingtone, s_incomingCallRingtoneChangedCallback);
1013                     if (ret != SystemSettingsError.None)
1014                     {
1015                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1016                     }
1017                 }
1018             }
1019         }
1020
1021         private static readonly Interop.Settings.SystemSettingsChangedCallback s_wallpaperHomeScreenChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1022         {
1023             string path = SystemSettings.WallpaperHomeScreen;
1024             WallpaperHomeScreenChangedEventArgs eventArgs = new WallpaperHomeScreenChangedEventArgs(path);
1025             s_wallpaperHomeScreenChanged?.Invoke(null, eventArgs);
1026         };
1027         private static event EventHandler<WallpaperHomeScreenChangedEventArgs> s_wallpaperHomeScreenChanged;
1028         /// <summary>
1029         /// THe WallpaperHomeScreenChanged event is triggered when the file path of the current home screen wallpaper is changed.
1030         /// </summary>
1031         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1032         /// <privlevel>platform</privlevel>
1033         /// <feature>http://tizen.org/feature/systemsetting</feature>
1034         /// <feature>http://tizen.org/feature/systemsetting.home_screen</feature>
1035         /// <exception cref="ArgumentException">Invalid Argument</exception>
1036         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1037         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1038         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1039         /// <since_tizen> 3 </since_tizen>
1040         public static event EventHandler<WallpaperHomeScreenChangedEventArgs> WallpaperHomeScreenChanged
1041         {
1042             add
1043             {
1044                 if (s_wallpaperHomeScreenChanged == null)
1045                 {
1046                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.WallpaperHomeScreen, s_wallpaperHomeScreenChangedCallback, IntPtr.Zero);
1047                     if (ret != SystemSettingsError.None)
1048                     {
1049                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1050                     }
1051                 }
1052                 s_wallpaperHomeScreenChanged += value;
1053             }
1054
1055             remove
1056             {
1057                 if (s_wallpaperHomeScreenChanged == null)
1058                     return;
1059
1060                 s_wallpaperHomeScreenChanged -= value;
1061                 if (s_wallpaperHomeScreenChanged == null)
1062                 {
1063                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.WallpaperHomeScreen, s_wallpaperHomeScreenChangedCallback);
1064                     if (ret != SystemSettingsError.None)
1065                     {
1066                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1067                     }
1068                 }
1069             }
1070         }
1071
1072         private static readonly Interop.Settings.SystemSettingsChangedCallback s_wallpaperLockScreenChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1073         {
1074             string path = SystemSettings.WallpaperLockScreen;
1075             WallpaperLockScreenChangedEventArgs eventArgs = new WallpaperLockScreenChangedEventArgs(path);
1076             s_wallpaperLockScreenChanged?.Invoke(null, eventArgs);
1077         };
1078         private static event EventHandler<WallpaperLockScreenChangedEventArgs> s_wallpaperLockScreenChanged;
1079         /// <summary>
1080         /// The WallpaperLockScreenChanged event is triggered when the file path of the current lock screen wallpaper is changed.
1081         /// </summary>
1082         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1083         /// <privlevel>platform</privlevel>
1084         /// <feature>http://tizen.org/feature/systemsetting</feature>
1085         /// <feature>http://tizen.org/feature/systemsetting.lock_screen</feature>
1086         /// <exception cref="ArgumentException">Invalid Argument</exception>
1087         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1088         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1089         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1090         /// <since_tizen> 3 </since_tizen>
1091         public static event EventHandler<WallpaperLockScreenChangedEventArgs> WallpaperLockScreenChanged
1092         {
1093             add
1094             {
1095                 if (s_wallpaperLockScreenChanged == null)
1096                 {
1097                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.WallpaperLockScreen, s_wallpaperLockScreenChangedCallback, IntPtr.Zero);
1098                     if (ret != SystemSettingsError.None)
1099                     {
1100                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1101                     }
1102                 }
1103                 s_wallpaperLockScreenChanged += value;
1104             }
1105
1106             remove
1107             {
1108                 if (s_wallpaperLockScreenChanged == null)
1109                     return;
1110
1111                 s_wallpaperLockScreenChanged -= value;
1112                 if (s_wallpaperLockScreenChanged == null)
1113                 {
1114                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.WallpaperLockScreen, s_wallpaperLockScreenChangedCallback);
1115                     if (ret != SystemSettingsError.None)
1116                     {
1117                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1118                     }
1119                 }
1120             }
1121         }
1122
1123         private static readonly Interop.Settings.SystemSettingsChangedCallback s_fontSizeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1124         {
1125             SystemSettingsFontSize fontSize = SystemSettings.FontSize;
1126             FontSizeChangedEventArgs eventArgs = new FontSizeChangedEventArgs(fontSize);
1127             s_fontSizeChanged?.Invoke(null, eventArgs);
1128         };
1129         private static event EventHandler<FontSizeChangedEventArgs> s_fontSizeChanged;
1130         /// <summary>
1131         /// The FontSizeChanged event is triggered when the current system font size is changed.
1132         /// </summary>
1133         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1134         /// <privlevel>platform</privlevel>
1135         /// <feature>http://tizen.org/feature/systemsetting</feature>
1136         /// <exception cref="ArgumentException">Invalid Argument</exception>
1137         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1138         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1139         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1140         /// <since_tizen> 3 </since_tizen>
1141         public static event EventHandler<FontSizeChangedEventArgs> FontSizeChanged
1142         {
1143             add
1144             {
1145                 if (s_fontSizeChanged == null)
1146                 {
1147                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.FontSize, s_fontSizeChangedCallback, IntPtr.Zero);
1148                     if (ret != SystemSettingsError.None)
1149                     {
1150                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1151                     }
1152                 }
1153                 s_fontSizeChanged += value;
1154             }
1155
1156             remove
1157             {
1158                 if (s_fontSizeChanged == null)
1159                     return;
1160
1161                 s_fontSizeChanged -= value;
1162                 if (s_fontSizeChanged == null)
1163                 {
1164                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.FontSize, s_fontSizeChangedCallback);
1165                     if (ret != SystemSettingsError.None)
1166                     {
1167                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1168                     }
1169                 }
1170             }
1171         }
1172
1173         private static readonly Interop.Settings.SystemSettingsChangedCallback s_fontTypeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1174         {
1175             string fontType = SystemSettings.FontType;
1176             FontTypeChangedEventArgs eventArgs = new FontTypeChangedEventArgs(fontType);
1177             s_fontTypeChanged?.Invoke(null, eventArgs);
1178         };
1179         private static event EventHandler<FontTypeChangedEventArgs> s_fontTypeChanged;
1180         /// <summary>
1181         /// The FontTypeChanged event is triggered when the current system font type is changed.
1182         /// </summary>
1183         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1184         /// <privlevel>platform</privlevel>
1185         /// <feature>http://tizen.org/feature/systemsetting</feature>
1186         /// <exception cref="ArgumentException">Invalid Argument</exception>
1187         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1188         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1189         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1190         /// <since_tizen> 3 </since_tizen>
1191         public static event EventHandler<FontTypeChangedEventArgs> FontTypeChanged
1192         {
1193             add
1194             {
1195                 if (s_fontTypeChanged == null)
1196                 {
1197                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.FontType, s_fontTypeChangedCallback, IntPtr.Zero);
1198                     if (ret != SystemSettingsError.None)
1199                     {
1200                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1201                     }
1202                 }
1203                 s_fontTypeChanged += value;
1204             }
1205
1206             remove
1207             {
1208                 if (s_fontTypeChanged == null)
1209                     return;
1210
1211                 s_fontTypeChanged -= value;
1212                 if (s_fontTypeChanged == null)
1213                 {
1214                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.FontType, s_fontTypeChangedCallback);
1215                     if (ret != SystemSettingsError.None)
1216                     {
1217                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1218                     }
1219                 }
1220             }
1221         }
1222
1223         private static readonly Interop.Settings.SystemSettingsChangedCallback s_motionActivationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1224         {
1225             bool motionActivation = SystemSettings.MotionActivationEnabled;
1226             MotionActivationSettingChangedEventArgs eventArgs = new MotionActivationSettingChangedEventArgs(motionActivation);
1227             s_motionActivationChanged?.Invoke(null, eventArgs);
1228         };
1229         private static event EventHandler<MotionActivationSettingChangedEventArgs> s_motionActivationChanged;
1230         /// <summary>
1231         /// The MotionActivationChanged event is triggered when the motion service status is changed.
1232         /// </summary>
1233         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1234         /// <privlevel>platform</privlevel>
1235         /// <feature>http://tizen.org/feature/systemsetting</feature>
1236         /// <exception cref="ArgumentException">Invalid Argument</exception>
1237         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1238         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1239         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1240         /// <since_tizen> 3 </since_tizen>
1241         public static event EventHandler<MotionActivationSettingChangedEventArgs> MotionActivationSettingChanged
1242         {
1243             add
1244             {
1245                 if (s_motionActivationChanged == null)
1246                 {
1247                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.MotionActivationEnabled, s_motionActivationChangedCallback, IntPtr.Zero);
1248                     if (ret != SystemSettingsError.None)
1249                     {
1250                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1251                     }
1252                 }
1253                 s_motionActivationChanged += value;
1254             }
1255
1256             remove
1257             {
1258                 if (s_motionActivationChanged == null)
1259                     return;
1260
1261                 s_motionActivationChanged -= value;
1262                 if (s_motionActivationChanged == null)
1263                 {
1264                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.MotionActivationEnabled, s_motionActivationChangedCallback);
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_emailAlertRingtoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1274         {
1275             string emailAlertRingtone = SystemSettings.EmailAlertRingtone;
1276             EmailAlertRingtoneChangedEventArgs eventArgs = new EmailAlertRingtoneChangedEventArgs(emailAlertRingtone);
1277             s_emailAlertRingtoneChanged?.Invoke(null, eventArgs);
1278         };
1279         private static event EventHandler<EmailAlertRingtoneChangedEventArgs> s_emailAlertRingtoneChanged;
1280         /// <summary>
1281         /// The EmailAlertRingtoneChanged event is triggered when the file path of the current email alert ringtone is changed.
1282         /// </summary>
1283         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1284         /// <privlevel>platform</privlevel>
1285         /// <feature>http://tizen.org/feature/systemsetting</feature>
1286         /// <feature>http://tizen.org/feature/systemsetting.notification_email</feature>
1287         /// <exception cref="ArgumentException">Invalid Argument</exception>
1288         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1289         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1290         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1291         /// <since_tizen> 3 </since_tizen>
1292         public static event EventHandler<EmailAlertRingtoneChangedEventArgs> EmailAlertRingtoneChanged
1293         {
1294             add
1295             {
1296                 if (s_emailAlertRingtoneChanged == null)
1297                 {
1298                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.EmailAlertRingtone, s_emailAlertRingtoneChangedCallback, IntPtr.Zero);
1299                     if (ret != SystemSettingsError.None)
1300                     {
1301                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1302                     }
1303                 }
1304                 s_emailAlertRingtoneChanged += value;
1305             }
1306
1307             remove
1308             {
1309                 if (s_emailAlertRingtoneChanged == null)
1310                     return;
1311
1312                 s_emailAlertRingtoneChanged -= value;
1313                 if (s_emailAlertRingtoneChanged == null)
1314                 {
1315                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.EmailAlertRingtone, s_emailAlertRingtoneChangedCallback);
1316                     if (ret != SystemSettingsError.None)
1317                     {
1318                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1319                     }
1320                 }
1321             }
1322         }
1323
1324         private static readonly Interop.Settings.SystemSettingsChangedCallback s_usbDebuggingSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1325         {
1326             bool usbDebuggingEnabled = SystemSettings.UsbDebuggingEnabled;
1327             UsbDebuggingSettingChangedEventArgs eventArgs = new UsbDebuggingSettingChangedEventArgs(usbDebuggingEnabled);
1328             s_usbDebuggingSettingChanged?.Invoke(null, eventArgs);
1329         };
1330         private static event EventHandler<UsbDebuggingSettingChangedEventArgs> s_usbDebuggingSettingChanged;
1331         /// <summary>
1332         /// The UsbDebuggingSettingChangedEventArgs event is triggered when the USB debugging status is changed.
1333         /// </summary>
1334         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1335         /// <privlevel>platform</privlevel>
1336         /// <feature>http://tizen.org/feature/systemsetting</feature>
1337         /// <exception cref="ArgumentException">Invalid Argument</exception>
1338         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1339         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1340         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1341         /// <since_tizen> 3 </since_tizen>
1342         public static event EventHandler<UsbDebuggingSettingChangedEventArgs> UsbDebuggingSettingChanged
1343         {
1344             add
1345             {
1346                 if (s_usbDebuggingSettingChanged == null)
1347                 {
1348                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UsbDebuggingEnabled, s_usbDebuggingSettingChangedCallback, IntPtr.Zero);
1349                     if (ret != SystemSettingsError.None)
1350                     {
1351                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1352                     }
1353                 }
1354                 s_usbDebuggingSettingChanged += value;
1355             }
1356
1357             remove
1358             {
1359                 if (s_usbDebuggingSettingChanged == null)
1360                     return;
1361
1362                 s_usbDebuggingSettingChanged -= value;
1363                 if (s_usbDebuggingSettingChanged == null)
1364                 {
1365                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UsbDebuggingEnabled, s_usbDebuggingSettingChangedCallback);
1366                     if (ret != SystemSettingsError.None)
1367                     {
1368                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1369                     }
1370                 }
1371             }
1372         }
1373
1374         private static readonly Interop.Settings.SystemSettingsChangedCallback s_data3GNetworkSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1375         {
1376             bool data3GEnabled = SystemSettings.Data3GNetworkEnabled;
1377             Data3GNetworkSettingChangedEventArgs eventArgs = new Data3GNetworkSettingChangedEventArgs(data3GEnabled);
1378             s_data3GNetworkSettingChanged?.Invoke(null, eventArgs);
1379         };
1380         private static event EventHandler<Data3GNetworkSettingChangedEventArgs> s_data3GNetworkSettingChanged;
1381         /// <summary>
1382         /// The Data3GNetworkSettingChanged event is triggered when the 3G data network status is changed.
1383         /// </summary>
1384         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1385         /// <privlevel>platform</privlevel>
1386         /// <feature>http://tizen.org/feature/systemsetting</feature>
1387         /// <exception cref="ArgumentException">Invalid Argument</exception>
1388         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1389         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1390         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1391         /// <since_tizen> 3 </since_tizen>
1392         public static event EventHandler<Data3GNetworkSettingChangedEventArgs> Data3GNetworkSettingChanged
1393         {
1394             add
1395             {
1396                 if (s_data3GNetworkSettingChanged == null)
1397                 {
1398                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.Data3GNetworkEnabled, s_data3GNetworkSettingChangedCallback, IntPtr.Zero);
1399                     if (ret != SystemSettingsError.None)
1400                     {
1401                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1402                     }
1403                 }
1404                 s_data3GNetworkSettingChanged += value;
1405             }
1406
1407             remove
1408             {
1409                 if (s_data3GNetworkSettingChanged == null)
1410                     return;
1411
1412                 s_data3GNetworkSettingChanged -= value;
1413                 if (s_data3GNetworkSettingChanged == null)
1414                 {
1415                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.Data3GNetworkEnabled, s_data3GNetworkSettingChangedCallback);
1416                     if (ret != SystemSettingsError.None)
1417                     {
1418                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1419                     }
1420                 }
1421             }
1422         }
1423
1424         private static readonly Interop.Settings.SystemSettingsChangedCallback s_lockscreenAppChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1425         {
1426             string lockScreenApp = SystemSettings.LockScreenApp;
1427             LockScreenAppChangedEventArgs eventArgs = new LockScreenAppChangedEventArgs(lockScreenApp);
1428             s_lockscreenAppChanged?.Invoke(null, eventArgs);
1429         };
1430         private static event EventHandler<LockScreenAppChangedEventArgs> s_lockscreenAppChanged;
1431         /// <summary>
1432         /// The LockScreenAppChanged event is triggered when the lockscreen application package name is changed.
1433         /// </summary>
1434         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1435         /// <privlevel>platform</privlevel>
1436         /// <feature>http://tizen.org/feature/systemsetting</feature>
1437         /// <feature>http://tizen.org/feature/systemsetting.lock_screen</feature>
1438         /// <exception cref="ArgumentException">Invalid Argument</exception>
1439         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1440         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1441         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1442         /// <since_tizen> 4 </since_tizen>
1443         public static event EventHandler<LockScreenAppChangedEventArgs> LockScreenAppChanged
1444         {
1445             add
1446             {
1447                 if (s_lockscreenAppChanged == null)
1448                 {
1449                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LockScreenApp, s_lockscreenAppChangedCallback, IntPtr.Zero);
1450                     if (ret != SystemSettingsError.None)
1451                     {
1452                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1453                     }
1454                 }
1455                 s_lockscreenAppChanged += value;
1456             }
1457
1458             remove
1459             {
1460                 if (s_lockscreenAppChanged == null)
1461                     return;
1462
1463                 s_lockscreenAppChanged -= value;
1464                 if (s_lockscreenAppChanged == null)
1465                 {
1466                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LockScreenApp, s_lockscreenAppChangedCallback);
1467                     if (ret != SystemSettingsError.None)
1468                     {
1469                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1470                     }
1471                 }
1472             }
1473         }
1474
1475         private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeCountryChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1476         {
1477             string localeCountry = SystemSettings.LocaleCountry;
1478             LocaleCountryChangedEventArgs eventArgs = new LocaleCountryChangedEventArgs(localeCountry);
1479             s_localeCountryChanged?.Invoke(null, eventArgs);
1480         };
1481         private static event EventHandler<LocaleCountryChangedEventArgs> s_localeCountryChanged;
1482         /// <summary>
1483         /// The LocaleCountryChanged event is triggered when the current country setting in the &lt;LANGUAGE&gt;_&lt;REGION&gt; syntax, is changed.
1484         /// </summary>
1485         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1486         /// <privlevel>platform</privlevel>
1487         /// <feature>http://tizen.org/feature/systemsetting</feature>
1488         /// <exception cref="ArgumentException">Invalid Argument</exception>
1489         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1490         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1491         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1492         /// <since_tizen> 3 </since_tizen>
1493         public static event EventHandler<LocaleCountryChangedEventArgs> LocaleCountryChanged
1494         {
1495             add
1496             {
1497                 if (s_localeCountryChanged == null)
1498                 {
1499                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleCountry, s_localeCountryChangedCallback, IntPtr.Zero);
1500                     if (ret != SystemSettingsError.None)
1501                     {
1502                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1503                     }
1504                 }
1505                 s_localeCountryChanged += value;
1506             }
1507
1508             remove
1509             {
1510                 if (s_localeCountryChanged == null)
1511                     return;
1512
1513                 s_localeCountryChanged -= value;
1514                 if (s_localeCountryChanged == null)
1515                 {
1516                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleCountry, s_localeCountryChangedCallback);
1517                     if (ret != SystemSettingsError.None)
1518                     {
1519                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1520                     }
1521                 }
1522             }
1523         }
1524
1525         private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeLanguageChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1526         {
1527             string localeLanguage = SystemSettings.LocaleLanguage;
1528             LocaleLanguageChangedEventArgs eventArgs = new LocaleLanguageChangedEventArgs(localeLanguage);
1529             s_localeLanguageChanged?.Invoke(null, eventArgs);
1530         };
1531         private static event EventHandler<LocaleLanguageChangedEventArgs> s_localeLanguageChanged;
1532         /// <summary>
1533         /// The LocaleLanguageChanged event is triggered when the current language setting in the &lt;LANGUAGE&gt;_&lt;REGION&gt; syntax, is changed.
1534         /// </summary>
1535         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1536         /// <privlevel>platform</privlevel>
1537         /// <feature>http://tizen.org/feature/systemsetting</feature>
1538         /// <exception cref="ArgumentException">Invalid Argument</exception>
1539         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1540         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1541         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1542         /// <since_tizen> 3 </since_tizen>
1543         public static event EventHandler<LocaleLanguageChangedEventArgs> LocaleLanguageChanged
1544         {
1545             add
1546             {
1547                 if (s_localeLanguageChanged == null)
1548                 {
1549                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleLanguage, s_localeLanguageChangedCallback, IntPtr.Zero);
1550                     if (ret != SystemSettingsError.None)
1551                     {
1552                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1553                     }
1554                 }
1555                 s_localeLanguageChanged += value;
1556             }
1557
1558             remove
1559             {
1560                 if (s_localeLanguageChanged == null)
1561                     return;
1562
1563                 s_localeLanguageChanged -= value;
1564                 if (s_localeLanguageChanged == null)
1565                 {
1566                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleLanguage, s_localeLanguageChangedCallback);
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_localeTimeFormat24HourChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1576         {
1577             bool localeTimeFormat24Hour = SystemSettings.LocaleTimeFormat24HourEnabled;
1578             LocaleTimeFormat24HourSettingChangedEventArgs eventArgs = new LocaleTimeFormat24HourSettingChangedEventArgs(localeTimeFormat24Hour);
1579             s_localeTimeFormat24HourChanged?.Invoke(null, eventArgs);
1580         };
1581         private static event EventHandler<LocaleTimeFormat24HourSettingChangedEventArgs> s_localeTimeFormat24HourChanged;
1582         /// <summary>
1583         /// The LocaleTimeFormat24HourChanged event is triggered when the time format is changed.
1584         /// </summary>
1585         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1586         /// <privlevel>platform</privlevel>
1587         /// <feature>http://tizen.org/feature/systemsetting</feature>
1588         /// <exception cref="ArgumentException">Invalid Argument</exception>
1589         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1590         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1591         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1592         /// <since_tizen> 3 </since_tizen>
1593         public static event EventHandler<LocaleTimeFormat24HourSettingChangedEventArgs> LocaleTimeFormat24HourSettingChanged
1594         {
1595             add
1596             {
1597                 if (s_localeTimeFormat24HourChanged == null)
1598                 {
1599                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, s_localeTimeFormat24HourChangedCallback, IntPtr.Zero);
1600                     if (ret != SystemSettingsError.None)
1601                     {
1602                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1603                     }
1604                 }
1605                 s_localeTimeFormat24HourChanged += value;
1606             }
1607
1608             remove
1609             {
1610                 if (s_localeTimeFormat24HourChanged == null)
1611                     return;
1612
1613                 s_localeTimeFormat24HourChanged -= value;
1614                 if (s_localeTimeFormat24HourChanged == null)
1615                 {
1616                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, s_localeTimeFormat24HourChangedCallback);
1617                     if (ret != SystemSettingsError.None)
1618                     {
1619                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1620                     }
1621                 }
1622             }
1623         }
1624
1625         private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeTimeZoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1626         {
1627             string localeTimeZone = SystemSettings.LocaleTimeZone;
1628             LocaleTimeZoneChangedEventArgs eventArgs = new LocaleTimeZoneChangedEventArgs(localeTimeZone);
1629             s_localeTimeZoneChanged?.Invoke(null, eventArgs);
1630         };
1631         private static event EventHandler<LocaleTimeZoneChangedEventArgs> s_localeTimeZoneChanged;
1632         /// <summary>
1633         /// The LocaleTimeZoneChanged event is triggered when the current time zone is changed.
1634         /// </summary>
1635         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1636         /// <privlevel>platform</privlevel>
1637         /// <feature>http://tizen.org/feature/systemsetting</feature>
1638         /// <exception cref="ArgumentException">Invalid Argument</exception>
1639         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1640         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1641         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1642         /// <since_tizen> 3 </since_tizen>
1643         public static event EventHandler<LocaleTimeZoneChangedEventArgs> LocaleTimeZoneChanged
1644         {
1645             add
1646             {
1647                 if (s_localeTimeZoneChanged == null)
1648                 {
1649                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleTimeZone, s_localeTimeZoneChangedCallback, IntPtr.Zero);
1650                     if (ret != SystemSettingsError.None)
1651                     {
1652                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1653                     }
1654                 }
1655                 s_localeTimeZoneChanged += value;
1656             }
1657
1658             remove
1659             {
1660                 if (s_localeTimeZoneChanged == null)
1661                     return;
1662
1663                 s_localeTimeZoneChanged -= value;
1664                 if (s_localeTimeZoneChanged == null)
1665                 {
1666                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleTimeZone, s_localeTimeZoneChangedCallback);
1667                     if (ret != SystemSettingsError.None)
1668                     {
1669                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1670                     }
1671                 }
1672             }
1673         }
1674
1675         private static readonly Interop.Settings.SystemSettingsChangedCallback s_timeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1676         {
1677
1678             int time = SystemSettings.Time;
1679             TimeChangedEventArgs eventArgs = new TimeChangedEventArgs(time);
1680             s_timeChanged?.Invoke(null, eventArgs);
1681         };
1682         private static event EventHandler<TimeChangedEventArgs> s_timeChanged;
1683         /// <summary>
1684         /// The TimeChanged event is triggered when the system time is changed.
1685         /// </summary>
1686         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1687         /// <privlevel>platform</privlevel>
1688         /// <feature>http://tizen.org/feature/systemsetting</feature>
1689         /// <exception cref="ArgumentException">Invalid Argument</exception>
1690         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1691         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1692         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1693         /// <since_tizen> 3 </since_tizen>
1694         public static event EventHandler<TimeChangedEventArgs> TimeChanged
1695         {
1696             add
1697             {
1698                 if (s_timeChanged == null)
1699                 {
1700                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.Time, s_timeChangedCallback, IntPtr.Zero);
1701                     if (ret != SystemSettingsError.None)
1702                     {
1703                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1704                     }
1705                 }
1706                 s_timeChanged += value;
1707             }
1708
1709             remove
1710             {
1711                 if (s_timeChanged == null)
1712                     return;
1713
1714                 s_timeChanged -= value;
1715                 if (s_timeChanged == null)
1716                 {
1717                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.Time, s_timeChangedCallback);
1718                     if (ret != SystemSettingsError.None)
1719                     {
1720                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1721                     }
1722                 }
1723             }
1724         }
1725
1726         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundLockChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1727         {
1728             bool soundLock = SystemSettings.SoundLockEnabled;
1729             SoundLockSettingChangedEventArgs eventArgs = new SoundLockSettingChangedEventArgs(soundLock);
1730             s_soundLockChanged?.Invoke(null, eventArgs);
1731         };
1732         private static event EventHandler<SoundLockSettingChangedEventArgs> s_soundLockChanged;
1733         /// <summary>
1734         /// The SoundLockChanged event is triggered when the screen lock sound enabled status is changed.
1735         /// </summary>
1736         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1737         /// <privlevel>platform</privlevel>
1738         /// <feature>http://tizen.org/feature/systemsetting</feature>
1739         /// <exception cref="ArgumentException">Invalid Argument</exception>
1740         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1741         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1742         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1743         /// <since_tizen> 3 </since_tizen>
1744         public static event EventHandler<SoundLockSettingChangedEventArgs> SoundLockSettingChanged
1745         {
1746             add
1747             {
1748                 if (s_soundLockChanged == null)
1749                 {
1750                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundLockEnabled, s_soundLockChangedCallback, IntPtr.Zero);
1751                     if (ret != SystemSettingsError.None)
1752                     {
1753                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1754                     }
1755                 }
1756                 s_soundLockChanged += value;
1757             }
1758
1759             remove
1760             {
1761                 if (s_soundLockChanged == null)
1762                     return;
1763
1764                 s_soundLockChanged -= value;
1765                 if (s_soundLockChanged == null)
1766                 {
1767                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundLockEnabled, s_soundLockChangedCallback);
1768                     if (ret != SystemSettingsError.None)
1769                     {
1770                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1771                     }
1772                 }
1773             }
1774         }
1775
1776         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundSilentModeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1777         {
1778             bool soundSilentMode = SystemSettings.SoundSilentModeEnabled;
1779             SoundSilentModeSettingChangedEventArgs eventArgs = new SoundSilentModeSettingChangedEventArgs(soundSilentMode);
1780             s_soundSilentModeChanged?.Invoke(null, eventArgs);
1781         };
1782         private static event EventHandler<SoundSilentModeSettingChangedEventArgs> s_soundSilentModeChanged;
1783         /// <summary>
1784         /// The SoundSilentModeChanged event is triggered when the silent mode status is changed.
1785         /// </summary>
1786         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1787         /// <privlevel>platform</privlevel>
1788         /// <feature>http://tizen.org/feature/systemsetting</feature>
1789         /// <exception cref="ArgumentException">Invalid Argument</exception>
1790         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1791         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1792         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1793         /// <since_tizen> 3 </since_tizen>
1794         public static event EventHandler<SoundSilentModeSettingChangedEventArgs> SoundSilentModeSettingChanged
1795         {
1796             add
1797             {
1798                 if (s_soundSilentModeChanged == null)
1799                 {
1800                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundSilentModeEnabled, s_soundSilentModeChangedCallback, IntPtr.Zero);
1801                     if (ret != SystemSettingsError.None)
1802                     {
1803                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1804                     }
1805                 }
1806                 s_soundSilentModeChanged += value;
1807             }
1808
1809             remove
1810             {
1811                 if (s_soundSilentModeChanged == null)
1812                     return;
1813
1814                 s_soundSilentModeChanged -= value;
1815                 if (s_soundSilentModeChanged == null)
1816                 {
1817                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundSilentModeEnabled, s_soundSilentModeChangedCallback);
1818                     if (ret != SystemSettingsError.None)
1819                     {
1820                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1821                     }
1822                 }
1823             }
1824         }
1825
1826         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundTouchChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1827         {
1828             bool soundTouch = SystemSettings.SoundTouchEnabled;
1829             SoundTouchSettingChangedEventArgs eventArgs = new SoundTouchSettingChangedEventArgs(soundTouch);
1830             s_soundTouchChanged?.Invoke(null, eventArgs);
1831         };
1832         private static event EventHandler<SoundTouchSettingChangedEventArgs> s_soundTouchChanged;
1833         /// <summary>
1834         /// THe SoundTouchChanged event is triggered when the screen touch sound enabled status is changed.
1835         /// </summary>
1836         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1837         /// <privlevel>platform</privlevel>
1838         /// <feature>http://tizen.org/feature/systemsetting</feature>
1839         /// <exception cref="ArgumentException">Invalid Argument</exception>
1840         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1841         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1842         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1843         /// <since_tizen> 3 </since_tizen>
1844         public static event EventHandler<SoundTouchSettingChangedEventArgs> SoundTouchSettingChanged
1845         {
1846             add
1847             {
1848                 if (s_soundTouchChanged == null)
1849                 {
1850                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundTouchEnabled, s_soundTouchChangedCallback, IntPtr.Zero);
1851                     if (ret != SystemSettingsError.None)
1852                     {
1853                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1854                     }
1855                 }
1856                 s_soundTouchChanged += value;
1857             }
1858
1859             remove
1860             {
1861                 if (s_soundTouchChanged == null)
1862                     return;
1863
1864                 s_soundTouchChanged -= value;
1865                 if (s_soundTouchChanged == null)
1866                 {
1867                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundTouchEnabled, s_soundTouchChangedCallback);
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_displayScreenRotationAutoChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1877         {
1878             bool displayScreenRotationAuto = SystemSettings.DisplayScreenRotationAutoEnabled;
1879             DisplayScreenRotationAutoSettingChangedEventArgs eventArgs = new DisplayScreenRotationAutoSettingChangedEventArgs(displayScreenRotationAuto);
1880             s_displayScreenRotationAutoChanged?.Invoke(null, eventArgs);
1881         };
1882         private static event EventHandler<DisplayScreenRotationAutoSettingChangedEventArgs> s_displayScreenRotationAutoChanged;
1883         /// <summary>
1884         /// The DisplayScreenRotationAutoChanged event is triggered when the automatic rotation control status is changed.
1885         /// </summary>
1886         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1887         /// <privlevel>platform</privlevel>
1888         /// <feature>http://tizen.org/feature/systemsetting</feature>
1889         /// <exception cref="ArgumentException">Invalid Argument</exception>
1890         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1891         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1892         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1893         /// <since_tizen> 3 </since_tizen>
1894         public static event EventHandler<DisplayScreenRotationAutoSettingChangedEventArgs> DisplayScreenRotationAutoSettingChanged
1895         {
1896             add
1897             {
1898                 if (s_displayScreenRotationAutoChanged == null)
1899                 {
1900                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.DisplayScreenRotationAutoEnabled, s_displayScreenRotationAutoChangedCallback, IntPtr.Zero);
1901                     if (ret != SystemSettingsError.None)
1902                     {
1903                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1904                     }
1905                 }
1906                 s_displayScreenRotationAutoChanged += value;
1907             }
1908
1909             remove
1910             {
1911                 if (s_displayScreenRotationAutoChanged == null)
1912                     return;
1913
1914                 s_displayScreenRotationAutoChanged -= value;
1915                 if (s_displayScreenRotationAutoChanged == null)
1916                 {
1917                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.DisplayScreenRotationAutoEnabled, s_displayScreenRotationAutoChangedCallback);
1918                     if (ret != SystemSettingsError.None)
1919                     {
1920                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1921                     }
1922                 }
1923             }
1924         }
1925
1926         private static readonly Interop.Settings.SystemSettingsChangedCallback s_deviceNameChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1927         {
1928             string deviceName = SystemSettings.DeviceName;
1929             DeviceNameChangedEventArgs eventArgs = new DeviceNameChangedEventArgs(deviceName);
1930             s_deviceNameChanged?.Invoke(null, eventArgs);
1931         };
1932         private static event EventHandler<DeviceNameChangedEventArgs> s_deviceNameChanged;
1933         /// <summary>
1934         /// The DeviceNameChanged event is triggered when the device name is changed.
1935         /// </summary>
1936         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1937         /// <privlevel>platform</privlevel>
1938         /// <feature>http://tizen.org/feature/systemsetting</feature>
1939         /// <exception cref="ArgumentException">Invalid Argument</exception>
1940         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1941         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1942         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1943         /// <since_tizen> 3 </since_tizen>
1944         public static event EventHandler<DeviceNameChangedEventArgs> DeviceNameChanged
1945         {
1946             add
1947             {
1948                 if (s_deviceNameChanged == null)
1949                 {
1950                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.DeviceName, s_deviceNameChangedCallback, IntPtr.Zero);
1951                     if (ret != SystemSettingsError.None)
1952                     {
1953                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1954                     }
1955                 }
1956                 s_deviceNameChanged += value;
1957             }
1958
1959             remove
1960             {
1961                 if (s_deviceNameChanged == null)
1962                     return;
1963
1964                 s_deviceNameChanged -= value;
1965                 if (s_deviceNameChanged == null)
1966                 {
1967                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.DeviceName, s_deviceNameChangedCallback);
1968                     if (ret != SystemSettingsError.None)
1969                     {
1970                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
1971                     }
1972                 }
1973             }
1974         }
1975
1976         private static readonly Interop.Settings.SystemSettingsChangedCallback s_motionSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
1977         {
1978             bool motionEnabled = SystemSettings.MotionEnabled;
1979             MotionSettingChangedEventArgs eventArgs = new MotionSettingChangedEventArgs(motionEnabled);
1980             s_motionSettingChanged?.Invoke(null, eventArgs);
1981         };
1982         private static event EventHandler<MotionSettingChangedEventArgs> s_motionSettingChanged;
1983         /// <summary>
1984         /// The MotionSettingChanged event is triggered when the motion feature enabled status is changed.
1985         /// </summary>
1986         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
1987         /// <privlevel>platform</privlevel>
1988         /// <feature>http://tizen.org/feature/systemsetting</feature>
1989         /// <exception cref="ArgumentException">Invalid Argument</exception>
1990         /// <exception cref="NotSupportedException">Not Supported feature</exception>
1991         /// <exception cref="InvalidOperationException">Invalid operation</exception>
1992         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
1993         /// <since_tizen> 3 </since_tizen>
1994         public static event EventHandler<MotionSettingChangedEventArgs> MotionSettingChanged
1995         {
1996             add
1997             {
1998                 if (s_motionSettingChanged == null)
1999                 {
2000                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.MotionEnabled, s_motionSettingChangedCallback, IntPtr.Zero);
2001                     if (ret != SystemSettingsError.None)
2002                     {
2003                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2004                     }
2005                 }
2006                 s_motionSettingChanged += value;
2007             }
2008
2009             remove
2010             {
2011                 if (s_motionSettingChanged == null)
2012                     return;
2013
2014                  s_motionSettingChanged -= value;
2015                 if (s_motionSettingChanged == null)
2016                 {
2017                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.MotionEnabled, s_motionSettingChangedCallback);
2018                     if (ret != SystemSettingsError.None)
2019                     {
2020                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2021                     }
2022                 }
2023             }
2024         }
2025
2026         private static readonly Interop.Settings.SystemSettingsChangedCallback s_networkWifiNotificationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
2027         {
2028             bool networkWifiNotification = SystemSettings.NetworkWifiNotificationEnabled;
2029             NetworkWifiNotificationSettingChangedEventArgs eventArgs = new NetworkWifiNotificationSettingChangedEventArgs(networkWifiNotification);
2030             s_networkWifiNotificationChanged?.Invoke(null, eventArgs);
2031         };
2032         private static event EventHandler<NetworkWifiNotificationSettingChangedEventArgs> s_networkWifiNotificationChanged;
2033         /// <summary>
2034         /// The NetworkWifiNotificationChanged event is triggered when the WiFi-related notifications enabled status is changed.
2035         /// </summary>
2036         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
2037         /// <privlevel>platform</privlevel>
2038         /// <feature>http://tizen.org/feature/systemsetting</feature>
2039         /// <feature>http://tizen.org/feature/network.wifi</feature>
2040         /// <exception cref="ArgumentException">Invalid Argument</exception>
2041         /// <exception cref="NotSupportedException">Not Supported feature</exception>
2042         /// <exception cref="InvalidOperationException">Invalid operation</exception>
2043         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
2044         /// <since_tizen> 3 </since_tizen>
2045         public static event EventHandler<NetworkWifiNotificationSettingChangedEventArgs> NetworkWifiNotificationSettingChanged
2046         {
2047             add
2048             {
2049                 if (s_networkWifiNotificationChanged == null)
2050                 {
2051                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.NetworkWifiNotificationEnabled, s_networkWifiNotificationChangedCallback, IntPtr.Zero);
2052                     if (ret != SystemSettingsError.None)
2053                     {
2054                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2055                     }
2056                 }
2057                 s_networkWifiNotificationChanged += value;
2058             }
2059
2060             remove
2061             {
2062                 if (s_networkWifiNotificationChanged == null)
2063                     return;
2064
2065                 s_networkWifiNotificationChanged -= value;
2066                 if (s_networkWifiNotificationChanged == null)
2067                 {
2068                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.NetworkWifiNotificationEnabled, s_networkWifiNotificationChangedCallback);
2069                     if (ret != SystemSettingsError.None)
2070                     {
2071                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2072                     }
2073                 }
2074             }
2075         }
2076
2077         private static readonly Interop.Settings.SystemSettingsChangedCallback s_networkFlightModeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
2078         {
2079             bool networkFlightMode = SystemSettings.NetworkFlightModeEnabled;
2080             NetworkFlightModeSettingChangedEventArgs eventArgs = new NetworkFlightModeSettingChangedEventArgs(networkFlightMode);
2081             s_networkFlightModeChanged?.Invoke(null, eventArgs);
2082         };
2083         private static event EventHandler<NetworkFlightModeSettingChangedEventArgs> s_networkFlightModeChanged;
2084         /// <summary>
2085         /// The NetworkFlightModeChanged event is triggered when the flight mode status is changed.
2086         /// </summary>
2087         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
2088         /// <privlevel>platform</privlevel>
2089         /// <feature>http://tizen.org/feature/systemsetting</feature>
2090         /// <exception cref="ArgumentException">Invalid Argument</exception>
2091         /// <exception cref="NotSupportedException">Not Supported feature</exception>
2092         /// <exception cref="InvalidOperationException">Invalid operation</exception>
2093         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
2094         /// <since_tizen> 3 </since_tizen>
2095         public static event EventHandler<NetworkFlightModeSettingChangedEventArgs> NetworkFlightModeSettingChanged
2096         {
2097             add
2098             {
2099                 if (s_networkFlightModeChanged == null)
2100                 {
2101                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.NetworkFlightModeEnabled, s_networkFlightModeChangedCallback, IntPtr.Zero);
2102                     if (ret != SystemSettingsError.None)
2103                     {
2104                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2105                     }
2106                 }
2107                 s_networkFlightModeChanged += value;
2108             }
2109
2110             remove
2111             {
2112                 if (s_networkFlightModeChanged == null)
2113                     return;
2114
2115                 s_networkFlightModeChanged -= value;
2116                 if (s_networkFlightModeChanged == null)
2117                 {
2118                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.NetworkFlightModeEnabled, s_networkFlightModeChangedCallback);
2119                     if (ret != SystemSettingsError.None)
2120                     {
2121                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2122                     }
2123                 }
2124             }
2125         }
2126
2127         private static readonly Interop.Settings.SystemSettingsChangedCallback s_screenBacklightTimeChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
2128         {
2129             int screenBacklightTime = SystemSettings.ScreenBacklightTime;
2130             ScreenBacklightTimeChangedEventArgs eventArgs = new ScreenBacklightTimeChangedEventArgs(screenBacklightTime);
2131             s_screenBacklightTimeChanged?.Invoke(null, eventArgs);
2132         };
2133         private static event EventHandler<ScreenBacklightTimeChangedEventArgs> s_screenBacklightTimeChanged;
2134         /// <summary>
2135         /// THe ScreenBacklightTimeChanged event is triggered when the backlight time is changed.
2136         /// </summary>
2137         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
2138         /// <privlevel>platform</privlevel>
2139         /// <feature>http://tizen.org/feature/systemsetting</feature>
2140         /// <exception cref="ArgumentException">Invalid Argument</exception>
2141         /// <exception cref="NotSupportedException">Not Supported feature</exception>
2142         /// <exception cref="InvalidOperationException">Invalid operation</exception>
2143         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
2144         /// <since_tizen> 3 </since_tizen>
2145         public static event EventHandler<ScreenBacklightTimeChangedEventArgs> ScreenBacklightTimeChanged
2146         {
2147             add
2148             {
2149                 if (s_screenBacklightTimeChanged == null)
2150                 {
2151                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.ScreenBacklightTime, s_screenBacklightTimeChangedCallback, IntPtr.Zero);
2152                     if (ret != SystemSettingsError.None)
2153                     {
2154                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2155                     }
2156                 }
2157                 s_screenBacklightTimeChanged += value;
2158             }
2159
2160             remove
2161             {
2162                 if (s_screenBacklightTimeChanged == null)
2163                     return;
2164
2165                 s_screenBacklightTimeChanged -= value;
2166                 if (s_screenBacklightTimeChanged == null)
2167                 {
2168                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.ScreenBacklightTime, s_screenBacklightTimeChangedCallback);
2169                     if (ret != SystemSettingsError.None)
2170                     {
2171                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2172                     }
2173                 }
2174             }
2175         }
2176
2177         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundNotificationChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
2178         {
2179             string soundNotification = SystemSettings.SoundNotification;
2180             SoundNotificationChangedEventArgs eventArgs = new SoundNotificationChangedEventArgs(soundNotification);
2181             s_soundNotificationChanged?.Invoke(null, eventArgs);
2182         };
2183         private static event EventHandler<SoundNotificationChangedEventArgs> s_soundNotificationChanged;
2184         /// <summary>
2185         /// The SoundNotificationChanged event is triggered when the file path of the current notification tone set by the user is changed.
2186         /// </summary>
2187         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
2188         /// <privlevel>platform</privlevel>
2189         /// <feature>http://tizen.org/feature/systemsetting</feature>
2190         /// <feature>http://tizen.org/feature/systemsetting.incoming_call</feature>
2191         /// <exception cref="ArgumentException">Invalid Argument</exception>
2192         /// <exception cref="NotSupportedException">Not Supported feature</exception>
2193         /// <exception cref="InvalidOperationException">Invalid operation</exception>
2194         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
2195         /// <since_tizen> 3 </since_tizen>
2196         public static event EventHandler<SoundNotificationChangedEventArgs> SoundNotificationChanged
2197         {
2198             add
2199             {
2200                 if (s_soundNotificationChanged == null)
2201                 {
2202                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundNotification, s_soundNotificationChangedCallback, IntPtr.Zero);
2203                     if (ret != SystemSettingsError.None)
2204                     {
2205                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2206                     }
2207                 }
2208                 s_soundNotificationChanged += value;
2209             }
2210
2211             remove
2212             {
2213                 if (s_soundNotificationChanged == null)
2214                     return;
2215
2216                 s_soundNotificationChanged -= value;
2217                 if (s_soundNotificationChanged == null)
2218                 {
2219                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundNotification, s_soundNotificationChangedCallback);
2220                     if (ret != SystemSettingsError.None)
2221                     {
2222                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2223                     }
2224                 }
2225             }
2226         }
2227
2228         private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundNotificationRepetitionPeriodChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
2229         {
2230             int soundNotificationRepetitionPeriod = SystemSettings.SoundNotificationRepetitionPeriod;
2231             SoundNotificationRepetitionPeriodChangedEventArgs eventArgs = new SoundNotificationRepetitionPeriodChangedEventArgs(soundNotificationRepetitionPeriod);
2232             s_soundNotificationRepetitionPeriodChanged?.Invoke(null, eventArgs);
2233         };
2234         private static event EventHandler<SoundNotificationRepetitionPeriodChangedEventArgs> s_soundNotificationRepetitionPeriodChanged;
2235         /// <summary>
2236         /// The SoundNotificationRepetitionPeriodChanged event is triggered when the time period for notification repetitions is changed.
2237         /// </summary>
2238         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
2239         /// <privlevel>platform</privlevel>
2240         /// <feature>http://tizen.org/feature/systemsetting</feature>
2241         /// <exception cref="ArgumentException">Invalid Argument</exception>
2242         /// <exception cref="NotSupportedException">Not Supported feature</exception>
2243         /// <exception cref="InvalidOperationException">Invalid operation</exception>
2244         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
2245         /// <since_tizen> 3 </since_tizen>
2246         public static event EventHandler<SoundNotificationRepetitionPeriodChangedEventArgs> SoundNotificationRepetitionPeriodChanged
2247         {
2248             add
2249             {
2250                 if (s_soundNotificationRepetitionPeriodChanged == null)
2251                 {
2252                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundNotificationRepetitionPeriod, s_soundNotificationRepetitionPeriodChangedCallback, IntPtr.Zero);
2253                     if (ret != SystemSettingsError.None)
2254                     {
2255                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2256                     }
2257                 }
2258                 s_soundNotificationRepetitionPeriodChanged += value;
2259             }
2260
2261             remove
2262             {
2263                 if (s_soundNotificationRepetitionPeriodChanged == null)
2264                     return;
2265
2266                 s_soundNotificationRepetitionPeriodChanged -= value;
2267                 if (s_soundNotificationRepetitionPeriodChanged == null)
2268                 {
2269                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundNotificationRepetitionPeriod, s_soundNotificationRepetitionPeriodChangedCallback);
2270                     if (ret != SystemSettingsError.None)
2271                     {
2272                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2273                     }
2274                 }
2275             }
2276         }
2277
2278         private static readonly Interop.Settings.SystemSettingsChangedCallback s_lockStateChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
2279         {
2280             SystemSettingsIdleLockState lockState = SystemSettings.LockState;
2281             LockStateChangedEventArgs eventArgs = new LockStateChangedEventArgs(lockState);
2282             s_lockStateChanged?.Invoke(null, eventArgs);
2283         };
2284         private static event EventHandler<LockStateChangedEventArgs> s_lockStateChanged;
2285         /// <summary>
2286         /// The LockStateChanged event is triggered when the current lock state is changed.
2287         /// </summary>
2288         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
2289         /// <privlevel>platform</privlevel>
2290         /// <feature>http://tizen.org/feature/systemsetting</feature>
2291         /// <exception cref="ArgumentException">Invalid Argument</exception>
2292         /// <exception cref="NotSupportedException">Not Supported feature</exception>
2293         /// <exception cref="InvalidOperationException">Invalid operation</exception>
2294         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
2295         /// <since_tizen> 3 </since_tizen>
2296         public static event EventHandler<LockStateChangedEventArgs> LockStateChanged
2297         {
2298             add
2299             {
2300                 if (s_lockStateChanged == null)
2301                 {
2302                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LockState, s_lockStateChangedCallback, IntPtr.Zero);
2303                     if (ret != SystemSettingsError.None)
2304                     {
2305                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2306                     }
2307                 }
2308                 s_lockStateChanged += value;
2309             }
2310
2311             remove
2312             {
2313                 if (s_lockStateChanged == null)
2314                     return;
2315
2316                 s_lockStateChanged -= value;
2317                 if (s_lockStateChanged == null)
2318                 {
2319                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LockState, s_lockStateChangedCallback);
2320                     if (ret != SystemSettingsError.None)
2321                     {
2322                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2323                     }
2324                 }
2325             }
2326         }
2327
2328         private static readonly Interop.Settings.SystemSettingsChangedCallback s_adsIdChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
2329         {
2330             string adsId = SystemSettings.AdsId;
2331             AdsIdChangedEventArgs eventArgs = new AdsIdChangedEventArgs(adsId);
2332             s_adsIdChanged?.Invoke(null, eventArgs);
2333         };
2334         private static event EventHandler<AdsIdChangedEventArgs> s_adsIdChanged;
2335         /// <summary>
2336         /// The AdsIdChanged event is triggered when the current ADS ID state is changed.
2337         /// </summary>
2338         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
2339         /// <privlevel>platform</privlevel>
2340         /// <feature>http://tizen.org/feature/systemsetting</feature>
2341         /// <exception cref="ArgumentException">Invalid Argument</exception>
2342         /// <exception cref="NotSupportedException">Not Supported feature</exception>
2343         /// <exception cref="InvalidOperationException">Invalid operation</exception>
2344         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
2345         /// <since_tizen> 3 </since_tizen>
2346         public static event EventHandler<AdsIdChangedEventArgs> AdsIdChanged
2347         {
2348             add
2349             {
2350                 if (s_adsIdChanged == null)
2351                 {
2352                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.AdsId, s_adsIdChangedCallback, IntPtr.Zero);
2353                     if (ret != SystemSettingsError.None)
2354                     {
2355                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2356                     }
2357                 }
2358                 s_adsIdChanged += value;
2359             }
2360
2361             remove
2362             {
2363                 if (s_adsIdChanged == null)
2364                     return;
2365
2366                 s_adsIdChanged -= value;
2367                 if (s_adsIdChanged == null)
2368                 {
2369                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.AdsId, s_adsIdChangedCallback);
2370                     if (ret != SystemSettingsError.None)
2371                     {
2372                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2373                     }
2374                 }
2375             }
2376         }
2377
2378         private static readonly Interop.Settings.SystemSettingsChangedCallback s_ultraDataSaveChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
2379         {
2380             SystemSettingsUdsState ultraDataSave = SystemSettings.UltraDataSave;
2381             UltraDataSaveChangedEventArgs eventArgs = new UltraDataSaveChangedEventArgs(ultraDataSave);
2382             s_ultraDataSaveChanged?.Invoke(null, eventArgs);
2383         };
2384         private static event EventHandler<UltraDataSaveChangedEventArgs> s_ultraDataSaveChanged;
2385         /// <summary>
2386         /// The UltraDataSaveChanged event is triggered when the current Ultra Data Save state is changed.
2387         /// </summary>
2388         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
2389         /// <privlevel>platform</privlevel>
2390         /// <feature>http://tizen.org/feature/systemsetting</feature>
2391         /// <feature>http://tizen.org/feature/network.telephony</feature>
2392         /// <exception cref="ArgumentException">Invalid Argument</exception>
2393         /// <exception cref="NotSupportedException">Not Supported feature</exception>
2394         /// <exception cref="InvalidOperationException">Invalid operation</exception>
2395         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
2396         /// <since_tizen> 3 </since_tizen>
2397         public static event EventHandler<UltraDataSaveChangedEventArgs> UltraDataSaveChanged
2398         {
2399             add
2400             {
2401                 if (s_ultraDataSaveChanged == null)
2402                 {
2403                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UltraDataSave, s_ultraDataSaveChangedCallback, IntPtr.Zero);
2404                     if (ret != SystemSettingsError.None)
2405                     {
2406                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2407                     }
2408                 }
2409                 s_ultraDataSaveChanged += value;
2410             }
2411
2412             remove
2413             {
2414                 if (s_ultraDataSaveChanged == null)
2415                     return;
2416
2417                 s_ultraDataSaveChanged -= value;
2418                 if (s_ultraDataSaveChanged == null)
2419                 {
2420                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UltraDataSave, s_ultraDataSaveChangedCallback);
2421                     if (ret != SystemSettingsError.None)
2422                     {
2423                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2424                     }
2425                 }
2426             }
2427         }
2428
2429         private static readonly Interop.Settings.SystemSettingsChangedCallback s_ultraDataSavePackageListChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
2430         {
2431             string ultraDataSavePackageList = "None";
2432             UltraDataSavePackageListChangedEventArgs eventArgs = new UltraDataSavePackageListChangedEventArgs(ultraDataSavePackageList);
2433             s_ultraDataSavePackageListChanged?.Invoke(null, eventArgs);
2434         };
2435         private static event EventHandler<UltraDataSavePackageListChangedEventArgs> s_ultraDataSavePackageListChanged;
2436         /// <summary>
2437         /// The UltraDataSavePackageListChanged event is triggered when the current ADS ID state is changed.
2438         /// </summary>
2439         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
2440         /// <privlevel>platform</privlevel>
2441         /// <feature>http://tizen.org/feature/systemsetting</feature>
2442         /// <feature>http://tizen.org/feature/network.telephony</feature>
2443         /// <exception cref="ArgumentException">Invalid Argument</exception>
2444         /// <exception cref="NotSupportedException">Not Supported feature</exception>
2445         /// <exception cref="InvalidOperationException">Invalid operation</exception>
2446         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
2447         /// <since_tizen> 3 </since_tizen>
2448         public static event EventHandler<UltraDataSavePackageListChangedEventArgs> UltraDataSavePackageListChanged
2449         {
2450             add
2451             {
2452                 if (s_ultraDataSavePackageListChanged == null)
2453                 {
2454                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UltraDataSavePackageList, s_ultraDataSavePackageListChangedCallback, IntPtr.Zero);
2455                     if (ret != SystemSettingsError.None)
2456                     {
2457                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2458                     }
2459                 }
2460                 s_ultraDataSavePackageListChanged += value;
2461             }
2462
2463             remove
2464             {
2465                 if (s_ultraDataSavePackageListChanged == null)
2466                     return;
2467
2468                 s_ultraDataSavePackageListChanged -= value;
2469                 if (s_ultraDataSavePackageListChanged == null)
2470                 {
2471                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UltraDataSavePackageList, s_ultraDataSavePackageListChangedCallback);
2472                     if (ret != SystemSettingsError.None)
2473                     {
2474                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2475                     }
2476                 }
2477             }
2478         }
2479
2480         private static readonly Interop.Settings.SystemSettingsChangedCallback s_accessibilityTtsChangedCallback = (SystemSettingsKeys key, IntPtr userData) =>
2481         {
2482             bool accessibilityTts = SystemSettings.AccessibilityTtsEnabled;
2483             AccessibilityTtsSettingChangedEventArgs eventArgs = new AccessibilityTtsSettingChangedEventArgs(accessibilityTts);
2484             s_accessibilityTtsChanged?.Invoke(null, eventArgs);
2485         };
2486         private static event EventHandler<AccessibilityTtsSettingChangedEventArgs> s_accessibilityTtsChanged;
2487         /// <summary>
2488         /// THe AccessibilityTtsChanged event is triggered when the screen touch sound enabled status is changed.
2489         /// </summary>
2490         /// <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
2491         /// <privlevel>platform</privlevel>
2492         /// <feature>http://tizen.org/feature/systemsetting</feature>
2493         /// <exception cref="ArgumentException">Invalid Argument</exception>
2494         /// <exception cref="NotSupportedException">Not Supported feature</exception>
2495         /// <exception cref="InvalidOperationException">Invalid operation</exception>
2496         /// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
2497         /// <since_tizen> 4 </since_tizen>
2498         public static event EventHandler<AccessibilityTtsSettingChangedEventArgs> AccessibilityTtsSettingChanged
2499         {
2500             add
2501             {
2502                 if (s_accessibilityTtsChanged == null)
2503                 {
2504                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.AccessibilityTtsEnabled, s_accessibilityTtsChangedCallback, IntPtr.Zero);
2505                     if (ret != SystemSettingsError.None)
2506                     {
2507                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2508                     }
2509                 }
2510                 s_accessibilityTtsChanged += value;
2511             }
2512
2513             remove
2514             {
2515                 if (s_accessibilityTtsChanged == null)
2516                     return;
2517
2518                 s_accessibilityTtsChanged -= value;
2519                 if (s_accessibilityTtsChanged == null)
2520
2521                 {
2522                     SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.AccessibilityTtsEnabled, s_accessibilityTtsChangedCallback);
2523                     if (ret != SystemSettingsError.None)
2524                     {
2525                         throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling");
2526                     }
2527                 }
2528             }
2529         }
2530
2531     }
2532 }
2533