tizen 2.3 release
[apps/home/settings.git] / setting-network / src / setting-network-con.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-network-con.h>
22 //#include <tethering.h>
23
24 static int setting_network_con_create(void *cb);
25 static int setting_network_con_destroy(void *cb);
26 static int setting_network_con_update(void *cb);
27 static int setting_network_con_cleanup(void *cb);
28
29 setting_view setting_view_network_con = {
30         .create = setting_network_con_create,
31         .destroy = setting_network_con_destroy,
32         .update = setting_network_con_update,
33         .cleanup = setting_network_con_cleanup,
34 };
35
36 static Eina_Bool __add_other_apn(void *data) {
37         SETTING_TRACE_BEGIN;
38         SettingNetworkUG *ad = (SettingNetworkUG *)data;
39
40         //show other APN whose type is not internet/APN
41         connection_profile_iterator_h profile_iter = NULL;
42         connection_profile_h profile_h = NULL;
43
44         char *profile_name = NULL;
45         char *apn = NULL;
46         bool profile_bhidden = false;
47         connection_profile_type_e profile_type = CONNECTION_PROFILE_TYPE_CELLULAR;
48         connection_cellular_service_type_e service_type = CONNECTION_CELLULAR_SERVICE_TYPE_UNKNOWN;
49
50         int rv = connection_get_profile_iterator(ad->connection, CONNECTION_ITERATOR_TYPE_REGISTERED, &profile_iter);
51         if (rv != CONNECTION_ERROR_NONE) {
52                 SETTING_TRACE_ERROR("Fail to get profile iterator [%d]", rv);
53                 ad->add_apn_timer = NULL;
54                 return FALSE;
55         }
56
57         int cnt = 0;
58         int item_cnt = 0;
59         Elm_Object_Item *last_item = NULL;
60
61         Setting_GenGroupItem_Data *item_data = NULL;
62
63         int     before_groupstyle = SETTING_GROUP_STYLE_NONE;
64
65         while (connection_profile_iterator_has_next(profile_iter)) {
66                 if (cnt >= MAX_PROFILE_NUM)
67                 {
68                         break;
69                 }
70                 if (connection_profile_iterator_next(profile_iter, &profile_h) != CONNECTION_ERROR_NONE) {
71                         SETTING_TRACE_ERROR("Fail to get profile handle");
72                         break;
73                 }
74
75                 if (connection_profile_get_type(profile_h, &profile_type) != CONNECTION_ERROR_NONE) {
76                         SETTING_TRACE_ERROR("Fail to get profile type");
77                         continue;
78                 }
79                 if (connection_profile_get_cellular_service_type(profile_h, &service_type) != CONNECTION_ERROR_NONE) {
80                         SETTING_TRACE_ERROR("Fail to get service type");
81                         continue;
82                 }
83
84                 if (connection_profile_get_name(profile_h, &profile_name) != CONNECTION_ERROR_NONE) {
85                         SETTING_TRACE_ERROR("Fail to get profile name");
86                         continue;
87                 }
88
89                 if (connection_profile_is_cellular_hidden(profile_h, &profile_bhidden) != CONNECTION_ERROR_NONE) {
90                         SETTING_TRACE_ERROR("Fail to get profile hidden attr (true/false)");
91                         continue;
92                 }
93
94                 if (connection_profile_get_cellular_apn(profile_h, &apn) != CONNECTION_ERROR_NONE) {
95                         SETTING_TRACE_ERROR("Fail to get apn");
96                         G_FREE(profile_name);
97                         continue;
98                 }
99
100                 SETTING_TRACE("Record[%d:%s], profile_name:%s, profile_type:%d, service_type:%d",
101                               cnt, apn, profile_name, profile_type, service_type);
102                 if(CONNECTION_PROFILE_TYPE_CELLULAR != profile_type)
103                 {
104                         G_FREE(apn);
105                         G_FREE(profile_name);
106                         continue;
107                 }
108                 if ( profile_bhidden == false
109                         && CONNECTION_CELLULAR_SERVICE_TYPE_MMS != service_type
110                     && CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET != service_type) //unknow, match with ad->con_name
111                 {
112                         if ( before_groupstyle == SETTING_GROUP_STYLE_NONE )
113                         {
114                                 last_item = elm_genlist_item_append(ad->connections_gl, &itc_seperator,
115                                                                    NULL, NULL,
116                                                                    ELM_GENLIST_ITEM_NONE, NULL, NULL);
117                                 elm_genlist_item_select_mode_set(last_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
118                         }
119
120                         #ifdef SUPPORT_REVERSED_ORDER
121                         item_data = setting_create_Gendial_field_def(ad->connections_gl, &itc_1text,
122                                                          setting_network_con_item_Gendial_mouse_up_cb,
123                                                          ad, SWALLOW_Type_INVALID, NULL, NULL,
124                                                          0, apn, NULL,
125                                                          NULL);
126                         #else
127                         item_data = calloc(1, sizeof(Setting_GenGroupItem_Data));
128                         setting_retvm_if(!item_data, FALSE, "calloc failed");
129                         item_data->keyStr = (char *)g_strdup(profile_name);
130                         item_data->sub_desc = (char *)g_strdup(apn);
131                         item_data->swallow_type = SWALLOW_Type_INVALID;
132
133                         item_data->item = elm_genlist_item_insert_after(ad->connections_gl,
134                                                         &itc_2text, item_data, NULL, last_item,
135                                                         ELM_GENLIST_ITEM_NONE,
136                                                         setting_network_con_item_Gendial_mouse_up_cb,ad);
137
138                         last_item = item_data->item;
139                         #endif
140
141                         item_data->chk_status = service_type;//record the service type
142                         item_cnt ++;
143
144                         if ( before_groupstyle == SETTING_GROUP_STYLE_NONE )
145                         {
146                                 elm_object_item_signal_emit(item_data->item, "elm,state,top", "");
147                                 before_groupstyle = SETTING_GROUP_STYLE_TOP;
148                         }
149                         else
150                         if ( before_groupstyle == SETTING_GROUP_STYLE_TOP )
151                         {
152                                 elm_object_item_signal_emit(item_data->item, "elm,state,center", "");
153                                 before_groupstyle = SETTING_GROUP_STYLE_CENTER;
154                         }
155
156                         SETTING_TRACE("profile hidden attribute : %d ", profile_bhidden);
157                 } else {
158                         SETTING_TRACE("profile hidden attribute : %d ", profile_bhidden);
159                 }
160                 G_FREE(apn);
161                 G_FREE(profile_name);
162                 cnt++;
163         }
164
165         if (item_cnt == 1) {
166                 elm_object_item_signal_emit(item_data->item, "elm,state,normal", "");
167         } else if (item_cnt > 1) {
168                 elm_object_item_signal_emit(item_data->item, "elm,state,bottom", "");
169         }
170
171         ad->add_apn_timer = NULL;
172         return FALSE;
173 }
174
175 static void __setting_network_con_genlist_create(void *data)
176 {
177         SETTING_TRACE_BEGIN;
178         setting_retm_if(data == NULL, "data is NULL");
179         SettingNetworkUG *ad = (SettingNetworkUG *) data;
180         elm_genlist_clear(ad->connections_gl);  /* first to clear list */
181
182         Elm_Object_Item *item = NULL;
183         item = elm_genlist_item_append(ad->connections_gl, &itc_seperator, NULL, NULL,
184                         ELM_GENLIST_ITEM_NONE, NULL, NULL);
185         elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
186
187         /* scroller is a genlist */
188
189         /* [UI] Internet Connections */
190         SETTING_TRACE("ad->apn_internet:%d, ad->apn_MMS:%d", ad->apn_internet, ad->apn_MMS);
191         ad->apn_internet = __get_profile_name(CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET, ad);
192         Setting_GenGroupItem_Data * internet_conn = setting_create_Gendial_field_def(ad->connections_gl, &itc_2text_3,
193                         setting_network_con_item_Gendial_mouse_up_cb,
194                         ad, SWALLOW_Type_INVALID, NULL, NULL,
195                         0, "IDS_ST_BODY_INTERNET_CONNECTION",
196                         g_strdup(ad->apn_internet), NULL);
197         if (internet_conn) {
198                 //internet_conn->group_style = SETTING_GROUP_STYLE_NONE;
199                 setting_genlist_item_groupstyle_set(internet_conn, SETTING_GROUP_STYLE_NONE);
200         } else {
201                 SETTING_TRACE_ERROR("internet_conn is NULL");
202         }
203         ad->internet_conn = internet_conn;
204
205         if (internet_conn) {
206                 setting_genlist_item_groupstyle_set(internet_conn, SETTING_GROUP_STYLE_TOP);
207         }
208         ad->apn_MMS = __get_profile_name(CONNECTION_CELLULAR_SERVICE_TYPE_MMS, ad);
209         /* [MMS Connections] Internet Connections */
210         Setting_GenGroupItem_Data * mms_conn = setting_create_Gendial_field_def(ad->connections_gl, &itc_2text_3,
211                         setting_network_con_item_Gendial_mouse_up_cb,
212                         ad, SWALLOW_Type_INVALID, NULL, NULL,
213                         0, STR_SETTING_MMS_CONNECTIONS,
214                         g_strdup(ad->apn_MMS), NULL);
215         if (mms_conn) {
216                 setting_genlist_item_groupstyle_set(mms_conn, SETTING_GROUP_STYLE_BOTTOM);
217         } else {
218                 SETTING_TRACE_ERROR("mms_conn is NULL");
219         }
220
221         ad->mms_conn = mms_conn;
222
223
224 #ifdef ENABLED_PREFERRED_NETWORKS
225         setting_create_Gendial_field_def(ad->connections_gl, &itc_1text,
226                                          setting_network_con_item_Gendial_mouse_up_cb,
227                                          ad, SWALLOW_Type_INVALID, NULL, NULL,
228                                          0, "IDS_ST_BODY_PREFERRED_NETWORKS",
229                                          NULL, NULL);
230 #endif
231 #ifdef ENABLED_2G3G_NETWORK
232         /*  create 3g connection option */
233         setting_create_Gendial_field_def(ad->connections_gl, &itc_1text,
234                                          setting_network_con_item_Gendial_mouse_up_cb,
235                                          ad, SWALLOW_Type_INVALID, NULL, NULL,
236                                          0, "2G/3G Connection", NULL, NULL);
237
238 #endif
239
240         /* add other APN
241         if (!ad->is_update) {
242                 if (ad->add_apn_timer) {
243                         ecore_idler_del(ad->add_apn_timer);
244                         ad->add_apn_timer = NULL;
245                 }
246                 ad->add_apn_timer = ecore_timer_add(0.5, (Ecore_Task_Cb) __add_other_apn, ad);
247         } else {
248                 __add_other_apn(ad);
249         }
250         */
251 //      __add_other_apn(ad);
252         SETTING_TRACE_END;
253
254 }
255
256 /* ***************************************************
257  *
258  *basic func
259  *
260  ***************************************************/
261
262 /**
263  * Connections
264  */
265 static int setting_network_con_create(void *cb)
266 {
267         SETTING_TRACE_BEGIN;
268         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
269
270         SettingNetworkUG *ad = (SettingNetworkUG *) cb;
271
272         Evas_Object *scroller = elm_genlist_add(ad->win_main_layout);
273         retvm_if(scroller == NULL, SETTING_DRAW_ERR_FAIL_SCROLLER,
274                  "Cannot set scroller object  as contento of layout");
275         elm_genlist_realization_mode_set(scroller, EINA_TRUE);
276         elm_object_style_set(scroller, "dialogue");
277         ad->connections_gl = scroller;
278         evas_object_smart_callback_add(scroller, "realized", __gl_realized_cb, NULL);
279
280         Elm_Object_Item * navi_it = setting_push_layout_navi_bar(_("IDS_ST_BODY_CONNECTIONS"),
281                                      _("IDS_COM_BODY_BACK"),
282                                      NULL,//_(KeyStr_Reset_Def),
283                                      _(KeyStr_Reset_Def),//_("IDS_COM_BODY_CREATE"),
284                                      NULL,
285                                      NULL,//setting_network_con_click_softkey_reset_cb,
286                                      setting_network_con_click_softkey_reset_cb,//setting_network_con_click_softkey_create_cb,
287                                      ad, scroller, ad->navi_bar, NULL);
288
289         elm_naviframe_item_pop_cb_set(navi_it, setting_network_con_click_softkey_cancel_cb, ad);
290
291         __setting_network_con_genlist_create(ad);
292
293         setting_view_network_con.is_create = 1;
294
295         SETTING_TRACE_END;
296         return SETTING_RETURN_SUCCESS;
297 }
298
299 static int setting_network_con_destroy(void *cb)
300 {
301         SETTING_TRACE_BEGIN;
302         /* error check */
303         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
304
305         SettingNetworkUG *ad = (SettingNetworkUG *) cb;
306         ad->is_update = 0;
307         //FREE(ad->con_name);
308         ad->connections_gl = NULL;
309         if (setting_view_network_con.is_create)
310         {
311 #if SUPPORT_TETHERING
312                 if (ad->th_connections)
313                 {
314                         SETTING_TRACE("tethering destruction ");
315                         tethering_destroy(ad->th_connections);
316                         ad->th_connections = NULL;
317                 }
318 #endif
319                 if (ad->add_apn_timer) {
320                         ecore_idler_del(ad->add_apn_timer);
321                         ad->add_apn_timer = NULL;
322                 }
323
324                 elm_naviframe_item_pop(ad->navi_bar);
325                 setting_view_network_con.is_create = 0;
326         } else {
327                 SETTING_TRACE("why is this is_create == 0 ?? !!!");
328         }
329
330
331         return SETTING_RETURN_SUCCESS;
332 }
333
334 static int setting_network_con_update(void *cb)
335 {
336         SETTING_TRACE_BEGIN;
337         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
338         SettingNetworkUG *ad = (SettingNetworkUG *) cb;
339         __setting_network_con_genlist_create(ad);
340         return SETTING_RETURN_SUCCESS;
341 }
342
343 static int setting_network_con_cleanup(void *cb)
344 {
345         SETTING_TRACE_BEGIN;
346         return setting_network_con_destroy(cb);
347 }
348
349 /* ***************************************************
350  *
351  *general func
352  *
353  ***************************************************/
354
355 /* ***************************************************
356  *
357  *call back func
358  *
359  ***************************************************/
360
361 static void
362 setting_network_con_item_Gendial_mouse_up_cb(void *data, Evas_Object *obj,
363                                               void *event_info)
364 {
365         SETTING_TRACE_BEGIN;
366         /* error check */
367         setting_retm_if(data == NULL, "Data parameter is NULL");
368         Elm_Object_Item *item = (Elm_Object_Item *) event_info;
369         elm_genlist_item_selected_set(item, 0);
370         Setting_GenGroupItem_Data *list_item =
371             (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
372
373         SettingNetworkUG *ad = (SettingNetworkUG *) data;
374         ad->profile_topper_view = NULL;
375
376         SETTING_TRACE("clicking item[%s]", _(list_item->keyStr));
377
378         ad->profile_service_type = 0;
379
380         if (!safeStrCmp("IDS_COM_BODY_NETWORK_OPERATORS", list_item->keyStr)) {
381                 setting_view_change(&setting_view_network_con,
382                                         &setting_view_network_select_network,
383                                         ad);
384         }
385 #ifdef ENABLED_PREFERRED_NETWORKS
386         else if (!safeStrCmp("IDS_ST_BODY_PREFERRED_NETWORKS",
387                                 list_item->keyStr)) {
388
389                 int value = -1;
390                 int err = -1;
391
392                 setting_get_int_slp_key(INT_SLP_SETTING_SIM_SLOT, &value,
393                                             &err);
394                         /** @todo check 'err' variable for exception handling */
395                 SETTING_TRACE("INT_SLP_SETTING_SIM_SLOT value:%d", value);
396                 switch (value) {
397                 case VCONFKEY_TELEPHONY_SIM_INSERTED:
398                         /* To Recreate the view in order to search the perferred network again. */
399                         /* ret = setting_view_destroy(&setting_view_network_preferred_network, ad); */
400
401                         setting_view_change(&setting_view_network_con,
402                                                 &setting_view_network_preferred_network,
403                                                 ad);
404
405                         break;
406
407                 case VCONFKEY_TELEPHONY_SIM_NOT_PRESENT:
408
409                         setting_create_simple_popup(NULL, ad->win_get,
410                                                     NULL, _(""));/*this code is not used now, so remove the ID which is not in po file*/
411                         SETTING_TRACE_DEBUG
412                             ("%s*** [ERR] INCORRECTED SIM. sim_slot_type=%d ***%s",
413                              SETTING_FONT_RED, value, SETTING_FONT_BLACK);
414                         return;
415
416                         break;
417
418                 case VCONFKEY_TELEPHONY_SIM_CARD_ERROR:
419                 case VCONFKEY_TELEPHONY_SIM_UNKNOWN:
420
421                         setting_create_simple_popup(NULL, ad->win_get,
422                                                     NULL, _("IDS_COM_BODY_INVALID_SIM_CARD"));
423                         SETTING_TRACE_DEBUG
424                             ("%s*** [ERR] INCORRECTED SIM. sim_slot_type=%d ***%s",
425                              SETTING_FONT_RED, value, SETTING_FONT_BLACK);
426                         return;
427
428                         break;
429                 default:
430                         SETTING_TRACE("Unknown SIM information from vconf");
431                         break;
432                 }
433         }
434 #endif
435 #ifdef ENABLED_2G3G_NETWORK
436         else if (!safeStrCmp("2G/3G Connection", list_item->keyStr)) {
437                 setting_view_change(&setting_view_network_con,
438                                         &setting_view_network_3gcon, ad);
439         }
440 #endif
441         else if (!safeStrCmp("IDS_ST_BODY_INTERNET_CONNECTION", list_item->keyStr)) {//connections..
442
443                 FREE(ad->con_name);
444                 SETTING_TRACE("list_item->keyStr:%s, ad->con_name:%s", list_item->keyStr, ad->con_name);
445                 ad->con_name = strdup(list_item->keyStr);
446                 ad->profile_service_type = CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET;
447                 setting_view_change(&setting_view_network_con,
448                                         &setting_view_network_con_list,
449                                         ad);
450         }
451         else if (!safeStrCmp(STR_SETTING_MMS_CONNECTIONS, list_item->keyStr))
452         {
453                 FREE(ad->con_name);
454                 ad->profile_topper_view = &setting_view_network_con;
455                 ad->con_name = strdup(STR_SETTING_MMS_CONNECTIONS);
456                 ad->access_name = strdup(STR_SETTING_MMS_CONNECTIONS);
457                 ad->profile_service_type = CONNECTION_CELLULAR_SERVICE_TYPE_MMS;
458                 setting_view_create(&setting_view_network_connection_create, ad);
459         }
460         else
461         {
462                 FREE(ad->con_name);
463                 ad->profile_topper_view = &setting_view_network_con;
464                 ad->con_name = strdup(list_item->sub_desc);
465                 ad->access_name = strdup(list_item->sub_desc);
466                 ad->profile_service_type = list_item->chk_status;
467                 setting_view_create(&setting_view_network_connection_create, ad);
468         }
469         SETTING_TRACE_END;
470 }
471
472 static void
473 setting_network_con_click_softkey_reset_cb(void *data, Evas_Object *obj, void *event_info)
474 {
475         SETTING_TRACE_BEGIN;
476         /* error check */
477         retm_if(data == NULL, "Data parameter is NULL");
478
479         SettingNetworkUG *ad = (SettingNetworkUG *) data;
480
481         ad->popup_conreset = setting_create_popup_with_btn(ad, ad->win_get,
482                                                         NULL, _("IDS_ST_POP_RESET_TO_DEFAULT_Q"),
483                                                         setting_network_con_reset_popup_cb,
484                                                         0, 2, _("IDS_ST_BUTTON_OK"), _("IDS_COM_SK_CANCEL"));
485
486         return;
487 }
488
489 void _reset_cb(connection_error_e result, void* user_data) {
490         SETTING_TRACE_BEGIN;
491         setting_retm_if(NULL == user_data, "NULL == data");
492         SettingNetworkUG *ad = (SettingNetworkUG *) user_data;
493
494         if (ad->network_ug_pop) {
495                 evas_object_del(ad->network_ug_pop);
496                 ad->network_ug_pop = NULL;
497         }
498         if (result == CONNECTION_ERROR_NONE) {
499                 SETTING_TRACE("reset successfully");
500                 FREE(ad->apn_internet);
501                 FREE(ad->apn_MMS);
502                 __setting_network_con_genlist_create(ad);
503         } else {
504                 SETTING_TRACE_ERROR("failed to reset ret = %d", result);
505         }
506 }
507
508 static void
509 setting_network_con_reset_popup_cb(void *data, Evas_Object *obj, void *event_info)
510 {
511         SETTING_TRACE_BEGIN;
512
513         /* error check */
514         setting_retm_if(NULL == data, "NULL == data");
515
516         int     response_type = btn_type( obj );
517         int ret = 0;
518
519         SettingNetworkUG *ad = (SettingNetworkUG *) data;
520
521         if ( ad )
522         {
523                 evas_object_del( ad->popup_conreset );
524                 ad->popup_conreset = NULL;
525         }
526
527         if ( response_type == POPUP_RESPONSE_OK )
528         {
529                 //setting_create_simple_popup(ad, ad->win_get, NULL, _("IDS_COM_POP_SUCCESS"));
530                 setting_create_popup_without_btn(ad, ad->win_get, NULL, _("IDS_COM_POP_SUCCESS"),
531                                                  NULL, POPUP_INTERVAL, TRUE, FALSE);
532
533                 if ( ad->connection ) {
534                         ret = connection_reset_profile(ad->connection, CONNECTION_RESET_DEFAULT_PROFILE,
535                                         0, _reset_cb, ad);
536                         if (CONNECTION_ERROR_NONE == ret) {
537                                 SETTING_TRACE("Reset successfully");
538                         } else {
539                                 SETTING_TRACE("Failed to reset, ret = %d", ret);
540                         }
541                 }
542         }
543
544         return;
545 }
546
547 #if 0
548 static void
549 setting_network_con_click_softkey_create_cb(void *data, Evas_Object *obj,
550                                            void *event_info)
551 {
552         /* error check */
553         retm_if(data == NULL, "Data parameter is NULL");
554         SettingNetworkUG *ad = (SettingNetworkUG *) data;
555         SETTING_TRACE_BEGIN;
556         //setting_create_simple_popup(ad, ad->win_get, NULL, _("UX Undefined"));
557         //return;
558
559         //to add a new connection
560         //ad->con_type = -1;
561         FREE(ad->con_name);
562         ad->con_name = strdup(STR_SETTING_NEW_CONNECTIONS);
563         ad->profile_topper_view = &setting_view_network_con;
564         //not normal view realtion,so need to change manully
565         //setting_view_change(&setting_view_network_con, &setting_view_network_connection_create, ad);
566         setting_view_create(&setting_view_network_connection_create, ad);
567 }
568 #endif
569
570 static Eina_Bool
571 setting_network_con_click_softkey_cancel_cb(void *data, Elm_Object_Item *it)
572 {
573         SETTING_TRACE_BEGIN;
574         retvm_if(data == NULL, EINA_FALSE,"Data parameter is NULL");
575
576         SettingNetworkUG *ad = (SettingNetworkUG *) data;
577
578         setting_view_change(&setting_view_network_con,
579                             &setting_view_network_main, ad);
580         return EINA_TRUE;
581 }