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