apply FSL license
[apps/home/settings.git] / setting-connectivity / src / setting-connectivity-usb-help.c
1 /*
2   * Copyright 2012  Samsung Electronics Co., Ltd
3   *
4   * Licensed under the Flora License, Version 1.0 (the "License");
5   * you may not use this file except in compliance with the License.
6   * You may obtain a copy of the License at
7   *
8   *     http://www.tizenopensource.org/license
9   *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16
17
18 #include <setting-connectivity-usb-help.h>
19
20 #define HELP_MGS_BUF_LEN 256
21
22 static int setting_connectivity_usb_help_create(void *cb);
23 static int setting_connectivity_usb_help_destroy(void *cb);
24 static int setting_connectivity_usb_help_update(void *cb);
25 static int setting_connectivity_usb_help_cleanup(void *cb);
26
27 setting_view setting_view_connectivity_usb_help = {
28         .create = setting_connectivity_usb_help_create,
29         .destroy = setting_connectivity_usb_help_destroy,
30         .update = setting_connectivity_usb_help_update,
31         .cleanup = setting_connectivity_usb_help_cleanup,
32 };
33
34 /* **************************************************
35  *
36  *basic func
37  *
38  ***************************************************/
39
40 static int setting_connectivity_usb_help_create(void *cb)
41 {
42         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
43
44         SettingConnectivityUG *ad = (SettingConnectivityUG *) cb;
45
46         char usb_debugging_help_msg[HELP_MGS_BUF_LEN];
47         Evas_Object *genlist;
48         setting_push_layout_navi_bar_genlist(ad->win_main_layout,
49                                              ad->win_get,
50                                              _("IDS_COM_BODY_HELP"),
51                                              _("IDS_COM_BODY_BACK"),
52                                              NULL,
53                                              setting_connectivity_usb_help_click_back_cb,
54                                              NULL, ad, &genlist,
55                                              ad->navi_bar);
56
57         snprintf(usb_debugging_help_msg, HELP_MGS_BUF_LEN, "<b>%s</b><br>""%s",
58                                         _("IDS_ST_BODY_USB_DEBUGGING"), 
59                                         _("IDS_ST_BODY_THIS_MODE_IS_FOR_APPLICATION_DEVELOPERS_YOU_CAN_TEST_AND_DEVELOP_SOFTWARE"));
60
61         setting_create_Gendial_field_def(genlist, &(ad->itc_help_style),
62                                         NULL,
63                                         ad, SWALLOW_Type_LAYOUT_SPECIALIZTION_X, NULL, NULL,
64                                         0, usb_debugging_help_msg, NULL,
65                                         NULL);
66
67         setting_view_connectivity_usb_help.is_create = 1;
68
69         return SETTING_RETURN_SUCCESS;
70 }
71
72 static int setting_connectivity_usb_help_destroy(void *cb)
73 {
74         /* error check */
75         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
76
77         SettingConnectivityUG *ad = (SettingConnectivityUG *) cb;
78
79         elm_naviframe_item_pop(ad->navi_bar);
80         setting_view_connectivity_usb_help.is_create = 0;
81
82         return SETTING_RETURN_SUCCESS;
83 }
84
85 static int setting_connectivity_usb_help_update(void *cb)
86 {
87         return SETTING_RETURN_SUCCESS;
88 }
89
90 static int setting_connectivity_usb_help_cleanup(void *cb)
91 {
92         return setting_connectivity_usb_help_destroy(cb);
93 }
94
95 /* ***************************************************
96  *
97  *call back func
98  *
99  ***************************************************/
100
101 static void
102 setting_connectivity_usb_help_click_back_cb(void *data, Evas_Object *obj,
103                                             void *event_info)
104 {
105         /* error check */
106         setting_retm_if(data == NULL, " Data parameter is NULL");
107
108         SettingConnectivityUG *ad = (SettingConnectivityUG *) data;
109         setting_view_change(&setting_view_connectivity_usb_help,
110                             &setting_view_connectivity_usb, ad);
111 }