Пример #1
0
/*****************************************************************************
 * FUNCTION
 *  mmi_bt_avrcp_ct_cmd_confirm
 * DESCRIPTION
 *  This function is to
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_bt_avrcp_ct_cmd_confirm(U16 op_code, U8 command_type, BOOL key_press)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    CHAR display_buffer[80];

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    switch (op_code)
    {
        case BT_AVRCP_OP_UNIT_INFO:
            mmi_ucs2cpy(display_buffer, (CHAR*) GetString(STR_BT_AVRCP_CMD_UNIT_COMMAND));
            break;

        case BT_AVRCP_OP_SUBUNIT_INFO:
            mmi_ucs2cpy(display_buffer, (CHAR*) GetString(STR_BT_AVRCP_CMD_SUBUNIT_COMMAND));
            break;

        case BT_AVRCP_OP_PASS_THROUGH:
            mmi_ucs2cpy(display_buffer, (CHAR*) GetString(mmi_bt_avrcp_util_get_cmd_string(command_type)));
            break;

        default:
            mmi_ucs2cpy(display_buffer, (CHAR*) GetString(STR_GLOBAL_ERROR));        
            break;
    }

    mmi_ucs2cat(display_buffer, (CHAR*)L"\n Response\0");

    mmi_popup_display_simple((WCHAR*) display_buffer, MMI_EVENT_SUCCESS, GRP_ID_ROOT, NULL);

}
Пример #2
0
/*****************************************************************************
 * FUNCTION
 *  mmi_vrsi_redial_no_number
 * DESCRIPTION
 *  no number to dial prompt
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_vrsi_redial_no_number(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S8 str_prompt[MMI_VRSI_MAX_PROMPT_STR * ENCODING_LENGTH];

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* Append redial type */
    if (g_vrsi_redial_type == PHB_LND)
    {
        mmi_ucs2cpy(str_prompt, GetString(STR_ID_VRSI_REDIAL_DIALED));
    }
    else if (g_vrsi_redial_type == PHB_LNM)
    {
        mmi_ucs2cpy(str_prompt, GetString(STR_ID_VRSI_REDIAL_MISSED));
    }
    else if (g_vrsi_redial_type == PHB_LNR)
    {
        mmi_ucs2cpy(str_prompt, GetString(STR_ID_VRSI_REDIAL_RECEIVED));
    }

    /* Play prompt TTS */
    mmi_vrsi_util_play_tts((U16*) str_prompt, mmi_vrsi_entry_rcg);
}
Пример #3
0
/*****************************************************************************
 * FUNCTION
 *  format_asking_string
 * DESCRIPTION
 *  Add mid_name and "?" into string.
 * PARAMETERS
 *  string_id       [IN]        String ID
 * RETURNS
 *
 *****************************************************************************/
static PU8 format_asking_string(U16 string_id)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    kal_int32 string_len = mmi_ucs2strlen(GetString(string_id));
    kal_wchar *mid_name = get_running_mid_name();

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (mid_name == NULL)
    {
        mid_name = (kal_wchar*) GetString(STR_SCR_JAVA_CAPTION);
    }
    if (asking_string_buffer != NULL)
    {
        free_ctrl_buffer(asking_string_buffer);
    }
    asking_string_buffer = (kal_wchar*) get_ctrl_buffer((string_len + mmi_ucs2strlen((S8*) mid_name) + 2) << 1);
    mmi_ucs2cpy((S8*) asking_string_buffer, GetString(string_id));
    mmi_ucs2cpy((S8*) (asking_string_buffer + string_len), (S8*) mid_name);
    string_len += mmi_ucs2strlen((S8*) mid_name);
    asking_string_buffer[string_len] = '?';
    asking_string_buffer[string_len + 1] = 0;
    return (PU8) asking_string_buffer;
}
Пример #4
0
/*****************************************************************************
 * FUNCTION
 *  mmi_rmgr_show_trans_LSK_and_hint
 * DESCRIPTION
 *  Update and show trans LSK and hint
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void mmi_rmgr_show_trans_LSK_and_hint(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U16 highlight_idx;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    highlight_idx = GetCurrHiliteID();

    if (mmi_rmgr_p->trans_state)
    {
        ChangeLeftSoftkey(STR_GLOBAL_OFF, IMG_GLOBAL_OK);
        mmi_ucs2cpy((S8*) hintData[highlight_idx], (S8*) GetString(STR_GLOBAL_ON));
    }
    else
    {
        ChangeLeftSoftkey(STR_GLOBAL_ON, IMG_GLOBAL_OK);
        mmi_ucs2cpy((S8*) hintData[highlight_idx], (S8*) GetString(STR_GLOBAL_OFF));
    }

    Category52ChangeItemDescription(highlight_idx, hintData[highlight_idx]);
    RedrawCategoryFunction();
}
Пример #5
0
/*****************************************************************************
 * FUNCTION
 *  PmgReplaceExtMelodyBySlotPathFileName
 * DESCRIPTION
 *  
 * PARAMETERS
 *  pathfileName        [?]         
 *  freeSlot            [IN]        
 * RETURNS
 *  
 *****************************************************************************/
PMG_ADDFILE_ERRNO PmgReplaceExtMelodyBySlotPathFileName(S8 *pathfileName, U8 freeSlot) /* fileName is unicode */
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    /* U8 freeSlot=0; */
    S16 pError;
    U8 i;
    PMG_ADDFILE_ERRNO res = MMI_FALSE;
    DYNEXTMELODYELEM target;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (mmi_ucs2strlen(pathfileName) >= (MAX_EXT_MELODY_FULLNAME_WIDTH / ENCODING_LENGTH))
    {
        return PMG_ADDFILE_ERR_STR_TOO_LONG;
    }
    res = PmgSeparateFilePathName(
            (S8*) pathfileName,
            (S8*) target.filepath,
            sizeof(target.filepath),
            (S8*) target.filename,
            sizeof(target.filename));
    if (res != PMG_ADDFILE_ERR_SUCCESS)
    {
        return res;
    }

    /* check if it is shorname and mark it if possible */
    if (is_target_short_filename)
    {
        MARK_EXTMELODY_SHORTNAME(target.filepath);
    }

    /* Check Duplicate */
    for (i = 0; i < MAXIMUM_EXT_MELODY_NUM; i++)
    {
        if ((i != freeSlot)
            && (PmgIsEmptySlot(i) == MMI_FALSE)
            && (mmi_ucs2cmp((S8*) gPmgExtMelodyInfo.info[i].filepath, (S8*) target.filepath) == 0)
            && (mmi_ucs2cmp((S8*) gPmgExtMelodyInfo.info[i].filename, (S8*) target.filename) == 0))
        {
            return PMG_ADDFILE_ERR_DUPLICATED;
        }
    }

    mmi_ucs2cpy((S8*) gPmgExtMelodyInfo.info[freeSlot].filepath, (S8*) target.filepath);
    mmi_ucs2cpy((S8*) gPmgExtMelodyInfo.info[freeSlot].filename, (S8*) target.filename);

    PMG_ASSERT(NVRAM_EF_EXT_MELODY_INFO_SIZE == sizeof(gPmgExtMelodyInfo));
    WriteRecord(NVRAM_EF_EXT_MELODY_INFO_LID, 1, &gPmgExtMelodyInfo, sizeof(gPmgExtMelodyInfo), &pError);
    PMG_ASSERT(pError == NVRAM_WRITE_SUCCESS);

    return PMG_ADDFILE_ERR_SUCCESS;
}
Пример #6
0
static pBOOL mmi_dailer_list_get_item(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
{
	unsigned short wtmp[50];
	S32 index;
	U8 num_ascii[MAX_PB_NUMBER_LENGTH + 1 + 1];
	U16 num_ascii_wchar[MAX_PB_NUMBER_LENGTH + 1 + 1];
	S16 store_index;


	if (item_index > total_items)
	{		
		return MMI_FALSE;	
	}
#if 0//(NEW_DIAL_SCREEN)
	// 第一个列表元素设为用户输入
	if (item_index == FIRST_USER_INPUT_INDEX)
	{
		mmi_ucs2cpy((S8 *)str_buff, (S8 *)input_buffer);
		*img_buff_p = NULL;

		return MMI_TRUE;
	}
#endif

	// 电话本处理
	index = list_filter_index_array[item_index];
	store_index = g_phb_name_index[index];
	
	if (mmi_ucs2strlen((S8*) (PhoneBook[store_index].alpha_id.name)))
	{	
		// name
		mmi_ucs2cpy((S8*) str_buff, (S8*) (PhoneBook[store_index].alpha_id.name));
		//stretch_eight_chars_width(str_buff);
	
		// phone number
	#if 1   //>>luchongguang mod 2009-07-10 Bug #12887 存储+86的号码,然后待机界面输入号码前几位快速选择呼叫,字符“+”会被去掉,拨打电话失败 
		mmi_phb_convert_get_ucs2_number((S8*) num_ascii_wchar, store_index);
	#else
		mmi_phb_convert_to_digit_by_storage(num_ascii, PhoneBook[store_index].tel.number, MAX_PB_NUMBER_LENGTH + 1,MMI_NVRAM);
		mmi_asc_to_ucs2((S8 *)num_ascii_wchar, (S8 *)num_ascii);
	#endif  /* Bug #12994 */

		mmi_ucs2cat((S8*) str_buff, (S8 *)L"  ");
		mmi_ucs2cat((S8 *)str_buff, (S8 *)num_ascii_wchar);		
	}
	else
	{
		 mmi_phb_convert_get_ucs2_number((S8*) str_buff, store_index);
	}
	

	*img_buff_p = NULL;

	return MMI_TRUE;
}
Пример #7
0
/*****************************************************************************
 * FUNCTION
 *  mmi_vrsi_redial_dial_prompt_message
 * DESCRIPTION
 *  This function prepare redial prompt message.
 * PARAMETERS
 *  str_prompt      [IN]        Prompt string buffer
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_vrsi_redial_dial_prompt_message(S8 *str_prompt)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    LOG_CALL *redial_call = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* Append redial type, use first record only */
    if (g_vrsi_redial_type == PHB_LND)
    {
        redial_call = &chis_p->dialedCalls[0];
        mmi_ucs2cpy(str_prompt, GetString(STR_ID_VRSI_REDIAL_DIALED));
    }
    else if (g_vrsi_redial_type == PHB_LNM)
    {
        redial_call = &chis_p->missedCalls[0];
        mmi_ucs2cpy(str_prompt, GetString(STR_ID_VRSI_REDIAL_MISSED));
    }
    else if (g_vrsi_redial_type == PHB_LNR)
    {
        redial_call = &chis_p->recvdCalls[0];
        mmi_ucs2cpy(str_prompt, GetString(STR_ID_VRSI_REDIAL_RECEIVED));
    }
    else
    {
        DisplayPopup(
            (U8*) GetString(STR_GLOBAL_ERROR),
            IMG_GLOBAL_ERROR,
            TRUE,
            UI_POPUP_NOTIFYDURATION_TIME,
            ERROR_TONE);
        return;
    }

    mmi_ucs2cat(str_prompt, (S8*) L" ");

    /* Append Name or Number */
    if (mmi_ucs2strlen(redial_call->pbName))
    {
        mmi_ucs2cat(str_prompt, redial_call->pbName);
    }
    else
    {
        mmi_ucs2cat(str_prompt, (S8*) redial_call->number);
    }

    /* Append dialing string */
    mmi_ucs2cat(str_prompt, (S8*) L" ");
    mmi_ucs2cat(str_prompt, GetString(STR_ID_VRSI_DIALING_PROMPT));
}
Пример #8
0
/*****************************************************************************
 * FUNCTION
 *  mmi_brw_stored_page_pre_entry_page_properties
 * DESCRIPTION
 *  Entry function for store page properties
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_brw_stored_page_pre_entry_page_properties(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
	S8 temp_str[100];
	applib_time_struct time_obj;
	S32 local_time_in_sec;
	S32 page_size;
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
	MMI_ASSERT(g_brw_cntx.saved_page_properties_p);

	mmi_brw_object_properties_reset();

	if(g_brw_cntx.saved_page_properties_p)
	{
		g_brw_obj_properties_cntx.prop_status[BRW_OBJECT_PROP_NAME] = MMI_TRUE;
		mmi_chset_utf8_to_ucs2_string((U8*)g_brw_obj_properties_cntx.obj_name, (BRW_OBJECT_PROPERTIES_NAME_LEN+1)*ENCODING_LENGTH,
			(U8*)g_brw_cntx.saved_page_properties_p->label);

		g_brw_obj_properties_cntx.prop_status[BRW_OBJECT_PROP_ADDRESS] = MMI_TRUE;
		mmi_chset_utf8_to_ucs2_string((U8*)g_brw_obj_properties_cntx.obj_address, (BRW_OBJECT_PROPERTIES_ADDRESS_LEN+1)*ENCODING_LENGTH,
			(U8*)g_brw_cntx.saved_page_properties_p->url);

		g_brw_obj_properties_cntx.prop_status[BRW_OBJECT_PROP_SIZE] = MMI_TRUE;
		page_size = (S32)g_brw_cntx.saved_page_properties_p->data_size;
		if( page_size > 0 )
		{
	        mmi_brw_convert_int_to_unicode_string((U8*)temp_str,(U32)g_brw_cntx.saved_page_properties_p->data_size);
	        mmi_ucs2cat((S8*)temp_str,(S8*)L" ");
	        mmi_ucs2cat((S8*)temp_str,(S8*)get_string(STR_ID_BRW_BYTES));
		}
		else
		{
			mmi_ucs2cpy((S8*)temp_str,(S8*)get_string(STR_ID_BRW_UNKNOWN));
		}
		mmi_ucs2cpy((S8*)g_brw_obj_properties_cntx.obj_size, (S8*)temp_str);

		g_brw_obj_properties_cntx.prop_status[BRW_OBJECT_PROP_DATE] = MMI_TRUE;
		local_time_in_sec = applib_dt_sec_utc_to_local(g_brw_cntx.saved_page_properties_p->date);
		if(applib_dt_utc_sec_2_mytime(local_time_in_sec, &time_obj, MMI_FALSE))
		{
			sprintf((S8*) temp_str, "%d/%d/%d", time_obj.nMonth, time_obj.nDay, time_obj.nYear);
			mmi_asc_to_ucs2((S8*)g_brw_obj_properties_cntx.obj_date, (S8*)temp_str);
		}
	}

	g_brw_obj_properties_cntx.prop_count = BRW_STORED_PAGE_PROPERTIES_COUNT;
	mmi_brw_entry_object_properties();
}
Пример #9
0
/*****************************************************************************
 * FUNCTION
 *  csb_cat_scr_list_get_item
 * DESCRIPTION
 *  get the list of items
 * PARAMETERS
 *  item_index          [IN]            
 *  str_buff            [IN]            
 *  img_buff_p          [?]             
 *  str_img_mask        [IN]            
 *  a(?)                [IN]            Item index
 *  d(?)                [IN/OUT]        String image mask
 *  c(?)                [IN/OUT]        Image buffer
 *  b(?)                [IN/OUT]        String buffer
 * RETURNS
 * TRUE
*****************************************************************************/
pBOOL csb_cat_scr_list_get_item(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/



    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    UI_UNUSED_PARAMETER(str_img_mask);
	*img_buff_p = (PU8) GetImage(IMG_PROFILES_OUTDOOR);


	mmi_ucs2cpy((S8*) str_buff,(S8*) GetString(STR_ID_CSB_SHOW_CATEGORY_TEXT));

	/* Concatenate the categor ID to the category name */
	mmi_ucs2cat((S8*) str_buff,(S8*) csb_category_screen_list[item_index].pscreen_name);

	/* Concatenate the string to the category ID */
	mmi_ucs2cat((S8*) str_buff,(S8*) GetString(STR_ID_CSB_SCREEN_TEXT));
   
    return TRUE;

}
Пример #10
0
/*****************************************************************************
 * FUNCTION
 *  mmi_rmgr_hint_trans
 * DESCRIPTION
 *  Hint handler for trans. tracking ON/OFF
 * PARAMETERS
 *  hint_idx        [IN]        Hint index
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_rmgr_hint_trans(U16 hint_idx)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (mmi_rmgr_p->trans_state)
    {
        mmi_ucs2cpy((S8*) hintData[hint_idx], GetString(STR_GLOBAL_ON));
    }
    else
    {
        mmi_ucs2cpy((S8*) hintData[hint_idx], GetString(STR_GLOBAL_OFF));
    }
}
Пример #11
0
static S32 mmi_dailer_list_get_hint_item(S32 item_index, UI_string_type *hint_array)
{

#if 1
	return 0;
#else
	/*----------------------------------------------------------------*/
	/* Local Variables                                                */
	/*----------------------------------------------------------------*/
	U16 i, count, store_index;
	S8 temp_number[30 * ENCODING_LENGTH];
	S8 tmp[30];
	S32 index;
	U8 num_ascii[MAX_PB_NUMBER_LENGTH + 1 + 1];

	if (item_index > total_items)
	{		
		return 0;	
	}

	index = list_filter_index_array[item_index];

#if 1
	mmi_phb_convert_to_digit(num_ascii, PhoneBook[index].tel.number, MAX_PB_NUMBER_LENGTH + 1);
	mmi_asc_to_ucs2((S8*) temp_number, (S8 *)num_ascii);
#else

	for (i = 0; i < 10; i++)
	{
		if (index >= 0 && index <= 9)
			tmp[i] = index + '0';
		else
		{
			S16 c;

			c = index + 'A';
			if (c > 'Z')
			{
				c = 'A';
			}
			
			tmp[i] = c;
		}
	}
	
	tmp[i] = '\0';
	mmi_asc_to_ucs2((S8*) temp_number, tmp);
#endif	
	

	mmi_ucs2cpy((S8*) hint_array[0], (S8*) temp_number);

	return 1;   /* One hint data only, can be more hints. */
#endif	
}
Пример #12
0
/*****************************************************************************
 * FUNCTION
 *  ExitScrCMErrMsg
 * DESCRIPTION
 *  Exit handler for the error pop up screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void ExitScrCMErrMsg(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    MMI_TRACE(MMI_TRACE_G5_CM, MMI_CM_FUNC_ExitScrCMErrMsg);

    if (GetErrorToneFlag() > 0)
    {
        stopRequestedTone(GetErrorToneFlag());
        SetErrorToneFlag(0);
    }
    StopTimer(CM_NOTIFYDURATION_TIMER);

    if (cm_p->redial_info.RedialState == TRUE)
    {
        /* in redial process */
        if (cm_p->redial_info.ErrRedialScreen == TRUE)
        {
            /* error msg got interrupted */
            history Scr1009;
            S16 nHistory = 0;

            MMI_TRACE(MMI_TRACE_G5_CM, MMI_CM_INFO_ExitScrCMErrMsgRedial);

            Scr1009.scrnID = CM_SCR_RDL_TIME;
            Scr1009.entryFuncPtr = EntryScrShowUserTimeToRedial;
            mmi_ucs2cpy((S8*) Scr1009.inputBuffer, (S8*) & nHistory);
            GetCategoryHistory(Scr1009.guiBuffer);
            AddHistory(Scr1009);
            cm_p->redial_info.ErrRedialScreen = FALSE;
            return;
        }
        else
        {
            /* error msg timer expire => going to Notify Redial Screen */
            return;
        }
    }

    /* SetRedialScreen(FALSE); */

    if (GetPOPUpFlag())
    {
        SetPOPUpFlag(FALSE);
        AdjustHistoryForCM();
    }
}
Пример #13
0
/*****************************************************************************
 * FUNCTION
 *  mmi_vrsi_prf_switch_prompt_message
 * DESCRIPTION
 *  This function play prompt tts when switch mode
 * PARAMETERS
 *  str_prompt      [IN]        Prompt string
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_vrsi_prf_switch_prompt_message(S8 *str_prompt)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_ucs2cpy(str_prompt, GetString(STR_ID_VRSI_SWITCHED_PROMPT));

    mmi_vrsi_prf_get_mode_prompt(str_prompt);
}
Пример #14
0
/*****************************************************************************
 * FUNCTION
 *  mmi_bt_avrcp_ct_main_list_item
 * DESCRIPTION
 *  This function is to
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
pBOOL mmi_bt_avrcp_ct_main_list_item(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_ucs2cpy((CHAR*) str_buff, (CHAR*) GetString(g_mmi_bt_avrcp_cmd[item_index].str_id));
    img_buff_p = NULL;

    return TRUE;
}
Пример #15
0
/*****************************************************************************
 * FUNCTION
 *  mmi_vrsi_prf_no_mode_prompt
 * DESCRIPTION
 *  This function play tts for no profile to switch.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_vrsi_prf_no_mode_prompt(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S8 str_prompt[MMI_VRSI_MAX_PROMPT_STR * ENCODING_LENGTH];

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_ucs2cpy(str_prompt, GetString(STR_ID_VRSI_RCG_NOT_FOUND));
    mmi_ucs2cat(str_prompt, GetString(STR_PROFILE_CAPTION));
    mmi_ucs2cat(str_prompt, GetString(STR_ID_VRSI_SPEAK_AGAIN_PROMPT));

    /* Play prompt TTS */
    mmi_vrsi_util_play_tts((U16*) str_prompt, mmi_vrsi_entry_rcg);
}
Пример #16
0
/*****************************************************************************
 * FUNCTION
 *  jma_audio_recorder_reset_parameter
 * DESCRIPTION
 *  This function resets parameters
 * PARAMETERS
 *
 * RETURNS
 *  void
 *****************************************************************************/
void jma_audio_recorder_reset_parameter(kal_int32 vm_id)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    kal_trace(TRACE_GROUP_4, FUNC_J2ME_JMA_AUDIO_RECORDER_RESET_PARAMETER, vm_id, audio_recorder[vm_id].state);

    audio_recorder[vm_id].state = JAVA_MEDIA_STATE_NULL;
    audio_recorder[vm_id].format = MED_TYPE_NONE;
    mmi_ucs2cpy((PS8) audio_recorder[vm_id].filename, "");
    audio_recorder[vm_id].record_timer = &java_media_timer;
    audio_recorder[vm_id].id = INVALID_JPLAYER_ID;
    audio_recorder[vm_id].current_time = 0;
    audio_recorder[vm_id].record_size_limit = -1;
}
Пример #17
0
/*****************************************************************************
 * FUNCTION
 *  mmi_vrsi_prf_cannot_switch_prompt
 * DESCRIPTION
 *  This function play tts for can not switch to specific mode. (Ex. headset mode)
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_vrsi_prf_cannot_switch_prompt(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S8 str_prompt[MMI_VRSI_MAX_PROMPT_STR * ENCODING_LENGTH];

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_ucs2cpy(str_prompt, GetString(STR_ID_VRSI_CANT_SWITCH_PROMPT));

    mmi_vrsi_prf_get_mode_prompt(str_prompt);

    mmi_ucs2cat(str_prompt, GetString(STR_ID_VRSI_SPEAK_AGAIN_PROMPT));

    /* Play prompt TTS */
    mmi_vrsi_util_play_tts((U16*) str_prompt, mmi_vrsi_entry_rcg);
}
Пример #18
0
/*****************************************************************************
 * FUNCTION
 *  mmi_java_entry_get_permission
 * DESCRIPTION
 *  The entry function to get user's permission to use Network or some
 *  resource.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_java_entry_get_permission(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    U8 *guiBuffer;
    U16 strid = mmi_java_permission_strid(mmi_java_get_permission_msg.title_id);
    S8 *buffer;
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    EntryNewScreen(SCR_JAVA_GET_PERMISSION, NULL, mmi_java_entry_get_permission, NULL);

    guiBuffer = GetCurrGuiBuffer(SCR_JAVA_GET_PERMISSION);

    mmi_java_get_permission_index = mmi_java_get_permission_msg.chosen_id;

    buffer = (S8*)subMenuData;
    kal_mem_set(buffer, 0, MAX_SUB_MENUS * MAX_SUB_MENU_SIZE);

    mmi_ucs2cpy((S8*)buffer, (S8*)GetString(strid));

    if(mmi_java_get_permission_msg.appendix)
    {
        mmi_ucs2cat((S8*)buffer, (S8*)mmi_java_get_permission_msg.appendix);
    }

    ShowCategory74Screen(
        STR_JAVA_PERMISSION_TITLE,
        mmi_java_get_title_icon(),
        STR_GLOBAL_YES,
        IMG_GLOBAL_YES,
        STR_GLOBAL_NO,
        IMG_GLOBAL_NO,
        (PU8) buffer,
        mmi_ucs2strlen((PS8) buffer),
        NULL);

    SetLeftSoftkeyFunction(mmi_java_get_permission_lsk_hdlr, KEY_EVENT_UP);
    SetRightSoftkeyFunction(mmi_java_get_permission_rsk_hdlr, KEY_EVENT_UP);
}
Пример #19
0
/*****************************************************************************
 * FUNCTION
 *  csb_frm_save_screen_shot
 * DESCRIPTION
 *  Function to create the file path and save the 
 *	LAYER contents in JPEG format
 * PARAMETERS
 *  U32			cat_ID
 * RETURNS
 *  void
 *****************************************************************************/
