📄 atbwapaui.c
字号:
/*******************************************************************************
$Function: ATB_wap_config_str
$Description: Sends string configuration information to the browser
$Returns: WAP_OK
$Arguments: View - The current view
param - ID of the configuration
value - Integer value of the configuration
string - String value of the configuration
length - Length of the string value
*******************************************************************************/
T_WAP_RES ATB_wap_config_str(T_WAP_VIEW *View, USHORT param, char *string, U32 length)
{
T_MMI_WAP_CONFIGURE_IND parameter;
parameter.object_id = View->object_id;
parameter.type = WAP_StrConfig;
parameter.param = param;
parameter.intvalue = 0;
parameter.strvalue = string;
parameter.length = length;
M_MMI_WAP_CONFIGURE_IND(¶meter);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_conn_config_int
$Description: Sends integer configuration information to the browser
$Returns: WAP_OK
$Arguments: View - The current view
param - ID of the configuration
value - Integer value of the configuration
*******************************************************************************/
T_WAP_RES ATB_wap_conn_config_int(T_WAP_VIEW *View, USHORT param, U32 value)
{
T_MMI_WAP_CONNECTION_CONFIGURE_IND parameter;
parameter.object_id = View->object_id;
parameter.type = WAP_IntConfig;
parameter.channel_id = View->channel;
parameter.param = param;
parameter.intvalue = value;
parameter.strvalue = NULL;
parameter.length = 0;
M_MMI_WAP_CONNECTION_CONFIGURE_IND(¶meter);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_conn_config_str
$Description: Sends string configuration information to the browser
$Returns: WAP_OK if successful, WAP_FAIL if otherwise
$Arguments: View - The current view
param - ID of the configuration
value - Integer value of the configuration
string - String value of the configuration
length - Length of the string value
*******************************************************************************/
T_WAP_RES ATB_wap_conn_config_str(T_WAP_VIEW *View, USHORT param, char *string, U32 length)
{
T_MMI_WAP_CONNECTION_CONFIGURE_IND parameter;
parameter.object_id = View->object_id;
parameter.type = WAP_StrConfig;
parameter.channel_id = View->channel;
parameter.param = param;
parameter.intvalue = 0;
parameter.strvalue = string;
parameter.length = length;
M_MMI_WAP_CONNECTION_CONFIGURE_IND(¶meter);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_download_url
$Description: Requests the WAP browser to download a particular URL
$Returns: WAP_OK
$Arguments: View - The current view
URL - The URL to download
reload - TRUE if page is to be fetched from network, not cache.
*******************************************************************************/
T_WAP_RES ATB_wap_download_url(T_WAP_VIEW *View, char *URL, BOOL reload)
{
T_MMI_WAP_DOWNLOAD_URL_IND parameter;
#ifdef TRACE_ATBWAPAUI
TRACE_FUNCTION("ATB_wap_download_url");
#endif
parameter.object_id = View->object_id;
parameter.Url = URL;
parameter.url_length = (U32)(strlen(URL)+1);
parameter.reload = reload;
M_MMI_WAP_DOWNLOAD_URL_IND(¶meter);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_stop_download
$Description: Requests the WAP browser to stop downloading a particular URL
$Returns: WAP_OK
$Arguments: View - the current view
*******************************************************************************/
T_WAP_RES ATB_wap_stop_download(T_WAP_VIEW *View)
{
T_MMI_WAP_BROWSE_CONTROL_IND parameter;
#ifdef TRACE_ATBWAPAUI
TRACE_FUNCTION("ATB_wap_stop_download");
#endif
parameter.object_id = View->object_id;
parameter.browse_command = WAP_DOWNLOAD_STOP;
M_MMI_WAP_BROWSE_CONTROL_IND(¶meter);
ATB_wap_status_change(View,ATB_WAP_NO_STATUS);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_card_refresh
$Description: Requests the WAP browser to refresh the current card from the network
$Returns: WAP_OK
$Arguments: View - the current view
*******************************************************************************/
T_WAP_RES ATB_wap_card_refresh(T_WAP_VIEW *View)
{
T_MMI_WAP_BROWSE_CONTROL_IND parameter;
#ifdef TRACE_ATBWAPAUI
TRACE_FUNCTION("ATB_wap_card_refresh");
#endif
parameter.object_id = View->object_id;
parameter.browse_command = WAP_CARD_REFRESH;
M_MMI_WAP_BROWSE_CONTROL_IND(¶meter);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_card_display
$Description: Requests the WAP browser to redisplay a card held in the cache
$Returns: WAP_OK
$Arguments: View - the current view
*******************************************************************************/
T_WAP_RES ATB_wap_card_display(T_WAP_VIEW *View)
{
T_MMI_WAP_BROWSE_CONTROL_IND parameter;
#ifdef TRACE_ATBWAPAUI
TRACE_FUNCTION("ATB_wap_card_display");
#endif
parameter.object_id = View->object_id;
parameter.browse_command = WAP_CARD_DISPLAY;
M_MMI_WAP_BROWSE_CONTROL_IND(¶meter);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_card_go_back
$Description: Requests the WAP browser to go to the previous card
$Returns: WAP_OK
$Arguments: View - the current view
*******************************************************************************/
T_WAP_RES ATB_wap_card_go_back(T_WAP_VIEW *View)
{
T_MMI_WAP_BROWSE_CONTROL_IND parameter;
#ifdef TRACE_ATBWAPAUI
TRACE_FUNCTION("ATB_wap_card_go_back");
#endif
parameter.object_id = View->object_id;
parameter.browse_command = WAP_CARD_GO_BACK;
M_MMI_WAP_BROWSE_CONTROL_IND(¶meter);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_card_key_event
$Description: Requests the WAP browser react to a key event, up/down etc.
$Returns: WAP_OK
$Arguments: View - the current view
keyType - the type of key selected
*******************************************************************************/
T_WAP_RES ATB_wap_card_key_event(T_WAP_VIEW *View, WAP_CONTROL_TYPES keyType)
{
T_MMI_WAP_BROWSE_CONTROL_IND command;
T_MMI_WAP_DRAW_CARD_REQ current_card;
#ifdef TRACE_ATBWAPAUI
TRACE_FUNCTION("ATB_wap_card_key_event");
#endif
command.object_id = View->object_id;
command.browse_command = keyType;
M_MMI_WAP_BROWSE_CONTROL_IND(&command);
/* For select, need to redraw card in order to update changed elements */
if (keyType == WAP_KEY_SELECT)
{
current_card.object_id = View->object_id;
M_MMI_WAP_DRAW_CARD_REQ(¤t_card);
}
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_key_selected
$Description: Send the id of the selected WAP key to the AUS browser.
$Returns: WAP_OK
$Arguments: View - the current view
keyId - Key identifier
*******************************************************************************/
T_WAP_RES ATB_wap_key_selected(T_WAP_VIEW *View, USHORT keyId)
{
T_MMI_WAP_KEY_SELECTED_IND parameter;
#ifdef TRACE_ATBWAPAUI
TRACE_FUNCTION("ATB_wap_key_selected");
#endif
parameter.object_id = View->object_id;
parameter.keyId = keyId;
M_MMI_WAP_KEY_SELECTED_IND(¶meter);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_card scroll
$Description: Scroll to a y position on the current card
$Returns: WAP_OK
$Arguments: View - the current view
scrollPos - Y position on card to which to scroll
*******************************************************************************/
T_WAP_RES ATB_wap_card_scroll(T_WAP_VIEW *View, SHORT scrollPos)
{
T_MMI_WAP_BROWSE_CONTROL_IND parameter;
/* Make sure the scroll destination is on the card */
if (scrollPos > (View->cardHeight-WAP_SCREEN_HEIGHT))
scrollPos = View->cardHeight-WAP_SCREEN_HEIGHT;
if (scrollPos<0)
scrollPos = 0;
/* Send the event */
parameter.object_id = View->object_id;
parameter.browse_command = WAP_KEY_SCROLL;
parameter.browse_parameter = (USHORT)scrollPos;
M_MMI_WAP_BROWSE_CONTROL_IND(¶meter);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_input_dialog_closed
$Description: Provides the answer of an input dialog.
$Returns: WAP_OK
$Arguments: parameter - Dialog confirmation information
*******************************************************************************/
T_WAP_RES ATB_wap_input_dialog_closed(T_MMI_WAP_INPUT_DIALOG_CNF *parameter)
{
T_MMI_WAP_DRAW_CARD_REQ current_card;
#ifdef TRACE_ATBWAPAUI
TRACE_FUNCTION("ATB_wap_input_dialog_closed");
#endif
M_MMI_WAP_INPUT_DIALOG_CNF(parameter);
current_card.object_id = parameter->object_id;
M_MMI_WAP_DRAW_CARD_REQ(¤t_card);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_password_dialog_closed
$Description: Provides the answer of a password dialog.
$Returns: WAP_OK
$Arguments: parameter - Dialog confirmation information
*******************************************************************************/
T_WAP_RES ATB_wap_password_dialog_closed(T_MMI_WAP_PASSWORD_DIALOG_CNF *parameter)
{
#ifdef TRACE_ATBWAPAUI
TRACE_FUNCTION("ATB_wap_password_dialog_closed");
#endif
M_MMI_WAP_PASSWORD_DIALOG_CNF(parameter);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_confirm_dialog_closed
$Description: Provides the answer of a confirmation dialog.
$Returns: WAP_OK
$Arguments: parameter - Dialog confirmation information
*******************************************************************************/
T_WAP_RES ATB_wap_confirm_dialog_closed(T_MMI_WAP_CONFIRM_DIALOG_CNF *parameter)
{
#ifdef TRACE_ATBWAPAUI
TRACE_FUNCTION("ATB_wap_confirm_dialog_closed");
#endif
M_MMI_WAP_CONFIRM_DIALOG_CNF(parameter);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_info_dialog_closed
$Description: Provides the answer of an info dialog.
$Returns: WAP_OK
$Arguments: parameter - Dialog confirmation information
*******************************************************************************/
T_WAP_RES ATB_wap_info_dialog_closed(T_MMI_WAP_INFO_DIALOG_CNF *parameter)
{
#ifdef TRACE_ATBWAPAUI
TRACE_FUNCTION("ATB_wap_info_dialog_closed");
#endif
M_MMI_WAP_INFO_DIALOG_CNF(parameter);
return WAP_OK;
}
/*******************************************************************************
$Function: ATB_wap_options_menu_select
$Description: The WAP key from the options menu has been selected.
$Returns: WAP_OK
$Arguments: View - the current view
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -