add APIs for getting SIM init status and importing SIM contacts by sim slot no
[platform/core/pim/contacts-service.git] / client / ctsvc_client_db_helper.h
1 /*
2  * Contacts Service
3  *
4  * Copyright (c) 2014 - 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
20 #ifndef __CTSVC_CLIENT_DB_HELPER_H__
21 #define __CTSVC_CLIENT_DB_HELPER_H__
22
23 #include "contacts_types.h"
24
25 int ctsvc_client_db_insert_record(contacts_h contact, contacts_record_h record, int *id);
26 int ctsvc_client_db_get_record(contacts_h contact, const char *view_uri, int id, contacts_record_h *out_record);
27 int ctsvc_client_db_update_record(contacts_h contact, contacts_record_h record);
28 int ctsvc_client_db_delete_record(contacts_h contact, const char *view_uri, int id);
29 int ctsvc_client_db_replace_record(contacts_h contact, contacts_record_h record, int id);
30 int ctsvc_client_db_get_all_records(contacts_h contact, const char *view_uri, int offset, int limit, contacts_list_h *out_list);
31 int ctsvc_client_db_get_records_with_query(contacts_h contact, contacts_query_h query, int offset, int limit, contacts_list_h *out_list);
32 int ctsvc_client_db_get_count(contacts_h contact, const char *view_uri, int *out_count);
33 int ctsvc_client_db_get_count_with_query(contacts_h contact, contacts_query_h query, int *out_count);
34 int ctsvc_client_db_insert_records(contacts_h contact, contacts_list_h list, int **ids, int *count);
35 int ctsvc_client_db_update_records(contacts_h contact, contacts_list_h list);
36 int ctsvc_client_db_delete_records(contacts_h contact, const char *view_uri, int ids[], int count);
37 int ctsvc_client_db_replace_records(contacts_h contact, contacts_list_h list, int ids[], int count);
38 int ctsvc_client_db_get_changes_by_version(contacts_h contact, const char *view_uri, int addressbook_id, int ctsvc_client_db_version, contacts_list_h *record_list, int *current_ctsvc_client_db_version);
39 int ctsvc_client_db_get_current_version(contacts_h contact, int *ctsvc_client_db_version);
40 int ctsvc_client_db_search_records(contacts_h contact, const char *view_uri, const char *keyword, int offset, int limit, contacts_list_h *out_list);
41 int ctsvc_client_db_search_records_with_range(contacts_h contact, const char *view_uri, const char *keyword, int offset, int limit, int range, contacts_list_h *out_list);
42 int ctsvc_client_db_search_records_with_query(contacts_h contact, contacts_query_h query, const char *keyword, int offset, int limit, contacts_list_h *out_list);
43 int ctsvc_client_db_search_records_for_snippet(contacts_h contact,
44                 const char *view_uri,
45                 const char *keyword,
46                 int offset,
47                 int limit,
48                 const char *start_match,
49                 const char *end_match,
50                 int token_number,
51                 contacts_list_h *out_list);
52 int ctsvc_client_db_search_records_with_range_for_snippet(contacts_h contact,
53                 const char *view_uri,
54                 const char *keyword,
55                 int offset,
56                 int limit,
57                 int range,
58                 const char *start_match,
59                 const char *end_match,
60                 int token_number,
61                 contacts_list_h *out_list);
62 int ctsvc_client_db_search_records_with_query_for_snippet(contacts_h contact,
63                 contacts_query_h query,
64                 const char *keyword,
65                 int offset,
66                 int limit,
67                 const char *start_match,
68                 const char *end_match,
69                 int token_number,
70                 contacts_list_h *out_list);
71 int ctsvc_client_db_get_last_change_version(contacts_h contact, int *last_version);
72 int ctsvc_client_db_get_status(contacts_h contact, contacts_db_status_e *status);
73 int ctsvc_client_db_add_status_changed_cb(contacts_h contact, contacts_db_status_changed_cb cb, void *user_data);
74 int ctsvc_client_db_remove_status_changed_cb(contacts_h contact, contacts_db_status_changed_cb cb, void *user_data);
75
76 #endif /* __CTSVC_CLIENT_DB_HELPER_H__ */
77