📄 phonebookmain.c
字号:
SetHintHandler(MENU_ID_PHB_NAME_LIST_FILTER, mmi_phb_hint_name_list_filter);
#endif /* defined(__MMI_PHB_NAME_LIST_FILTER__) */
#if defined(__MMI_VCARD__)
/* My vCard */
SetHiliteHandler(MENU_ID_PHB_VCARD_MYCARD, mmi_phb_highlight_vcard_mycard);
SetHiliteHandler(MENU_ID_PHB_VCARD_EDIT_MYCARD, mmi_phb_highlight_vcard_edit_mycard);
SetHiliteHandler(MENU_ID_PHB_VCARD_SEND_MYCARD, mmi_phb_highlight_vcard_send_mycard);
#if defined(__MMI_VCARD_V30__)
/* vCard version */
SetHiliteHandler(MENU_ID_PHB_VCARD_VERSION, mmi_phb_highlight_vcard_version);
SetHintHandler(MENU_ID_PHB_VCARD_VERSION, mmi_phb_hint_vcard_version);
SetHiliteHandler(MENU_ID_PHB_VCARD_VERSION_21, mmi_phb_highlight_vcard_version_21);
SetHiliteHandler(MENU_ID_PHB_VCARD_VERSION_30, mmi_phb_highlight_vcard_version_30);
#endif /* defined(__MMI_VCARD_V30__) */
#endif /* defined(__MMI_VCARD__) */
#if defined(__MMI_INTELLIGENT_CALL_ALERT__)
SetHiliteHandler(MENU_ID_PHB_SPEAK_NAME, mmi_phb_highlight_speak_name);
SetHintHandler(MENU_ID_PHB_SPEAK_NAME, mmi_phb_hint_speak_name);
#endif /* defined(__MMI_INTELLIGENT_CALL_ALERT__) */
/* Forward resource to phonebook entry */
#if defined(__MMI_PHB_CALLER_RES_SETTING__)
/* For submenu in phonebook */
SetHiliteHandler(MENU_ID_PHB_CALLER_PIC, mmi_phb_highlight_caller_pic);
SetHiliteHandler(MENU_ID_PHB_CALLER_RING, mmi_phb_highlight_caller_ring);
#if defined(__MMI_INCOMING_CALL_VIDEO__)
SetHiliteHandler(MENU_ID_PHB_CALLER_VIDEO, mmi_phb_highlight_caller_video);
#endif
#endif /* defined(__MMI_PHB_CALLER_RES_SETTING__) */
#if defined(__MMI_FILE_MANAGER__) && !defined(__MMI_DISPLAY_CHAR_HIDE_MENU_FROM_FILE__)
/* Save Image From File Manager */
SetHiliteHandler(MENU_ID_PHB_FMGR_SAVE_NEW, mmi_phb_highlight_fmgr_add_entry);
SetHiliteHandler(MENU_ID_PHB_FMGR_SAVE_LIST, mmi_phb_highlight_fmgr_edit_entry);
SetHiliteHandler(MENU_ID_PHB_FMGR_SAVE_CALLGRP, mmi_phb_highlight_edit_callergroup);
#endif /* defined(__MMI_FILE_MANAGER__) && !defined(__MMI_DISPLAY_CHAR_HIDE_MENU_FROM_FILE__) */
/* Done and Input Method */
mmi_frm_set_highlight_handler();
}
#ifdef __MMI_DUAL_SIM_MASTER__
/*****************************************************************************
* FUNCTION
* mmi_phb_ind_startup_begin
* DESCRIPTION
* Initialize variables before L4 Phb start to read
* PARAMETERS
* info [?]
* RETURNS
* void
*****************************************************************************/
void mmi_phb_reset_phb_entry_before_begin(U8 module_id)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 phb_min_index, phb_max_index;
U16 total_count, max_total;
U16 i, j, temp_store_index;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
max_total = MAX_PB_PHONE_ENTRIES + MAX_PB_SIM_ENTRIES + MTPNP_PFAL_SLAVE_PB_MAX_ENTRY_SUPPORT;
if (module_id == 0)
{
phb_min_index = 0;
phb_max_index = MAX_PB_PHONE_ENTRIES + MAX_PB_SIM_ENTRIES;
}
else
{
phb_min_index = MAX_PB_PHONE_ENTRIES + MAX_PB_SIM_ENTRIES;
phb_max_index = MAX_PB_PHONE_ENTRIES + MAX_PB_SIM_ENTRIES + MTPNP_PFAL_SLAVE_PB_MAX_ENTRY_SUPPORT;
}
total_count = PhoneBookEntryCount;
for (i = 0; i < total_count; i++)
{
temp_store_index = g_phb_name_index[i];
if ((temp_store_index >= phb_min_index) && (temp_store_index < phb_max_index))
{
g_phb_name_index[i] = max_total;
PhoneBookEntryCount--;
}
}
i = 0;
j = 0;
while (i < PhoneBookEntryCount)
{
if (g_phb_name_index[i] == max_total)
{
while (j < total_count)
{
if ((j > i) && (g_phb_name_index[j] != max_total))
{
g_phb_name_index[i] = g_phb_name_index[j];
g_phb_name_index[j] = max_total;
break;
}
j++;
}
}
i++;
}
g_phb_cntx.lookup_table_count = 0;
}
#endif /*__MMI_DUAL_SIM_MASTER__ */
/*****************************************************************************
* FUNCTION
* mmi_phb_ind_startup_begin
* DESCRIPTION
* Initialize variables before L4 Phb start to read
* PARAMETERS
* info [?]
* RETURNS
* void
*****************************************************************************/
void mmi_phb_ind_startup_begin(void *info)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#ifdef __SLT_MMI_PHB_BUG3693__
if ( ReadPbflag)
{
#endif
#ifdef __SLT_MMI_MULTIGSM_PHONEBOOK_INIT__ //tianjunxia
static BOOL IsFirstTime = TRUE;
U8 MultigsmNo;
multigsm_pb_trace("tttttttttt======in==========mmi_phb_ind_startup_begin tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT");
if(IsFirstTime == TRUE)
#endif
{
g_phb_cntx.phb_ready = FALSE;
#ifdef __MMI_PHB_USIM_FIELD__
g_phb_cntx.usim_ready_stage = MMI_PHB_USIM_NOT_READY;
#endif
#ifdef __SLT_MMI_MULTIGSM_PHONEBOOK_INIT__ //tianjunxia
for(MultigsmNo = 0;MultigsmNo < MAX_MUTLIGSM_L4C_COUNT;MultigsmNo++)
{
g_phb_cntx.phb_subready[MultigsmNo] = FALSE;
}
IsFirstTime = FALSE;
#endif
#ifdef __MMI_DUAL_SIM_MASTER__
if ((g_phb_cntx.sim_used + g_phb_cntx.phone_used) != 0)
{
mmi_phb_reset_phb_entry_before_begin(0);
}
g_phb_cntx.startup_before_sort = FALSE;
#else /* __MMI_DUAL_SIM_MASTER__ */
PhoneBookEntryCount = 0;
g_phb_cntx.lookup_table_count = 0;
#endif /* __MMI_DUAL_SIM_MASTER__ */
g_phb_cntx.sim_used = 0;
g_phb_cntx.sim2_used = 0;//add by tianjunxia 20070906
g_phb_cntx.phone_used = 0;
g_phb_cntx.populate_count = 0;
g_phb_cntx.current_op = MMI_PHB_OP_NONE;
}
#if defined(__MMI_VRSI__)
/* Phonebook reload so need reset VR. After sorting done, add phonebook entry again. */
mmi_vrsi_init_central_reset();
#endif /* defined(__MMI_VRSI__) */
#ifdef __SLT_MMI_PHB_BUG3693__
}
else
{
return;
}
#endif
}
/*****************************************************************************
* FUNCTION
* mmi_phb_sat_handler
* DESCRIPTION
* Handler sim refresh cmd
* PARAMETERS
* reset_adn [IN]
* RETURNS
* void
*****************************************************************************/
void mmi_phb_sat_handler(BOOL reset_adn)
{
g_phb_cntx.phb_ready = FALSE;
#ifdef __MMI_PHB_USIM_FIELD__
g_phb_cntx.usim_ready_stage = MMI_PHB_USIM_NOT_READY;
#endif
#ifdef __SLT_MMI_MULTIGSM_SAT__ //temp for stk super phb
{
U16 index = 0;
U16 temp[300];
U16 i=0;
g_phb_cntx.phb_ready = FALSE;
for(index=0;index<PhoneBookEntryCount;index++)
{
if(g_phb_name_index[index] >=600 && g_phb_name_index[index ] < 900)
{
kal_prompt_trace(MOD_MMI, " g_phb_name_index[index] = %d ", g_phb_name_index[index]);
temp[i++] = g_phb_name_index[index];
}
}
for(index=0;index<g_phb_cntx.sim2_used ;index++)
{
g_phb_name_index[index] =temp[index] ;
kal_prompt_trace(MOD_MMI, " g_phb_name_index[index] = %d index = %d ", g_phb_name_index[index], index );
}
}
if (reset_adn)
{
g_phb_cntx.sim_used = 0;
g_phb_cntx.phone_used = 0;
PhoneBookEntryCount = g_phb_cntx.sim2_used ;
kal_prompt_trace(MOD_MMI,"mmi_phb_sat_handler ");
}
g_phb_cntx.lookup_table_count = g_phb_cntx.sim2_used;
g_phb_cntx.populate_count = g_phb_cntx.sim2_used;
#else
if (reset_adn)
{
g_phb_cntx.sim_used = 0;
g_phb_cntx.phone_used = 0;
PhoneBookEntryCount = 0;
}
g_phb_cntx.lookup_table_count = 0;
g_phb_cntx.populate_count = 0;
#endif
#if defined(__MMI_VRSI__)
/* Phonebook reload so need reset VR. After sorting done, add phonebook entry again. */
mmi_vrsi_init_central_reset();
#endif /* defined(__MMI_VRSI__) */
if (g_phb_cntx.processing)
{
S8 outBuf[100], count[10];
g_phb_cntx.processing = FALSE;
TurnOnBacklight(1); /* Turn On Back Light When done */
DeleteScreenIfPresent(SCR_IN_PROGRESS_PHB);
if (g_phb_cntx.copy_all)
{
g_phb_cntx.copy_all = FALSE;
/* Display result for !g_phb_mass_op_success */
g_phb_mass_op_success = TRUE;
sprintf(count, "%d ", g_phb_mass_op_count);
mmi_asc_to_ucs2(outBuf, count);
if (g_phb_mass_op_count <= 1)
{
mmi_ucs2cat(outBuf, GetString(STR_ENTRY_COPIED));
}
else
{
mmi_ucs2cat(outBuf, GetString(STR_ENTRIES_COPIED));
}
DisplayPopup((PU8) outBuf, IMG_GLOBAL_UNFINISHED, TRUE, PHB_NOTIFY_TIMEOUT, ERROR_TONE);
/* Solve Copying Screen Hang Problem */
DeleteScreenIfPresent(SCR_COPY_ALL_PROGRESS);
}
else
{
/* Display result for !g_phb_mass_op_success */
g_phb_mass_op_success = TRUE;
sprintf(count, "%d ", g_phb_mass_op_count);
mmi_asc_to_ucs2(outBuf, count);
if (g_phb_mass_op_count <= 1)
{
mmi_ucs2cat(outBuf, GetString(STR_ID_PHB_ENTRY_DELETED));
}
else
{
mmi_ucs2cat(outBuf, GetString(STR_ID_PHB_ENTRIES_DELETED));
}
DisplayPopup((U8*) outBuf, IMG_GLOBAL_UNFINISHED, TRUE, PHB_NOTIFY_TIMEOUT, ERROR_TONE);
/* Solve Copying Screen Hang Problem */
DeleteScreenIfPresent(SCR_COPY_ALL_PROGRESS);
/* Re-add all central command for vrsi. */
#if defined(__MMI_VRSI__)
mmi_vrsi_init_central_abort();
/* Also remove SD tag if entry is deleted. */
#if defined(__MMI_VRSI_TRAIN_TAG__)
mmi_vrsi_ndial_central_update_sd_mapping();
#endif
#endif /* defined(__MMI_VRSI__) */
}
}
else if (g_phb_cntx.current_op == MMI_PHB_OP_ADD)
{
DisplayPopup(
(PU8) GetString(STR_GLOBAL_UNFINISHED),
IMG_GLOBAL_UNFINISHED,
TRUE,
PHB_NOTIFY_TIMEOUT,
ERROR_TONE);
mmi_phb_clear_old_add_history();
}
else if (g_phb_cntx.current_op == MMI_PHB_OP_EDIT)
{
DisplayPopup(
(PU8) GetString(STR_GLOBAL_UNFINISHED),
IMG_GLOBAL_UNFINISHED,
TRUE,
PHB_NOTIFY_TIMEOUT,
ERROR_TONE);
mmi_phb_clear_old_edit_history();
}
g_phb_enter_from = MMI_PHB_ENTER_NONE;
/* copyEntry = duplicateEntry = moveEntry = FALSE;*/
g_phb_cntx.current_op = MMI_PHB_NONE;
}
#ifdef __MMI_INTELLIGENT_CALL_ALERT__
/*****************************************************************************
* FUNCTION
* mmi_phb_speak_name_handler
* DESCRIPTION
*
* PARAMETERS
* result [IN]
* RETURNS
* void
*****************************************************************************/
void mmi_phb_speak_name_handler(mdi_result result)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
g_phb_is_speaking_name = 0;
}
#endif /* __MMI_INTELLIGENT_CALL_ALERT__ */
/*****************************************************************************
* FUNCTION
* mmi_phb_startup_read_entry
* DESCRIPTION
* This function set the read indication data from L4 Phb at bootup time.
* Stores each indication to the global phonebook list.
* PARAMETERS
* phb_entry [IN]
* store_index [IN]
* RETURNS
* void
*****************************************************************************/
static void mmi_phb_startup_read_entry(l4c_phb_bcd_entry_struct phb_entry, U16 store_index)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 num_ascii[MAX_PB_NUMBER_LENGTH + 1 + 1];
U8 bcd_length = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
PhoneBook[store_index].field = 0;
/* Name Field */
PhoneBook[store_index].alpha_id.name_length = phb_entry.alpha_id.name_length;
PhoneBook[store_index].alpha_id.name_dcs = phb_entry.alpha_id.name_dcs;
if (PhoneBook[store_index].alpha_id.name_length == 0
|| (phb_entry.alpha_id.name[0] == 0xff && phb_entry.alpha_id.name[1] == 0xff))
{
memset(PhoneBook[store_index].alpha_id.name, 0, 2);
}
else
{
PhoneBook[store_index].field |= MMI_PHB_ENTRY_FIELD_NAME;
InputboxConvertGSMToDeviceEncoding(
phb_entry.alpha_id.name,
PhoneBook[store_index].alpha_id.name,
phb_entry.alpha_id.name_length,
(MAX_PB_NAME_LENGTH + 1) * ENCODING_LENGTH,
phb_entry.alpha_id.name_dcs,
0,
1);
}
#if defined(__PHB_0x81_SUPPORT__) /* Support maximum length of 0x81 UCS2 */
if (PhoneBook[store_index].alpha_id.name_dcs == MMI_PHB_UCS2_81 ||
PhoneBook[store_index].alpha_id.name_dcs == MMI_PHB_UCS2_82)
{
PhoneBook[store_index].alpha_id.name_dcs = MMI_PHB_UCS2;
}
#endif /* defined(__PHB_0x81_SUPPORT__) */
#if defined(__MMI_PHB_PINYIN_SORT__)
mmi_phb_util_make_pinyin_cache(store_index);
#endif
/* Number Field
For L4 phb struct, the first byte of addr_bcd is TON, and the rest are BCD numbers.
And the length is the total byte of TON + BCD numbers. */
PhoneBook[store_index].tel.type = phb_entry.tel.addr_bcd[0];
if (phb_entry.tel.addr_length > 0)
{
bcd_length =
((phb_entry.tel.addr_length - 1) <
((MAX_PB_NUMBER_LENGTH + 1) / 2)) ? (phb_entry.tel.addr_length - 1) : ((MAX_PB_NUMBER_LENGTH + 1) / 2);
}
if (bcd_length > 0)
{
/* strncpy((S8*)PhoneBook[store_index].tel.number, (S8*)(LocalPtr->phb_entry.tel.addr_bcd+1), (MAX_PB_NUMBER_LENGTH + 1) / 2); */
memset(PhoneBook[store_index].tel.number, 0xff, ((MAX_PB_NUMBER_LENGTH + 1) / 2));
memcpy(PhoneBook[store_index].tel.number, (phb_entry.tel.addr_bcd + 1), bcd_length);
}
else
{
PhoneBook[store_index].tel.number[0] = 0xff;
}
mmi_phb_convert_to_digit(num_ascii, PhoneBook[store_index].tel.number, MAX_PB_NUMBER_LENGTH + 1);
PhoneBook[store_index].tel.length = strlen((S8*) num_ascii);
/* Update flag for number exists entry, Clear it first. */
if ((PhoneBook[store_index].tel.number[0] & 0x0f) != 0x0f)
{
PhoneBook[store_index].field |= MMI_PHB_ENTRY_FIELD_NUMBER;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -