2 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
4 * This file is part of the Manage Applications
5 * Written by Eunmi Son <eunmi.son@samsung.com>
8 * Janusz Kozerski <j.kozerski@samsung.com>
10 * PROPRIETARY/CONFIDENTIAL
12 * This software is the confidential and proprietary information of
13 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
14 * disclose such Confidential Information and shall use it only in
15 * accordance with the terms of the license agreement you entered
16 * into with SAMSUNG ELECTRONICS.
18 * SAMSUNG make no representations or warranties about the suitability
19 * of the software, either express or implied, including but not limited
20 * to the implied warranties of merchantability, fitness for a particular
21 * purpose, or non-infringement. SAMSUNG shall not be liable for any
22 * damages suffered by licensee as a result of using, modifying or
23 * distributing this software or its derivatives.
27 #ifndef __CERT_UTIL_H__
28 #define __CERT_UTIL_H_
30 #include <Elementary.h>
34 #include "certificates/certificates.h"
40 #define CERT_MAX_DATA_SIZE 256
41 #define MAX_PATH_LENGHT 512
42 #define NO_INFORMATION "no information"
52 struct ListElement *prev, *next;
53 char name[CERT_MAX_DATA_SIZE];
54 char title[CERT_MAX_DATA_SIZE];
55 char uninstall_path[MAX_PATH_LENGHT];
60 enum PositionOfElement {
61 NONE, // This is no element of the list
62 FIRST, // First element of list - there is nothing before, but is something after
63 LAST, // Last element of the list - there is nothing after, but is something before
64 IN_THE_MIDDLE, // There are element before and after this element
65 THE_LAST_ONE, // It means that this is the only one element on the list
68 void list_clicked_cb(void *data, Evas_Object *obj, void *event_info);
69 void genlist_clicked_cb(void *data, Evas_Object *obj, void *event_info);
70 Evas_Object *create_info_pop(const char *content);
72 struct ListElement* nextElement(struct ListElement *listElement);
73 struct ListElement* initList();
74 struct ListElement* addListElement(struct ListElement* lastListElement, char name[256]);
75 struct ListElement* addListElementWithTitle(struct ListElement* lastListElement, char name[256], char title[256]);
76 struct ListElement* addListElementSetUninstallPath(struct ListElement* lastListElement, char uninstall_path[256]);
77 struct ListElement* findLastElement(struct ListElement* listElement);
78 struct ListElement* findFirstElement(struct ListElement* listElement);
79 enum PositionOfElement removeListElement(struct ListElement *listElementToRemove);
80 void deleteList(struct ListElement* listElement);
84 * Merge two string in a correct path, e.g.:
86 * char *c1 = "/opt/shared"
87 * char *c2 = "file_1.pdf"
88 * result -> "/opt/shared/file_1.pdf"
92 * char *c1 = "/opt/shared/"
93 * char *c2 = "file_1.pdf"
94 * result -> "/opt/shared/file_1.pdf"
96 * (function put '/' char in the end of first string if it's needed)
98 * Result is char pointer allocated by malloc()
99 * Should be deallocated by free()
101 char *path_cat(const char *str1, char *str2);
102 char *extractDataFromCert(char *path);
104 struct ListElement *initList();
105 struct ListElement *addListElement(struct ListElement* lastListElement, char name[256]);
106 struct ListElement *addListElementWithTitle(struct ListElement* lastListElement, char name[256], char title[256]);
107 enum PositionOfElement removeListElement(struct ListElement *listElementToRemove);
108 struct ListElement *findLastElement(struct ListElement* listElement);
109 struct ListElement *findFirstElement(struct ListElement* listElement);
110 void cert_selection_cb(void *data, Evas_Object *obj, void *event_info);
111 void deleteList(struct ListElement* listElement);
112 void back_cb(void *data, Evas_Object *obj, void *event_info);
113 Eina_Bool make_list(struct ug_data *ad, Evas_Object *list, char *dir_path, struct ListElement *lastListElement, enum TypeOfCert type);
114 int set_path(struct ug_data *ad, char const *path);
115 void free_path(struct ug_data *ad);
116 void set_refresh_params(struct ug_data *ad, Evas_Object *list, struct ListElement *lastListElement, char dir[MAX_PATH_LENGHT]);
117 void refresh_list(struct ug_data *ad);
118 Evas_Object *create_yes_no_pop(struct ug_data *ad, const char *content);
119 Evas_Object *create_ok_pop(struct ug_data *ad, const char *content);
130 #define LOG_TAG "CERT-SVC-UI"
133 //temporary enum definition
134 #define ELM_TOOLBAR_SHRINK_EXPAND 4
139 #endif // end of CERT_UTIL_H