📄 mmimenu.c
字号:
/*******************************************************************************
CONDAT (UK)
********************************************************************************
This software product is the property of Condat (UK) Ltd and may not be
disclosed to any third party without the express permission of the owner.
********************************************************************************
$Project name: Basic MMI
$Project code: BMI (6349)
$Module: Menus
$File: MmiMenu.c
$Revision: 1.0
$Author: Condat(UK)
$Date: 25/10/00
********************************************************************************
Description:
This provides the implementation of the main menu handling for the basic
MMI
********************************************************************************
$History: MmiMenu.c
25/10/00 Original Condat(UK) BMI version.
20/08/02 ver0.101 fzq modified
$End
*******************************************************************************/
/*******************************************************************************
Include files
*******************************************************************************/
#define ENTITY_MFW
/* includes */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#if defined (NEW_FRAME)
#include "typedefs.h"
#include "vsi.h"
#include "pei.h"
#include "custom.h"
#include "gsm.h"
#else
#include "stddefs.h"
#include "custom.h"
#include "gsm.h"
#include "vsi.h"
#endif
#include "mfw_sys.h"
#include "p_sim.h"
#include "mfw_mfw.h"
#include "mfw_win.h"
#include "mfw_kbd.h"
#include "mfw_lng.h"
#include "mfw_edt.h"
#include "mfw_icn.h"
#include "mfw_mnu.h"
#include "mfw_phb.h"
#include "mfw_sim.h"
#include "mfw_nm.h"
#include "mfw_tim.h"
#include "mfw_sms.h"
#include "mfw_icn.h"
#include "mfw_sat.h"
#include "dspl.h"
#include "ksd.h"
#include "psa.h"
#include "MmiMmi.h"
#include "MmiMain.h"
#include "MmiStart.h"
#include "MmiDummy.h"
#include "MmiDialogs.h"
#include "MmiLists.h"
#include "mmiSmsBroadcast.h"
#include "MmiMenu.h"
#include "MmiSimToolkit.h"
#include "MmiSounds.h"
#include "MmiSettings.h"
#include "MmiServices.h"
#include "MmiPins.h"
#include "MmiIcons.h"
#include "MmiNetwork.h"
#include "MmiUserData.h"
#include "MmiSoftKeys.h"
#include "MmiTimeDate.h"
#include "MmiIdle.h"
#include "cus_aci.h"
#include "p_sim.h"
#include "pcm.h"
#include "mmibooksearchwindow.h"
/*******************************************************************************
Private definitions
*******************************************************************************/
/* next define used for code that might be removed
*/
#define KEEP 0
/*******************************************************************************
Global Data Elements
*******************************************************************************/
/* Menus display area
*/
/*******************************************************************************
Module Global Data Elements
*******************************************************************************/
MfwHnd MenuWin = (MfwHnd) 0;
static MfwHnd win=0; /* our window */
static MfwHnd mnu; /* our menu */
static MfwHnd kbd; /* our keyboard */
static MfwHnd kbdLong;
static SimMenuFunc SimCallback;
static MfwHnd SimWindow;
static MmiState nextState; /* next state when finished */
static BOOL fromHotKey;
static BOOL flagHotKey;
static const int OperatorIndex = 1;
extern int menu_start_index;
/*******************************************************************************
Local function prototypes
*******************************************************************************/
//static int mmiMenuNotImplemented( MfwMnu* m, MfwMnuItem* i );
//static void mmiMenuNotImplementedCB( T_MFW_HND win, UBYTE identifier, UBYTE reason );
/*******************************************************************************
$Function: leftKeyEventHandler
$Description: invokes the menu select handler
$Returns: as per mnuSelect
$Arguments: event, to be handled
keynoard, handle
*******************************************************************************/
static int leftKeyEventHandler( MfwEvt event, MfwKbd *keyboard)
{
return mnuSelect(mnu);
}
/*******************************************************************************
$Function: rightKeyEventHandler
$Description: invokes the menu escape handler
$Returns: as per mnuEscape
$Arguments: event, to be handled
keynoard, handle
*******************************************************************************/
static int rightKeyEventHandler( MfwEvt event, MfwKbd *keyboard)
{
return mnuEscape(mnu);
}
/*******************************************************************************
$Function: menuSimItemCallback
$Description: invokes the SimCallback function if it is allocated
$Returns: MfwResOk, always
$Arguments: m, menu being activated, i, item in menu
*******************************************************************************/
int menuSimItemCallback( MfwMnu* m, MfwMnuItem* i)
{
if( SimCallback != NULL )
SimCallback(SimWindow);
return MfwResOk;
}
/*******************************************************************************
Public Routines
*******************************************************************************/
/*******************************************************************************
$Function: item_flag_none
$Description: Attribut function for menu entries. This function shall
be used for all cases of no specific attributes (default)
$Returns: zero always
$Arguments: m, ma, mi - not used
*******************************************************************************/
USHORT item_flag_none( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi )
{
return 0;
}
USHORT ChoiceCopyItem (struct MfwMnuTag * m, struct MfwMnuAttrTag * ma, struct MfwMnuItemTag * mi)
{
TRACE_EVENT("ChoiceCopyItem");
// zgzTraceDataFunc("the index in total array",(unsigned short)mi->Dynamicindex);
if (bookname[(mi->Dynamicindex+menu_start_index+SearchTotal)%SearchTotal].selectflag==TRUE)
return FLAGFUNC_TRUE_ICON;
else
return FLAGFUNC_FALSE_ICON;
}
/*******************************************************************************
$Function: item_flag_hide
$Description: Attribut function for menu entries. This function shall
be used for all cases of hiding menu entries.
$Returns: MNU_ITEM_HIDE always
$Arguments: m, ma, mi - not used
*******************************************************************************/
USHORT item_flag_hide( T_MFW_MNU *m, T_MFW_MNU_ATTR *ma, T_MFW_MNU_ITEM *mi )
{
return MNU_ITEM_HIDE;
}
/*******************************************************************************
$Function: menuIsFocussed
$Description: Returns 1 if the menu window has the focus, else returns 0.
$Returns: Returns 1 if the menu window has the focus, else returns 0.
$Arguments: None
*******************************************************************************/
int menuIsFocussed( void )
{
return winIsFocussed( win );
}
/*******************************************************************************
$Function: menuEnableSimMenu
$Description: Unhides the SIM toolkit menu item, using <label> as the label.
If <label> is 0, the default label is used. If the SIM toolkit
menu item is invoked by the user, <simCallback> gets called
with argument <window>, unless <simCallback> is 0.
$Returns: None
$Arguments: label, simCallBack, simWindow as indicated above
*******************************************************************************/
void menuEnableSimMenu( char *label, SimMenuFunc simCallback, MfwHnd simWindow )
{
TRACE_FUNCTION("menuEnableSimMenu");
SimCallback = simCallback;
/* parameter to callback
*/
SimWindow = simWindow;
}
/*******************************************************************************
$Function: menuDisableSimMenu
$Description: Hides the SIM toolkit menu item
$Returns: None
$Arguments: None
*******************************************************************************/
void menuDisableSimMenu(void)
{
TRACE_FUNCTION("menuDisableSimMenu");
}
/*******************************************************************************
$Function: mmiMenuNotImplemented
$Description: Creates a timed dialog to display the message "Coming Soon..."
$Returns: 1 Always
$Arguments: m, menu being invoked, i item in menu
*******************************************************************************/
//int mmiMenuNotImplemented( MfwMnu* m, MfwMnuItem* i)
//{
// T_DISPLAY_DATA display_info;
/* construct a display info structure with appropriate information
to allow the timed dialog box to be shown.
The actual text to be displayed will depend on the TxtNotImplemented
string in the resource manager, refer MmiResources.h
*/
// display_info.TextString = NULL;
// display_info.TextString2 = NULL;
// display_info.LeftSoftKey = TxtNull;
// display_info.RightSoftKey = TxtSoftBack;
// display_info.Time = THREE_SECS;
// display_info.KeyEvents = KEY_CLEAR | KEY_RIGHT;
// display_info.TextId = TxtNotImplemented;
// display_info.TextId2 = 0;
// display_info.Identifier = 0;
// display_info.Callback = (T_VOID_FUNC) mmiMenuNotImplementedCB;
/* Throw up the dialog window
*/
// info_dialog (win, &display_info);
/* return a true status always
*/
// return 1;
//}
/*******************************************************************************
$Function: mmiMenuNotImplementedCB
$Description: Callback from not implemented dialog
- returns window to top of stack
$Returns: None
$Arguments: win, identifier, reason, as for all standard call back functions,
these are not all used in this scenario, just the window to be
restored on completion
*******************************************************************************/
//void mmiMenuNotImplementedCB( T_MFW_HND win, UBYTE identifier, UBYTE reason )
//{
// winShow( win );
//}
/*******************************************************************************
End Of File
*******************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -