Fix authentication key length
[platform/core/telephony/libtcore.git] / include / type / phonebook.h
1 /*
2  * libtcore
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Ja-young Gu <jygu@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20
21 #ifndef __TYPE_PHONEBOOK_H__
22 #define __TYPE_PHONEBOOK_H__
23
24 __BEGIN_DECLS
25
26 #include <glib.h>
27 #define PHONEBOOK_NAME_BYTE_MAX         256
28 #define PHONEBOOK_NUMBER_BYTE_MAX       256
29 #define PHONEBOOK_EMAIL_BYTE_MAX        256
30
31 enum tel_phonebook_type {
32         PB_TYPE_FDN, /**< Fixed Dialing Number */
33         PB_TYPE_ADN, /**< SIM - ADN      */
34         PB_TYPE_SDN, /**< Service Dialing Number  */
35         PB_TYPE_USIM, /**< USIM - 3G phone book */
36         PB_TYPE_AAS, /**< Additional number Alpha String */
37         PB_TYPE_GAS, /**< Grouping identifier Alpha String */
38         PB_TYPE_UNKNOWNN = 0xFF, /**< Unknown file type */
39 };
40
41 enum tel_phonebook_field_type {
42         PB_FIELD_NAME = 0x01, /**< Name */
43         PB_FIELD_NUMBER, /**< Number */
44         PB_FIELD_ANR1, /**< First Another number*/
45         PB_FIELD_ANR2, /**< Second Another number */
46         PB_FIELD_ANR3, /**< Third Another number */
47         PB_FIELD_EMAIL1, /**< First Email */
48         PB_FIELD_EMAIL2, /**< Second Email */
49         PB_FIELD_EMAIL3, /**< Third Email */
50         PB_FIELD_EMAIL4, /**< Fourth Email */
51         PB_FIELD_SNE, /**< Second name entry of main name*/
52         PB_FIELD_GRP, /**< Group  */
53         PB_FIELD_PBC, /** <1 byte control info and 1 byte hidden info*/
54 };
55
56 enum tel_phonebook_result {
57         PB_SUCCESS, /**< SIM phonebook operation successful. */
58         PB_FAIL, /**< SIM phonebook operation failure. */
59         PB_INVALID_INDEX, /**< The index passed was not a valid index. */
60         PB_INVALID_NUMBER_LENGTH, /**< The number length is exceeds the max length allowed (or 0). */
61         PB_INVALID_NAME_LENGTH, /**< The name length is exceeds the max length allowed (or 0). */
62         PB_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition for PB file is not satisfied. */
63 };
64
65 enum tel_phonebook_ton {
66         PB_TON_UNKNOWN = 0, /**< unknown */
67         PB_TON_INTERNATIONAL = 1, /**< international number */
68         PB_TON_NATIONAL = 2, /**< national number */
69         PB_TON_NETWORK_SPECIFIC = 3, /**< network specific number */
70         PB_TON_DEDICATED_ACCESS = 4, /**< subscriber number */
71         PB_TON_ALPHA_NUMERIC = 5, /**< alphanumeric, GSM 7-bit default alphabet) */
72         PB_TON_ABBREVIATED_NUMBER = 6, /**< abbreviated number */
73         PB_TON_RESERVED_FOR_EXT = 7 /**< reserved for extension */
74 };
75
76 enum tel_phonebook_dcs {
77         PB_TEXT_ASCII, /**< ASCII Encoding */
78         PB_TEXT_GSM7BIT, /**< GSM 7 Bit with bit 8 set to 0 Encoding */
79         PB_TEXT_UCS2, /**< UCS2 Encoding */
80         PB_TEXT_HEX, /**< HEX Encoding */
81 };
82
83 struct tel_phonebook_support_list {
84         gboolean b_fdn; /**< Fixed Dialing Number */
85         gboolean b_adn; /**< SIM - ADN(2G phonebook, Under DF phonebook */
86         gboolean b_sdn; /**< Service Dialing Number  */
87         gboolean b_usim; /**< USIM - 3G phonebook */
88         gboolean b_aas; /**< Additional number Alpha String phonebook */
89         gboolean b_gas; /**< Grouping information Alpha String phonebook */
90 };
91
92 struct treq_phonebook_get_count {
93         enum tel_phonebook_type phonebook_type;
94 };
95
96 struct treq_phonebook_get_info {
97         enum tel_phonebook_type phonebook_type;
98 };
99
100 struct treq_phonebook_get_usim_info {
101
102 };
103
104 struct treq_phonebook_read_record {
105         enum tel_phonebook_type phonebook_type;
106         unsigned short index;
107 };
108
109 struct treq_phonebook_update_record {
110         enum tel_phonebook_type phonebook_type;
111         unsigned short index;
112
113         unsigned char name[PHONEBOOK_NAME_BYTE_MAX+1];          // +1 is for Null termination
114         unsigned short name_len;
115         enum tel_phonebook_dcs dcs;
116
117         unsigned char number[PHONEBOOK_NUMBER_BYTE_MAX+1];      // +1 is for Null termination
118         enum tel_phonebook_ton ton;
119
120         /* following fields are valid in only USIM*/
121         unsigned char sne[PHONEBOOK_NAME_BYTE_MAX+1];           // +1 is for Null termination
122         unsigned short sne_len;
123         enum tel_phonebook_dcs sne_dcs;
124
125         unsigned char anr1[PHONEBOOK_NUMBER_BYTE_MAX+1];        // +1 is for Null termination
126         enum tel_phonebook_ton anr1_ton;
127         unsigned char anr2[PHONEBOOK_NUMBER_BYTE_MAX+1];        // +1 is for Null termination
128         enum tel_phonebook_ton anr2_ton;
129         unsigned char anr3[PHONEBOOK_NUMBER_BYTE_MAX+1];        // +1 is for Null termination
130         enum tel_phonebook_ton anr3_ton;
131
132         unsigned char email1[PHONEBOOK_EMAIL_BYTE_MAX+1];       // +1 is for Null termination
133         unsigned short email1_len;
134         unsigned char email2[PHONEBOOK_EMAIL_BYTE_MAX+1];       // +1 is for Null termination
135         unsigned short email2_len;
136         unsigned char email3[PHONEBOOK_EMAIL_BYTE_MAX+1];       // +1 is for Null termination
137         unsigned short email3_len;
138         unsigned char email4[PHONEBOOK_EMAIL_BYTE_MAX+1];       // +1 is for Null termination
139         unsigned short email4_len;
140
141         unsigned short group_index; //GRP
142         unsigned short pb_control; //PBC
143 };
144
145 struct treq_phonebook_delete_record {
146         enum tel_phonebook_type phonebook_type;
147         unsigned short index;
148 };
149
150 struct tresp_phonebook_get_count {
151         enum tel_phonebook_result result;
152         enum tel_phonebook_type type;
153         unsigned short used_count;
154         unsigned short total_count;
155 };
156
157 struct tresp_phonebook_get_info {
158         enum tel_phonebook_result result;
159         enum tel_phonebook_type type;
160         unsigned short index_min;
161         unsigned short index_max;
162         unsigned short number_length_max;
163         unsigned short text_length_max;
164 };
165
166 struct tel_phonebook_usim_meta {
167         enum tel_phonebook_field_type field;
168         unsigned short index_max;
169         unsigned short text_max;
170         unsigned short used_count;
171 };
172
173 struct tresp_phonebook_get_usim_info {
174         enum tel_phonebook_result result;
175         int field_count;
176         struct tel_phonebook_usim_meta field_list[13]; //supported fields are 13 currently.
177 };
178
179 struct tresp_phonebook_read_record {
180         enum tel_phonebook_result result;
181         enum tel_phonebook_type phonebook_type;
182         unsigned short index;
183         unsigned short next_index;
184
185         unsigned char name[PHONEBOOK_NAME_BYTE_MAX+1];          // +1 is for Null termination
186         unsigned short name_len;
187         enum tel_phonebook_dcs dcs;
188
189         unsigned char number[PHONEBOOK_NUMBER_BYTE_MAX+1];      // +1 is for Null termination
190         enum tel_phonebook_ton ton;
191
192         /* following fields are valid in only USIM*/
193         unsigned char sne[PHONEBOOK_NAME_BYTE_MAX+1];           // +1 is for Null termination
194         unsigned short sne_len;
195         enum tel_phonebook_dcs sne_dcs;
196
197         unsigned char anr1[PHONEBOOK_NUMBER_BYTE_MAX+1];        // +1 is for Null termination
198         enum tel_phonebook_ton anr1_ton;
199         unsigned char anr2[PHONEBOOK_NUMBER_BYTE_MAX+1];        // +1 is for Null termination
200         enum tel_phonebook_ton anr2_ton;
201         unsigned char anr3[PHONEBOOK_NUMBER_BYTE_MAX+1];        // +1 is for Null termination
202         enum tel_phonebook_ton anr3_ton;
203
204         unsigned char email1[PHONEBOOK_EMAIL_BYTE_MAX+1];       // +1 is for Null termination
205         unsigned short email1_len;
206         unsigned char email2[PHONEBOOK_EMAIL_BYTE_MAX+1];       // +1 is for Null termination
207         unsigned short email2_len;
208         unsigned char email3[PHONEBOOK_EMAIL_BYTE_MAX+1];       // +1 is for Null termination
209         unsigned short email3_len;
210         unsigned char email4[PHONEBOOK_EMAIL_BYTE_MAX+1];       // +1 is for Null termination
211         unsigned short email4_len;
212
213         unsigned short group_index; //GRP
214         unsigned short pb_control; //PBC
215 };
216
217 struct tresp_phonebook_update_record {
218         enum tel_phonebook_result result;
219 };
220
221 struct tresp_phonebook_delete_record {
222         enum tel_phonebook_result result;
223 };
224
225 struct tnoti_phonebook_status {
226         gboolean b_init;
227         struct tel_phonebook_support_list support_list;
228 };
229
230 __END_DECLS
231
232
233 #endif