Tizen 2.0 Release
[apps/home/settings.git] / setting-connectivity / src / setting-connectivity-usb-help.c
1 /*
2  * setting
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Flora License, Version 1.0 (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
8  *
9  *     http://floralicense.org/license/
10  *
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.
16  */
17 #include <setting-connectivity-usb-help.h>
18 #define HELP_LEN 2048
19
20 static int setting_connectivity_usb_help_create(void *cb);
21 static int setting_connectivity_usb_help_destroy(void *cb);
22 static int setting_connectivity_usb_help_update(void *cb);
23 static int setting_connectivity_usb_help_cleanup(void *cb);
24
25 setting_view setting_view_connectivity_usb_help = {
26         .create = setting_connectivity_usb_help_create,
27         .destroy = setting_connectivity_usb_help_destroy,
28         .update = setting_connectivity_usb_help_update,
29         .cleanup = setting_connectivity_usb_help_cleanup,
30 };
31
32 /* ***************************************************
33  *
34  *basic func
35  *
36  ***************************************************/
37
38 static int setting_connectivity_usb_help_create(void *cb)
39 {
40         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
41
42         SettingConnectivityUG *ad = (SettingConnectivityUG *) cb;
43
44         char samsung_kies_help[HELP_LEN];
45         char mass_storage_help[HELP_LEN];
46         char debugging_mode_help[HELP_LEN];
47
48         snprintf(samsung_kies_help, HELP_LEN,
49                 "%s%s%s%s", "<b>", _("IDS_ST_HEADER_SAMSUNG_KIES"), "</b><br>",
50                 evas_textblock_text_utf8_to_markup(NULL, _("IDS_ST_BODY_SAMSUNG_KIES_CONNECTION_CONNECTING_USB_HELP_MSG")));
51         snprintf(mass_storage_help, HELP_LEN,
52                 "%s%s%s%s", "<b>", _("IDS_ST_OPT_MASS_STORAGE_ABB"), "</b><br>",
53                 evas_textblock_text_utf8_to_markup(NULL, _("IDS_ST_BODY_MASS_STORAGE_HELP_MSG")));
54         snprintf(debugging_mode_help, HELP_LEN,
55                 "%s%s%s%s", "<b>", _("IDS_ST_BODY_USB_DEBUGGING"), "</b><br>",
56                 evas_textblock_text_utf8_to_markup(NULL, _("IDS_ST_BODY_USB_DEBUGGING_IS_INTENDED_FOR_DEVELOPMENT_PURPOSES_ONLY_MSG")));
57
58
59         Evas_Object *genlist;
60         setting_push_layout_navi_bar_genlist(ad->win_main_layout,
61                                              ad->win_get,
62                                              _("IDS_COM_BODY_HELP"),
63                                              _("IDS_COM_BODY_BACK"),
64                                              NULL,
65                                              setting_connectivity_usb_help_click_back_cb,
66                                              NULL, ad, &genlist,
67                                              ad->navi_bar);
68
69         setting_create_Gendial_field_def(genlist, &(ad->itc_help_style),
70                                          NULL,
71                                          ad, SWALLOW_Type_LAYOUT_SPECIALIZTION_X, NULL, NULL,
72                                          0, samsung_kies_help, NULL,
73                                          NULL);
74         
75         setting_create_Gendial_field_def(genlist, &(ad->itc_help_style),
76                                          NULL,
77                                          ad, SWALLOW_Type_LAYOUT_SPECIALIZTION_X, NULL, NULL,
78                                          0, mass_storage_help, NULL,
79                                          NULL);
80         
81         setting_create_Gendial_field_def(genlist, &(ad->itc_help_style),
82                                          NULL,
83                                          ad, SWALLOW_Type_LAYOUT_SPECIALIZTION_X, NULL, NULL,
84                                          0, debugging_mode_help, NULL,
85                                          NULL);
86
87         setting_view_connectivity_usb_help.is_create = 1;
88
89         return SETTING_RETURN_SUCCESS;
90 }
91
92 static int setting_connectivity_usb_help_destroy(void *cb)
93 {
94         /* error check */
95         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
96
97         SettingConnectivityUG *ad = (SettingConnectivityUG *) cb;
98
99         elm_naviframe_item_pop(ad->navi_bar);
100         setting_view_connectivity_usb_help.is_create = 0;
101
102         return SETTING_RETURN_SUCCESS;
103 }
104
105 static int setting_connectivity_usb_help_update(void *cb)
106 {
107         return SETTING_RETURN_SUCCESS;
108 }
109
110 static int setting_connectivity_usb_help_cleanup(void *cb)
111 {
112         return setting_connectivity_usb_help_destroy(cb);
113 }
114
115 /* ***************************************************
116  *
117  *call back func
118  *
119  ***************************************************/
120
121 static void
122 setting_connectivity_usb_help_click_back_cb(void *data, Evas_Object *obj,
123                                             void *event_info)
124 {
125         /* error check */
126         setting_retm_if(data == NULL, " Data parameter is NULL");
127
128         SettingConnectivityUG *ad = (SettingConnectivityUG *) data;
129         setting_view_change(&setting_view_connectivity_usb_help,
130                             &setting_view_connectivity_usb, ad);
131 }