Tizen release 1.0
[apps/home/settings.git] / setting-connectivity / src / setting-connectivity-usb-help.c
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved 
5  *
6  * This file is part of org.tizen.setting
7  * Written by Hyejin Kim <hyejin0906.kim@samsung.com>
8  *
9  * PROPRIETARY/CONFIDENTIAL
10  * 
11  * This software is the confidential and proprietary information of 
12  * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
13  * disclose such Confidential Information and shall use it only in
14  * accordance with the terms of the license agreement you entered
15  * into with SAMSUNG ELECTRONICS.
16  *
17  * SAMSUNG make no representations or warranties about the suitability 
18  * of the software, either express or implied, including but not limited
19  * to the implied warranties of merchantability, fitness for a particular
20  * purpose, or non-infringement. SAMSUNG shall not be liable for any
21  * damages suffered by licensee as a result of using, modifying or
22  * distributing this software or its derivatives.
23  *
24  */
25 #include <setting-connectivity-usb-help.h>
26
27 #define HELP_MGS_BUF_LEN 256
28
29 static int setting_connectivity_usb_help_create(void *cb);
30 static int setting_connectivity_usb_help_destroy(void *cb);
31 static int setting_connectivity_usb_help_update(void *cb);
32 static int setting_connectivity_usb_help_cleanup(void *cb);
33
34 setting_view setting_view_connectivity_usb_help = {
35         .create = setting_connectivity_usb_help_create,
36         .destroy = setting_connectivity_usb_help_destroy,
37         .update = setting_connectivity_usb_help_update,
38         .cleanup = setting_connectivity_usb_help_cleanup,
39 };
40
41 /* **************************************************
42  *
43  *basic func
44  *
45  ***************************************************/
46
47 static int setting_connectivity_usb_help_create(void *cb)
48 {
49         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
50
51         SettingConnectivityUG *ad = (SettingConnectivityUG *) cb;
52
53         char usb_debugging_help_msg[HELP_MGS_BUF_LEN];
54         Evas_Object *genlist;
55         setting_push_layout_navi_bar_genlist(ad->win_main_layout,
56                                              ad->win_get,
57                                              _("IDS_COM_BODY_HELP"),
58                                              _("IDS_COM_BODY_BACK"),
59                                              NULL,
60                                              setting_connectivity_usb_help_click_back_cb,
61                                              NULL, ad, &genlist,
62                                              ad->navi_bar);
63
64         snprintf(usb_debugging_help_msg, HELP_MGS_BUF_LEN, "<b>%s</b><br>""%s",
65                                         _("IDS_ST_BODY_USB_DEBUGGING"), 
66                                         _("IDS_ST_BODY_THIS_MODE_IS_FOR_APPLICATION_DEVELOPERS_YOU_CAN_TEST_AND_DEVELOP_SOFTWARE"));
67
68         setting_create_Gendial_field_def(genlist, &(ad->itc_help_style),
69                                         NULL,
70                                         ad, SWALLOW_Type_LAYOUT_SPECIALIZTION_X, NULL, NULL,
71                                         0, usb_debugging_help_msg, NULL,
72                                         NULL);
73
74         setting_view_connectivity_usb_help.is_create = 1;
75
76         return SETTING_RETURN_SUCCESS;
77 }
78
79 static int setting_connectivity_usb_help_destroy(void *cb)
80 {
81         /* error check */
82         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
83
84         SettingConnectivityUG *ad = (SettingConnectivityUG *) cb;
85
86         elm_naviframe_item_pop(ad->navi_bar);
87         setting_view_connectivity_usb_help.is_create = 0;
88
89         return SETTING_RETURN_SUCCESS;
90 }
91
92 static int setting_connectivity_usb_help_update(void *cb)
93 {
94         return SETTING_RETURN_SUCCESS;
95 }
96
97 static int setting_connectivity_usb_help_cleanup(void *cb)
98 {
99         return setting_connectivity_usb_help_destroy(cb);
100 }
101
102 /* ***************************************************
103  *
104  *call back func
105  *
106  ***************************************************/
107
108 static void
109 setting_connectivity_usb_help_click_back_cb(void *data, Evas_Object *obj,
110                                             void *event_info)
111 {
112         /* error check */
113         setting_retm_if(data == NULL, " Data parameter is NULL");
114
115         SettingConnectivityUG *ad = (SettingConnectivityUG *) data;
116         setting_view_change(&setting_view_connectivity_usb_help,
117                             &setting_view_connectivity_usb, ad);
118 }