summaryrefslogtreecommitdiff
path: root/main/src/common/ivug-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/common/ivug-config.c')
-rwxr-xr-xmain/src/common/ivug-config.c200
1 files changed, 0 insertions, 200 deletions
diff --git a/main/src/common/ivug-config.c b/main/src/common/ivug-config.c
deleted file mode 100755
index 06efce5..0000000
--- a/main/src/common/ivug-config.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright 2012 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.tizenopensource.org/license
- *
- * Unless required by applicable law or agreed to in writing, software
- * 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.
- */
-
-
-#include "ivug-common.h"
-#include "ivug-define.h"
-#include "ivug-effect.h"
-#include "ivug-config.h"
-
-#include <vconf.h>
-#include <vconf-keys.h>
-
-// TODO: Request vconf key to setting part, Slide show setting vconf key
-#define VCONFKEY_GALLERY_INTERVAL_TIME "db/setting/gallery/interval_time" //double
-#define VCONFKEY_GALLERY_REPEAT_STATE "db/setting/gallery/repeat_state" //boolean
-#define VCONFKEY_GALLERY_SHUFFLE_STATE "db/setting/gallery/shuffle_state" //boolean
-#define VCONFKEY_GALLERY_TRANSITION_EFFECT "db/setting/gallery/ss_effect" //char
-
-enum { STATE_FALSE = 0, STATE_TRUE = 1, };
-
-/*
- Set lock screen with given image.
-
- CAUTION : does not check filepath integrity
-*/
-bool ivug_config_set_lockscreen_image(const char* filepath)
-{
- if(filepath == NULL)
- {
- MSG_IMAGEVIEW_ERROR("Lock screen path is NULL");
- return FALSE;
- }
-
- if(vconf_set_str( VCONFKEY_IDLE_LOCK_BGSET, filepath ) < 0)
- {
- MSG_IMAGEVIEW_ERROR("Lockscreen set Error : %s", filepath);
- return FALSE;
- }
-
- MSG_IMAGEVIEW_HIGH("Set Lockscreen filepath = %s", filepath);
-
- return TRUE;
-}
-
-/*
- Set home screen with given image
-
- CAUTION : does not check filepath integrity
-*/
-bool ivug_config_set_homescreen_image( const char* filepath )
-{
- if(filepath == NULL)
- {
- MSG_IMAGEVIEW_ERROR("Home screen path is NULL");
- return FALSE;
- }
-// TODO : Need to check file existence?????
- if(vconf_set_str(VCONFKEY_BGSET, filepath) < 0)
- {
- MSG_IMAGEVIEW_ERROR("Homescreen set Error");
- return FALSE;
- }
-
- MSG_IMAGEVIEW_HIGH("Set Homescreen filepath = %s", filepath);
- return TRUE;
-}
-
-
-static bool
-_ivug_config_get_slideshow_repeat_state(void)
-{
- int repeat_state = STATE_FALSE;
-
- if(vconf_get_bool(VCONFKEY_GALLERY_REPEAT_STATE, &repeat_state) < 0)
- {
- MSG_IMAGEVIEW_ERROR("vconf_get_bool failed, set as repeat state as default: false");
- return false;
- }
-
- MSG_IMAGEVIEW_HIGH("repeat state is: %d", repeat_state);
-
- return (repeat_state == STATE_TRUE ? true : false);
-}
-
-static bool
-_ivug_config_get_slideshow_shuffle_state(void)
-{
- int shuffle_state = STATE_FALSE;
-
- if(vconf_get_bool(VCONFKEY_GALLERY_SHUFFLE_STATE, &shuffle_state) < 0)
- {
- MSG_IMAGEVIEW_ERROR("vconf_get_bool failed, set as shuffle state as default: false");
- return false;
- }
-
- MSG_IMAGEVIEW_HIGH("shuffle state is: %d", shuffle_state);
-
- return (shuffle_state == STATE_TRUE ? true : false);
-}
-
-static double
-_ivug_config_get_slideshow_interval_time(void)
-{
- double interval_time = 0.0;
-
- if(vconf_get_dbl(VCONFKEY_GALLERY_INTERVAL_TIME, &interval_time) < 0)
- {
- MSG_IMAGEVIEW_ERROR("vconf_get_dbl failed, set as interval time as -1");
-
- interval_time = -1.0;
- }
-
- MSG_IMAGEVIEW_HIGH("interval time is: %f", interval_time);
- return interval_time;
-}
-
-static char *
-_ivug_config_get_slideshow_effect_type(void)
-{
-// TODO : Free returned string??
- char *effect_str = NULL;
- effect_str = vconf_get_str(VCONFKEY_GALLERY_TRANSITION_EFFECT);
-
- if(!effect_str)
- {
- MSG_IMAGEVIEW_ERROR("vconf_get_str failed, set as effect type as default");
-
- effect_str = NULL;
- }
-
- MSG_IMAGEVIEW_HIGH("effect is: %s", effect_str);
-
- return effect_str;
-}
-
-static ivug_effect_type
-_ivug_config_get_effect_type_by_string(char *effect_str)
-{
- ivug_retv_if(!effect_str, EFFECT_NONE);
-
- ivug_effect_type type = IVUG_EFFECT_TYPE_SLIDE;
-
- if(!strncmp(effect_str, "Slide", strlen(effect_str)))
- {
- type = IVUG_EFFECT_TYPE_SLIDE;
- }
- else //Set all other cases as default NONE
- {
- MSG_SLIDER_WARN("Invalid type : %s", effect_str);
- type = EFFECT_NONE;
- }
-
- MSG_IMAGEVIEW_HIGH("effect_str = %s, type = %d", effect_str, type);
-
- return type;
-}
-
-void
-ivug_config_get_slideshow_setting(slide_show_mode *mode,
- double *interval_time,
- ivug_effect_type *effect_type)
-{
- *mode = SLIDE_SHOW_MODE_NORMAL;
-
- bool state;
-
- state = _ivug_config_get_slideshow_repeat_state();
- if(state == true)
- {
- *mode |= SLIDE_SHOW_MODE_REPEAT;
- }
-
- state = _ivug_config_get_slideshow_shuffle_state();
- if(state == true)
- {
- *mode |= SLIDE_SHOW_MODE_SHUFFLE;
- }
-
- *interval_time = _ivug_config_get_slideshow_interval_time();
-
- /* EFFECT_NONE, EFFECT_FADE, EFFECT_BLIND, EFFECT_IRIS */
- char *effect = _ivug_config_get_slideshow_effect_type();
-
- *effect_type = _ivug_config_get_effect_type_by_string(effect);
-}
-
-