Support on-demand launch
[platform/core/uifw/capi-ui-sticker.git] / server / stickerd_db_manager.h
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
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 __TIZEN_UIX_STICKERD_DB_MANAGER_H__
18 #define __TIZEN_UIX_STICKERD_DB_MANAGER_H__
19
20 #include <glib.h>
21 #include <tzplatform_config.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 typedef enum {
28     STICKER_DB_STICKER_ALL,
29     STICKER_DB_STICKER_APPID,
30     STICKER_DB_STICKER_TYPE,
31     STICKER_DB_STICKER_URI,
32     STICKER_DB_STICKER_THUMBNAIL,
33     STICKER_DB_STICKER_DESCRIPTION,
34     STICKER_DB_STICKER_GROUP,
35     STICKER_DB_STICKER_KEYWORD,
36 } sticker_info_db_type;
37
38 typedef struct {
39     char *app_id;
40     int  type;
41     char *uri;
42     char *thumbnail;
43     char *description;
44     char *group;
45     GList *keyword;
46     char *date;
47 } sticker_info_db;
48
49 int stickerd_db_init(void);
50 int stickerd_db_insert_sticker_info(int *record_id, sticker_info_db *sticker_info);
51 int stickerd_db_delete_sticker_info(int record_id);
52 int stickerd_db_update_sticker_info(int record_id, sticker_info_db_type type, void *data);
53 int stickerd_db_get_sticker_info_by_record_id(int record_id, sticker_info_db *sticker_info);
54 int stickerd_db_get_group_list(GVariantBuilder *builder);
55 int stickerd_db_get_keyword_list(GVariantBuilder *builder);
56 int stickerd_db_get_sticker_count(int *count, char *app_id);
57 int stickerd_db_get_record_id(sticker_info_db_type type, GList **id_list, void *data, int offset, int count);
58
59 #ifdef __cplusplus
60 }
61 #endif
62
63 #endif /* __TIZEN_UIX_STICKERD_DB_MANAGER_H__ */