2 * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file trusted_root_ca_cert.c
18 * @author Janusz Kozerski (j.kozerski@samsung.com)
25 #include "certificates/certificate_util.h"
26 #include "certificates/certificates.h"
30 static Eina_Bool trusted_root_cert_create_genlist(struct ug_data *ad, Evas_Object *parent)
35 ad->list_to_refresh = elm_genlist_add(parent);
36 evas_object_size_hint_weight_set(ad->list_to_refresh, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
37 evas_object_size_hint_align_set(ad->list_to_refresh, EVAS_HINT_FILL, EVAS_HINT_FILL);
39 Eina_Bool no_content_bool = EINA_TRUE;
40 if(!make_list(ad, ad->list_to_refresh, PATH_CERT_TRUSTEDUSER, ad->list_element)){
41 no_content_bool = EINA_FALSE;
43 ad->list_element = findLastElement(ad->list_element);
44 if(!make_list(ad, ad->list_to_refresh, PATH_CERT_SSL_ETC, ad->list_element)){
45 no_content_bool = EINA_FALSE;
47 return no_content_bool;
50 void trusted_root_cert_cb(void *data, Evas_Object *obj, void *event_info)
52 LOGD("trusted_root_cert_cb()");
56 struct ug_data *ad = (struct ug_data *) data;
57 struct ListElement *firstListElement = NULL;
58 struct ListElement *lastListElement = NULL;
59 firstListElement = initList();
61 if (!firstListElement) {
62 LOGD("Fail to initList for firstListElement");
66 lastListElement = firstListElement;
67 ad->list_element = firstListElement;
69 Elm_Object_Item *nf_it;
70 Evas_Object *box = NULL;
71 Evas_Object *genlist = NULL;
72 box = elm_box_add(ad->navi_bar);
73 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
74 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
76 Eina_Bool no_content_bool = trusted_root_cert_create_genlist(ad, box);
77 evas_object_show(ad->list_to_refresh);
78 elm_box_pack_end(box, ad->list_to_refresh);
79 evas_object_show(box);
81 if (!no_content_bool) { // There is some content
82 nf_it = elm_naviframe_item_push(ad->navi_bar, "IDS_ST_BODY_TRUSTED_ROOT_CA_CERTIFICATES_ABB", NULL, NULL, box, NULL);
85 Evas_Object *no_content = create_no_content_layout(ad);
87 LOGD("Cannot create no_content layout (NULL); return");
91 nf_it = elm_naviframe_item_push(ad->navi_bar, "IDS_ST_BODY_TRUSTED_ROOT_CA_CERTIFICATES_ABB", NULL, NULL, no_content, NULL);
93 elm_object_item_domain_text_translatable_set(nf_it, PACKAGE, EINA_TRUE);
94 elm_naviframe_item_pop_cb_set(nf_it, back_cb, (struct Evas_Object *)ad);