예제 #1
0
파일: bmi.c 프로젝트: jprothwell/sc-fix
/*****************************************************************************
* FUNCTION
*	EntryBMIInputScreen
* DESCRIPTION
*   Display inline editor screen for entering gender, height, and weight
* PARAMETERS
*	None
* RETURNS
*	None
* GLOBALS AFFECTED
*	None
*****************************************************************************/
void EntryBMIInputScreen(void) 
{
	U8 *guiBuffer;
	U8* inputBuffer;                       //added for inline edit history
	U16 inputBufferSize;                //added for inline edit history
	U16 BMIImageList[6] = {0,0,0,0,0,0};

	//to malloc memory
	if(g_bmi_cntx == NULL)
	{
		g_bmi_cntx = OslMalloc(sizeof(bmi_context_struct));
		memset(g_bmi_cntx, 0, sizeof(bmi_context_struct));
	}		
	//
	
	EntryNewScreen(SCR_BMI_INPUT, ExitBMIInputScreen, NULL, NULL);
	SetDelScrnIDCallbackHandler(SCR_BMI_INPUT, (HistoryDelCBPtr)BmiExit);

	InitializeCategory57Screen();							

	guiBuffer = GetCurrGuiBuffer(SCR_BMI_INPUT);

	BMIFillInlineStruct();

	RegisterHighlightHandler(HighlightBMIInlineEditor);

	if(g_bmi_cntx->Gender == 0)
		BMIImageList[ENUM_GENDER] = IMG_BMI_BLUE_FLOWER;
	else
		BMIImageList[ENUM_GENDER] = IMG_BMI_RED_FLOWER;

	inputBuffer = GetCurrNInputBuffer(SCR_BMI_INPUT, &inputBufferSize);    //added for inline edit history
	
	if(inputBuffer!=NULL)                                            //added for inline edit history
		SetCategory57Data(wgui_inline_items, ENUM_INLINE_TOTAL, inputBuffer);//sets the data 

 	DisableCategory57ScreenDone();
 	
 	#ifdef __MMI_SLIM_LISTMENU_NUMBER__ 
 		wgui_override_list_menu_slim_style(WGUI_LIST_MENU_SLIM_STYLE_DRAW_ICON);
 	#endif
 
	 
 	//Category57AppendTopImage(IMG_BMI_WELCOME_SCREEN, TRUE);
 	 
	ShowCategory57Screen(STR_BMI_INPUT_CAPTION,GetRootTitleIcon(ORGANIZER_HEALTH_MENU), 
	                     STR_GLOBAL_OK, IMG_GLOBAL_OK, 
	                     STR_GLOBAL_BACK, IMG_GLOBAL_BACK, 
						 ENUM_INLINE_TOTAL, 
						 BMIImageList,
						 wgui_inline_items, 
						 g_bmi_cntx->CurrHilite, 
						 guiBuffer);
 
	SetCategory57RightSoftkeyFunctions(BmiComputeResult, GoBackHistory);

}
예제 #2
0
/**************************************************************

	FUNCTION NAME		: EntryCHISTResetCallLog

  	PURPOSE				: Entry function of reset calls.

	INPUT PARAMETERS	: nil

	OUTPUT PARAMETERS	: nil

	RETURNS				: void

 

**************************************************************/
void EntryCHISTResetCallLog( void )
{
	//U16			nDispAttribute;  /* Stores display attribue */
	U8*			guiBuffer;       /* Buffer holding history data */
	U16			nStrItemList[MAX_SUB_MENUS];/* Stores the strings id of submenus returned */
	U16			nNumofItem;		 /* Stores no of children in the submenu*/
	U16			ItemIcons[MAX_SUB_MENUS];
	U8*			PopUpList[MAX_SUB_MENUS];

	/* Call Exit Handler*/
#ifdef __MMI_CH_NUMERIC_LIST_ICON__
	EntryNewScreen(SCR_CALLHISTORY_RESETCALL, wgui_restore_list_menu_slim_style,
	               EntryCHISTResetCallLog, NULL);
#else

	EntryNewScreen(SCR_CALLHISTORY_RESETCALL, NULL,
	               EntryCHISTResetCallLog, NULL);
#endif
	/* Get current screen to gui buffer  for history purposes*/
	guiBuffer = GetCurrGuiBuffer( SCR_CALLHISTORY_RESETCALL);
	/* Retrieve no of child of menu item to be displayed */
	nNumofItem = GetNumOfChild( MENU8113_CALLHISTORY_RESETCALL );
	/* Get attribute of menu to be displayed */
	//nDispAttribute = GetDispAttributeOfItem( MENU8113_CALLHISTORY_RESETCALL );
	/* Retrieve string ids in sequence of given menu item to be displayed */
	GetSequenceStringIds( MENU8113_CALLHISTORY_RESETCALL, nStrItemList );
	GetSequenceImageIds( MENU8113_CALLHISTORY_RESETCALL, ItemIcons );
	/* Set current parent id*/
	SetParentHandler( MENU8113_CALLHISTORY_RESETCALL );
	/* Register highlight handler to be called in menu screen */
	RegisterHighlightHandler( ExecuteCurrHiliteHandler );
	/* Construct the hint handler for the menu items */
	ConstructHintsList(MENU8113_CALLHISTORY_RESETCALL, PopUpList);

#ifdef __MMI_CH_NUMERIC_LIST_ICON__
      wgui_override_list_menu_slim_style(WGUI_LIST_MENU_SLIM_STYLE_NUMBER);
#endif

	/* Display the screen for the reset call logs */
	ShowCategory52Screen( STR_MENU8113_CALLHISTORY_RESETCALL,
	                      IMG_SCR8056_CAPTION,
	                      STR_GLOBAL_OK, IMG_GLOBAL_OK, STR_GLOBAL_BACK,
	                      IMG_GLOBAL_BACK, nNumofItem, nStrItemList,
	                      ItemIcons, ( U8 * * )
	                      PopUpList, 0, 0,guiBuffer );

	/* Register function with right softkey */
	SetKeyHandler( GoBackHistory,KEY_LEFT_ARROW, KEY_EVENT_DOWN);
	SetRightSoftkeyFunction( GoBackHistory, KEY_EVENT_UP );
	return;
}
예제 #3
0
파일: Service.c 프로젝트: 12019/mtktest
/*****************************************************************************
 * FUNCTION
 *  GoToServicesMenu
 * DESCRIPTION
 *  Displays Services Menu
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void GoToServicesMenu(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U16 nStrItemList[MAX_SUB_MENUS];
    U16 nIconItemList[MAX_SUB_MENUS];

    U8 *Strings[MAX_SUB_MENUS];
    U16 Icons[MAX_SUB_MENUS];
    U16 nNumofItem;

    U8 i = 0, j;
    U8 *guiBuffer;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#ifdef __MMI_DUAL_SIM_MASTER__
    if ((MTPNP_AD_Get_Status() != MTPNP_AD_CARD1) &&
        (MTPNP_AD_Get_Status() != MTPNP_AD_CARD2) &&
        (MTPNP_AD_Get_Status() != MTPNP_AD_DUALCARD))
    {
        DisplayPopup(
            (PU8) GetString(SERVICES_NOT_PROVIDED_STRING_ID),
            IMG_GLOBAL_WARNING,
            0,
            UI_POPUP_NOTIFYDURATION_TIME,
            (U8) WARNING_TONE);
        return;
    }
#endif /* __MMI_DUAL_SIM_MASTER__ */

    /* Retrieve no of child of menu item to be displayed */
    nNumofItem = GetNumOfChild_Ext(MAIN_MENU_SERVICES_MENUID);

    /* Retrieve string ids in sequence of given menu item to be displayed */
    GetSequenceStringIds_Ext(MAIN_MENU_SERVICES_MENUID, nStrItemList);
    GetSequenceImageIds_Ext(MAIN_MENU_SERVICES_MENUID, nIconItemList);

