4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
6 * Contact: MyoungJune Park <mj2004.park@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include "setting-moreconnections.h"
25 #define UG_MODULE_API __attribute__ ((visibility("default")))
28 static void *setting_moreconnections_ug_on_create(ui_gadget_h ug,
29 enum ug_mode mode, app_control_h service,
33 setting_retvm_if((!priv), NULL, "!priv");
35 SettingMoreConnectionsUG *moreconnectionsUG = priv;
36 moreconnectionsUG->ug = ug;
37 moreconnectionsUG->win_main_layout = (Evas_Object *) ug_get_parent_layout(ug);
38 moreconnectionsUG->win_get = (Evas_Object *) ug_get_window();
40 moreconnectionsUG->evas = evas_object_evas_get(moreconnectionsUG->win_main_layout);
42 setting_retvm_if(moreconnectionsUG->win_main_layout == NULL, NULL,
43 "cannot get main window ");
44 setting_set_i18n(SETTING_PACKAGE, SETTING_LOCALEDIR);
46 /* register view node table */
47 setting_view_node_table_intialize();
48 setting_view_node_table_register(&setting_view_moreconnections_main, NULL);
50 /* creating a view. */
51 setting_create_Gendial_itc(SETTING_GENLIST_2LINE_STYLE, &(moreconnectionsUG->itc_2text_2));
52 setting_create_Gendial_itc(SETTING_GENLIST_ICON_1LINE_STYLE, &(moreconnectionsUG->itc_1text));
54 setting_view_node_set_cur_view(&setting_view_moreconnections_main);
55 setting_view_create(&setting_view_moreconnections_main, (void *)moreconnectionsUG);
57 return moreconnectionsUG->ly_main;
60 static void setting_moreconnections_ug_on_start(ui_gadget_h ug, app_control_h service,
67 static void setting_moreconnections_ug_on_pause(ui_gadget_h ug, app_control_h service,
74 static void setting_moreconnections_ug_on_resume(ui_gadget_h ug, app_control_h service,
78 setting_retvm_if((!priv), NULL, "!priv");
80 SettingMoreConnectionsUG *moreconnectionsUG = priv;
81 setting_view_create(&setting_view_moreconnections_main, (void *)moreconnectionsUG);
83 if (moreconnectionsUG->location_service) {
84 char *sub_desc = setting_location_is_enable(priv);
85 moreconnectionsUG->location_service->sub_desc = (char *)strdup(sub_desc);
86 elm_object_item_data_set(moreconnectionsUG->location_service->item, moreconnectionsUG->location_service);
87 elm_genlist_item_update(moreconnectionsUG->location_service->item);
93 static void setting_moreconnections_ug_on_destroy(ui_gadget_h ug, app_control_h service,
100 static void setting_moreconnections_ug_on_message(ui_gadget_h ug, app_control_h msg,
101 app_control_h service, void *priv)
107 static void setting_moreconnections_ug_on_event(ui_gadget_h ug,
108 enum ug_event event, app_control_h service,
115 static void setting_moreconnections_ug_on_key_event(ui_gadget_h ug,
116 enum ug_key_event event,
117 app_control_h service, void *priv)
123 UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops)
126 SettingMoreConnectionsUG *moreconnectionsUG = calloc(1, sizeof(SettingMoreConnectionsUG));
127 setting_retvm_if(!moreconnectionsUG, -1, "Create SettingMoreConnectionsUG obj failed");
129 memset(moreconnectionsUG, 0x00, sizeof(SettingMoreConnectionsUG));
131 ops->create = setting_moreconnections_ug_on_create;
132 ops->start = setting_moreconnections_ug_on_start;
133 ops->pause = setting_moreconnections_ug_on_pause;
134 ops->resume = setting_moreconnections_ug_on_resume;
135 ops->destroy = setting_moreconnections_ug_on_destroy;
136 ops->message = setting_moreconnections_ug_on_message;
137 ops->event = setting_moreconnections_ug_on_event;
138 ops->key_event = setting_moreconnections_ug_on_key_event;
139 ops->priv = moreconnectionsUG;
140 ops->opt = UG_OPT_INDICATOR_ENABLE;
145 UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops)
148 struct SettingMoreConnectionsUG *moreconnectionsUG;
149 setting_retm_if(!ops, "ops == NULL");
151 moreconnectionsUG = ops->priv;
152 if (moreconnectionsUG) {
153 FREE(moreconnectionsUG);