2 * Open Service Platform
3 * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd
5 * Licensed under the Flora License, Version 1.1 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://floralicense.org/license/
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include "libug-setting-location-efl.h"
19 #include "libug-setting-location-efl-help.h"
20 #include "libug-setting-location-efl-log.h"
22 static char *help_menu[] = {
23 N_("IDS_LBS_BODY_GPS"),
24 N_("IDS_LBS_BODY_ADVANCED_GPS"),
25 N_("IDS_LBS_BODY_NETWORK_POSITION"),
28 static char *help_msg[] = {
29 N_("IDS_LBS_POP_APPLICATIONS_WILL_BE_PERMITTED_TO_USE_YOUR_LOCATION"),
30 N_("IDS_LBS_BODY_DOWNLOADING_DATA_WILL_SPEED_UP_GPS_OPERATION_BUT_INCUR_CHARGES"),
31 N_("IDS_LBS_BODY_ENABLING_NETWORK_POSITIONING_WILL_HELP_YOU_FIND_YOUR_LOCATION_EVEN_IF_YOU_ARE_INDOORS_MSG"),
34 #define EDJ_NAME EDJDIR"/setting-location.edj"
36 #define GROUP_NAME "help"
38 #define LOCATION_HELP_MENU_GPS 0
39 #define LOCATION_HELP_MENU_AGPS 1
40 #define LOCATION_HELP_MENU_NET 2
42 static void setting_location_help_back_cb(void *data, Evas_Object * obj, void *event_info)
44 LOC_LOG("setting_location_help_back_cb");
45 struct ug_data *ugd = (struct ug_data *)data;
46 elm_naviframe_item_pop(ugd->naviframe);
49 static char *setting_location_get_help_msg(void)
51 char help_message[1024] = {0,};
53 snprintf(help_message, sizeof(help_message) - 1,
54 "<title>%s</title><br><msg>%s</msg><br><br><title>%s</title><br><msg>%s</msg><br><br><title>%s</title><br><msg>%s</msg>",
55 _(help_menu[LOCATION_HELP_MENU_GPS]), _(help_msg[LOCATION_HELP_MENU_GPS]),\
56 _(help_menu[LOCATION_HELP_MENU_AGPS]), _(help_msg[LOCATION_HELP_MENU_AGPS]),\
57 _(help_menu[LOCATION_HELP_MENU_NET]), _(help_msg[LOCATION_HELP_MENU_NET]));
59 return strdup(help_message);
62 static Evas_Object *setting_location_get_layout(Evas_Object * parent, void *data)
64 Evas_Object *layout = elm_layout_add(parent);
66 elm_layout_file_set(layout, EDJ_NAME, GROUP_NAME);
67 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
68 evas_object_show(layout);
70 edje_object_part_text_set(_EDJ(layout), "help_msg", setting_location_get_help_msg());
75 int setting_location_help_view(void *data)
77 struct ug_data *ugd = (struct ug_data *)data;
80 Evas_Object *l_button;
82 l_button = elm_button_add(ugd->naviframe);
83 evas_object_smart_callback_add(l_button, "clicked", setting_location_help_back_cb, ugd);
85 layout = setting_location_get_layout(ugd->naviframe, ugd);
86 elm_naviframe_item_push(ugd->naviframe, S_("IDS_COM_BODY_HELP"), l_button, NULL, layout, NULL);
87 elm_object_style_set(l_button, "naviframe/back_btn/default");