SET(INC_DIR include)
INCLUDE_DIRECTORIES(${INC_DIR})
-#SET(requires "elementary ecore ecore-file dlog vconf appcore-efl capi-base-common glib-2.0 gobject-2.0 fontconfig libxml-2.0 efl-assist")
-SET(requires "elementary ecore ecore-file dlog vconf appcore-efl capi-base-common glib-2.0 gobject-2.0 fontconfig libxml-2.0")
+SET(requires "elementary ecore ecore-file dlog vconf appcore-efl capi-base-common glib-2.0 gobject-2.0 fontconfig libxml-2.0 bundle capi-appfw-application pkgmgr pkgmgr-info")
+
SET(pc_requires "capi-base-common")
IF(TIZEN_WEARABLE)
* System Settings API provides functions for getting the system configuration related to user preferences.
* The main features of the System Settings API include accessing system-wide configurations, such as ringtones, wallpapers, and etc.
*
-* For more information on feature, see <a href="../org.tizen.mobile.native.appprogramming/html/guide/system/system_settings.htm">System Settings Programming Guide.</a>
+* For more information on feature, see <a href="https://developer.tizen.org/development/guides/native-application/system/system-settings">System Settings Programming Guide.</a>
*/
SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, /**< (string) Indicates the file path of the current notification tone set by the user. */
SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD, /**< (int) Indicates the time period for notification repetitions. */
+ SYSTEM_SETTINGS_KEY_LOCK_STATE, /**< (int) Indicates the current lock state */
SYSTEM_SETTINGS_KEY_MAX,
} system_settings_key_e;
+/**
+ * @brief Enumeration for Idle Lock State
+ * @since_tizen 2.3.1
+ */
+typedef enum {
+ SYSTEM_SETTINGS_LOCK_STATE_UNLOCK = 0, /**< Device is unlocked */
+ SYSTEM_SETTINGS_LOCK_STATE_LOCK, /**< Device is locked */
+ SYSTEM_SETTINGS_LOCK_STATE_LAUNCHING_LOCK /**< Device is being locked */
+} system_settings_idle_lock_state_e;
+
/**
* @brief Enumeration for font size.
/**
* @brief Gets the system settings value associated with the given key as an integer.
* @since_tizen 2.3
- * @privlevel public
* @param[in] key The key name of the system settings
* @param[out] value The current system settings value of the given key
* @return @c 0 on success, otherwise a negative error value
* @retval #SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
* @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ * @warning %http://tizen.org/privilege/systemsettings (public level privilege) <b>MUST NOT</b> be declared to use this API since 2.3.1.
*/
int system_settings_get_value_int(system_settings_key_e key, int *value);
/**
* @brief Gets the system settings value associated with the given key as a boolean.
* @since_tizen 2.3
- * @privlevel public
* @param[in] key The key name of the system settings
* @param[out] value The current system settings value of the given key
* @return @c 0 on success, otherwise a negative error value
* @retval #SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
* @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ * @warning %http://tizen.org/privilege/systemsettings (public level privilege) <b>MUST NOT</b> be declared to use this API since 2.3.1.
*/
int system_settings_get_value_bool(system_settings_key_e key, bool *value);
/**
* @brief Gets the system settings value associated with the given key as a string.
* @since_tizen 2.3
- * @privlevel public
* @remarks You must release @a value using free().
* @param[in] key The key name of the system settings
* @param[out] value The current system settings value of the given key
* @retval #SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
* @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ * @warning %http://tizen.org/privilege/systemsettings (public level privilege) <b>MUST NOT</b> be declared to use this API since 2.3.1.
*/
int system_settings_get_value_string(system_settings_key_e key, char **value);
/**
* @brief Registers a change event callback for the given system settings key.
* @since_tizen 2.3
- * @privlevel public
* @remarks #SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE is not available for set_changed_cb.
* @param[in] key The key name of the system settings
* @param[in] callback The callback function to invoke
*
* @see system_settings_unset_changed_cb()
* @see system_settings_changed_cb()
+ * @warning %http://tizen.org/privilege/systemsettings (public level privilege) <b>MUST NOT</b> be declared to use this API since 2.3.1.
*
*/
int system_settings_set_changed_cb(system_settings_key_e key, system_settings_changed_cb callback, void *user_data);
/**
* @brief Unregisters the callback function.
* @since_tizen 2.3
- * @privlevel public
* @remarks #SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE is not available for set_changed_cb.
* @param[in] key The key name of the system settings
* @return 0 on success, otherwise a negative error value
* @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
*
* @see system_settings_set_changed_cb()
+ * @warning %http://tizen.org/privilege/systemsettings (public level privilege) <b>MUST NOT</b> be declared to use this API since 2.3.1.
*/
int system_settings_unset_changed_cb(system_settings_key_e key);
int system_setting_unset_changed_callback_network_wifi_notification(system_settings_key_e key);
+/**
+ * @internal
+ * @brief get current Idle Lock State
+ * @since_tizen 2.3.1
+ * @return 0 on success, otherwise a negative error value
+ * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
+int system_setting_get_lock_state(system_settings_key_e key, system_setting_data_type_e data_type, void **value);
+
+/**
+ * @internal
+ * @since_tizen 2.3
+ * @return 0 on success, otherwise a negative error value
+ * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
+int system_setting_set_lock_state(system_settings_key_e key, system_setting_data_type_e data_type, void *value);
+
+/**
+ * @internal
+ * @since_tizen 2.3
+ * @return 0 on success, otherwise a negative error value
+ * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
+int system_setting_set_changed_callback_lock_state(system_settings_key_e key, system_settings_changed_cb callback, void *user_data);
+
+/**
+ * @internal
+ * @since_tizen 2.3
+ * @return 0 on success, otherwise a negative error value
+ * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
+int system_setting_unset_changed_callback_lock_state(system_settings_key_e key);
+
/*// */
Version: 0.0.2
Release: 3
Group: System/System Info
-License: Apache-1.0
+License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(ecore-file)
BuildRequires: pkgconfig(appcore-efl)
+BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: pkgconfig(capi-base-common)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(libxml-2.0)
+BuildRequires: pkgconfig(bundle)
+BuildRequires: pkgconfig(pkgmgr)
+BuildRequires: pkgconfig(pkgmgr-info)
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
#include <fontconfig/fontconfig.h>
+//#include <pkgmgr-info.h>
#include <Elementary.h>
#include <Evas.h>
#include <Ecore_Evas.h>
+#include <bundle.h>
+#include <bundle_internal.h>
+#include <app_control_internal.h>
+#include <pkgmgr-info.h>
+
#include <system_settings.h>
#include <system_settings_private.h>
int system_setting_set_wallpaper_lock_screen(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
{
+ SETTING_TRACE_BEGIN;
char *vconf_value;
vconf_value = (char *)value;
*/
void *font_conf_doc_parse(char *doc_name, char *font_name)
{
+ SETTING_TRACE_BEGIN;
xmlDocPtr doc = NULL;
xmlNodePtr cur = NULL;
xmlNodePtr cur2 = NULL;
char *vconf_value;
vconf_value = (char *)value;
+
if (system_setting_vconf_set_value_string(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, vconf_value)) {
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
if (system_setting_vconf_set_value_bool(VCONFKEY_3G_ENABLE, *vconf_value)) {
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
+
return SYSTEM_SETTINGS_ERROR_NONE;
}
char *vconf_value;
vconf_value = (char *)value; /* ex) com.samsung.lockscreen */
-#if 0
int r = 0;
pkgmgrinfo_appinfo_h handle;
char *apptype = NULL;
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
}
-#endif
return SYSTEM_SETTINGS_ERROR_NONE;
}
if (system_setting_vconf_set_value_string(VCONFKEY_REGIONFORMAT, arr)) {
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
-
return SYSTEM_SETTINGS_ERROR_NONE;
}
if (system_setting_vconf_set_value_string(VCONFKEY_LANGSET, arr)) {
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
-
return SYSTEM_SETTINGS_ERROR_NONE;
}
return system_setting_vconf_unset_changed_cb(VCONFKEY_REGIONFORMAT_TIME1224, 3);
}
- //VCONFKEY_SETAPPL_TIMEZONE_ID
int system_setting_get_locale_timezone(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
{
SETTING_TRACE_BEGIN;
if (system_setting_vconf_set_value_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, *vconf_value)) {
return SYSTEM_SETTINGS_ERROR_IO_ERROR;
}
+
return SYSTEM_SETTINGS_ERROR_NONE;
}
int system_setting_set_changed_callback_notification_repetition_period(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
{
SETTING_TRACE_BEGIN;
- return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO, 1, user_data);
+ return system_setting_vconf_set_changed_cb(VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT, SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION_REPETITION_PERIOD, 1, user_data);
}
int system_setting_unset_changed_callback_notification_repetition_period(system_settings_key_e key)
return system_setting_vconf_unset_changed_cb(VCONFKEY_WIFI_ENABLE_QS, 4);
}
+int system_setting_get_lock_state(system_settings_key_e key, system_setting_data_type_e data_type, void **value)
+{
+ int vconf_value;
+
+ if (system_setting_vconf_get_value_int(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, &vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ *value = (void *)vconf_value;
+
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+int system_setting_set_lock_state(system_settings_key_e key, system_setting_data_type_e data_type, void *value)
+{
+ SETTING_TRACE_BEGIN;
+ int *vconf_value;
+ vconf_value = (int *)value;
+
+ if (system_setting_vconf_set_value_int(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, *vconf_value)) {
+ return SYSTEM_SETTINGS_ERROR_IO_ERROR;
+ }
+ SETTING_TRACE_END;
+ return SYSTEM_SETTINGS_ERROR_NONE;
+}
+
+int system_setting_set_changed_callback_lock_state(system_settings_key_e key, system_settings_changed_cb callback, void *user_data)
+{
+ return system_setting_vconf_set_changed_cb(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, SYSTEM_SETTINGS_KEY_LOCK_STATE, 4, user_data);
+}
+
+int system_setting_unset_changed_callback_lock_state(system_settings_key_e key)
+{
+ return system_setting_vconf_unset_changed_cb(VCONFKEY_IDLE_LOCK_STATE_READ_ONLY, 4);
+}
NULL /* user data */
},
{
+ SYSTEM_SETTINGS_KEY_LOCK_STATE,
+ SYSTEM_SETTING_DATA_TYPE_INT,
+ system_setting_get_lock_state,
+ system_setting_set_lock_state,
+ system_setting_set_changed_callback_lock_state,
+ system_setting_unset_changed_callback_lock_state,
+ NULL,
+ NULL /* user data */
+ },
+ {
SYSTEM_SETTINGS_MAX, -1, NULL, NULL, NULL, NULL, NULL, NULL
}
};