📄 wap_mmi.c
字号:
/*
+-----------------------------------------------------------------------------
| File : wap_mmi.c
+-----------------------------------------------------------------------------
| Copyright Condat AG 1999-2001, Berlin
| All rights reserved.
|
| This file is confidential and a trade secret of Condat AG
| The receipt of or possession of this file does not convey
| any rights to reproduce or disclose its contents or to
| manufacture, use, or sell anything it may describe, in
| whole, or in part, without the specific written consent of
| Condat AG.
+-----------------------------------------------------------------------------
| Purpose : callbacks for AUS browser, NULL, NOT IMPLEMENTED YET
|
+-----------------------------------------------------------------------------
*/
#ifndef WAP_MMI_C
#define WAP_MMI_C
#endif
#define ENTITY_WAP
/*==== INCLUDES ===================================================*/
#if defined (NEW_FRAME)
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include "typedefs.h"
#include "pcm.h"
#include "pconst.cdg"
#include "mconst.cdg"
#include "message.h"
#include "ccdapi.h"
#include "vsi.h"
#include "custom.h"
#include "gsm.h"
#include "prim.h"
#include "cnf_wap.h"
#include "mon_wap.h"
#include "pei.h"
#include "tok.h"
#include "dti.h" /* functionality of the dti library */
#else
#include <string.h>
#include "stddefs.h"
#include "pconst.cdg"
#include "message.h"
#include "ccdapi.h"
#include "custom.h"
#include "gsm.h"
#include "cnf_wap.h"
#include "mon_wap.h"
#include "prim.h"
#include "vsi.h"
#include "pei.h"
#include "tok.h"
#endif
#include "wap.h"
#include "cus_wap.h"
#include "aapimmi.h"
#include "capimmi.h"
#include "aapiclnt.h"
#include "aapigle.h"
#include "capiclnt.h"
#include "wap_types.h"
#include "wap_examples.h"
#include "wap_wapmmi.h"
VOID MMIa_linkInfo (
UCHAR viewId,
UCHAR widgetType,
UCHAR widgetId,
const CHAR *URL
)
{
#if defined LOG_EXTERNAL
CLNTa_log(viewId, 0, "MMIc_linkInfo\nUCHAR \t widgetType \t %u\nUCHAR widgetId \t %u\nconst CHAR * URL \t %s\n", widgetType, widgetId, URL);
#endif
}
VOID MMIa_unknownContent (
UCHAR viewId,
const CHAR *data,
USHORT length,
const CHAR *contentType,
const CHAR *URL
)
{
#if defined LOG_EXTERNAL
CLNTa_log(viewId, 0, "MMIa_unknownContent\nconst CHAR * \t data \t %s\nUSHORT \t length \t %u\nconst CHAR * \t contentType \t %s\nconst CHAR * \t url \t %s\n", data, (int)length, contentType, URL);
#endif
}
/*******************************************************************************
$Function: MMIa_alertDialog
$Description: Causes the given message to be displayed to the user. The function
does not wait for user confirmation, but returns immediately.
$Returns:
$Arguments: viewId - id of the user agent
dialogId - id of the dialog
message - the message to be present in the dialog
*******************************************************************************/
VOID MMIa_alertDialog (
UCHAR viewId,
UCHAR dialogId,
const WCHAR *message
)
{
T_WAP_MMI_INFO_DIALOG_REQ parameter;
#if defined LOG_EXTERNAL
CLNTa_log(viewId, 0, "MMIa_alertDialog\nUCHAR \t dialogId \t %u\nconst WCHAR * \t message \t %S\n", (int)dialogId, message);
#endif
/* SPR#2393 - SH - Now set length of NULL strings to 0 */
parameter.object_id = viewId;
parameter.dialog_id = (UINT8) dialogId;
/* Text of alert dialog */
parameter.Message = (USHORT *)message;
if (message==NULL)
parameter.message_length = 0;
else
parameter.message_length = (UINT16) GLEa_strlen((GLE_STRING)message);
W_WAP_MMI_INFO_DIALOG_REQ(¶meter);
return;
}
/*******************************************************************************
$Function: MMIa_confirmDialog
$Description: Displays the given dialog and offers two reply alternatives, ok and
cancel.
$Returns:
$Arguments: viewId - id of the user agent
dialogId - id of the dialog
message - the message to be present in the dialog
ok - the default ok text may be replaced by alternative text
cancel - the default cancel text may be replaced by alternative
text
*******************************************************************************/
VOID MMIa_confirmDialog (
UCHAR viewId,
UCHAR dialogId,
const WCHAR *message,
const WCHAR *ok,
const WCHAR *cancel
)
{
T_WAP_MMI_CONFIRM_DIALOG_REQ parameter;
#if defined LOG_EXTERNAL
CLNTa_log(viewId, 0, "MMIa_confirmDialog\nUCHAR \t dialogId \t %u\nconst WCHAR * \t message \t %S\nconst WCHAR * \t ok \t %S\nconst WCHAR * \t cancel \t %S\n", (int)dialogId, message, ok, cancel);
#endif
/* SPR#2393 - SH - Now set length of NULL strings to 0 */
parameter.object_id = viewId;
parameter.dialog_id = (UINT8) dialogId;
/* Text of confirm dialog */
parameter.Message = (USHORT*)message;
if (message==NULL)
parameter.message_length = 0;
else
parameter.message_length = (UINT16) GLEa_strlen((GLE_STRING)message);
/* Soft keys */
parameter.Ok_key = (USHORT*)ok;
if (ok==NULL)
parameter.ok_key_length = 0;
else
parameter.ok_key_length = (UINT16) GLEa_strlen((GLE_STRING)ok);
parameter.Cancel_key = (USHORT*)cancel;
if (cancel==NULL)
parameter.cancel_key_length = 0;
else
parameter.cancel_key_length = (UINT16) GLEa_strlen((GLE_STRING)cancel);
W_WAP_MMI_CONFIRM_DIALOG_REQ(¶meter);
return;
}
/*******************************************************************************
$Function: MMIa_promptDialog
$Description: Opens a dialog and prompts for user input.
$Returns:
$Arguments: viewId - id of the user agent
dialogId - id of the dialog
message - the message to be present in the dialog
defaultInput - The initial content for user input.
*******************************************************************************/
VOID MMIa_promptDialog (
UCHAR viewId,
UCHAR dialogId,
const WCHAR *message,
const WCHAR *defaultInput
)
{
T_WAP_MMI_INPUT_DIALOG_REQ parameter;
TRACE_FUNCTION("MMIa_promptDialog");
#if defined LOG_EXTERNAL
CLNTa_log(viewId, 0, "MMIa_promptDialog\nUCHAR \t dialogId \t %u\nconst WCHAR * \t message \t %S\nconst WCHAR * \t defaultInput \t %S\n", (int)dialogId, message, defaultInput);
#endif
/* SPR#2393 - SH - Now set length of NULL strings to 0 */
parameter.object_id = viewId;
parameter.dialog_id = (UINT8) dialogId;
parameter.is_password = FALSE;
parameter.empty_ok = TRUE;
parameter.visible = TRUE;
parameter.size = 100;
/* Title of prompt dialog */
parameter.Title = (USHORT*)message;
if (message==NULL)
parameter.title_length = 0;
else
parameter.title_length = (UINT16) GLEa_strlen((GLE_STRING)message);
/* Text that is already in buffer */
parameter.Input = (USHORT*)defaultInput;
if (defaultInput==NULL)
parameter.input_length = 0;
else
parameter.input_length = (UINT16) GLEa_strlen((GLE_STRING)defaultInput);
/* Formatting of editor */
parameter.format_length = 0;
parameter.Format = NULL;
/* Set dialog_pointer to NULL to indicate this is not a GLE dialog */
parameter.dialog_pointer = NULL;
W_WAP_MMI_INPUT_DIALOG_REQ(¶meter);
return;
}
VOID MMIa_status (
UCHAR viewId,
UCHAR status,
const CHAR *URL
)
{
T_WAP_MMI_CONTROL_IND parameter;
#if defined LOG_EXTERNAL
CLNTa_log(viewId, 0, "MMIa_status\nUCHAR \t status \t %u\nconst CHAR * \t URL \t %s\n", (int)status, URL);
#endif
parameter.object_id = viewId;
parameter.status_code = status;
parameter.error_code = 0;
parameter.play_standard_click = TRUE;
W_WAP_MMI_CONTROL_IND(¶meter); // Send status code to MMI task
}
/*******************************************************************************
$Function: MMIa_passwordDialog
$Description: Opens a dialog containing a password input.
$Returns:
$Arguments: viewId - id of the user agent
dialogId - id of the dialog
realm - provides the user information in order to decide what
id and password this particular server requires.
type - type of authentication required
*******************************************************************************/
VOID MMIa_passwordDialog (
UCHAR viewId,
USHORT dialogId,
const CHAR *realm,
INT8 type
)
{
T_WAP_MMI_PASSWORD_DIALOG_REQ parameter;
#if defined LOG_EXTERNAL
CLNTa_log(viewId, 0, "MMIa_passwordDialog\nUSHORT \t dialogId \t %u\nconst CHAR * \t realm \t %s\nCHAR \t type \t %u\n", (int)dialogId, realm, (int)type);
#endif
/* SPR#2393 - SH - Now set length of NULL strings to 0 */
parameter.object_id = viewId;
parameter.dialog_id = (UINT8) dialogId;
parameter.dialog_type = (UINT8) type;
parameter.Realm = (char*)realm;
if (realm==NULL)
parameter.realm_length = 0;
else
parameter.realm_length = strlen((char*)realm);
W_WAP_MMI_PASSWORD_DIALOG_REQ(¶meter);
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -