Example #1
0
/*************************************************************
**	FUNCTION NAME		: csb_frm_start_view_auto
**
** 	PURPOSE				: Enrty function for CSB Start View 
**						  in Auto Mode
**
**	INPUT PARAMETERS	: nil
**
**	OUTPUT PARAMETERS	: void
**
**	RETURNS				: void
**
**	REMARKS			: 
***************************************************************/
void csb_frm_start_view_auto(void)
{
	/* Stop the time if started */
	StopTimer(CSB_AUTO_MODE_TIMER_ID);

	if(g_CSB_struct.screen_counter < TOTAL_CATEGORY_SCREENS)
	{

		/* ASSERT if entryFunPtr is NULL -- should never happen */
		ASSERT(g_CSB_struct.pscreen_info[g_CSB_struct.screen_counter].entryFuncPtr != NULL);
		/* Call the entry function pointer */
		g_CSB_struct.pscreen_info[g_CSB_struct.screen_counter++].entryFuncPtr();
		SetKeyHandler(GoBackToMainMenu, KEY_END, KEY_EVENT_DOWN);
		SetKeyHandler(csb_show_current_screen_ID, KEY_SEND, KEY_EVENT_DOWN);
		/* Delete the history nodes added after every call */
		DeleteUptoScrID(SCR_ID_CSB_VIEW_SCR_ID);
		/* Start the timer */
		StartTimer(CSB_AUTO_MODE_TIMER_ID, g_CSB_struct.csb_settings.timer_value, csb_frm_start_view_auto);
	}
	else
	{
		g_CSB_struct.screen_counter = 0;
		DeleteUptoScrID(SCR_ID_CSB_VIEW_SCR_ID);
		GoBackHistory();
		/* Backlight was turned ON permanently while entering AUTO mode, turn ON it temporary now */
		TurnOffBacklight();

		/* Release the EMS buffer */
		ReleaseEMSEditBuffer();
	}
}
Example #2
0
/*****************************************************************************
 * FUNCTION
 *  GoBackToMainMenu
 * DESCRIPTION
 *  
 * PARAMETERS
 *  nIndex				[IN]            
 * RETURNS				void
 *****************************************************************************/
