[SVACE Issue Fixes]
[platform/core/pim/contacts-service.git] / server / db / ctsvc_db_plugin_contact_helper.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_PLUGIN_CONTACT_HELPER_H__
20 #define __CTSVC_DB_PLUGIN_CONTACT_HELPER_H__
21
22 #include "ctsvc_struct.h"
23 #include "ctsvc_db_sqlite.h"
24
25 int ctsvc_contact_add_image_file(int parent_id, int img_id, char *src_img,
26                 char *dest_name, int dest_size);
27 int ctsvc_contact_update_image_file(int parent_id, int img_id, char *src_img,
28                 char *dest_name, int dest_size);
29 int ctsvc_contact_delete_image_file_with_path(const unsigned char *image_path);
30
31 void ctsvc_contact_make_display_name(ctsvc_contact_s *contact);
32 int ctsvc_contact_make_search_name(ctsvc_contact_s *contact, char **search_name);
33 int ctsvc_contact_get_name_language(const ctsvc_name_s *name);
34
35 int ctsvc_db_contact_update_changed_time(int contact_id);
36 int ctsvc_contact_update_display_name(int contact_id,
37                 contacts_display_name_source_type_e changed_record_type);
38
39 int ctsvc_db_contact_delete(int contact_id);
40 int ctsvc_db_contact_get(int id, contacts_record_h *out_record);
41
42 int ctsvc_get_data_info_name(cts_stmt stmt, contacts_list_h name_list);
43 int ctsvc_get_data_info_event(cts_stmt stmt, contacts_list_h list);
44 int ctsvc_get_data_info_number(cts_stmt stmt, contacts_list_h number_list);
45 int ctsvc_get_data_info_email(cts_stmt stmt, contacts_list_h list);
46 int ctsvc_get_data_info_address(cts_stmt stmt, contacts_list_h list);
47 int ctsvc_get_data_info_messenger(cts_stmt stmt, contacts_list_h list);
48 int ctsvc_get_data_info_note(cts_stmt stmt, contacts_list_h list);
49 int ctsvc_get_data_info_company(cts_stmt stmt, contacts_list_h list);
50 int ctsvc_get_data_info_profile(cts_stmt stmt, contacts_list_h list);
51 int ctsvc_get_data_info_relationship(cts_stmt stmt, contacts_list_h list);
52 int ctsvc_get_data_info_image(cts_stmt stmt, contacts_list_h list);
53 int ctsvc_get_data_info_url(cts_stmt stmt, contacts_list_h list);
54 int ctsvc_get_data_info_nickname(cts_stmt stmt, contacts_list_h list);
55 int ctsvc_get_data_info_extension(cts_stmt stmt, contacts_list_h list);
56 int ctsvc_get_data_info_sip(cts_stmt stmt, contacts_list_h list);
57
58 bool ctsvc_contact_check_default_number(contacts_list_h number_list);
59 bool ctsvc_contact_check_default_email(contacts_list_h email_list);
60 bool ctsvc_contact_check_default_address(contacts_list_h address_list);
61 bool ctsvc_contact_check_default_image(contacts_list_h image_list);
62 bool ctsvc_contact_check_image_location(const char *path);
63
64 int ctsvc_contact_update_data_name(contacts_list_h name_list, int contact_id,
65                 bool is_my_profile);
66 int ctsvc_contact_update_data_company(contacts_list_h company_list, int contact_id,
67                 bool is_my_profile);
68 int ctsvc_contact_update_data_note(contacts_list_h note_list, int contact_id,
69                 bool is_my_profile);
70 int ctsvc_contact_update_data_event(contacts_list_h event_list, int contact_id,
71                 bool is_my_profile);
72 int ctsvc_contact_update_data_messenger(contacts_list_h messenger_list,
73                 int contact_id, bool is_my_profile);
74 int ctsvc_contact_update_data_address(contacts_list_h address_list, int contact_id,
75                 bool is_my_profile);
76 int ctsvc_contact_update_data_url(contacts_list_h url_list, int contact_id,
77                 bool is_my_profile);
78 int ctsvc_contact_update_data_profile(contacts_list_h profile_list, int contact_id,
79                 bool is_my_profile);
80 int ctsvc_contact_update_data_relationship(contacts_list_h relationship_list,
81                 int contact_id, bool is_my_profile);
82 int ctsvc_contact_update_data_image(contacts_list_h image_list, int contact_id,
83                 bool is_my_profile);
84 int ctsvc_contact_update_data_nickname(contacts_list_h nickname_list, int contact_id,
85                 bool is_my_profile);
86 int ctsvc_contact_update_data_extension(contacts_list_h extension_list, int contact_id,
87                 bool is_my_profile);
88 int ctsvc_contact_update_data_number(contacts_list_h number_list, int contact_id,
89                 bool is_my_profile, bool *had_phonenumber);
90 int ctsvc_contact_update_data_email(contacts_list_h email_list, int contact_id,
91                 bool is_my_profile, bool *had_email);
92 int ctsvc_contact_update_data_sip(contacts_list_h sip_list, int contact_id,
93                 bool is_my_profile);
94
95 int ctsvc_contact_insert_data_name(contacts_list_h name_list, int contact_id,
96                 bool is_my_profile);
97 int ctsvc_contact_insert_data_number(contacts_list_h number_list, int contact_id,
98                 bool is_my_profile);
99 int ctsvc_contact_insert_data_email(contacts_list_h email_list, int contact_id,
100                 bool is_my_profile);
101 int ctsvc_contact_insert_data_profile(contacts_list_h profile_list, int contact_id,
102                 bool is_my_profile);
103 int ctsvc_contact_insert_data_company(contacts_list_h company_list, int contact_id,
104                 bool is_my_profile);
105 int ctsvc_contact_insert_data_note(contacts_list_h note_list, int contact_id,
106                 bool is_my_profile);
107 int ctsvc_contact_insert_data_event(contacts_list_h event_list, int contact_id,
108                 bool is_my_profile);
109 int ctsvc_contact_insert_data_messenger(contacts_list_h messenger_list, int contact_id,
110                 bool is_my_profile);
111 int ctsvc_contact_insert_data_address(contacts_list_h address_list, int contact_id,
112                 bool is_my_profile);
113 int ctsvc_contact_insert_data_url(contacts_list_h url_list, int contact_id,
114                 bool is_my_profile);
115 int ctsvc_contact_insert_data_nickname(contacts_list_h nickname_list, int contact_id,
116                 bool is_my_profile);
117 int ctsvc_contact_insert_data_relationship(contacts_list_h relationship_list,
118                 int contact_id, bool is_my_profile);
119 int ctsvc_contact_insert_data_image(contacts_list_h image_list, int contact_id,
120                 bool is_my_profile);
121 int ctsvc_contact_insert_data_extension(contacts_list_h extension_list, int contact_id,
122                 bool is_my_profile);
123 int ctsvc_contact_insert_data_sip(contacts_list_h sip_list, int contact_id,
124                 bool is_my_profile);
125
126 #endif /* __CTSVC_DB_PLUGIN_CONTACT_HELPER_H__ */