#ifdef __SAT__
#if (defined __MMI_DUAL_SIM_SINGLE_CALL__) || (defined __MMI_DUAL_SIM_MASTER__)
    if ((IsSATPresent() && MTPNP_AD_Get_Status() == MTPNP_AD_CARD1) ||
        (IsSATPresent() && MTPNP_AD_Get_Status() == MTPNP_AD_DUALCARD))
#else /* (defined __MMI_DUAL_SIM_SINGLE_CALL__) || (defined __MMI_DUAL_SIM_MASTER__) */
    if (IsSATPresent())
#endif /* (defined __MMI_DUAL_SIM_SINGLE_CALL__) || (defined __MMI_DUAL_SIM_MASTER__) */
    {
        Strings[0] = (mmi_ucs2strlen((S8*) gSATMainMenu.alphaId) == 0) ? (PU8) get_string(SAT_MENU_STRING_ID) : gSATMainMenu.alphaId;
        Icons[0] = SAT_TITLE_IMAGE_ID;
        i++;
    }

#if (defined __MMI_DUAL_SIM_SINGLE_CALL__) || (defined __MMI_DUAL_SIM_MASTER__)
    if (IsSAT2Present() && IsSATPresent() && MTPNP_AD_Get_Status() == MTPNP_AD_DUALCARD)
    {
        Strings[1] = (mmi_ucs2strlen((S8*) gSATMainMenu.alphaId_2) == 0) ? (PU8) get_string(SAT_MENU_STRING_ID) : gSATMainMenu.alphaId_2;
        Icons[1] = SAT_TITLE_IMAGE_ID_2;
        i++;
    }
    else if ((IsSAT2Present() && MTPNP_AD_Get_Status() == MTPNP_AD_CARD2) ||
             (IsSAT2Present() && !IsSATPresent() && MTPNP_AD_Get_Status() == MTPNP_AD_DUALCARD))
    {
        Strings[0] = (mmi_ucs2strlen((S8*) gSATMainMenu.alphaId_2) == 0) ? (PU8) get_string(SAT_MENU_STRING_ID) : gSATMainMenu.alphaId_2;
        Icons[0] = SAT_TITLE_IMAGE_ID_2;
        i++;
    }
