ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DSLP_DEBUG")
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
aux_source_directory(src SOURCES)
ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
#---------------------------------------------------------------------
-INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(TARGETS ${fw_name} DESTINATION lib)
INSTALL(
DIRECTORY ${INC_DIR}/ DESTINATION include/system
FILES_MATCHING
${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
@ONLY
)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION lib/pkgconfig)
# INSTALL (TARGETS test DESTINATION bin)
static void utc_system_settings_set_string_p(void);
static void utc_system_settings_set_bool_p(void);
static void utc_system_settings_get_string_p(void);
-static void utc_system_settings_get_int_p(void);
+
+static void utc_system_settings_set_bool_p(void);
static void utc_system_settings_get_bool_p(void);
+
+static void utc_system_settings_get_int_p(void);
+static void utc_system_settings_set_int_p(void);
+
static void utc_system_settings_set_changed_cb(void);
static void utc_system_settings_unset_changed_cb(void);
{utc_system_settings_get_string_p, 1},
{utc_system_settings_get_int_p, 1},
{utc_system_settings_get_bool_p, 1},
+ {utc_system_settings_set_int_p, 1},
{utc_system_settings_set_changed_cb, 1},
{utc_system_settings_unset_changed_cb, 1},
{NULL, 0},
}
}
+static void utc_system_settings_set_int_p(void)
+{
+ int retcode =system_settings_set_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, SYSTEM_SETTINGS_FONT_SIZE_NORMAL);
+
+ if (retcode == SYSTEM_SETTINGS_ERROR_NONE) {
+ dts_pass(API_NAME_SETTINGS_SET_VALUE_INT, "passed");
+ }
+ else {
+ dts_fail(API_NAME_SETTINGS_SET_VALUE_INT, "failed");
+ }
+}
+
+
static void utc_system_settings_set_changed_cb(void)
{
int retcode = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, utc_system_settings_changed_motion_activation, NULL);
prefix=@PREFIX@
exec_prefix=/usr
-libdir=@LIB_INSTALL_DIR@
+libdir=/usr/lib
includedir=/usr/include/system
Name: @PC_NAME@
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License.
+ * limitations under the License.
*/
#ifndef __TIZEN_SYSTEM_SYSTEM_SETTINGS_H__
{
#endif
- /**
+/**
+ * @file system_settings.h
+ */
+
+/**
* @addtogroup CAPI_SYSTEM_SYSTEM_SETTINGS_MODULE
* @{
*/
/**
- * @brief Enumeration of error code for system settings
+ * @brief Enumeration for system settings error.
*/
typedef enum
{
SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
SYSTEM_SETTINGS_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
SYSTEM_SETTINGS_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< Internal I/O error */
+ SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permition denied */
+ SYSTEM_SETTINGS_ERROR_CALL_UNSUPPORTED_API = TIZEN_ERROR_INVALID_PARAMETER, /**< Permition denied */
+
+ // lock screen app error code
+ SYSTEM_SETTINGS_ERROR_LOCKSCREEN_APP_PASSWORD_MODE = TIZEN_ERROR_SYSTEM_SETTING|0x01, /**< Current lock screen app set 'password' type */
} system_settings_error_e;
/**
- * @brief Enumeration of key for system settings
+ * @brief Enumeration for System Settings Key.
*/
typedef enum
{
/**
- * @brief Enumeration of font size
+ * @brief Enumeration for font size.
*/
typedef enum
{
/**
- * @brief Called when the system settings changes
- * @param[in] key The key name of the system settings changed
+ * @brief Called when the system settings changes.
+ * @since_tizen 2.3
+ * @param[in] key The key name of the system settings changed system settings
* @param[in] user_data The user data passed from the callback registration function
* @pre system_settings_set_changed_cb() will invoke this callback function.
* @see system_settings_set_changed_cb()
typedef void (*system_settings_changed_cb)(system_settings_key_e key, void *user_data);
/**
+ * @internal
* @brief Sets the system settings value associated with the given key as an integer.
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/systemsettings.admin
+ * @param[in] key The key name of the system settings changed
* @param[in] key The key name of the system settings
* @param[out] value The new system settings value of the given key
- * @return 0 on success, otherwise a negative error value.
+ * @return @c 0 on success, otherwise a negative error value
* @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
* @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
*/
int system_settings_set_value_int(system_settings_key_e key, int value);
/**
* @brief Gets the system settings value associated with the given key as an integer.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/systemsettings
* @param[in] key The key name of the system settings
* @param[out] value The current system settings value of the given key
- * @return 0 on success, otherwise a negative error value.
+ * @return @c 0 on success, otherwise a negative error value
* @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
* @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
*/
int system_settings_get_value_int(system_settings_key_e key, int *value);
/**
+ * @internal
* @brief Sets the system settings value associated with the given key as a boolean.
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/systemsettings.admin
* @param[in] key The key name of the system settings
* @param[out] value The new system settings value of the given key
- * @return 0 on success, otherwise a negative error value.
+ * @return @c 0 on success, otherwise a negative error value
* @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
* @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
*/
int system_settings_set_value_bool(system_settings_key_e key, bool value);
/**
* @brief Gets the system settings value associated with the given key as a boolean.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/systemsettings
* @param[in] key The key name of the system settings
* @param[out] value The current system settings value of the given key
- * @return 0 on success, otherwise a negative error value.
+ * @return @c 0 on success, otherwise a negative error value
* @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
* @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
*/
int system_settings_get_value_bool(system_settings_key_e key, bool *value);
-
-/**
- * @brief Sets the system settings value associated with the given key as a double.
- * @param[in] key The key name of the system settings
- * @param[out] value The new system settings value of the given key
- * @return 0 on success, otherwise a negative error value.
- * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
- * @retval #SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
- */
-int system_settings_set_value_double(system_settings_key_e key, double value);
-
-/**
- * @brief Gets the system settings value associated with the given key as a double.
- * @param[in] key The key name of the system settings
- * @param[out] value The current system settings value of the given key
- * @return 0 on success, otherwise a negative error value.
- * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
- * @retval #SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
- */
-int system_settings_get_value_double(system_settings_key_e key, double *value);
-
-
/**
+ * @internal
* @brief Sets the system settings value associated with the given key as a string.
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/systemsettings.admin
+ * @remarks #SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE is not available for setting.
* @param[in] key The key name of the system settings
* @param[out] value The new system settings value of the given key
- * @return 0 on success, otherwise a negative error value.
+ * @return @c 0 on success, otherwise a negative error value
* @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
* @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
*/
int system_settings_set_value_string(system_settings_key_e key, const char *value);
/**
* @brief Gets the system settings value associated with the given key as a string.
- * @remarks @a value must be released with @c free() by you.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/systemsettings
+ * @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
- * @return 0 on success, otherwise a negative error value.
+ * @return 0 on success, otherwise a negative error value
* @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
* @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
*/
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
+ * @privilege %http://tizen.org/privilege/systemsettings
+ * @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
* @param[in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
+ * @return 0 on success, otherwise a negative error value
* @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
* @retval #SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
* @post system_settings_changed_cb() will be invoked.
*
* @see system_settings_unset_changed_cb()
* @see system_settings_changed_cb()
+ *
*/
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
+ * @privilege %http://tizen.org/privilege/systemsettings
+ * @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.
+ * @return 0 on success, otherwise a negative error value
* @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
* @retval #SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
*
* @see system_settings_set_changed_cb()
*/
#define VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME "db/setting/accessibility/font_name"
+/**
+ * @internal
+ * @since_tizen 2.3
+ * Enumeration for data type of internal getter/setter.
+ */
typedef enum {
- SYSTEM_SETTING_DATA_TYPE_STRING,
- SYSTEM_SETTING_DATA_TYPE_INT,
- SYSTEM_SETTING_DATA_TYPE_DOUBLE,
- SYSTEM_SETTING_DATA_TYPE_BOOL,
+ SYSTEM_SETTING_DATA_TYPE_STRING, /**< string */
+ SYSTEM_SETTING_DATA_TYPE_INT, /**< integer */
+ SYSTEM_SETTING_DATA_TYPE_BOOL, /**< boolean */
+ #if 0
+ //SYSTEM_SETTING_DATA_TYPE_FLOAT,
+ //SYSTEM_SETTING_DATA_TYPE_DOULBE,
+ #endif
} system_setting_data_type_e;
+/**
+ * @internal
+ * @since_tizen 2.3
+ * @return 0 on success, otherwise a negative error value
+ * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @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
+ */
typedef int (*system_setting_get_value_cb) (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_INVALID_PARAMETER Invalid parameter
+ * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
typedef int (*system_setting_set_value_cb) (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_INVALID_PARAMETER Invalid parameter
+ * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
typedef int (*system_setting_set_changed_callback_cb)(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_INVALID_PARAMETER Invalid parameter
+ * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
typedef int (*system_setting_unset_changed_callback_cb)(system_settings_key_e key);
+/**
+ * @internal
+ * @since_tizen 2.3
+ * @return 0 on success, otherwise a negative error value
+ * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @retval #SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #SYSTEM_SETTINGS_ERROR_IO_ERROR Internal I/O error
+ */
typedef struct {
- system_settings_key_e key; /* key */
- system_setting_data_type_e data_type;
- system_setting_get_value_cb get_value_cb; /* get value */
- system_setting_set_value_cb set_value_cb; /* set value */
+ system_settings_key_e key; /**< key */
+ system_setting_data_type_e data_type; /**< data type */
+ system_setting_get_value_cb get_value_cb; /**< function pointer for getter */
+ system_setting_set_value_cb set_value_cb; /**< function pointer for setter */
- system_setting_set_changed_callback_cb set_changed_cb;
- system_setting_unset_changed_callback_cb unset_changed_cb ;
+ system_setting_set_changed_callback_cb set_changed_cb; /**< function pointer to register for notification callback */
+ system_setting_unset_changed_callback_cb unset_changed_cb ; /**< function pointer to un-register for notification callback */
system_settings_changed_cb changed_cb; /* registered by user application */
void* user_data; /* user_data */
typedef system_setting_s* system_setting_h;
+/**
+ * @internal
+ * @since_tizen 2.3
+ * @return 0 on success, otherwise a negative error value
+ * @retval #SYSTEM_SETTINGS_ERROR_NONE Successful
+ * @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
+ */
int system_settings_get_item(system_settings_key_e key, system_setting_h *item);
// get
+
+/**
+ * @internal
+ * @brief get vconf of in type value
+ * @since_tizen 2.3
+ *
+ * @param[in] vconf_key string
+ * @param[out] value get the integer type value
+ *
+ * @return 0 on success, -1 on error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
int system_setting_vconf_get_value_int(const char *vconf_key, int *value);
+
+/**
+ * @internal
+ * @brief get vconf of in bool value
+ * @since_tizen 2.3
+ *
+ * @param[in] vconf_key string
+ * @param[out] value get the bool type value
+ *
+ * @return 0 on success, -1 on error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
int system_setting_vconf_get_value_bool(const char *vconf_key, bool *value);
-int system_setting_vconf_get_value_double(const char *vconf_key, double *value);
+
+/**
+ * @internal
+ * @brief get vconf of string type value
+ * @since_tizen 2.3
+ *
+ * @param[in] vconf_key string
+ * @param[out] value get the string(char*) type value
+ *
+ * @return 0 on success, -1 on error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
int system_setting_vconf_get_value_string(const char *vconf_key, char **value);
-// set
+/**
+ * @internal
+ * @brief set the int type vconf value
+ * @since_tizen 2.3
+ *
+ * @param[in] vconf_key key name
+ * @param[in] value int type value
+ *
+ * @return 0 on success, -1 on error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
int system_setting_vconf_set_value_int(const char *vconf_key, int value);
+
+/**
+ * @internal
+ * @brief set the bool type vconf value
+ * @since_tizen 2.3
+ *
+ * @param[in] vconf_key key name
+ * @param[in] value bool type value
+ *
+ * @return 0 on success, -1 on error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
int system_setting_vconf_set_value_bool(const char *vconf_key, bool value);
-int system_setting_vconf_set_value_double(const char *vconf_key, double value);
-int system_setting_vconf_set_value_string(const char *vconf_key, char *value);
+/**
+ * @internal
+ * @brief set the string type vconf value
+ * @since_tizen 2.3
+ *
+ * @param[in] vconf_key key name
+ * @param[in] value string type value
+ *
+ * @return 0 on success, -1 on error
+ * @retval #SYSTEM_SETTINGS_ERROR_PERMISSION_DENIED Permission violation error
+ */
+int system_setting_vconf_set_value_string(const char *vconf_key, char *value);
+/**
+ * @internal
+ * @brief Set the system settings notification callback
+ * @since_tizen 2.3
+ * @param[in] vconf_key
+ * @param[in] key
+ * @param[in] slot internal slot to set the key (0~4)
+ * @param[in] user_data user data
+ * @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_vconf_set_changed_cb(const char *vconf_key, system_settings_key_e key, int slot, void* user_data);
+
+/**
+ * @internal
+ * @brief Unset the system settings notification callback
+ * @since_tizen 2.3
+ * @param[in] vconf_key vconf key name used in the code
+ * @param[in] slot internal slot to set the key (0~4)
+ * @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_vconf_unset_changed_cb(const char *vconf_key, int slot);
int system_setting_get_incoming_call_ringtone(system_settings_key_e key, system_setting_data_type_e data_type, void** value);
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(libxml-2.0)
+BuildRequires: pkgconfig(pkgmgr)
+BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(libtzplatform-config)
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
%description
A System Settings library in Tizen Native API.
make %{?jobs:-j%jobs}
%install
+rm -rf %{buildroot}
%make_install
%post -p /sbin/ldconfig
return system_settings_get_value(key, SYSTEM_SETTING_DATA_TYPE_BOOL, (void**)value);
}
+#if 0
int system_settings_set_value_double(system_settings_key_e key, double value)
{
double* ptr = &value;
{
return system_settings_get_value(key, SYSTEM_SETTING_DATA_TYPE_DOUBLE, (void**)value);
}
+#endif
int system_settings_set_value_string(system_settings_key_e key, const char *value)
{