PhoneBookpbapc.h 12.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
/*****************************************************************************
*  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:
 * ---------
 *  PhoneBookpbapc.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!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * 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 __PHONE_BOOK_PBAPC_H__
#define __PHONE_BOOK_PBAPC_H__

#include "MMI_features.h"

#if defined(__MMI_BT_PBAP_CLIENT__)

#include "MMIDataType.h"
#include "MMI_include.h"

#include "MMI_common_app_trc.h"
#include "mmi_rp_app_mainmenu_def.h"

#include "custom_phb_config.h"
#include "mmi_frm_scenario_gprot.h"
#include "MenuCuiGprot.h"

#include "PhbpbapSrvGprot.h"
#include "UcmSrvGprot.h"
#include "SmsUmBtMapProt.h"
#include "SmsAppGprot.h"
#include "UCMGProt.h"
#include "BtcmSrvGprot.h"

#include "Vcard_lib.h"

#include "PhoneBookResDef.h"
#include "mmi_rp_app_phonebook_def.h"
#include "PhoneBookProt.h"
#include "PhbCuiGprot.h"


#define MAX_PHB_PBAPC_MAX_FIELDS                        (5)

#define MMI_PHB_PBAPC_TRACE_GROUP                       TRACE_GROUP_9

//#define MMI_PHB_PBAPC_READ_PHONE_ONLY

typedef struct
{
    S32 ret;
    S32 sel_index;
} mmi_phb_pbapc_sel_num_rsp_struct;

typedef struct
{
    U8 cb_type; /* 0: pse entry, 1: select number */
    void *type_rsp;
    void *user_data;
} mmi_phb_pbapc_cb_info_struct;

typedef S32(*mmi_phb_pbapc_cb_func)(mmi_phb_pbapc_cb_info_struct *cb_info);


typedef struct
{
    SRV_PHB_PBAPC_HANDLE pbapc_handle;
    MMI_ID parent_id;
    srv_phb_pbap_storage_enum read_storage;
    U16 total_pse_contact;
    U16 pse_phone_num;
    U16 pse_sim_num;
    MMI_BOOL data_ready;
    U16 pse_list_index;
    U16 pse_entry_index;
    srv_phb_pbap_storage_enum contact_storage;

    /* select number operation 0: msg, 1: call. */
    U8 op_type;
    void *sel_num_ud;
    mmi_phb_pbapc_cb_func sel_cb_func;
    MMI_ID sel_num_pid;
    mmi_phb_pbapc_phb_info_struct sel_phb_info;
    S32 sel_hlight_index;
    /* view pse contact detail */
    mmi_phb_pbapc_phb_info_struct pse_phb;
    S32 hlight_index;
    /* read pse cb info */
    void *user_data;
    mmi_phb_pbapc_cb_func cb_func;
    /* job type 0: read list, 1: read entry */
    U8 job_type;
    /* global buff */
    srv_phb_pbapc_list_entry_struct  read_entry[SRV_PHB_PBAPC_MAX_READ_LIST_NUM];
    srv_phb_pbapc_list_entry_struct  pse_contact[MMI_PHB_PBAPC_MAX_PSE_CONTACT];
    /* PHB search suppport */
    MMI_BOOL search_done;
    MMI_BOOL show_dummy;
    MMI_BOOL is_full;

    /* select contact cui cntx */
    mmi_id cui_sel_contact_pid;
    void *cui_sel_contact_ud;
    U16 cui_pse_list_index;
    U16 cui_pse_entry_index;
    srv_phb_pbap_storage_enum cui_contact_storage;
    mmi_phb_pbapc_phb_info_struct cui_pse_phb;
    /* list type, 0: phb, 1: cui */
    U8 list_type;

    U16 *local_contact_id;
    U16 local_contact_count;
    U16 local_contact_hlight_index;
    U16 *qsearch_input_buffer;
    U16 phb_input_buffer[MMI_PHB_NAME_LENGTH + 1];
    U16 cui_input_buffer[MMI_PHB_NAME_LENGTH + 1];
    U16 local_qsearch_input_buffer[MMI_PHB_NAME_LENGTH + 1];

    /* high light tab, 0: init, 1: local, 2: bt */
    U8 phb_list;
    U8 cui_list;
    /* list state: 0: init, 1: active, 2: inactive */
    U8 list_state;
    /* flag, 0: init, 1: handle release evt */
    U8 flag;
    /* free flag */
    U8 free_handle;
    /* symbol picker */
    //U8 symbol_show;
    /* state: 0: null, 1: call */
    U8 phb_state;

    /* loading */
    MMI_ID load_gid;
    MMI_ID load_sid;
} mmi_phb_pbapc_cntx_struct;


/* func */

void mmi_phb_pbapc_entry_list_tab(void);

void mmi_phb_pbapc_exit_list_tab(void);

void mmi_phb_pbapc_entry_list(void);

void mmi_phb_pbapc_exit_list(void);

mmi_phb_pbapc_cntx_struct *mmi_phb_pbapc_get_cntx(void);

void mmi_phb_pbapc_set_list_type(U8 list_type);

void mmi_phb_pbapc_select_op_number(mmi_id parent_id, mmi_phb_pbapc_cb_func sel_cb_func,
                        void *user_data, mmi_phb_pbapc_phb_info_struct *phb_info);

/* local */

static void mmi_phb_pbapc_show_loading(MMI_ID parent_id, MMI_ID scrn_id);

static MMI_RET mmi_phb_pbapc_loading_scrn_proc(mmi_event_struct *evt);

static void mmi_phb_pbapc_pse_list_loading_abort(void);

static void mmi_phb_pbapc_show_searching(void);

static void mmi_phb_pbapc_searching_abort(void);

static void mmi_phb_pbapc_pse_list_op_option(void);

static void mmi_phb_pbapc_pse_list_connect(void);

static void mmi_phb_pbapc_pse_list_op_option_back(void);

static S32 mmi_phb_pbapc_read_pse_list_hdlr(srv_phb_pbapc_read_list_rsp_struct *list_rsp, void *user_data);

static void mmi_phb_pbapc_pse_list_highlight_hdlr(S32 item_index);

static S32 mmi_phb_pbapc_pse_list_get_item(S32 item_index, gui_iconlist_menu_item *menu_data, S32 data_size);

static void mmi_phb_pbapc_pse_list_get_item_int(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p1, PU8 *img_buff_p2);

static void mmi_phb_pbapc_entry_show_loading(void);

static S32 mmi_phb_pbapc_read_pse_list(void);

static S32 mmi_phb_pbapc_search_pse_list_hdlr(srv_phb_pbapc_read_list_rsp_struct *list_rsp, void *user_data);

static S32 mmi_phb_pbapc_search_pse_list(void);

static S32 mmi_phb_pbapc_search_function(U8 *keyword);

static void mmi_phb_pbapc_show_pse_list(void);

static void cui_phb_pbapc_view_pse_contact(mmi_id parent_id, U16 entry_index, srv_phb_pbap_storage_enum storage);

static void mmi_phb_pbapc_pse_list_call(void);

static S32 mmi_phb_pbapc_pse_list_call_read_entry_cb(mmi_phb_pbapc_cb_info_struct *cb_info);

static mmi_ret mmi_phb_pbapc_view_pse_contact_proc(mmi_event_struct *evt);

static void mmi_phb_pbapc_read_pse_entry(U16 entry_index, srv_phb_pbap_storage_enum storage,
                                void *user_data, mmi_phb_pbapc_cb_func cb_func);

static S32 mmi_phb_pbapc_read_pse_entry_hdlr(srv_phb_pbapc_read_entry_rsp_struct *entry_rsp, void *user_data);

static void mmi_phb_pbapc_show_loading_abort(MMI_ID parent_id, MMI_ID scrn_id);

static S32 mmi_phb_pbapc_read_pse_contact_cb(mmi_phb_pbapc_cb_info_struct *cb_info);

static S32 mmi_phb_pbapc_parse_single_vcard_file(U16 *path, mmi_phb_pbapc_phb_info_struct *pse_phb);

static S32 mmi_phb_pbapc_remove_sp_char(U16 *number);

static S32 mmi_phb_pbapc_convert_vobject_to_phb(vcard_object_struct *vcard_object, mmi_phb_pbapc_phb_info_struct *pse_phb);

static MMI_RET mmi_phb_pbapc_view_contact_scrn_proc(mmi_event_struct *evt);

static void mmi_phb_pbapc_show_pse_contact_detail(void);

static U16 mmi_phb_pbapc_get_num_type(U8 num_type);

static MMI_BOOL mmi_phb_pbapc_set_pse_view_flags(S32 index, U32* flag, U32* flag_ex);

static void mmi_phb_pbapc_view_contact_highlight_hdlr(S32 index);

static void mmi_phb_pbapc_view_contact_option(void);

static void  mmi_phb_pbapc_view_contact_op_msg(void);

static void  mmi_phb_pbapc_view_contact_op_call(void);

static void  mmi_phb_pbapc_save_pse_contact(void);

static S32 mmi_phb_pbapc_view_sel_num_cb(mmi_phb_pbapc_cb_info_struct *cb_info);

static void mmi_phb_pbapc_view_contact_option_back(void);

static MMI_RET mmi_phb_pbapc_select_op_number_proc(mmi_event_struct *evt);

static void mmi_phb_pbapc_show_select_number(void);

static void mmi_phb_pbapc_select_number_hlight_hdlr(S32 index);

static void mmi_phb_pbapc_select_num_done(S32 ret);

static void mmi_phb_pbapc_select_num_ok(void);

static void mmi_phb_pbapc_select_num_cancel(void);

mmi_ret mmi_phb_pbapc_notify_evt_hdlr(mmi_event_struct *evt);

static void mmi_phb_pbapc_revise_string(U8 *str, U16 buf_len);

#if defined(__MMI_FTE_SUPPORT__) && defined(__MMI_TOUCH_SCREEN__)
static void mmi_phb_pbapc_bt_list_tap_callback(mmi_tap_type_enum tap_type, S32 index);
#endif

/* select cui */

static mmi_ret cui_phb_pbapc_select_contact_proc(mmi_event_struct *evt);

static void cui_phb_pbapc_select_contact_entry(void);

static void cui_phb_pbapc_select_contact_exit(void);

static void cui_phb_pbapc_select_contact_local_entry(void);

static void cui_phb_pbapc_select_contact_local_exit(void);

static void cui_phb_pbapc_select_contact_bt_entry(void);

static void cui_phb_pbapc_select_contact_bt_exit(void);

static S32 cui_phb_pbapc_local_get_get_item(S32 start_index, gui_iconlist_menu_item *menu_data, S32 num_items);

static pBOOL cui_phb_pbapc_local_get_get_item_int(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p1, PU8 *img_buff_p2);

static void cui_phb_pbapc_local_show_list(void);

static void cui_phb_pbapc_local_list_highlight_hdlr(S32 item_index);

static void cui_phb_pbapc_local_list_option(void);

static void cui_phb_pbapc_local_list_option_back(void);

static void cui_phb_pbapc_select_contact_send_req_close(void);

static void cui_phb_pbapc_bt_send_select_result(mmi_phb_pbapc_phb_info_struct *pse_phb, S32 ret);

static void cui_phb_pbapc_pre_select_contact(void);

static S32 cui_phb_pbapc_pre_select_contact_cb(mmi_phb_pbapc_cb_info_struct *cb_info);

static S32 cui_phb_pbapc_pre_select_contact_number_cb(mmi_phb_pbapc_cb_info_struct *cb_info);

static void cui_phb_pbapc_bt_send_select_result_ext(mmi_phb_pbapc_phb_info_struct *pse_phb, S32 index, S32 ret);


MMI_BOOL mmi_pbapc_is_bqb_test();

void mmi_pbapc_bqb_start();

static mmi_ret mmi_pbapc_bqb_grp_proc();

static mmi_ret mmi_pbapc_bqb_scr_proc(mmi_event_struct *evt);

static void mmi_pbapc_bqb_show();

static void mmi_pbapc_bqb_highlight_hdlr(S32 index);

static void mmi_pbapc_bqb_option();

static void mmi_pbapc_bqb_back();

static void mmi_pbapc_bqb_read_folder();

static S32 mmi_pbapc_bqb_read_folder_cb(srv_phb_pbapc_read_folder_rsp_struct *folder_rsp, void *user_data);

static void mmi_pbapc_bqb_abort();

#endif /* defined(__MMI_BT_PBAP_CLIENT__) */

#endif /* __PHONE_BOOK_PBAPC_H__ */