The original image is used as a thumbnail when the thumbnail is not made
[platform/core/pim/contacts-service.git] / server / db / ctsvc_db_utils.h
1 /*
2  * Contacts Service
3  *
4  * Copyright (c) 2010 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19 #ifndef __CTSVC_DB_UTILS_H__
20 #define __CTSVC_DB_UTILS_H__
21
22 const char* ctsvc_get_display_column(void);
23 const char* ctsvc_get_sort_column(void);
24 const char* ctsvc_get_sort_name_column(void);
25
26 int ctsvc_begin_trans(void);
27 int ctsvc_end_trans(bool is_success);
28 int ctsvc_get_next_ver(void);
29 int ctsvc_get_current_version(int *out_current_version);
30 int ctsvc_get_transaction_ver(void);
31
32 int ctsvc_utils_copy_image(const char *dir, const char *src, const char *file);
33 void ctsvc_utils_make_image_file_name(int parent_id, int id, char *src_img, char *dest,
34                 int dest_size);
35 char* ctsvc_utils_get_thumbnail_path(const char *image_path, bool check_file);
36 char* ctsvc_utils_get_image_path(const char *thumbnail_path);
37 char* ctsvc_utils_make_thumbnail(const char *image_path);
38
39 int SAFE_SNPRINTF(char **buf, int *buf_size, int len, const char *src);
40
41 #endif /* __CTSVC_DB_UTILS_H__ */