The source code moved from the SPIN with license changed to Flora 1.1
[apps/native/home/homescreen-efl.git] / inc / db / db.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (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
7  *
8  * http://floralicense.org/license/
9  *
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.
15  */
16
17 #ifndef __DB_H__
18 #define __DB_H__
19
20 #include "app_item.h"
21 #include "util.h"
22
23 typedef struct
24 {
25         int id;
26         app_item_type_t type;
27         char *appid;
28
29         int first_id;
30         int next_id;
31
32         int x;
33         int y;
34         int w;
35         int h;
36
37         char *content_info;
38 } db_item_t;
39
40 /**
41  * @brief Create database table
42  */
43 extern bool db_create_tables(void);
44
45 /**
46  * @brief Get the applications list from the database
47  * @param apps Eina_List pointer
48  */
49 extern bool db_get_apps(Eina_List **apps);
50
51 /**
52  * @brief Frees the application list
53  * @param apps Pointer to Eina_List.
54  */
55 extern void db_free_apps(Eina_List *apps);
56
57 /**
58  * @brief Updates the database
59  * @param updated item
60  * @param insert flag.
61  */
62 extern bool db_update_apps(db_item_t item, bool insert);
63
64 #endif /* __DB_H__ */