#endif /* (defined __MMI_DUAL_SIM_SINGLE_CALL__) || (defined __MMI_DUAL_SIM_MASTER__) */
#endif /* __SAT__ */

    for (j = 0; j < nNumofItem; j++)
    {
        if (isInfoNumPresent == 0 && nStrItemList[j] == SERVICES_INFO_NUM_STRING_ID)
        {
            continue;
        }
        Strings[i] = (PU8) GetString(nStrItemList[j]);
        Icons[i] = nIconItemList[j];
        i++;
    }

    nNumofItem = i;

#ifdef __MMI_MERGE_SAT_TO_MAINMENU__
    if (nNumofItem == 0)
    {
        DisplayPopup((PU8) GetString(SERVICES_NOT_PROVIDED_STRING_ID), IMG_GLOBAL_ERROR, 0, 1000, ERROR_TONE);
        return;
    }
    else if (nNumofItem == 1 && IsSATPresent())
    {
        GoToSATMainMenu();
        return;
    }
#endif /* __MMI_MERGE_SAT_TO_MAINMENU__ */ 

#ifdef __MMI_SERVICE_MENU_NUMERIC_LIST_ICON__
    EntryNewScreen(SERVICES_MAIN_MENU_SCREEN_ID, wgui_restore_list_menu_slim_style, GoToServicesMenu, NULL);
    wgui_override_list_menu_slim_style(WGUI_LIST_MENU_SLIM_STYLE_NUMBER);
#else /* __MMI_SERVICE_MENU_NUMERIC_LIST_ICON__ */ 
    EntryNewScreen(SERVICES_MAIN_MENU_SCREEN_ID, NULL, GoToServicesMenu, NULL);
#endif /* __MMI_SERVICE_MENU_NUMERIC_LIST_ICON__ */ 

    SetParentHandler(MAIN_MENU_SERVICES_MENUID);
    guiBuffer = GetCurrGuiBuffer(SERVICES_MAIN_MENU_SCREEN_ID);
    RegisterHighlightHandler(ServicesMenuIndex);

#ifdef __MMI_WGUI_MINI_TAB_BAR__
    wgui_enable_mini_tab_bar(MAIN_MENU_SERVICES_MENUID);
#endif 

    ShowCategory84Screen(
        SERVICES_TITLE_STRING_ID,
        GetRootTitleIcon(MAIN_MENU_SERVICES_MENUID),
        STR_GLOBAL_OK,
        IMG_GLOBAL_OK,
        STR_GLOBAL_BACK,
        IMG_GLOBAL_BACK,
        nNumofItem,
        Strings,
        Icons,
        LIST_MENU,
        0,
        guiBuffer);

    if (nNumofItem == 0)
    {
        /* No menu item and no SAT in GSM only project */
        ChangeLeftSoftkey(0, 0);
    }

    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
    SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
}
예제 #4
0
/*****************************************************************************
 * FUNCTION
 *  EntryCHISTMainMenu
 * DESCRIPTION
 *  Main screen of call history
 * NA
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void EntryCHISTMainMenu(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    // U16                  nDispAttribute; /* Stores display attribue */
    U8 *guiBuffer;                          /* Buffer holding history data */
    U16 nStrItemList[MAX_SUB_MENUS];        /* Stores the strings id of submenus returned */
    U16 nNumofItem;                         /* Stores no of children in the submenu */
    U16 ItemIcons[MAX_SUB_MENUS];
    U8 *PopUpList[MAX_SUB_MENUS];
    U16 LSKStr;
    U16 LSKImg;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* S32       maskingByte=-1;
       S32               menuItemId=-1; */

#ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
    if (mmi_is_redrawing_bk_screens() == TRUE)
    {
        return;
    }
#endif /* __MMI_UI_SMALL_SCREEN_SUPPORT__ */

    /* Call Exit Handler */
#ifdef __MMI_CH_NUMERIC_LIST_ICON__
    EntryNewScreen(SCR_CALL_HISTORY_MAIN_MENU, wgui_restore_list_menu_slim_style, EntryCHISTMainMenu, NULL);
#else 
    EntryNewScreen(SCR_CALL_HISTORY_MAIN_MENU, NULL, EntryCHISTMainMenu, NULL);
#endif 

    /* reset the indicies for dialed/recived/missed call list menus */
    chis_p->currRecvdCallIndex = 0;
    chis_p->currMissedCallIndex = 0;
    chis_p->currDialedCallIndex = 0;

    /* Get current screen to gui buffer  for history purposes */
    guiBuffer = GetCurrGuiBuffer(SCR_CALL_HISTORY_MAIN_MENU);
    /* Retrieve no of child of menu item to be displayed */
    nNumofItem = GetNumOfChild_Ext(MAIN_MENU_CALL_HISTORY); /* diamond, 2005/07/01 add _Ext to menu item functions */
    /* Get attribute of menu to be displayed */
    /* nDispAttribute = GetDispAttributeOfItem( MAIN_MENU_CALL_HISTORY ); */
    /* Retrieve string/image ids in sequence of given menu item to be displayed */
    GetSequenceStringIds_Ext(MAIN_MENU_CALL_HISTORY, nStrItemList);     /* diamond, 2005/07/01 add _Ext to menu item functions */
    GetSequenceImageIds_Ext(MAIN_MENU_CALL_HISTORY, ItemIcons); /* diamond, 2005/07/01 add _Ext to menu item functions */
    /* Set current parent id */
    SetParentHandler(MAIN_MENU_CALL_HISTORY);
    /* Register highlight handler to be called in menu screen */
    RegisterHighlightHandler(ExecuteCurrHiliteHandler);

    /* diamond, 2005/07/01 removed for new menu item architecture to CPHS */
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif /* 0 */ 

    /* construct hint popup strings for menu items */
    ConstructHintsList(MAIN_MENU_CALL_HISTORY, PopUpList);

#ifdef __MMI_CH_NUMERIC_LIST_ICON__
    wgui_override_list_menu_slim_style(WGUI_LIST_MENU_SLIM_STYLE_NUMBER);
#endif 

    /* MTK Leo add, mini_tab_bar */
#ifdef __MMI_WGUI_MINI_TAB_BAR__
    wgui_enable_mini_tab_bar(MAIN_MENU_CALL_HISTORY);
#endif 
    /* MTK Leo end */

    /* There may be no menu items in call log */
    if (nNumofItem == 0)
    {
        LSKStr = 0;
        LSKImg = 0;
    }
    else
    {
        LSKStr = STR_GLOBAL_OK;
        LSKImg = IMG_GLOBAL_OK;        
    }
    /* Display the call history main screen */
    ShowCategory52Screen(
    #ifdef __MMI_DUAL_SIM_MASTER__
        STRING_MTPNP_CARD1_CALL_HISTORY,
    #else /* __MMI_DUAL_SIM_MASTER__ */
        STR_SCR_CALL_HISTORY_MAIN_MENU_CAPTION,
    #endif /* __MMI_DUAL_SIM_MASTER__ */
        IMG_SCR_CALL_HISTORY_MAIN_MENU_CAPTION,
        LSKStr,
        LSKImg,
        STR_GLOBAL_BACK,
        IMG_GLOBAL_BACK,
        nNumofItem,
        nStrItemList,
        ItemIcons,
        (U8 **)PopUpList,
        0,
        0,  /* u16callhist_curindex, */
        guiBuffer);

    /* Register function with right softkey */
    SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
    return;
}