📄 events.c
字号:
* ExecuteCurrHiliteHandler_Ext
* DESCRIPTION
*
* PARAMETERS
* hiliteid [IN]
* RETURNS
* void
*****************************************************************************/
void ExecuteCurrHiliteHandler_Ext(S32 hiliteid)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
FuncPtr currFuncPtr = NULL;
S32 hiliteItemID;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_EXECURHILIHTE_HDLR, hiliteid));
currHiliteID = (U16) hiliteid;
if (currParentID == 0)
{
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_ERROR_EVENT_EXECURHILIHTE_HDLR));
return;
}
/* check if menuitem is hidden */
hiliteItemID = GetSeqItemId_Ext((U16) currParentID, (S16) hiliteid);
currFuncPtr = maxHiliteInfo[hiliteItemID].entryFuncPtr;
if (currFuncPtr)
{
(*currFuncPtr) ();
}
}
/*****************************************************************************
* FUNCTION
* GetCurrHiliteID
* DESCRIPTION
* Returns the index of the currently highlighted menu item
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
U16 GetCurrHiliteID(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return currHiliteID;
}
/*****************************************************************************
* FUNCTION
* SetHiliteHandler
* DESCRIPTION
* Sets hilite func handlers
*
* This is used to set hilite func handlers
* PARAMETERS
* itemid [IN]
* hiliteFuncPtr [IN]
* RETURNS
* void
*****************************************************************************/
void SetHiliteHandler(U16 itemid, FuncPtr hiliteFuncPtr)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_SETCURHILIHTE_HDLR, itemid));
maxHiliteInfo[itemid].entryFuncPtr = hiliteFuncPtr;
}
/*****************************************************************************
* FUNCTION
* ClearHiliteHandler
* DESCRIPTION
* Clear hilite handler
*
* This is used to clear hilite func handlers for a particular menu item
* PARAMETERS
* itemid [IN]
* RETURNS
* void
*****************************************************************************/
void ClearHiliteHandler(U16 itemid)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_CLRCURHILIHTE_HDLR, itemid));
maxHiliteInfo[itemid].entryFuncPtr = NULL;
}
/*****************************************************************************
* FUNCTION
* ConstructHintsList
* DESCRIPTION
* Constructs Hint List for a static menu screen
* PARAMETERS
* parentID [IN]
* hintArray [IN]
* RETURNS
* void
*****************************************************************************/
extern MMI_BOOL mmi_frm_test_menu_item_hide(U16 menu_item_id);
void ConstructHintsList(U16 parentID, U8 **hintArray)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 i, noOfChild;
U16 hiliteItemID[MAX_SUB_MENUS];
U8 idx = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
noOfChild = (U8) GetNumOfChild(parentID);
for (i = 0; i < noOfChild; i++)
{
hiliteItemID[i] = GetSeqItemId((U16) parentID, (S16) i);
/* check if menuitem is hidden */
if (!mmi_frm_test_menu_item_hide(hiliteItemID[i])) /* the menuitem is not hidden */
{
if (maxHiliteInfo[hiliteItemID[i]].hintFuncPtr)
{
(*maxHiliteInfo[hiliteItemID[i]].hintFuncPtr) (idx);
hintArray[idx] = hintData[idx];
idx++;
}
else
{
hintArray[idx++] = NULL;
}
}
}
}
/*****************************************************************************
* FUNCTION
* SetHintHandler
* DESCRIPTION
* Sets Hint Func Handlers
* PARAMETERS
* itemid [IN] FuncPtr hiliteFuncPtr
* hintFuncPtr [IN]
* RETURNS
* void
*****************************************************************************/
void SetHintHandler(U16 itemid, FuncPtrShort hintFuncPtr)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_SETHINT_HDLR, itemid));
maxHiliteInfo[itemid].hintFuncPtr = hintFuncPtr;
}
/*****************************************************************************
* FUNCTION
* ClearHintHandler
* DESCRIPTION
* clears hint handlers
*
* This is used to clear hint func handlers
* PARAMETERS
* itemid [IN]
* RETURNS
* void
*****************************************************************************/
void ClearHintHandler(U16 itemid)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_CLRHINT_HDLR, itemid));
maxHiliteInfo[itemid].hintFuncPtr = NULL;
}
/*****************************************************************************
* FUNCTION
* SetParentHandler
* DESCRIPTION
* sets current parent item id
*
* This is used to set current parent item id
* PARAMETERS
* parentID [IN]
* RETURNS
* void
*****************************************************************************/
void SetParentHandler(U16 parentID)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_SETPARENT_HDLR, parentID));
currParentID = parentID;
}
/* MTK Brian added for AT+CVIB, 2003/11/23 */
/*****************************************************************************
* FUNCTION
* GetParentHandler
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
*
*****************************************************************************/
U16 GetParentHandler(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return currParentID;
}
/*****************************************************************************
* FUNCTION
* SetKeyHandler
* DESCRIPTION
* sets the curent screen key handlers
*
* This is used to set the curent screen key handlers
* PARAMETERS
* funcPtr [IN]
* keyCode [IN]
* keyType [IN]
* RETURNS
* void
*****************************************************************************/
void SetKeyHandler(FuncPtr funcPtr, U16 keyCode, U16 keyType)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_SETKEY_HDLR, keyCode, keyType, funcPtr));
MMI_ASSERT((keyCode < MAX_KEYS) && (keyType < MAX_KEY_TYPE));
currKeyFuncPtrs[keyCode][keyType] = funcPtr;
}
/*****************************************************************************
* FUNCTION
* GetKeyHandler
* DESCRIPTION
* return the curent screen key handlers
*
* This is used to set the curent screen key handlers
* PARAMETERS
* keyCode [IN]
* keyType [IN]
* RETURNS
* void
*****************************************************************************/
FuncPtr GetKeyHandler(U16 keyCode, U16 keyType)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_ASSERT((keyCode < MAX_KEYS) && (keyType < MAX_KEY_TYPE));
return (currKeyFuncPtrs[keyCode][keyType]);
}
/*****************************************************************************
* FUNCTION
* SetGroupKeyHandler
* DESCRIPTION
* sets the curent screen same key handler to the group pf keycodes
*
* This is used to set the same key handler for a group of keycodes.
* PARAMETERS
* funcPtr [IN]
* keyCodes [IN]
* len [IN]
* keyType [IN]
* RETURNS
* void
*****************************************************************************/
void SetGroupKeyHandler(FuncPtr funcPtr, PU16 keyCodes, U8 len, U16 keyType)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 count;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_ASSERT((len <= MAX_KEYS) && (keyType < MAX_KEY_TYPE));
for (count = 0; count < len; count++)
{
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_SETGROUPKEY_HDLR, keyCodes[count], keyType));
currKeyFuncPtrs[keyCodes[count]][keyType] = funcPtr;
}
}
/*****************************************************************************
* FUNCTION
* ClearKeyHandler
* DESCRIPTION
* clears the current screen key handlers
*
* This is used to clears the current screen key handlers
* PARAMETERS
* keyCode [IN]
* keyType [IN]
* RETURNS
* void
*****************************************************************************/
void ClearKeyHandler(U16 keyCode, U16 keyType)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_CLRKEY_HDLR, keyCode, keyType));
MMI_ASSERT((keyCode < MAX_KEYS) && (keyType < MAX_KEY_TYPE));
currKeyFuncPtrs[keyCode][keyType] = NULL;
}
/*****************************************************************************
* FUNCTION
* ClearAllKeyHandler
* DESCRIPTION
* clears all the current screen key handlers
*
* This is used to clears all the current screen key handlers
* PARAMETERS
* void
* RETURNS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -