4 * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef __CTSVC_CLIENT_DB_HELPER_H__
21 #define __CTSVC_CLIENT_DB_HELPER_H__
23 #include "contacts_types.h"
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,
48 const char *start_match,
49 const char *end_match,
51 contacts_list_h *out_list);
52 int ctsvc_client_db_search_records_with_range_for_snippet(contacts_h contact,
58 const char *start_match,
59 const char *end_match,
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,
67 const char *start_match,
68 const char *end_match,
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);
76 #endif /* __CTSVC_CLIENT_DB_HELPER_H__ */