void GoBackToMainMenu(void)
{
	/* In search By Screen ID, editor screen is to be deleted when press END key */
	if(SEARCH_MODE_SCREENID == csb_frm_get_search_mode())
	{
		DeleteUptoScrID(SCR_ID_CSB_SEARCH_SCR_ID);
	}

	TurnOffBacklight();

	/* Release the EMS buffer */
	ReleaseEMSEditBuffer();

	g_CSB_struct.screen_counter = 0;
	GoBackHistory();
}
Example #3
0
/*************************************************************
**	FUNCTION NAME		: csb_frm_start_view_manual
**
** 	PURPOSE				: Enrty function for CSB Start View 
						  in Manual Mode
**
**	INPUT PARAMETERS	: nil
**
**	OUTPUT PARAMETERS	: void
**
**	RETURNS				: void
**
**	REMARKS			: 
***************************************************************/
void csb_frm_start_view_manual(void)
{

	/* Manual Mode should be Interactive or Non-Interactive, ASSERT otherwise */
	ASSERT(g_CSB_struct.csb_settings.manual_mode == MANUAL_MODE_NONINTERACTIVE || g_CSB_struct.csb_settings.manual_mode == MANUAL_MODE_INTERACTIVE);

	if(g_CSB_struct.screen_counter < TOTAL_CATEGORY_SCREENS)
	{
		/* ASSERT if entryFunPtr is NULL -- should never happen */
		ASSERT(g_CSB_struct.pscreen_info[g_CSB_struct.screen_counter].entryFuncPtr != NULL);


		/* Call the entry function pointer of the categpry screen */
		g_CSB_struct.pscreen_info[g_CSB_struct.screen_counter++].entryFuncPtr();
		
		/* Set the key handlers here for Manual Mode */
		SetKeyHandler(csb_frm_start_view_manual, KEY_VOL_DOWN, KEY_EVENT_DOWN);
		SetKeyHandler(GoToPreviousScreen, KEY_VOL_UP, KEY_EVENT_DOWN);
		SetKeyHandler(GoBackToMainMenu, KEY_END, KEY_EVENT_DOWN);
		SetKeyHandler(csb_show_current_screen_ID, KEY_SEND, KEY_EVENT_DOWN);

		/* Delete the history nodes added after every call */
		DeleteUptoScrID(SCR_ID_CSB_VIEW_SCR_ID);
	}
	else
	{
		/* If all the screen counter exceeds the limit, set the global counter as ZERO 
		and delete screen from history and go back one level */
		g_CSB_struct.screen_counter = 0;
		DeleteUptoScrID(SCR_ID_CSB_VIEW_SCR_ID);
		GoBackHistory();

		/* Release the EMS buffer */
		ReleaseEMSEditBuffer();
	}
}
Example #4
0
/*****************************************************************************

	FUNCTION NAME		: Entry_SP_Msg_Service

  PURPOSE	:From Mobile Paradise back to  the previous screen.
	INPUT PARAMETERS	: void
	OUTPUT PARAMETERS	: void

	RETURNS				:


             Entry_MobileEden   Entry_SP_Level1  SP_Pre_Entry_Level2  Entry_SP_Msg_Service
                  |                   |             |                    |
                  |    /Level1/       | /Level2/    |                    |
  Mobile Paradise |        |          |    |        |                    |
                  ->New Style World        |        |                    |
                                    ---->Joke                            |
                                               -------->Request          |

                                                               ------------->
                                          ...

               <-----              <-----
      SP_EDEN_GoBackHistory  SP_Level1_GoBackHistory
******************************************************************************/
void Entry_SP_Msg_Service (void)
{
    S8			textbuf[SP_CODE_LENGTH*ENCODING_LENGTH];
    EMSData*	pEMS;
    byte			result;
    history_t		temphistory;
    U8 service = sp_level_3_service_index;
    S8 codeNum[SP_LONG_CODE_LENGTH];
    S8 dest_number[12]= "10664321";//now only china Mobile has SP, the destination number is only one.
    SP_SMS_Service_Code_Struct sp_level2_service_code;
    int i=0;
    mmi_trace(g_sw_SP,"niej service[%d]", service);

    /****************phone number********************/
    memset(textbuf, 0, SP_CODE_LENGTH*ENCODING_LENGTH);
    memset(g_msg_cntx.smsPhoneNumber, 0, (MAX_DIGITS+1)*ENCODING_LENGTH);
    AnsiiToUnicodeString((S8*)textbuf, (S8*)dest_number);
    pfnUnicodeStrcat(g_msg_cntx.smsPhoneNumber, textbuf);
    mmi_trace(g_sw_SP,"niej 1textbuf[%s]", textbuf);
    mmi_trace(g_sw_SP,"niej g_msg_cntx.smsPhoneNumber[%s]", g_msg_cntx.smsPhoneNumber);

    /*Service code*/
    ReleaseEMSEditBuffer();
    memset(textbuf, 0, SP_CODE_LENGTH*ENCODING_LENGTH);
    memset(codeNum, 0, SP_LONG_CODE_LENGTH-1);
    SP_Get_Level2_Service_Code(sp_level1_scr.sp_menu_id,
                               sp_level1_scr.sp_menu_id+sp_level_2_index+1,
                               &sp_level2_service_code);
    switch(service)
    {
    case SP_SERVICE_SUBSCRIBE:
        memcpy(codeNum, sp_level2_service_code.Code_Subscribe, SP_LONG_CODE_LENGTH-1);
        break;

    case SP_SERVICE_ORDER:
        memcpy(codeNum, sp_level2_service_code.Code_Order, SP_LONG_CODE_LENGTH-1);
        break;

    case SP_SERVICE_COST:
        if((MENU_ID_SP_NEW_WORLD_THUMB_FUN == sp_level2_service_code.Level2_Menu_Id)
                ||(MENU_ID_SP_NEW_WORLD_CHALLENGER == sp_level2_service_code.Level2_Menu_Id)
                ||(MENU_ID_SP_FUN_EVERYDAY_JOY_TEST == sp_level2_service_code.Level2_Menu_Id)
                ||(MENU_ID_SP_FUN_EVERYDAY_SWEET_WORD == sp_level2_service_code.Level2_Menu_Id)
                ||(MENU_ID_SP_FUN_EVERYDAY_GUESS_WIN == sp_level2_service_code.Level2_Menu_Id)
          )
        {
            int len = strlen(sp_level2_service_code.Code_Cost);
            int strid = 0;
            for(; i<len; i++)
            {
                strid += (sp_level2_service_code.Code_Cost[i]-48)*N_Multiplication(10, (len-i-1));
            }
            mmi_trace(g_sw_SP,"niej strid[%d]",strid);

            Sp_Entry_Explain_Screen(strid);//43519 is id of title in next screen(Price Explanation)
            return;
        }
        else
        {
            memcpy(codeNum, sp_level2_service_code.Code_Cost, SP_LONG_CODE_LENGTH-1);
        }
        break;

    case SP_SERVICE_CANCEL:
        memcpy(codeNum, sp_level2_service_code.Code_Order, SP_LONG_CODE_LENGTH-1);
        break;

    case SP_SERVICE_EXPLAIN:
        Sp_Entry_Explain_Screen(sp_level2_service_code.Explain_StrId);//43520 is id of title in next screen(Description)
        return;

    case SP_SERVICE_CUSTOMER:
        SP_Entry_Make_Call();
        return;

    default:
        mmi_trace(g_sw_SP,"niej invalid service[%d]", service);
        return;
    }
    mmi_trace(g_sw_SP,"niej codeNum[%s]",codeNum);
    memset(textbuf, 0, SP_CODE_LENGTH*ENCODING_LENGTH);
    AnsiiToUnicodeString(textbuf, (S8*)codeNum);
    mmi_trace(g_sw_SP,"niej 2textbuf[%s]",textbuf);
    memset (& temphistory, 0, sizeof (temphistory));
    GetHistory (SCR_ID_MSG_WRITE, &temphistory);
    pEMS = GetEMSDataForEdit (0, 0);

    result = AppendEMSString_Ext(INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
                                 pEMS, (U8*)textbuf, SMSAL_DEFAULT_DCS, temphistory.guiBuffer  );

    mmi_trace(g_sw_SP,"niej result[%d]", result);
    if(result)
    {
        mmi_frm_sms_send_struct * sendData=OslMalloc(sizeof(mmi_frm_sms_send_struct));
        memset((S8*)sendData, 0, sizeof(mmi_frm_sms_send_struct));
        memset(sendData->number, 0, SP_MAX_DIGITS_SMS);
        if(pfnUnicodeStrlen((S8*)g_msg_cntx.smsPhoneNumber))
            UnicodeToAnsii((S8*)sendData->number, (S8*)g_msg_cntx.smsPhoneNumber);

        mmi_trace(g_sw_SP,"niej sendData->number[%s]", sendData->number);
        mmi_frm_sms_send_sms(Sp_Send_Msg_Rsp, MOD_MMI, sendData);
        OslMfree(sendData);
    }
    else
    {
        DisplayPopup ((PU8)GetString (STR_SMS_DOES_NOT_SUPPORT), IMG_GLOBAL_UNFINISHED, 1, MESSAGES_POPUP_TIME_OUT, (U8)ERROR_TONE);
    }

}