pBOOL csb_frm_save_screen_shot(U32 nIndex)
{
	/*----------------------------------------------------------*/
    /* Local Variables                                          */
    /*----------------------------------------------------------*/

	U8	file_name_prefix_in_unicode[MAX_CSB_SCREEN_NAME_LENGTH * ENCODING_LENGTH];
	U8	file_name_prefix_in_ascii[MAX_CSB_SCREEN_NAME_LENGTH] = "category_";
	U8	local_file_path[MAX_CSB_PATH_LENGTH * ENCODING_LENGTH];
	
	gdi_handle handle = GDI_NULL_HANDLE;
	GDI_RESULT	error;

	/*----------------------------------------------------------*/
    /* Code Body                                                */
    /*----------------------------------------------------------*/

	/* Convert Ansii string to Unicode */
 	mmi_asc_to_ucs2((PS8) file_name_prefix_in_unicode, (PS8) file_name_prefix_in_ascii);

	mmi_ucs2cpy((PS8)local_file_path, (PS8) g_CSB_struct.csb_settings.csb_screenshots_folder_path);

	/* Concatenate the category screen prefix to the file name -- "category_" */
	mmi_ucs2cat((PS8)local_file_path, (PS8) file_name_prefix_in_unicode);
	/* Concatenate the category ID to the file name */
	mmi_ucs2cat((PS8)local_file_path, (PS8) g_CSB_struct.pscreen_info[nIndex].cat_scr_name);
	/* Append the extension of the file -- ".jpg" */
	mmi_ucs2cat((PS8)local_file_path, (PS8) L".jpg\0");

	/* Merge all the layers to one */
	gdi_layer_flatten_previous_to_base();
	handle = GDI_LAYER_MAIN_BASE_LAYER_HANDLE;

	/* API to save the snapshot of the given the LAYER handle at the given path */
	error = gdi_layer_save_jpeg_file(handle, (S8*) local_file_path);

	if(error == GDI_FAILED)
	{
		return FALSE;
	}
	return TRUE;
}
Пример #20
0
/*****************************************************************************
 * FUNCTION
 *  PmgConstructPathFileName
 * DESCRIPTION
 *  
 * PARAMETERS
 *  buf         [?]         
 *  size        [IN]        
 *  path        [?]         
 *  file        [?]         
 * RETURNS
 *  void
 *****************************************************************************/
void PmgConstructPathFileName(S8 *buf, U16 size, S8 *path, S8 *file)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (size < MAX_EXT_MELODY_FULLNAME_WIDTH)
    {
        buf[0] = 0x0;
        buf[1] = 0x0;
        return;
    }
    mmi_ucs2cpy(buf, (S8*) path);
    mmi_ucs2cat(buf, (S8*) L"\\");
    mmi_ucs2cat(buf, (S8*) file);
    UNMARK_EXTMELODY_SHORTNAME(buf);
}
Пример #21
0
/*****************************************************************************
 * FUNCTION
 *  mmi_netset_exit_user_ctrl_plmn_add_data
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_netset_exit_user_ctrl_plmn_add_data(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    history Scr;            /* Variable to hold the history data */
    S16 nHistory = 0;
    U16 inputBufferSize;    /* added for inline edit history */

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    CloseCategory57Screen();
    Scr.scrnID = SCR_ID_NETSET_USER_CTRL_PLMN_ADD;
    Scr.entryFuncPtr = mmi_netset_entry_user_ctrl_plmn_add_data;
    mmi_ucs2cpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
    inputBufferSize = (S16) GetCategory57DataSize();    /* added for inline edit history */
    GetCategory57Data((U8*) Scr.inputBuffer);           /* added for inline edit history */
    GetCategory57History(Scr.guiBuffer);
    AddNHistory(Scr, inputBufferSize);
}
Пример #22
0
void category658_highlight_handler(S32 item_index)
{
	S32 index;
	S16 store_index;
	U8 num_ascii[MAX_PB_NUMBER_LENGTH + 1 + 1];


	memset(CallBuffer, 0, sizeof(CallBuffer));
	
	if (item_index > total_items)
	{		
		return ;	
	}

#if 0//(NEW_DIAL_SCREEN)
	if (item_index == FIRST_USER_INPUT_INDEX)
	{
		mmi_ucs2cpy((S8 *)CallBuffer, (S8 *)input_buffer);
		return;
	}
#endif
	index = list_filter_index_array[item_index];
	store_index = g_phb_name_index[index];

        // Bug #13052, 电话簿存储+86的号码,待机界面输入手机号码前几位快速选择呼叫,字符“+”会被去掉,拨打电话失败 ouyangyi 090711
	if (((PhoneBook[store_index].tel.type & 0x90) == 0x90) && (PhoneBook[store_index].tel.type != 0xFF))
	{
		num_ascii[0] = '+';
		//mmi_phb_convert_to_digit_by_storage(num_ascii + 1, PhoneBook[store_index].tel.number, MAX_PB_NUMBER_LENGTH + 1, MMI_NVRAM);
		mmi_phb_convert_to_digit(num_ascii + 1, PhoneBook[store_index].tel.number, MAX_PB_NUMBER_LENGTH + 1);

	}
	else
	// End Bug #13052   Bug #12994
	//mmi_phb_convert_to_digit_by_storage(num_ascii, PhoneBook[store_index].tel.number, MAX_PB_NUMBER_LENGTH + 1, MMI_NVRAM);
	mmi_phb_convert_to_digit(num_ascii, PhoneBook[store_index].tel.number, MAX_PB_NUMBER_LENGTH + 1);

	mmi_asc_to_ucs2((S8 *)CallBuffer, (S8 *)num_ascii);
}
Пример #23
0
/*****************************************************************************
 * FUNCTION
 *  srv_ctm_skip_unicode_char
 * DESCRIPTION
 *  Deal with the backspace character (0x08)
 * PARAMETERS
 *  str         [IN]        
 *  len         [IN]        
 *  ch          [IN]        
 *  void(?)     [IN]        *
 * RETURNS
 *  void
 *****************************************************************************/
