add tzplatform-config and fix coding conventions 24/66924/1 accepted/tizen/common/20160422.172000 accepted/tizen/ivi/20160422.070403 accepted/tizen/mobile/20160422.070526 accepted/tizen/tv/20160422.070351 accepted/tizen/wearable/20160422.070335 submit/tizen/20160422.044504
authorMyoungJune Park <mj2004.park@samsung.com>
Fri, 22 Apr 2016 04:42:42 +0000 (13:42 +0900)
committerMyoungJune Park <mj2004.park@samsung.com>
Fri, 22 Apr 2016 04:42:42 +0000 (13:42 +0900)
Change-Id: I6fe2afa9d097dec7c2d721094aca10c198d20722

TC_gui/main.c
include/system_settings.h
include/system_settings_private.h
packaging/capi-system-system-settings.spec
src/system_setting_platform.c
src/system_settings.c
src/system_settings_vconf.c

index 939134e..082cd98 100644 (file)
@@ -43,8 +43,8 @@ static Evas_Object *create_win(const char *name)
        elm_win_borderless_set(eo, EINA_TRUE);
        elm_win_autodel_set(eo, EINA_TRUE);
        evas_object_smart_callback_add(eo, "delete,request", _quit_cb, NULL);
-       //ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
-       //evas_object_resize(eo, w, h);
+       /*ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h); */
+       /*evas_object_resize(eo, w, h); */
 
        return eo;
 }
@@ -894,23 +894,23 @@ static int _rotation_cb(enum appcore_rm mode, void *data)
        int angle;
 
        switch (mode) {
-               case APPCORE_RM_LANDSCAPE_NORMAL:
-                       angle = -90;
-                       break;
-
-               case APPCORE_RM_LANDSCAPE_REVERSE:
-                       angle = 90;
-                       break;
-
-               case APPCORE_RM_PORTRAIT_REVERSE:
-                       angle = 180;
-                       break;
-
-               case APPCORE_RM_UNKNOWN:
-               case APPCORE_RM_PORTRAIT_NORMAL:
-               default:
-                       angle = 0;
-                       break;
+       case APPCORE_RM_LANDSCAPE_NORMAL:
+               angle = -90;
+               break;
+
+       case APPCORE_RM_LANDSCAPE_REVERSE:
+               angle = 90;
+               break;
+
+       case APPCORE_RM_PORTRAIT_REVERSE:
+               angle = 180;
+               break;
+
+       case APPCORE_RM_UNKNOWN:
+       case APPCORE_RM_PORTRAIT_NORMAL:
+       default:
+               angle = 0;
+               break;
        }
 
        elm_win_rotation_with_resize_set(ad->win_main, angle);
index 128cfa8..a2ab27c 100644 (file)
@@ -38,8 +38,7 @@ extern "C"
  * @brief Enumeration for system settings error.
  * @since_tizen 2.3
  */
-typedef enum
-{
+typedef enum {
        SYSTEM_SETTINGS_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
        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 */
@@ -59,40 +58,40 @@ system_settings_error_e;
  * @since_tizen 2.3
  */
 typedef enum {
-    SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, /**< (string) The file path of the current ringtone */
-    SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, /**< (string) The file path of the current home screen wallpaper */
-    SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, /**< (string) The file path of the current lock screen wallpaper */
-    SYSTEM_SETTINGS_KEY_FONT_SIZE, /**< (int) The current system font size */
-    SYSTEM_SETTINGS_KEY_FONT_TYPE, /**< (string) The current system font type */
-
-    SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, /**< (bool) Indicates whether the motion service is activated */
-    SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE,  /**< (string) The file path of the current email alert ringtone */
-    SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED,  /**< (bool) Indicates whether the USB debugging is enabled (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */
-    SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED,  /**< bool) Indicates whether the 3G data network is enabled (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */
-    SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP = SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED+2,  /**< (string) Indicates lockscreen app pkg name  */
-
-    SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE,/**< (string) The current system default font type (only support Get) */
-    SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY,                /**< (string) Indicates the current country setting in the <LANGUAGE>_<REGION> syntax. The country setting is in the ISO 639-2 format, and the region setting is in the ISO 3166-1 alpha-2 format */
-    SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE,       /**< (string) Indicates the current language setting in the <LANGUAGE>_<REGION> syntax. The language setting is in the ISO 639-2 format and the region setting is in the ISO 3166-1 alpha-2 format. */
-    SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,      /**< (bool) Indicates whether the 24-hour clock is used. If the value is @c false, the 12-hour clock is used. */
-    SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE,       /**< (string) Indicates the current time zone. */
-
-    SYSTEM_SETTINGS_KEY_TIME_CHANGED,          /**< (int) Once System changes time, this event occurs to notify time change. */
-    SYSTEM_SETTINGS_KEY_SOUND_LOCK,                                    /**< GET (bool) Indicates whether the screen lock sound is enabled on the device. ex) LCD on/off sound */
-    SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE,                     /**< GET (bool) Indicates whether the device is in the silent mode. */
-    SYSTEM_SETTINGS_KEY_SOUND_TOUCH,                           /**< GET (bool) Indicates whether the screen touch sound is enabled on the device. */
-    SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO,  /**< GET (bool) Indicates whether rotation control is automatic.*/
-
-    SYSTEM_SETTINGS_KEY_DEVICE_NAME,                                   /**< GET (string) Indicates device name. */
-    SYSTEM_SETTINGS_KEY_MOTION_ENABLED,                                        /**< GET (bool) Indicates whether the device user has enabled the motion feature. */
-    SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION,             /**< GET (bool) Indicates whether Wi-Fi-related notifications are enabled on the device. */
-    SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE,                   /**< GET (bool) Indicates whether the device is in the flight mode. */
-    SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME,                         /**< (int) Indicates the backlight time (in seconds). @internal The following values can be used: 15, 30, 60, 120, 300, and 600. */
-
-    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_INCOMING_CALL_RINGTONE, /**< (string) The file path of the current ringtone */
+       SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, /**< (string) The file path of the current home screen wallpaper */
+       SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, /**< (string) The file path of the current lock screen wallpaper */
+       SYSTEM_SETTINGS_KEY_FONT_SIZE, /**< (int) The current system font size */
+       SYSTEM_SETTINGS_KEY_FONT_TYPE, /**< (string) The current system font type */
+
+       SYSTEM_SETTINGS_KEY_MOTION_ACTIVATION, /**< (bool) Indicates whether the motion service is activated */
+       SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE,  /**< (string) The file path of the current email alert ringtone */
+       SYSTEM_SETTINGS_KEY_USB_DEBUGGING_ENABLED,  /**< (bool) Indicates whether the USB debugging is enabled (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */
+       SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED,  /**< bool) Indicates whether the 3G data network is enabled (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */
+       SYSTEM_SETTINGS_KEY_LOCKSCREEN_APP = SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED+2,  /**< (string) Indicates lockscreen app pkg name  */
+
+       SYSTEM_SETTINGS_KEY_DEFAULT_FONT_TYPE,/**< (string) The current system default font type (only support Get) */
+       SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY,             /**< (string) Indicates the current country setting in the <LANGUAGE>_<REGION> syntax. The country setting is in the ISO 639-2 format, and the region setting is in the ISO 3166-1 alpha-2 format */
+       SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE,    /**< (string) Indicates the current language setting in the <LANGUAGE>_<REGION> syntax. The language setting is in the ISO 639-2 format and the region setting is in the ISO 3166-1 alpha-2 format. */
+       SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR,   /**< (bool) Indicates whether the 24-hour clock is used. If the value is @c false, the 12-hour clock is used. */
+       SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE,    /**< (string) Indicates the current time zone. */
+
+       SYSTEM_SETTINGS_KEY_TIME_CHANGED,               /**< (int) Once System changes time, this event occurs to notify time change. */
+       SYSTEM_SETTINGS_KEY_SOUND_LOCK,                                 /**< GET (bool) Indicates whether the screen lock sound is enabled on the device. ex) LCD on/off sound */
+       SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE,                  /**< GET (bool) Indicates whether the device is in the silent mode. */
+       SYSTEM_SETTINGS_KEY_SOUND_TOUCH,                                /**< GET (bool) Indicates whether the screen touch sound is enabled on the device. */
+       SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO,       /**< GET (bool) Indicates whether rotation control is automatic.*/
+
+       SYSTEM_SETTINGS_KEY_DEVICE_NAME,                                        /**< GET (string) Indicates device name. */
+       SYSTEM_SETTINGS_KEY_MOTION_ENABLED,                                     /**< GET (bool) Indicates whether the device user has enabled the motion feature. */
+       SYSTEM_SETTINGS_KEY_NETWORK_WIFI_NOTIFICATION,          /**< GET (bool) Indicates whether Wi-Fi-related notifications are enabled on the device. */
+       SYSTEM_SETTINGS_KEY_NETWORK_FLIGHT_MODE,                        /**< GET (bool) Indicates whether the device is in the flight mode. */
+       SYSTEM_SETTINGS_KEY_SCREEN_BACKLIGHT_TIME,                      /**< (int) Indicates the backlight time (in seconds). @internal The following values can be used: 15, 30, 60, 120, 300, and 600. */
+
+       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;
 
@@ -101,9 +100,9 @@ typedef enum {
  * @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_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;
 
 
@@ -112,11 +111,11 @@ typedef enum {
  * @since_tizen 2.3
  */
 typedef enum {
-    SYSTEM_SETTINGS_FONT_SIZE_SMALL = 0, /**< A small size */
-    SYSTEM_SETTINGS_FONT_SIZE_NORMAL, /**< A normal size */
-    SYSTEM_SETTINGS_FONT_SIZE_LARGE, /**< A large size */
-    SYSTEM_SETTINGS_FONT_SIZE_HUGE, /**< A huge size */
-    SYSTEM_SETTINGS_FONT_SIZE_GIANT, /**< A giant size */
+       SYSTEM_SETTINGS_FONT_SIZE_SMALL = 0, /**< A small size */
+       SYSTEM_SETTINGS_FONT_SIZE_NORMAL, /**< A normal size */
+       SYSTEM_SETTINGS_FONT_SIZE_LARGE, /**< A large size */
+       SYSTEM_SETTINGS_FONT_SIZE_HUGE, /**< A huge size */
+       SYSTEM_SETTINGS_FONT_SIZE_GIANT, /**< A giant size */
 } system_settings_font_size_e;
 
 
index 463c421..173c7be 100644 (file)
@@ -39,20 +39,20 @@ extern "C"
 #define SETTING_TRACE_DEBUG(fmt, arg...) \
        do {\
                SECURE_LOGD("\033[0;32mDEBUG: " fmt "\033[0m\n", ##arg);\
-       }while(0);
+       } while (0);
 
 #define SETTING_TRACE(fmt, arg...) \
        do {\
                SECURE_LOGI("\033[0;36m" fmt "\033[0m\n", ##arg);\
-       }while(0);
+       } while (0);
 
 #define SETTING_TRACE_BEGIN do {\
                SECURE_LOGD("\033[0;35mENTER FUNCTION: %s. \033[0m\n", __FUNCTION__);\
-       }while(0);
+       } while (0);
 
 #define SETTING_TRACE_END  do {\
                SECURE_LOGD("\033[0;35mEXIT FUNCTION: %s. \033[0m\n", __FUNCTION__);\
-       }while(0);
+       } while (0);
 #else
 #define SETTING_TRACE_DEBUG(fmt, arg...)
 #define SETTING_TRACE(fmt, arg...)
index 5b2b832..4b849d7 100755 (executable)
@@ -14,6 +14,7 @@ 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
index 4f43ec0..42dd8a7 100644 (file)
@@ -36,7 +36,7 @@
 
 #include <fontconfig/fontconfig.h>
 
-//#include <pkgmgr-info.h>
+/*#include <pkgmgr-info.h> */
 
 #include <Elementary.h>
 #include <Evas.h>
@@ -280,9 +280,9 @@ int _is_file_accessible(const char *path)
                SETTING_TRACE("found the file  %s", path);
                return 0;
        } else {
-               // error code : 13
+               /* error code : 13 */
                SETTING_TRACE("found the file  %s --- error code : %d ", path, errno);
-                       return -errno;
+               return -errno;
        }
 }
 
@@ -330,7 +330,7 @@ int system_setting_set_email_alert_ringtone(system_settings_key_e key, system_se
 bool __is_supported_image_type_load(char *path)
 {
        SETTING_TRACE_BEGIN;
-       //evas_init();
+       /*evas_init(); */
        ecore_evas_init();
        Ecore_Evas  *ee;
        Evas        *evas;
@@ -559,7 +559,7 @@ int system_setting_set_wallpaper_home_screen(system_settings_key_e key, system_s
 
                        if (system_setting_get_extended_wallpaper_num(dirp->d_name, &temp_image_num)
                            != SYSTEM_SETTINGS_ERROR_NONE) {
-                               if(dp)
+                               if (dp)
                                        closedir(dp);
                                return SYSTEM_SETTINGS_ERROR_IO_ERROR;
                        }
@@ -570,7 +570,7 @@ int system_setting_set_wallpaper_home_screen(system_settings_key_e key, system_s
 
                        image_count++;
                }
-               if(dp)
+               if (dp)
                        closedir(dp);
 
                /* Numbering rule: Gear is odd number */
@@ -1166,7 +1166,7 @@ int __is_available_font(char *font_name)
                                                /* I will set english as default family language. */
                                                /* If there is no proper family language for current locale, */
                                                /* we have to show the english family name. */
-                                               if (!strcmp((char*)lang, "en")) {
+                                               if (!strcmp((char *)lang, "en")) {
                                                        family_result = (char *)family;
                                                }
                                                id++;
@@ -1414,24 +1414,24 @@ static int __font_size_get()
        }
 
        switch (vconf_value) {
-               case SYSTEM_SETTINGS_FONT_SIZE_SMALL:
-                       font_size = SMALL_FONT_DPI;
-                       break;
-               case SYSTEM_SETTINGS_FONT_SIZE_NORMAL:
-                       font_size = MIDDLE_FONT_DPI;
-                       break;
-               case SYSTEM_SETTINGS_FONT_SIZE_LARGE:
-                       font_size = LARGE_FONT_DPI;
-                       break;
-               case SYSTEM_SETTINGS_FONT_SIZE_HUGE:
-                       font_size = HUGE_FONT_DPI;
-                       break;
-               case SYSTEM_SETTINGS_FONT_SIZE_GIANT:
-                       font_size = GIANT_FONT_DPI;
-                       break;
-               default:
-                       font_size = MIDDLE_FONT_DPI;
-                       break;
+       case SYSTEM_SETTINGS_FONT_SIZE_SMALL:
+               font_size = SMALL_FONT_DPI;
+               break;
+       case SYSTEM_SETTINGS_FONT_SIZE_NORMAL:
+               font_size = MIDDLE_FONT_DPI;
+               break;
+       case SYSTEM_SETTINGS_FONT_SIZE_LARGE:
+               font_size = LARGE_FONT_DPI;
+               break;
+       case SYSTEM_SETTINGS_FONT_SIZE_HUGE:
+               font_size = HUGE_FONT_DPI;
+               break;
+       case SYSTEM_SETTINGS_FONT_SIZE_GIANT:
+               font_size = GIANT_FONT_DPI;
+               break;
+       default:
+               font_size = MIDDLE_FONT_DPI;
+               break;
        }
        return font_size;
 }
index 7a9d9d3..dfc432e 100644 (file)
@@ -446,7 +446,7 @@ int system_settings_set_value(system_settings_key_e key, system_setting_data_typ
 
        int ret = system_settings_get_item(key, &system_setting_item);
 
-       if (0 != ret ) {
+       if (0 != ret) {
                LOGE("[%s] INVALID_PARAMETER(0x%08x) : invalid key", __FUNCTION__, SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER);
                return SYSTEM_SETTINGS_ERROR_NOT_SUPPORTED;
        }
index 5e6f53c..b442a51 100644 (file)
@@ -190,25 +190,25 @@ static void system_setting_vconf_event_cb100(keynode_t *node, void *event_data)
 static system_setting_vconf_event_cb system_setting_vconf_get_event_cb_slot(int slot)
 {
        switch (slot) {
-               case 0:
-                       return system_setting_vconf_event_cb0;
+       case 0:
+               return system_setting_vconf_event_cb0;
 
-               case 1:
-                       return system_setting_vconf_event_cb1;
+       case 1:
+               return system_setting_vconf_event_cb1;
 
-               case 2:
-                       return system_setting_vconf_event_cb2;
+       case 2:
+               return system_setting_vconf_event_cb2;
 
-               case 3:
-                       return system_setting_vconf_event_cb3;
+       case 3:
+               return system_setting_vconf_event_cb3;
 
-               case 4:
-                       return system_setting_vconf_event_cb4;
-               case 100:
-                       return system_setting_vconf_event_cb100;
+       case 4:
+               return system_setting_vconf_event_cb4;
+       case 100:
+               return system_setting_vconf_event_cb100;
 
-               default:
-                       return NULL;
+       default:
+               return NULL;
        }
 }