<meta http-equiv="X-UA-Compatible" content="IE=9" />
<link rel="stylesheet" type="text/css" href="../../css/styles.css" />
<link rel="stylesheet" type="text/css" href="../../css/snippet.css" />
- <script type="text/javascript" src="../../scripts/snippet.js"></script>
+ <script type="text/javascript" src="../../scripts/snippet.js"></script>
<script type="text/javascript" src="../../scripts/jquery.util.js" charset="utf-8"></script>
<script type="text/javascript" src="../../scripts/common.js" charset="utf-8"></script>
<script type="text/javascript" src="../../scripts/core.js" charset="utf-8"></script>
<script type="text/javascript" src="../../scripts/search.js" charset="utf-8"></script>
- <title>System Settings: Getting Miscellaneous System Settings and Preferences</title>
+ <title>System Settings: Getting Miscellaneous System Settings and Preferences</title>
</head>
<body onload="prettyPrint()" style="overflow: auto;">
<ul class="toc">
<li><a href="#settings">Managing System Settings</a>
</li>
- </ul>
+ </ul>
<p class="toc-title">Related Info</p>
<ul class="toc">
<li><a href="../../../../org.tizen.guides/html/native/system/settings_n.htm">System Settings Guide</a></li>
<li><a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__SYSTEM__SYSTEM__SETTINGS__MODULE.html">System Settings API for Wearable Native</a></li>
</ul>
</div></div>
-</div>
+</div>
<div id="container"><div id="contents"><div class="content">
<h1>System Settings: Getting Miscellaneous System Settings and Preferences</h1>
- <p>This tutorial demonstrates how you can manage and monitor system settings.</p>
-
+ <p>This tutorial demonstrates how you can manage and monitor system settings.</p>
+
<h2>Warm-up</h2>
- <p>Become familiar with the System Settings API basics by learning about:</p>
+ <p>Become familiar with the System Settings API basics by learning about:</p>
<ul>
<li><a href="#settings">Managing System Settings</a>
<p>Obtain and monitor system setting values.</p>
</li>
- </ul>
+ </ul>
<h2 id="settings" name="settings">Managing System Settings</h2>
<li><p>Define auxiliary structures:</p>
<pre class="prettyprint">
-struct
+struct
_ret_type_define
{
system_settings_key_e key;
int returns;
};
-typedef
+typedef
enum
{
_RET_BOO = 0,
_RET_STRING
} _SYSTEM_SETTINGS_TYPES;
-struct _ret_type_define
+struct _ret_type_define
_ret_type[] =
{
{
<li><p>Obtain the setting data.</p>
<p>The available settings are defined in the <span style="font-family: Courier New,Courier,monospace">system_settings_key_e</span> enumerator (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SYSTEM__SYSTEM__SETTINGS__MODULE.html#ga56c8fa435516884c5648efecdd871eaa">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__SYSTEM__SYSTEM__SETTINGS__MODULE.html#ga56c8fa435516884c5648efecdd871eaa">wearable</a> applications).</p>
-
+
<p>Read the data using the following functions, according to the data type of the value you want to read:</p>
<ul><li><span style="font-family: Courier New,Courier,monospace">system_settings_get_value_int()</span></li>
<li><p>Monitor changes in the setting values.</p>
<ol type="a"><li><p>To monitor when a system setting value changes, set a callback using the <span style="font-family: Courier New,Courier,monospace">system_settings_set_changed_cb()</span> function with the appropriate key as the first parameter.</p>
-<p>Because the <span style="font-family: Courier New,Courier,monospace">SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE</span> setting does not support the callback function, you must iterate through the <span style="font-family: Courier New,Courier,monospace">SYS_INFO_COUNT - 1</span> records.</p>
-
<pre class="prettyprint">
-for (i = 0; i < SYS_INFO_COUNT - 1; i++)
+for (i = 0; i < SYS_INFO_COUNT; i++)
{
system_settings_set_changed_cb(_ret_type[i].key, _system_settings_changed_cb, 0);
}
<p>The <span style="font-family: Courier New,Courier,monospace">system_settings_key_e</span> key refers to the key that has changed.</p>
<pre class="prettyprint">
-static void
+static void
_system_settings_changed_cb(system_settings_key_e key, void *user_data)
{
dlog_print(DLOG_ERROR, LOG_TAG, "Runtime Info changed: %s", _info_key[key]);
<li><p>When the callbacks are no longer needed, unset them:</p>
<pre class="prettyprint">
-for (i = 0; i < SYS_INFO_COUNT - 1; i++)
+for (i = 0; i < SYS_INFO_COUNT; i++)
{
system_settings_unset_changed_cb(_ret_type[i].key, _system_settings_changed_cb, 0);
}
</pre></li></ol>
</li>
-</ol>
-
+</ol>
+
<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
<script type="text/javascript" src="../../scripts/showhide.js"></script>