Fix N_SE-13547 and N_SE-13516
[apps/core/preloaded/settings.git] / setting-connectivity / src / setting-connectivity-usb-help.c
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5  *
6  * Contact: MyoungJune Park <mj2004.park@samsung.com>
7  * 
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 #include <setting-connectivity-usb-help.h>
22 #define HELP_LEN 2048
23
24 static int setting_connectivity_usb_help_create(void *cb);
25 static int setting_connectivity_usb_help_destroy(void *cb);
26 static int setting_connectivity_usb_help_update(void *cb);
27 static int setting_connectivity_usb_help_cleanup(void *cb);
28
29 setting_view setting_view_connectivity_usb_help = {
30         .create = setting_connectivity_usb_help_create,
31         .destroy = setting_connectivity_usb_help_destroy,
32         .update = setting_connectivity_usb_help_update,
33         .cleanup = setting_connectivity_usb_help_cleanup,
34 };
35
36 /* ***************************************************
37  *
38  *basic func
39  *
40  ***************************************************/
41
42 static int setting_connectivity_usb_help_create(void *cb)
43 {
44         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
45
46         SettingConnectivityUG *ad = (SettingConnectivityUG *) cb;
47
48         char samsung_kies_help[HELP_LEN];
49         char mass_storage_help[HELP_LEN];
50         char debugging_mode_help[HELP_LEN];
51
52         snprintf(samsung_kies_help, HELP_LEN,
53                 "%s%s%s%s", "<b>", _("IDS_ST_HEADER_SAMSUNG_KIES"), "</b><br>",
54                 evas_textblock_text_utf8_to_markup(NULL, _("IDS_ST_BODY_SAMSUNG_KIES_CONNECTION_CONNECTING_USB_HELP_MSG")));
55         snprintf(mass_storage_help, HELP_LEN,
56                 "%s%s%s%s", "<b>", _("IDS_ST_OPT_MASS_STORAGE_ABB"), "</b><br>",
57                 evas_textblock_text_utf8_to_markup(NULL, _("IDS_ST_BODY_MASS_STORAGE_HELP_MSG")));
58         snprintf(debugging_mode_help, HELP_LEN,
59                 "%s%s%s%s", "<b>", _("IDS_ST_BODY_USB_DEBUGGING"), "</b><br>",
60                 evas_textblock_text_utf8_to_markup(NULL, _("IDS_ST_BODY_USB_DEBUGGING_IS_INTENDED_FOR_DEVELOPMENT_PURPOSES_ONLY_MSG")));
61
62
63         Evas_Object *genlist;
64         setting_push_layout_navi_bar_genlist(ad->win_main_layout,
65                                              ad->win_get,
66                                              _("IDS_COM_BODY_HELP"),
67                                              _("IDS_COM_BODY_BACK"),
68                                              NULL,
69                                              setting_connectivity_usb_help_click_back_cb,
70                                              NULL, ad, &genlist,
71                                              ad->navi_bar);
72
73         setting_create_Gendial_field_def(genlist, &(ad->itc_help_style),
74                                          NULL,
75                                          ad, SWALLOW_Type_LAYOUT_SPECIALIZTION_X, NULL, NULL,
76                                          0, samsung_kies_help, NULL,
77                                          NULL);
78         
79         setting_create_Gendial_field_def(genlist, &(ad->itc_help_style),
80                                          NULL,
81                                          ad, SWALLOW_Type_LAYOUT_SPECIALIZTION_X, NULL, NULL,
82                                          0, mass_storage_help, NULL,
83                                          NULL);
84         
85         setting_create_Gendial_field_def(genlist, &(ad->itc_help_style),
86                                          NULL,
87                                          ad, SWALLOW_Type_LAYOUT_SPECIALIZTION_X, NULL, NULL,
88                                          0, debugging_mode_help, NULL,
89                                          NULL);
90
91         setting_view_connectivity_usb_help.is_create = 1;
92
93         return SETTING_RETURN_SUCCESS;
94 }
95
96 static int setting_connectivity_usb_help_destroy(void *cb)
97 {
98         /* error check */
99         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
100
101         SettingConnectivityUG *ad = (SettingConnectivityUG *) cb;
102
103         elm_naviframe_item_pop(ad->navi_bar);
104         setting_view_connectivity_usb_help.is_create = 0;
105
106         return SETTING_RETURN_SUCCESS;
107 }
108
109 static int setting_connectivity_usb_help_update(void *cb)
110 {
111         return SETTING_RETURN_SUCCESS;
112 }
113
114 static int setting_connectivity_usb_help_cleanup(void *cb)
115 {
116         return setting_connectivity_usb_help_destroy(cb);
117 }
118
119 /* ***************************************************
120  *
121  *call back func
122  *
123  ***************************************************/
124
125 static void
126 setting_connectivity_usb_help_click_back_cb(void *data, Evas_Object *obj,
127                                             void *event_info)
128 {
129         /* error check */
130         setting_retm_if(data == NULL, " Data parameter is NULL");
131
132         SettingConnectivityUG *ad = (SettingConnectivityUG *) data;
133         setting_view_change(&setting_view_connectivity_usb_help,
134                             &setting_view_connectivity_usb, ad);
135 }