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 certificate_util.h
18 * @author Janusz Kozerski (j.kozerski@samsung.com)
23 #ifndef __CERT_UTIL_H__
24 #define __CERT_UTIL_H_
26 #include <Elementary.h>
29 #include <cert-svc/cstring.h>
31 #include "certificates/certificates.h"
45 typedef struct ListElement {
46 struct ListElement *prev;
47 struct ListElement *next;
55 enum PositionOfElement {
56 NONE, // This is no element of the list
57 FIRST, // First element of list - there is nothing before, but is something after
58 LAST, // Last element of the list - there is nothing after, but is something before
59 IN_THE_MIDDLE, // There are element before and after this element
60 THE_LAST_ONE, // It means that this is the only one element on the list
63 enum CountOfSelected {
64 SELECTED_NONE, // NONE element is selected
65 SELECTED_FEW, // At least one, but not all element are selected
66 SELECTED_ALL, // ALL element are selected
69 Eina_Bool quit_cb(void *data, Elm_Object_Item *it);
70 void list_clicked_cb(void *data, Evas_Object *obj, void *event_info);
71 void genlist_clicked_cb(void *data, Evas_Object *obj, void *event_info);
73 struct ListElement* initList();
74 struct ListElement* nextElement(struct ListElement *listElement);
75 struct ListElement* addListElement(struct ListElement* lastListElement, const char *name);
76 struct ListElement* addListElementWithTitle(struct ListElement* lastListElement, const char *name, const char *title);
77 struct ListElement* addListElementWithPath(struct ListElement* lastListElement, const char *name, const char *path);
78 struct ListElement* addListElementWithPathAndTitle(struct ListElement* lastListElement, const char *name, const char *path, const char *title);
79 struct ListElement* findLastElement(struct ListElement* listElement);
80 struct ListElement* findFirstElement(struct ListElement* listElement);
81 enum PositionOfElement removeListElement(struct ListElement *listElementToRemove);
82 void deleteList(struct ListElement* listElement);
83 void clear_pfx_genlist_data();
87 * Merge two string in a correct path, e.g.:
89 * char *c1 = "/opt/shared"
90 * char *c2 = "file_1.pdf"
91 * result -> "/opt/shared/file_1.pdf"
95 * char *c1 = "/opt/shared/"
96 * char *c2 = "file_1.pdf"
97 * result -> "/opt/shared/file_1.pdf"
99 * (function put '/' char in the end of first string if it's needed)
101 * Result is char pointer allocated by malloc()
102 * Should be deallocated by free()
104 char *path_cat(const char *str1, char *str2);
105 char *extractDataFromCert(char *path);
106 const char* get_email(CertSvcString alias);
108 //void back_cb (void *data, Evas_Object *obj, void *event_info);
109 Eina_Bool back_cb(void *data, Elm_Object_Item *it);
110 void back_install_cb(void *data, Evas_Object *obj, void *event_info);
111 void install_button_cb(void *data, Evas_Object *obj, void *event_info);
113 Evas_Object *create_yes_no_pop(struct ug_data *ad, const char *content);
114 Evas_Object *create_ok_pop(struct ug_data *ad, const char *content);
116 Evas_Object *create_no_content_layout(struct ug_data *ad);
121 const char *dir_path,
122 struct ListElement *lastListElement);
131 #define LOG_TAG "CERT_SVC_UI"
133 //temporary enum definition
134 #define ELM_TOOLBAR_SHRINK_EXPAND 4
138 #endif // end of CERT_UTIL_H