U16 srv_ctm_skip_unicode_char(PU16 str, U16 len, U16 ch)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U16 length, i;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    length = len;
    for (i = 0; i < length; i++)
    {
        if (str[i] == ch)
        {
            mmi_ucs2cpy((CHAR*) & str[i], (CHAR*) & str[i + 1]);
            str[length] = 0;
            length--;
        }
    }
    return length;
}
Пример #24
0
static BOOL mmi_da_wps_send_http_req(U8 request_id, U8 http_method,
                                     S8 * url, S8 * post_data, PU16 file_path)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    wps_http_req_struct     *http_req;
    wps_http_req_var_struct http_req_var;
    peer_buff_struct        *peer_buff_ptr = NULL;
    U16                     pdu_length;
    U16                     len;
    FS_HANDLE               hd;
    static S8               range_header[30];

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    DA_WPS_TRACE(MMI_DA_WPS_TRACE_GROUP, MMI_DA_OMA_SEND_HTTP_REQ, request_id);

    ASSERT(_da_wps_is_ready());
    ASSERT(request_id < MMI_DA_WPS_REQUEST_ID_RANGE);

    http_req = (wps_http_req_struct *) construct_local_para(sizeof(wps_http_req_struct), TD_CTRL);
    http_req->channel_id = da_wps_context.channel_id;
    http_req->request_id = request_id + MMI_DA_WPS_REQUEST_ID_BASE;
    http_req->method = http_method;
    http_req->option = WPS_HTTP_OPTION_NO_CACHE;

    http_req_var.request_url_len = (kal_uint32) strlen(url);
    http_req_var.request_url = (kal_uint8 *) url;
    http_req_var.request_header_len = 0;
    http_req_var.request_header = NULL;

    if (http_method == WPS_HTTP_METHOD_POST)
    {
        ASSERT(post_data != NULL);
        http_req->reply_type = WPS_DATA_TYPE_BUFFER;
        http_req->reply_segment_len = 0;        /* no use here */
        http_req->post_type = WPS_DATA_TYPE_BUFFER;
        http_req->post_path[0] = '\0';
        http_req->post_path[1] = '\0';
        http_req->post_total_len = strlen(post_data);
        http_req->more_post = MMI_FALSE;
        http_req_var.post_segment_len = strlen(post_data);
        http_req_var.post_segment = (kal_uint8 *) post_data;
        http_req_var.request_header_len = strlen("Content-Type: text/plain; charset=UTF-8\r\n");
        http_req_var.request_header = (kal_uint8 *)"Content-Type: text/plain; charset=UTF-8\r\n";
    }
    else
    {
        ASSERT(file_path != NULL && mmi_ucs2strlen((S8 *) file_path) < 256);
        http_req->reply_type = WPS_DATA_TYPE_FILE;
        mmi_ucs2cpy((S8 *) http_req->reply_path, (S8 *) file_path);
        http_req->reply_segment_len = 0;        /* no use here */
        http_req->post_type = WPS_DATA_TYPE_BUFFER;
        http_req->post_path[0] = '\0';
        http_req->post_path[1] = '\0';
        http_req->post_total_len = 0;
        http_req->more_post = MMI_FALSE;
        http_req_var.post_segment_len = 0;
        http_req_var.post_segment = NULL;
        
        // If the target file exist, it means RESUME
        if ((hd = FS_Open((PU16)file_path, FS_READ_ONLY)) >= 0)
        {
            UINT file_size;
            FS_GetFileSize(hd, &file_size);
            sprintf(range_header, "Range:bytes=%d-", file_size);
            FS_Close(hd);
            http_req_var.request_header_len = strlen(range_header);
            http_req_var.request_header = (kal_uint8 *)range_header;
        }
    }

    pdu_length = wps_pun_var_part(WPS_PUN_SIZE, MSG_ID_WPS_HTTP_REQ, &http_req_var, NULL);

    if (pdu_length > 0)
    {
        peer_buff_ptr = construct_peer_buff(pdu_length, 0, 0, TD_RESET);
        if (wps_pun_var_part(WPS_PUN_PACK, MSG_ID_WPS_HTTP_REQ, &http_req_var, get_pdu_ptr(peer_buff_ptr, &len)) !=
            pdu_length)
        {
            free_peer_buff(peer_buff_ptr);
            peer_buff_ptr = NULL;
        }
    }

    mmi_da_send_ilm(http_req, peer_buff_ptr, MSG_ID_WPS_HTTP_REQ, MOD_WPS);

    SetProtocolEventHandler((PsFuncPtr) mmi_da_wps_recv_http_rsp, MSG_ID_WPS_HTTP_RSP);
    SetProtocolEventHandler((PsFuncPtr) mmi_da_wps_recv_dl_progress_ind, MSG_ID_WPS_DL_PROGRESS_IND);
    SetProtocolEventHandler((PsFuncPtr) mmi_da_wps_recv_http_auth_ind, MSG_ID_WPS_HTTP_AUTH_IND);

    return MMI_TRUE;
}
Пример #25
0
/*****************************************************************************
 * FUNCTION
 *  cui_pict_run
 * DESCRIPTION
 *  Pictbridge CUI run function. 
 * PARAMETERS
 *  g_pict_gid        [IN]        Pictbridge CUI Group ID
 * RETURNS
 *  void
 *****************************************************************************/
static void cui_pict_run(mmi_id gid, MMI_BOOL is_multi_sel, const cui_pict_file_info_struct *info)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* use 0 not SMART_CLOSE_FLAG, otherwise group will automatically close and can't send 
       print result to parent, such as press RSK "back" in setting screen" */

    mmi_frm_group_enter(g_pict_gid, MMI_FRM_NODE_NONE_FLAG);

    /* printer is not present */
    if (!mmi_pict_is_dps_device_present())
    {        
        cui_pict_disp_popup(CUI_PICT_RESULT_NOT_READY, STR_ID_PICT_PRINTER_REMOVED, MMI_EVENT_FAILURE);        
        return;
    }

    if (!mmi_pict_is_configure_ready())
    {    
        /* waiting for initialization with the printer */        
        cui_pict_disp_popup(CUI_PICT_RESULT_NOT_READY, STR_ID_PICT_CONFIGURATION, MMI_EVENT_FAILURE);        
        return;
    }

    if (g_pict_bridge_context.printing != PICT_PRINTING_NONE)
    {
        cui_pict_disp_popup(CUI_PICT_RESULT_BUSY, STR_GLOBAL_BUSY_TRY_LATER, MMI_EVENT_FAILURE);
        return;
    }
    
#ifdef __MMI_FMGR_MULTI_SELECT_SUPPORT__    
    if (is_multi_sel)
    {
        mmi_pict_reset_files_info();        
        mmi_pict_entry_file_processing_screen();
        
        if (info != NULL)
        {
			mmi_pict_record_file_info(info->full_path, info->info);                
        }        

        if (g_pict_total_count == 1)
        {
            mmi_pict_prepare_file_done();
        }
        else
        {
            cui_pict_post_evt_to_parent();
        }
    }
    else
#endif
    {
        if (info != NULL)
        {            
            mmi_ucs2cpy((S8*) g_pict_bridge_context.printing_filepath, (S8*) info->full_path);
        
            if (!mmi_pict_jpg_format_validation((S8*) g_pict_bridge_context.printing_filepath))
            {
                /* invalid file */                    
                cui_pict_disp_popup(CUI_PICT_RESULT_ERROR, STR_ID_PICT_INVALID_JPG_FILE, MMI_EVENT_FAILURE);                    
                return;
            }
#ifdef __DRM_SUPPORT__
            if (!mmi_pict_drm_jpg_file_check(g_pict_bridge_context.printing_filepath))
            {
                cui_pict_disp_popup(CUI_PICT_RESULT_ERROR, STR_GLOBAL_DRM_PROHIBITED, MMI_EVENT_FAILURE);                    
                return;
            }
#endif /* __DRM_SUPPORT__ */
#ifdef __MMI_FMGR_MULTI_SELECT_SUPPORT__
            mmi_pict_prepare_single_file_data(); //prepare data for multiple file buffer
#else
            mmi_pict_get_file_date();
#endif
            mmi_pict_entry_print_settings();
        }
    }    
}
Пример #26
0
/*****************************************************************************
 * FUNCTION
 *  mmi_brw_service_inbox_list_get_item
 * DESCRIPTION
 *  Item call back function for dynamic list of push messages
 * PARAMETERS
 *  item_index          [IN]
 *  str_buff            [IN]
 *  img_buff_p          [IN]
 *  str_img_mask        [IN]
 * RETURNS
 *  void
 *****************************************************************************/
