at_phonebook: Add Phonebook skeleton
[platform/core/telephony/tel-plugin-at_standard.git] / src / at_phonebook.c
1 /*
2  * tel-plugin-at_standard
3  *
4  * Copyright (c) 2012 Intel Corporation. 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 #include <glib.h>
20
21 #include <tcore.h>
22 #include <core_object.h>
23 #include <plugin.h>
24 #include <co_phonebook.h>
25
26 #include "at_phonebook.h"
27
28 static TReturn at_get_count(CoreObject *co, UserRequest *ur)
29 {
30         return TCORE_RETURN_ENOSYS;
31 }
32
33 static TReturn at_get_info(CoreObject *co, UserRequest *ur)
34 {
35         return TCORE_RETURN_ENOSYS;
36 }
37
38 static TReturn at_get_usim_info(CoreObject *co, UserRequest *ur)
39 {
40         return TCORE_RETURN_ENOSYS;
41 }
42
43 static TReturn at_read_record(CoreObject *co, UserRequest *ur)
44 {
45         return TCORE_RETURN_ENOSYS;
46 }
47
48 static TReturn at_update_record(CoreObject *co, UserRequest *ur)
49 {
50         return TCORE_RETURN_ENOSYS;
51 }
52
53 static TReturn at_delete_record(CoreObject *co, UserRequest *ur)
54 {
55         return TCORE_RETURN_ENOSYS;
56 }
57
58 static struct tcore_phonebook_operations phonebook_ops = {
59         .get_count = at_get_count,
60         .get_info = at_get_info,
61         .get_usim_info = at_get_usim_info,
62         .read_record = at_read_record,
63         .update_record = at_update_record,
64         .delete_record = at_delete_record,
65 };
66
67 gboolean at_phonebook_init(TcorePlugin *cp)
68 {
69         CoreObject *co;
70
71         co = tcore_phonebook_new(cp, "phonebook", &phonebook_ops, NULL);
72         if (co == NULL)
73                 return FALSE;
74
75         return TRUE;
76 }
77
78 void at_phonebook_exit(TcorePlugin *cp)
79 {
80         CoreObject *co;
81
82         co = tcore_plugin_ref_core_object(cp, "phonebook");
83         if (co == NULL)
84                 return;
85
86         tcore_phonebook_free(co);
87 }
88