Initial refactoring merge
[platform/core/telephony/libtcore.git] / include / co_phonebook.h
1 /*
2  * libtcore
3  *
4  * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
5  * Copyright (c) 2013 Intel Corporation. All rights reserved.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #ifndef __CO_PHONEBOOK_H__
21 #define __CO_PHONEBOOK_H__
22
23 #include "core_object.h"
24 #include <tel_phonebook.h>
25 #include <tel_return.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 typedef struct {
32         TelReturn (*get_info)(CoreObject *co, TelPbType pb_type, TcoreObjectResponseCallback cb, void *cb_data);
33         TelReturn (*read_record)(CoreObject *co, const TelPbRecordInfo *record, TcoreObjectResponseCallback cb, void *cb_data);
34         TelReturn (*update_record)(CoreObject *co, const TelPbUpdateRecord *req_data, TcoreObjectResponseCallback cb, void *cb_data);
35         TelReturn (*delete_record)(CoreObject *co, const TelPbRecordInfo *record, TcoreObjectResponseCallback cb, void *cb_data);
36 } TcorePbOps;
37
38 CoreObject *tcore_phonebook_new(TcorePlugin *p, TcorePbOps *ops, TcoreHal *hal);
39 void tcore_phonebook_free(CoreObject *co);
40
41 gboolean tcore_phonebook_set_ops(CoreObject *co, TcorePbOps *ops);
42 void tcore_phonebook_override_ops(CoreObject *co, TcorePbOps *phonebook_ops);
43
44 gboolean tcore_phonebook_get_status(CoreObject *co, gboolean *init_status);
45 gboolean tcore_phonebook_set_status(CoreObject *co, gboolean init_status);
46
47 gboolean tcore_phonebook_get_support_list(CoreObject *co, TelPbList **pb_list);
48 gboolean tcore_phonebook_set_support_list(CoreObject *co, TelPbList *pb_list);
49
50 gboolean tcore_phonebook_get_selected_type(CoreObject *co, TelPbType *pb_type);
51 gboolean tcore_phonebook_set_selected_type(CoreObject *co, TelPbType pb_type);
52
53 #ifdef __cplusplus
54 }
55 #endif
56
57 #endif  /*__CO_PHONEBOOK_H__*/