pBOOL mmi_brw_service_inbox_list_get_item(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    struct tm expiry_timestamp = {0};
    U64 expiry_secs_since_1970 = {0};
    U64 current_secs_since_1970 = {0};
    U32 rcvd_message_href_len = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if ((item_index < 0) || (item_index > g_mmi_brw_push_cntx.max_push_messages))
    {
        return FALSE;
    }

    /* Edited by Vivek - 5th july 2006 */
    if (g_mmi_brw_push_cntx.service_msg_list_p[item_index]->service_flag == SERVICE_INDICATION)
    {
        if ((NULL == g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pmMessage) ||
                !mmi_ucs2strlen((S8*) g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pmMessage))
        {
            rcvd_message_href_len = mmi_ucs2strlen((S8*) g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pmHref);
            if (rcvd_message_href_len > MAX_SUBMENU_CHARACTERS - 1)
            {
                mmi_ucs2ncpy(
                    (S8*) str_buff,
                    (S8*) g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pmHref,
                    MAX_SUBMENU_CHARACTERS - 3);
                mmi_ucs2cat((S8*) str_buff, ".\0.\0.\0");
            }
            else
            {
                mmi_ucs2cpy((S8*) str_buff, (S8*) g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pmHref);
            }
        }
        else
        {
            rcvd_message_href_len = mmi_ucs2strlen((S8*) g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pmMessage);
            if (rcvd_message_href_len > MAX_SUBMENU_CHARACTERS - 1)
            {
                mmi_ucs2ncpy(
                    (S8*) str_buff,
                    (S8*) g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pmMessage,
                    MAX_SUBMENU_CHARACTERS - 3);
                mmi_ucs2cat((S8*) str_buff, ".\0.\0.\0");
            }
            else
            {
                mmi_ucs2cpy((S8*) str_buff, (S8*) g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pmMessage);
            }
        }
    }
    else if (g_mmi_brw_push_cntx.service_msg_list_p[item_index]->service_flag == SERVICE_LOADING)
    {
        rcvd_message_href_len = mmi_ucs2strlen((S8*) g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pmHref);
        if (rcvd_message_href_len > MAX_SUBMENU_CHARACTERS - 1)
        {
            mmi_ucs2ncpy(
                (S8*) str_buff,
                (S8*) g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pmHref,
                MAX_SUBMENU_CHARACTERS - 3);
            mmi_ucs2cat((S8*) str_buff, ".\0.\0.\0");
        }
        else
        {
            mmi_ucs2cpy((S8*) str_buff, (S8*) g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pmHref);
        }
    }
    else
    {
        /* ERROR */
    }

    /* Expiry time is to be calculated in case of SI to display expired message in case of expired message */
    if (g_mmi_brw_push_cntx.service_msg_list_p[item_index]->service_flag == SERVICE_INDICATION)
    {
        if (g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pSIExpires != NULL)
        {
            expiry_timestamp.tm_mon = g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pSIExpires->month - 1;        /* month scale to 0 to 11 */
            expiry_timestamp.tm_year = g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pSIExpires->year - 1900;     /* offset since 1900 */
            expiry_timestamp.tm_mday = g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pSIExpires->day;
            expiry_timestamp.tm_hour = g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pSIExpires->hour;
            expiry_timestamp.tm_min = g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pSIExpires->minute;
            expiry_timestamp.tm_sec = g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pSIExpires->seconds;

            /* Get difference of seconds of expiry time from 1970 (as per UTC standard) */
            expiry_secs_since_1970 = (time_t) mktime(&expiry_timestamp);
            /* Get difference of seconds of current time from 1970 (as per UTC standard) */
            current_secs_since_1970 = get_current_utc_time();
        }

        /* Show icon depending on whether it is read,unread,read but expired and unread but expired */
        if (g_mmi_brw_push_cntx.service_msg_list_p[item_index]->bIsRead == 0)
        {
            if ((expiry_secs_since_1970 > current_secs_since_1970) ||
                    (g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pSIExpires == NULL))
            {
                *img_buff_p = get_image(IMG_ID_BRW_PUSH_UNREAD);
            }
            else
            {
                *img_buff_p = get_image(IMG_ID_BRW_PUSH_EXPIRED_UNREAD);
            }
        }
        else
        {
            if ((expiry_secs_since_1970 > current_secs_since_1970) ||
                    (g_mmi_brw_push_cntx.service_msg_list_p[item_index]->pSIExpires == NULL))
            {
                *img_buff_p = get_image(IMG_ID_BRW_PUSH_READ);
            }
            else
            {
                *img_buff_p = get_image(IMG_ID_BRW_PUSH_EXPIRED_READ);
            }
        }
    }
    else if (g_mmi_brw_push_cntx.service_msg_list_p[item_index]->service_flag == SERVICE_LOADING)
    {
        if (g_mmi_brw_push_cntx.service_msg_list_p[item_index]->bIsRead == 0)
        {
            *img_buff_p = get_image(IMG_ID_BRW_PUSH_UNREAD);
        }
        else
        {
            *img_buff_p = get_image(IMG_ID_BRW_PUSH_READ);
        }
    }
    else
    {
        /* error */
    }

    return TRUE;
}
Пример #27
0
/*****************************************************************************
 * FUNCTION
 *  bidi_main
 * DESCRIPTION
 *  fill the string buffer to bidirectional algorithm
 * PARAMETERS
 *  logicalStr              [IN]        Input string for bidi
 *  logicalStrLen           [IN]        String length of input string
 *  logicalCurPos           [IN]        Current cursor position of input string
 *  visualStr               [OUT]       Final output string from bidi algorithm
 *  visualStrLen            [OUT]       String length of final output string
 *  visualCurPos            [OUT]       Cursor position of final output string
 *  fSwap                   [IN]        If true, then reserse the string after apply bidi algorithm
 *  inputMode               [IN]        
 *  logicalHilightStart     [IN]        Word hilight start position of input string
 *  logicalHilightEnd       [IN]        Word hilight end position of input string
 *  visualHilightStart      [OUT]       Word hilight start position of output string
 *  visualHilightEnd        [OUT]       Word hilight end position of output string
 * RETURNS
 *  void
 *****************************************************************************/
void bidi_main(
        U8 *logicalStr,
        U16 logicalStrLen,
        U16 logicalCurPos,
        U8 *visualStr,
        U16 *visualStrLen,
        U16 *visualCurPos,
        pBOOL fSwap,
        U8 inputMode,
        U16 logicalHilightStart,
        U16 logicalHilightEnd,
        U16 *visualHilightStart,
        U16 *visualHilightEnd)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    U8 paragraphEmbeddingLevel = 0;

#if BIDI_CONSIDER_DIFF_INPUT_METHOD_BEHAVIOR
    U8 lastType;
    pBOOL flag = FALSE;
#endif /* BIDI_CONSIDER_DIFF_INPUT_METHOD_BEHAVIOR */ 
    pBOOL bCheckFlag;
    S16 iCount, nParaCount = 0;
    U8 *pInputType = input_types;
    U8 *pInputLevels = input_levels;
    U8 *pDestLevels = dest_levels;
    U8 *pDestTypes = dest_types;
    U8 *pLogicalBuffer = localLogicalBuffer;
    U8 *pVisualBuffer = visualStr;
    U16 mark;

    /* START TARUN PMT 20050202 */
    U8 newLineflag = 0;

    /* END TARUN PMT 20050202 */
    U8 testHilighOneCharFlag = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    memset(input_types, 0,sizeof(input_types));
    memset(input_levels, 0,sizeof(input_levels));
    memset(dest_levels, 0,sizeof(dest_levels));
    memset(dest_types, 0,sizeof(dest_types));
    memset(localLogicalBuffer, 0,sizeof(localLogicalBuffer));

    if (logicalStrLen == 0)
    {
        /* *visualCurPos = 0; */
        *visualCurPos = 0xFFFF;
        *visualStr = 0;
        *(visualStr + 1) = 0;
        *visualStrLen = 0;
        *visualHilightStart = 0;
        *visualHilightEnd = 0;
        return;
    }

    if (logicalCurPos != 0xFFFF)
    {
        if (logicalCurPos < logicalHilightEnd)
        {
            logicalCurPos = logicalHilightEnd;
        }
        if (logicalHilightStart > logicalHilightEnd)
        {
            logicalHilightStart = logicalHilightEnd;
        }
    }


/*PMT IRE START*/
/*removed unwanted code*/
/*PMT IRE END*/
    mmi_ucs2ncpy((S8*) localLogicalBuffer, (const S8*)logicalStr, (U32) logicalStrLen);

#if BIDI_CONSIDER_DIFF_INPUT_METHOD_BEHAVIOR
    if (inputMode == BIDI_R)
    {
        bidi_get_char_type((U8*) & localLogicalBuffer[(logicalStrLen - 1) * BIDI_ENCODING_LENGTH], (U8*) & lastType);
        if (lastType == WS)
        {
            localLogicalBuffer[(logicalStrLen - 1) * BIDI_ENCODING_LENGTH] = 0;
            localLogicalBuffer[(logicalStrLen - 1) * BIDI_ENCODING_LENGTH + 1] = 0;
            if (logicalCurPos == logicalStrLen)
            {
                flag = TRUE;
                logicalCurPos--;
            }
            logicalStrLen--;
        }

        set_bidi_cursor_pos((U8*) localLogicalBuffer, logicalCurPos, (U16) CURSOR_MARK);

        logicalStrLen = (U16) mmi_ucs2strlen((const S8*)localLogicalBuffer);

        set_bidi_cursor_pos((U8*) localLogicalBuffer, logicalStrLen, (U16) LAST_MARK);
    }
    else
#endif /* BIDI_CONSIDER_DIFF_INPUT_METHOD_BEHAVIOR */ 
    {
        if (logicalCurPos != 0xFFFF)
        {
            set_bidi_cursor_pos((U8*) localLogicalBuffer, logicalCurPos, (U16) CURSOR_MARK);
        }
    }

    set_bidi_cursor_pos((U8*) localLogicalBuffer, logicalHilightEnd, (U16) SECOND_HIGHLT);
    set_bidi_cursor_pos((U8*) localLogicalBuffer, (U16) (logicalHilightStart), (U16) FIRST_HIGHLT);

    mmi_ucs2cpy((S8*) visualStr, (const S8*)localLogicalBuffer);
    logicalStrLen = get_direction_codes((U8*) input_types, (U8*) localLogicalBuffer, 0);

    iCount = 0;

    while (iCount < logicalStrLen)
    {
        bCheckFlag = FALSE;
        nParaCount = identify_paragraphs(pInputType, (U16) (logicalStrLen - iCount), &bCheckFlag);
        if (logicalCurPos < nParaCount)
        {
            newLineflag = 1;
        }
        copy_direction_codes(pDestTypes, pInputType, (U16) nParaCount);
        if (bCheckFlag)
        {
            pDestTypes[nParaCount] = 0;
            pInputType[nParaCount] = 0;
            if (pInputType[nParaCount - 1] == BIDI_B)
            {
                pDestTypes[nParaCount - 1] = 0;
                pInputType[nParaCount - 1] = 0;
            }
        }

        /*----------------------------------------------------------------*/
        /* We use bidi_main line by line, so we can't get the paragraph   */
        /* embedding level from the current line.                         */
        /* Now change to set the paragraph embedding                      */
        /* level by the flag: fSwap.                                       */
        /*----------------------------------------------------------------*/
        /* paragraphEmbeddingLevel = get_para_embedding_level(pInputType, nParaCount); */
        paragraphEmbeddingLevel = (fSwap == 1) ? 1 : 0;
        set_dest_levels(0, nParaCount, paragraphEmbeddingLevel, pDestLevels);

        get_run_level(nParaCount, paragraphEmbeddingLevel, pDestLevels, pDestTypes);
        resolve_lines(paragraphEmbeddingLevel, pVisualBuffer, nParaCount, TRUE, pDestTypes, pDestLevels);

        if (bCheckFlag)
        {
            nParaCount++;
        }
        pInputType += nParaCount;
        pInputLevels += nParaCount;
        pDestLevels += nParaCount;
        pDestTypes += nParaCount;
        pLogicalBuffer += nParaCount * 2;
        pVisualBuffer += nParaCount * 2;
        iCount += nParaCount;
    }

    *visualStrLen = (U16) mmi_ucs2strlen((const S8*)visualStr);

    if (fSwap)
    {
        bidi_reverse((U8*) visualStr, *visualStrLen);
    }

    *visualCurPos = 0xFFFF;
    /* START Changed by YOGESH PMT 20050912 */
    while (find_mark(visualStr, *visualStrLen, &mark, (U16*) & iCount))
        /* END YOGESH PMT 20050912 */
    {
        switch (mark)
        {
            case LAST_MARK:
            case CURSOR_MARK:
        #if BIDI_CONSIDER_DIFF_INPUT_METHOD_BEHAVIOR
                if (inputMode == BIDI_R)
                {
                    *visualCurPos = get_bidi_cursor_pos(visualStr, (U16) LAST_MARK);

                    if (lastType == WS)
                    {
                        set_bidi_cursor_pos(visualStr, *visualCurPos, (U16) (0x0020));
                    }

                    *visualCurPos = get_bidi_cursor_pos(visualStr, (U16) CURSOR_MARK);
                }
                else
        #endif /* BIDI_CONSIDER_DIFF_INPUT_METHOD_BEHAVIOR */ 
                {
                    *visualCurPos = get_bidi_cursor_pos(visualStr, (U16) CURSOR_MARK);
                }
                testHilighOneCharFlag = 1;
                break;
            case SECOND_HIGHLT:
                *visualHilightEnd = get_bidi_cursor_pos(visualStr, (U16) SECOND_HIGHLT);
                testHilighOneCharFlag = 0;
                break;
            case FIRST_HIGHLT:
                *visualHilightStart = get_bidi_cursor_pos(visualStr, (U16) FIRST_HIGHLT);
                testHilighOneCharFlag = 0;

                break;
        }
    }

    if (testHilighOneCharFlag == 0 && *visualHilightEnd == *visualHilightStart)
    {
        *visualHilightEnd = *visualHilightStart = *visualCurPos + 1;
    }

    if ((logicalHilightStart == 0) && (logicalHilightEnd == 0))
    {
        *visualHilightEnd = 0;
        *visualHilightStart = 0;
    }

    if ((*visualHilightEnd <
         /*=*/ *visualHilightStart) /* && (!(*visualHilightStart == 0 && *visualHilightEnd == 0)) */ )
    {
        (*visualHilightEnd)++;
        (*visualHilightStart)++;
    }

    *visualStrLen = (U16) mmi_ucs2strlen((const S8*)visualStr);
}
Пример #28
0
/*****************************************************************************
 * FUNCTION
 *  mmi_brw_new_push_msg_ind_on_idlescreen
 * DESCRIPTION
 *  Entry Function to display screen for push message arrived indication
 *  on idle-screen.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_brw_new_push_msg_ind_on_idlescreen(void)   /* added by puneet */
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    S8 buf[4] = {0};
    S8 pOutBuffer[8] = {0};
    S8 message_string[40] = {0};
    U32 brw_total_msg_count = 0;
    U32 brw_unread_msg_count = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_brw_get_push_statistics(&brw_total_msg_count, &brw_unread_msg_count);

    if (SCR_ID_BRW_NEW_PUSH_MESSAGE_IND == GetActiveScreenId())
    {
        DeleteNHistory(1);
    }

    if (0 == brw_unread_msg_count)
    {
        DisplayIdleScreen();
        return;
    }

    if (brw_unread_msg_count < 10)
    {
        sprintf(buf, "%01d", brw_unread_msg_count);
    }
    else
    {
        sprintf(buf, "%02d", brw_unread_msg_count);
    }

    mmi_asc_to_ucs2(pOutBuffer, buf);
    mmi_ucs2cpy((S8*) message_string, pOutBuffer);
    mmi_ucs2cat((S8*) message_string, " ");
    mmi_ucs2cat((S8*) message_string, GetString(STR_ID_BRW_SERVICE_MESSAGE_RCVD));

    EntryNewScreen(SCR_ID_BRW_NEW_PUSH_MESSAGE_IND, NULL, mmi_brw_new_push_msg_ind_on_idlescreen, NULL);
    ShowStatusIcon(STATUS_ICON_WAP);

    if (0 == g_keylock_context.gKeyPadLockFlag)
    {
        /*
         * ShowCategory154Screen(
         * 0,
         * 0,
         * STR_ID_BRW_READ,
         * IMG_GLOBAL_YES,
         * STR_GLOBAL_BACK,
         * IMG_GLOBAL_BACK,
         * (PU8) message_string,
         * 0,
         * IMG_NEW_MESSAGE_NOTIFICATION_MSG,
         * NULL);
         */

        /* Modified by vikas lal - 29032007 Category 154 will be replaced(By Category 66) here for text wraping */
        ShowCategory66Screen(
            0,
            0,
            STR_ID_BRW_READ,
            IMG_GLOBAL_YES,
            STR_GLOBAL_BACK,
            IMG_GLOBAL_BACK,
            (PU8) message_string,
            IMG_NEW_MESSAGE_NOTIFICATION_MSG,
            NULL);

        g_mmi_brw_cntx.push_msg_rcvd_flag = MMI_FALSE;

        if (1 == brw_unread_msg_count)
        {
            SetLeftSoftkeyFunction(mmi_brw_read_arrived_push_message, KEY_EVENT_UP);
        }
        else
        {
            SetLeftSoftkeyFunction(mmi_brw_entry_service_inbox, KEY_EVENT_UP);
        }

        SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
    }
    else    /* Keypad is locked */
    {
        extern void EntryScrAfterPessingRSK(void);

#if defined(__MMI_KEYPAD_LOCK_PROMPT_TEXT__)
        extern void EntryScrKeyPadLockOnPessingAnyKey(void);
#endif

        /*
         * ShowCategory154Screen(
         * 0,
         * 0,
         * g_keylock_context.KeyLockLSKStringID,
         * g_keylock_context.KeyLockLSKIconID,
         * g_keylock_context.KeyLockRSKStringID,
         * g_keylock_context.KeyLockRSKIconID,
         * (PU8) message_string,
         * 0,
         * IMG_NEW_MESSAGE_NOTIFICATION_MSG,
         * NULL);
         */
        /* Modified by vikas lal - 29032007 Category 154 will be replaced(By Category 66) here for text wraping */
        ShowCategory66Screen(
            0,
            0,
            g_keylock_context.KeyLockLSKStringID,
            g_keylock_context.KeyLockLSKIconID,
            g_keylock_context.KeyLockRSKStringID,
            g_keylock_context.KeyLockRSKIconID,
            (PU8) message_string,
            IMG_NEW_MESSAGE_NOTIFICATION_MSG,
            NULL);

#if defined(__MMI_KEYPAD_LOCK_PROMPT_TEXT__)
        SetGroupKeyHandler(
            EntryScrKeyPadLockOnPessingAnyKey,
            (PU16) PresentAllKeys,
            (U8) TOTAL_KEYS,
            (U16) KEY_EVENT_DOWN);
#endif /* defined(__MMI_KEYPAD_LOCK_PROMPT_TEXT__) */

#ifdef __MMI_TOUCH_SCREEN__

#ifdef __MMI_KEYPAD_LOCK_PROMPT_TEXT__
#ifdef __MMI_KEYPAD_LOCK_PATTERN_1__
        SetRightSoftkeyFunction(EntryScrKeyPadLockOnPessingAnyKey, KEY_EVENT_DOWN);
#endif
#ifdef __MMI_KEYPAD_LOCK_PATTERN_2__
        SetLeftSoftkeyFunction(EntryScrKeyPadLockOnPessingAnyKey, KEY_EVENT_DOWN);
#endif
#else /* __MMI_KEYPAD_LOCK_PROMPT_TEXT__ */
        ClearKeyHandler(KEY_LSK, KEY_EVENT_DOWN);
        ClearKeyHandler(KEY_LSK, KEY_EVENT_UP);
        ClearKeyHandler(KEY_RSK, KEY_EVENT_DOWN);
        ClearKeyHandler(KEY_RSK, KEY_EVENT_UP);
#endif /* __MMI_KEYPAD_LOCK_PROMPT_TEXT__ */
        SetKeyHandler(EntryScrAfterPessingRSK, KEY_SEND, KEY_EVENT_DOWN);

#else /* __MMI_TOUCH_SCREEN__ */

#ifdef __MMI_KEYPAD_LOCK_PATTERN_1__
        SetRightSoftkeyFunction(EntryScrAfterPessingRSK, KEY_EVENT_DOWN);
#endif
#ifdef __MMI_KEYPAD_LOCK_PATTERN_2__
        SetLeftSoftkeyFunction(EntryScrAfterPessingRSK, KEY_EVENT_DOWN);
#endif

#endif /* __MMI_TOUCH_SCREEN__ */

        ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
#ifdef __MMI_TOUCH_SCREEN__
        mmi_idle_pen_block();
#endif
    }
}
Пример #29
0
/*****************************************************************************
 * FUNCTION
 *  csb_frm_select_folder_callback
 * DESCRIPTION
 *
 * PARAMETERS
 *  U32			cat_ID
 * RETURNS
 *  void
 *****************************************************************************/
