Support to copy thumbnail to RW directory
[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_DB_STICKER_DISP_TYPE,
37 } sticker_info_db_type;
38
39 typedef struct {
40     char *app_id;
41     int  type;
42     char *uri;
43     char *thumbnail;
44     char *description;
45     char *group;
46     GList *keyword;
47     char *date;
48     int  display_type;
49 } sticker_info_db;
50
51 int stickerd_db_init(void);
52 int stickerd_db_insert_sticker_info(int *record_id, sticker_info_db *sticker_info);
53 int stickerd_db_delete_sticker_info(int record_id);
54 int stickerd_db_delete_sticker_info_by_uri(char *uri);
55 int stickerd_db_update_sticker_info(int record_id, sticker_info_db_type type, void *data);
56 int stickerd_db_get_sticker_info_by_record_id(int record_id, sticker_info_db *sticker_info);
57 int stickerd_db_get_group_list(GVariantBuilder *builder, char *app_id);
58 int stickerd_db_get_keyword_list(GVariantBuilder *builder, char *app_id);
59 int stickerd_db_get_sticker_count(int *count, char *app_id);
60 int stickerd_db_get_record_id(sticker_info_db_type type, GList **id_list, void *data, char *app_id, int offset, int count);
61 int stickerd_db_get_group_list_by_display_type(GVariantBuilder *builder, char *app_id, int disp_type);
62 int stickerd_db_check_file_exists(int *result, char *uri);
63
64 #ifdef __cplusplus
65 }
66 #endif
67
68 #endif /* __TIZEN_UIX_STICKERD_DB_MANAGER_H__ */