PhbpbapSrvGprot.h
16.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* PhbpbapSrvGprot.h
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
* PBAPC
*
* Author:
* -------
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#ifndef __PHB_PBAP_SRV_GPROT_H__
#define __PHB_PBAP_SRV_GPROT_H__
#include "MMI_features.h"
#if defined(__BT_PBAP_CLIENT__)
#include "PbapSrvGprot.h"
typedef void* SRV_PHB_PBAPC_HANDLE;
/* pbap storage path enum */
typedef enum
{
SRV_PHB_PBAP_STORAGE_NULL = 0,
/* phone */
SRV_PHB_PBAP_STORAGE_PHONE_PB,
SRV_PHB_PBAP_STORAGE_PHONE_ICH,
SRV_PHB_PBAP_STORAGE_PHONE_OCH,
SRV_PHB_PBAP_STORAGE_PHONE_MCH,
SRV_PHB_PBAP_STORAGE_PHONE_CCH,
/* sim */
SRV_PHB_PBAP_STORAGE_SIM1_PB,
SRV_PHB_PBAP_STORAGE_SIM1_ICH,
SRV_PHB_PBAP_STORAGE_SIM1_OCH,
SRV_PHB_PBAP_STORAGE_SIM1_MCH,
SRV_PHB_PBAP_STORAGE_SIM1_CCH,
SRV_PHB_PBAP_STORAGE_TOTAL
} srv_phb_pbap_storage_enum;
/* pbap folder type enum */
typedef enum
{
SRV_PHB_PBAP_FORWARD_FOLDER = PBAP_FORWARD_FOLDER,
SRV_PHB_PBAP_BACK_FOLDER = PBAP_BACK_FOLDER,
SRV_PHB_PBAP_ROOT_FOLDER = PBAP_ROOT_FOLDER,
SRV_PHB_PBAP_TOTAL
} srv_phb_pbap_set_folder_type_enum;
/* pbap query attr */
typedef enum
{
SRV_PHB_PBAP_ATTR_NAME = PBAP_SEARCH_ATTRIB_NAME,
SRV_PHB_PBAP_ATTR_NUMBER = PBAP_SEARCH_ATTRIB_NUMBER,
SRV_PHB_PBAP_ATTR_SOUND = PBAP_SEARCH_ATTRIB_SOUND,
SRV_PHB_PBAP_ATTR_TOTAL
} srv_phb_pbap_query_attr_enum;
/* vcard sort order in listing */
typedef enum
{
SRV_PHB_PBAP_SORT_ORDER_INDEXED = PBAP_SORT_ORDER_INDEXED, /* Indexed sorting PBAP_SORT_ORDER_INDEXED */
SRV_PHB_PBAP_SORT_ORDER_ALPHA = PBAP_SORT_ORDER_ALPHA, /* Alphabetical sorting */
SRV_PHB_PBAP_SORT_ORDER_PHONETICAL = PBAP_SORT_ORDER_PHONETICAL, /* Phonetical sorting */
SRV_PHB_PBAP_SORT_ORDER_TOTAL
} srv_phb_pbap_sort_order_enum;
/* vcard format */
typedef enum
{
SRV_PHB_PBAP_VCARD_FORMAT_21 = VCARD_FORMAT_21,
SRV_PHB_PBAP_VCARD_FORMAT_30 = VCARD_FORMAT_30,
} srv_phb_pbap_vcard_format_enum;
/* phb pbapc job type enum */
typedef enum
{
SRV_PHB_PBAPC_JOB_NULL = 0,
SRV_PHB_PBAPC_JOB_SET_PATH,
SRV_PHB_PBAPC_JOB_READ_LIST,
SRV_PHB_PBAPC_JOB_READ_FOLDER,
SRV_PHB_PBAPC_JOB_READ_ENTRY,
SRV_PHB_PBAPC_JOB_GET_LIST_DATA,
SRV_PHB_PBAPC_JOB_TOTAL
} srv_phb_pbapc_job_enum;
#define SRV_PHB_PBAP_VCARD_FILTER_VER (1 << (PBAP_VCARD_FILTER_VER + 1)) /* Version (Bit 0) */
#define SRV_PHB_PBAP_VCARD_FILTER_FN (1 << (PBAP_VCARD_FILTER_FN + 1)) /* Formatted Name (Bit 1) */
#define SRV_PHB_PBAP_VCARD_FILTER_N (1 << (PBAP_VCARD_FILTER_N + 1)) /* Structured Presentation of Name (Bit 2) */
#define SRV_PHB_PBAP_VCARD_FILTER_PHOTO (1 << (PBAP_VCARD_FILTER_PHOTO + 1)) /* Associated Image or Photo (Bit 3) */
#define SRV_PHB_PBAP_VCARD_FILTER_BDAY (1 << (PBAP_VCARD_FILTER_BDAY + 1)) /* Birthday (Bit 4) */
#define SRV_PHB_PBAP_VCARD_FILTER_ADR (1 << (PBAP_VCARD_FILTER_ADR + 1)) /* Delivery Address (Bit 5) */
#define SRV_PHB_PBAP_VCARD_FILTER_LABEL (1 << (PBAP_VCARD_FILTER_LABEL + 1)) /* Delivery (Bit 6) */
#define SRV_PHB_PBAP_VCARD_FILTER_TEL (1 << (PBAP_VCARD_FILTER_TEL + 1)) /* Telephone (Bit 7) */
#define SRV_PHB_PBAP_VCARD_FILTER_EMAIL (1 << (PBAP_VCARD_FILTER_EMAIL + 1)) /* Electronic Mail Address (Bit 8) */
#define SRV_PHB_PBAP_VCARD_FILTER_MAILER (1 << (PBAP_VCARD_FILTER_MAILER + 1)) /* Electronic Mail (Bit 9) */
#define SRV_PHB_PBAP_VCARD_FILTER_TZ (1 << (PBAP_VCARD_FILTER_TZ + 1)) /* Time Zone (Bit 10) */
#define SRV_PHB_PBAP_VCARD_FILTER_GEO (1 << (PBAP_VCARD_FILTER_GEO + 1)) /* Geographic Position (Bit 11) */
#define SRV_PHB_PBAP_VCARD_FILTER_TITLE (1 << (PBAP_VCARD_FILTER_TITLE + 1)) /* Job (Bit 12) */
#define SRV_PHB_PBAP_VCARD_FILTER_ROLE (1 << (PBAP_VCARD_FILTER_ROLE + 1)) /* Role within the Organization (Bit 13) */
#define SRV_PHB_PBAP_VCARD_FILTER_LOGO (1 << (PBAP_VCARD_FILTER_LOGO + 1)) /* Organization Logo (Bit 14) */
#define SRV_PHB_PBAP_VCARD_FILTER_AGENT (1 << (PBAP_VCARD_FILTER_AGENT + 1)) /* vCard of Person Representing (Bit 15) */
#define SRV_PHB_PBAP_VCARD_FILTER_ORG (1 << (PBAP_VCARD_FILTER_ORG + 1)) /* Name of Organization (Bit 16) */
#define SRV_PHB_PBAP_VCARD_FILTER_NOTE (1 << (PBAP_VCARD_FILTER_NOTE + 1)) /* Comments (Bit 17) */
#define SRV_PHB_PBAP_VCARD_FILTER_REV (1 << (PBAP_VCARD_FILTER_REV + 1)) /* Revision (Bit 18) */
#define SRV_PHB_PBAP_VCARD_FILTER_SOUND (1 << (PBAP_VCARD_FILTER_SOUND + 1)) /* Pronunciation of Name (Bit 19) */
#define SRV_PHB_PBAP_VCARD_FILTER_URL (1 << (PBAP_VCARD_FILTER_URL + 1)) /* Uniform Resource Locator (Bit 20) */
#define SRV_PHB_PBAP_VCARD_FILTER_UID (1 << (PBAP_VCARD_FILTER_UID + 1)) /* Unique ID (Bit 21) */
#define SRV_PHB_PBAP_VCARD_FILTER_KEY (1 << (PBAP_VCARD_FILTER_KEY + 1)) /* Public Encryption Key (Bit 22) */
#define SRV_PHB_PBAP_VCARD_FILTER_NICK (1 << (PBAP_VCARD_FILTER_NICK + 1)) /* Nickname (Bit 23) */
#define SRV_PHB_PBAP_VCARD_FILTER_CAT (1 << (PBAP_VCARD_FILTER_CAT + 1)) /* Categories (Bit 24) */
#define SRV_PHB_PBAP_VCARD_FILTER_PRODID (1 << (PBAP_VCARD_FILTER_PRODID + 1)) /* Product Id (Bit 25) */
#define SRV_PHB_PBAP_VCARD_FILTER_CLASS (1 << (PBAP_VCARD_FILTER_CLASS + 1)) /* Class Information (Bit 26) */
#define SRV_PHB_PBAP_VCARD_FILTER_SORT_STR (1 << (PBAP_VCARD_FILTER_SORT_STR + 1)) /* Sort string (Bit 27) */
#define SRV_PHB_PBAP_VCARD_FILTER_TIMESTAMP (1 << (PBAP_VCARD_FILTER_TIMESTAMP + 1))/* Time stamp (Bit 28) */
#define SRV_PHB_PBAP_VCARD_FILTER_TOTAL (PBAP_VCARD_FILTER_TIMESTAMP + 1)
#define SRV_PHB_PBAP_VCARD_FILTER_ALL (0xffffffff)
#define SRV_PHB_PBAPC_REQ_HEAD \
SRV_PHB_PBAPC_HANDLE handle; \
srv_phb_pbap_storage_enum storage; \
void *user_data
#define SRV_PHB_PBAPC_MAX_READ_LIST_COUNT (0xffff)
#define SRV_PHB_PBAPC_MAX_READ_LIST_NUM (PBAP_XML_PARSE_NUM)
#define SRV_PHB_PBAPC_MAX_ENTRY_NAME_LEN (21) // PBAP_MAX_NAME_LEN/2 128/2
#define SRV_PHB_PBAPC_FOLDER_PATH (PBAPC_ADP_FOLDER_FILE)
#define SRV_PHB_PBAPC_ENTRY_FILE_PATH (PBAPC_ADP_ENTRY_FILE);
#define SRV_PHB_PBAPC_MAX_PATH_LEN (127)
#define SRV_PHB_PBAPC_MAX_QUERY_LEN (32)
/* Structure for the ex-request of reading list */
typedef struct
{
S32 entry_index;
U8 entry_name[SRV_PHB_PBAPC_MAX_ENTRY_NAME_LEN + 1];
} srv_phb_pbapc_list_entry_struct;
typedef struct
{
S32 entry_count;
srv_phb_pbapc_list_entry_struct *list_entry;
} srv_phb_pbapc_read_list_req_ex_struct;
typedef srv_phb_pbapc_read_list_req_ex_struct srv_phb_pbapc_read_list_entry;
/* Structure for the request of reading list */
typedef struct
{
SRV_PHB_PBAPC_REQ_HEAD;
U16 *folder_name;
U8 query_attr;
U8 order;
U8 *query_pattern;
U8 query_length; /* < SRV_PHB_PBAPC_MAX_ENTRY_NAME_LEN */
U16 query_count;
U16 query_offset;
/* ex-req, provide buf to save index & name. list_entry buf size: SRV_PHB_PBAPC_MAX_READ_LIST_NUM * sizeof(srv_phb_pbapc_list_entry_struct) */
srv_phb_pbapc_read_list_req_ex_struct *list_req_ex;
} srv_phb_pbapc_read_list_req_struct;
/* Structure for the confirmation of reading list */
typedef struct
{
U16 phb_size; // phoneBookSize: 0xffff indicates have only data
U16 mc; //newMissedCalls: 0xffff means type is not MCH
S32 ret;
/* when list_valid is TRUE, following data is valid */
MMI_BOOL is_list_valid;
U16 more_data;
S32 entry_count;
srv_phb_pbapc_read_list_entry *list;
} srv_phb_pbapc_read_list_rsp_struct;
/* Structure for the request of reading entry */
typedef struct
{
SRV_PHB_PBAPC_REQ_HEAD;
U16 entry_index; /* index in pse index.vcf */
srv_phb_pbap_vcard_format_enum vcard_format;
U32 vcard_filter;
} srv_phb_pbapc_read_entry_req_struct;
/* Structure for the confirmation of reading entry */
typedef struct
{
U16 *entry_path;
S32 ret;
} srv_phb_pbapc_read_entry_rsp_struct;
/* Structure for the request of reading folder */
typedef struct
{
SRV_PHB_PBAPC_REQ_HEAD;
U16 *folder_name;
srv_phb_pbap_vcard_format_enum vcard_format;
U32 vcard_filter;
U16 list_count;
U16 list_offset;
} srv_phb_pbapc_read_folder_req_struct;
/* Structure for the confirmation of reading entry */
typedef struct
{
U16 *folder_path;
S32 ret;
} srv_phb_pbapc_read_folder_rsp_struct;
/* Structure for the request of reading folder */
typedef struct
{
SRV_PHB_PBAPC_REQ_HEAD;
srv_phb_pbap_set_folder_type_enum folder_type;
} srv_phb_pbapc_set_path_req_struct;
/* Structure for the confirmation of reading entry */
typedef struct
{
S32 ret;
} srv_phb_pbapc_set_path_rsp_struct;
/* phb pbapc notify event struct */
typedef struct
{
MMI_EVT_PARAM_HEADER
U8 evt_type;
} srv_phb_pbapc_notify_evt_struct;
/* Result code used in most APIs, should be zero or negative number */
typedef enum
{
SRV_PHB_PBAPC_RET_OK = 0, /* Success */
SRV_PHB_PBAPC_RET_NOT_READY = -1, /* Srv is not ready */
SRV_PHB_PBAPC_RET_BUSY = -2, /* Srv handle is busy */
SRV_PHB_PBAPC_RET_NOT_USER = -3, /* Currently, pbap srv can't be used */
SRV_PHB_PBAPC_RET_INVALID_PARAMETERS = -4, /* Parameter is not right */
SRV_PHB_PBAPC_RET_HANDLE_EXHAUST = -5, /* Phb srv handle is exhausted */
SRV_PHB_PBAPC_RET_POINTER_NULL = -6, /* Ptr is null */
SRV_PHB_PBAPC_RET_UNKNOW_JOB = -7, /* Job type is unknowed */
SRV_PHB_PBAPC_RET_REQ_HANDLE_INVALID = -8, /* Req handle is invalid */
SRV_PHB_PBAPC_RET_NOT_EXIST_HANDLE = -9, /* Req handle is invalid */
SRV_PHB_PBAPC_RET_FAIL = -10,
SRV_PHB_PBAPC_RET_DISCONNECT = -11,
SRV_PHB_PBAPC_RET_UNKNOWN = -100, /* Unknown error */
SRV_PHB_PBAPC_RET_MAX_ITEM /* Max item */
} srv_phb_phapc_ret_enum;
/* callback function type */
typedef S32(*srv_phb_pbapc_read_pse_list_cb) (srv_phb_pbapc_read_list_rsp_struct *list_rsp, void *user_data);
typedef S32(*srv_phb_pbapc_read_pse_entry_cb) (srv_phb_pbapc_read_entry_rsp_struct *entry_rsp, void *user_data);
typedef S32(*srv_phb_pbapc_read_pse_folder_cb) (srv_phb_pbapc_read_folder_rsp_struct *folder_rsp, void *user_data);
typedef S32(*srv_phb_pbapc_set_pse_path_cb) (srv_phb_pbapc_set_path_rsp_struct *path_rsp, void *user_data);
/*****************************************************************************
* Extern Global Function
*****************************************************************************/
#ifdef __cplusplus
extern "C"
{
#endif
/*****************************************************************************
* FUNCTION
* srv_phb_pbapc_create_handle
* DESCRIPTION
* this api is employed to create pbapc handle
* PARAMETERS
* result [OUT] return ret
* RETURNS
* if ok, return handle or NULL
*****************************************************************************/
extern SRV_PHB_PBAPC_HANDLE srv_phb_pbapc_create_handle(S32 *result);
/*****************************************************************************
* FUNCTION
* srv_phb_pbapc_destory_handle
* DESCRIPTION
* this api is employed to destory pbapc handle
* PARAMETERS
* hanlde [IN] pbapc hanlde created by srv_phb_pbapc_create_handle
* RETURNS
* if ok, return success or fail error enum
*****************************************************************************/
extern S32 srv_phb_pbapc_destory_handle(SRV_PHB_PBAPC_HANDLE handle);
/*****************************************************************************
* FUNCTION
* srv_phb_pbapc_init_para
* DESCRIPTION
* this api is employed to init job req struct
* PARAMETERS
* job_type [IN] job type enum
* para [IN] req para
* RETURNS
* return init ret
*****************************************************************************/
extern S32 srv_phb_pbapc_init_para(srv_phb_pbapc_job_enum job_type, void *para);
/*****************************************************************************
* FUNCTION
* srv_phb_pbapc_read_pse_list
* DESCRIPTION
* this api is employed to send read pse list req
* PARAMETERS
* list_req [IN] list req struct
* cb_func [IN] call back function
* RETURNS
* return request ret
*****************************************************************************/
extern S32 srv_phb_pbapc_read_pse_list(srv_phb_pbapc_read_list_req_struct *list_req, srv_phb_pbapc_read_pse_list_cb cb_func);
/*****************************************************************************
* FUNCTION
* srv_phb_pbapc_read_pse_entry
* DESCRIPTION
* this api is employed to send read pse entry req
* PARAMETERS
* entry_req [IN] entry req struct
* cb_func [IN] call back function
* RETURNS
* return request ret
*****************************************************************************/
extern S32 srv_phb_pbapc_read_pse_entry(srv_phb_pbapc_read_entry_req_struct *entry_req, srv_phb_pbapc_read_pse_entry_cb cb_func);
/*****************************************************************************
* FUNCTION
* srv_phb_pbapc_read_pse_folder
* DESCRIPTION
* this api is employed to send read pse folder req
* PARAMETERS
* folder_req [IN] folder req struct
* cb_func [IN] call back function
* RETURNS
* return request ret
*****************************************************************************/
extern S32 srv_phb_pbapc_read_pse_folder(srv_phb_pbapc_read_folder_req_struct *folder_req, srv_phb_pbapc_read_pse_folder_cb cb_func);
#ifdef __cplusplus
}
#endif
#endif /* defined(__BT_PBAP_CLIENT__) */
#endif /* __PHB_PBAP_SRV_GPROT_H__ */