void csb_frm_select_folder_callback(void *fullpath, int is_short)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
	U8	csb_drive_phone_unicode[10];
	U8	csb_drive_card_unicode[10];
	U8  csb_default_folder_unicode[10];
	U8  temp_ascii[5];

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    UI_UNUSED_PARAMETER(is_short);

	sprintf((S8*)temp_ascii, "%c%s", MMI_PUBLIC_DRV, ":\\");
	mmi_asc_to_ucs2((PS8) csb_drive_phone_unicode, (PS8) temp_ascii);

	
	sprintf((S8*)temp_ascii, "%c%s", MMI_CARD_DRV, ":\\");
	mmi_asc_to_ucs2((PS8) csb_drive_card_unicode, (PS8) temp_ascii);

	mmi_asc_to_ucs2((PS8) csb_default_folder_unicode, (PS8) "CSB\\");


	/* If the file path returned by FileManager is longer than MAX, show error popup */
	if(fullpath)
	{
	if((mmi_ucs2strlen((char*) fullpath)) > MAX_CSB_PATH_LENGTH)
	{
		DisplayPopup((PU8) GetString(STR_ID_CSB_FILE_PATH_TOO_LONG),
				IMG_GLOBAL_ERROR, 
				1, 
				CSB_NOTIFY_DURATION, 
				0);
	}
		else if(!(mmi_ucs2cmp((PS8) fullpath, (PS8) csb_drive_phone_unicode)))
	{

	/* Store the path returned by CallBack in the Global variable */
		mmi_ucs2cpy((PS8) g_CSB_struct.csb_settings.csb_screenshots_folder_path, (PS8)fullpath);

			mmi_ucs2cat((PS8) g_CSB_struct.csb_settings.csb_screenshots_folder_path, (PS8) csb_default_folder_unicode);

			/* Write the updated value in NVRAM */
			csb_frm_write_in_nvram();

			DisplayPopup((PU8) GetString(STR_GLOBAL_DONE),
					IMG_GLOBAL_ACTIVATED, 
					1, 
					CSB_NOTIFY_DURATION, 
					0);
		}
		else if(!(mmi_ucs2cmp((PS8) fullpath, (PS8) csb_drive_card_unicode)))
		{

			/* Store the path returned by CallBack in the Global variable */
			mmi_ucs2cpy((PS8) g_CSB_struct.csb_settings.csb_screenshots_folder_path, (PS8)fullpath);
		
			mmi_ucs2cat((PS8) g_CSB_struct.csb_settings.csb_screenshots_folder_path, (PS8) csb_default_folder_unicode);

			/* Write the updated value in NVRAM */
			csb_frm_write_in_nvram();

			DisplayPopup((PU8) GetString(STR_GLOBAL_DONE),
					IMG_GLOBAL_ACTIVATED, 
					1, 
					CSB_NOTIFY_DURATION, 
					0);
		}
		else
		{
			/* Store the path returned by CallBack in the Global variable */
			mmi_ucs2cpy((PS8) g_CSB_struct.csb_settings.csb_screenshots_folder_path, (PS8)fullpath);
		
		/* Write the updated value in NVRAM */
		csb_frm_write_in_nvram();

		DisplayPopup((PU8) GetString(STR_GLOBAL_DONE),
				IMG_GLOBAL_ACTIVATED, 
				1, 
				CSB_NOTIFY_DURATION, 
				0);
	}
	}
	else
	{
		GoBackHistory();
	}
	DeleteUptoScrID(SCR_ID_CSB_TESTTOOL_SCR_ID);
}