📄 mmibookcalldetailswindow.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: PhoneBook
$File: MmiBookCallDetailsWindow.c
$Revision: 1.0
$Author: Condat(UK)
$Date: 25/10/00
********************************************************************************
Description:
This provides the implementation of the call details window for the
phone book module
********************************************************************************
$History: MmiBookCallDetailsWindow.c
25/10/00 Original Condat(UK) BMI version.
$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 "mfw_mfw.h"
#include "mfw_win.h"
#include "mfw_kbd.h"
#include "mfw_lng.h"
/* SPR#1428 - SH - New Editor changes */
#ifndef NEW_EDITOR
#include "mfw_edt.h"
#endif
#include "mfw_icn.h"
#include "mfw_mnu.h"
#include "mfw_tim.h"
#include "mfw_sim.h"
#include "mfw_cm.h"
#include "mfw_nm.h"
#include "mfw_phb.h"
#include "mfw_mme.h"
#include "mfw_sat.h"
#include "mfw_sms.h"
#include "dspl.h"
#include "ksd.h"
#include "psa.h"
/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
#include "ATBCommon.h"
#include "ATBDisplay.h"
#include "ATBEditor.h"
#include "AUIEditor.h"
#endif
#include "MmiMain.h"
#include "MmiBookController.h"
#include "MmiDummy.h"
#include "MmiDialogs.h"
#include "MmiLists.h"
#include "MmiMenu.h"
#include "MmiCall.h"
#include "MmiIcons.h"
#include "MmiIdle.h"
#include "MmiSoftKeys.h"
#include "MmiSounds.h"
#include "MmiIdle.h"
#include "MmiNetwork.h"
#include "MmiSat_i.h"
#include "MmiAoc.h"
#include "gdi.h"
#include "audio.h"
#include "cus_aci.h"
#include "p_sim.h"
#include "mfw_ffs.h"
#include "MmiTimers.h"
#include "MmiBookShared.h"
#include "MmiCPHS.h"
#include "mmiColours.h"
#define CALLDETAILS_INFO_LEN 32
/*******************************************************************************
Private methods
*******************************************************************************/
/*******************************************************************************
$Function: bookCallDetails
$Description: dialog function for the call details windows
$Returns: None.
$Arguments: win, window handle
event, event to be handled
value, not used
parameter, not used
*******************************************************************************/
static void bookCallDetails( T_MFW_HND win, USHORT event, SHORT value, void * parameter )
{
T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data;
tBookStandard *data = (tBookStandard *)win_data->user;
#ifdef NEW_EDITOR
T_MFW_PHB_ENTRY p_pEntry;
tMmiPhbData current = data->phbk->current;
T_MFW_PHB_ENTRY *my = ¤t.entry[ current.selectedName - current.missedCallsOffset ];
T_ATB_TEXT nameText;
T_ATB_TEXT numberText;
T_ATB_TEXT otherText;
char *TempBuffer = (char *)ALLOC_MEMORY(CALLDETAILS_INFO_LEN);
TRACE_FUNCTION( "bookCallDetails()" );
/* SPR#1428 - SH - New Editor changes
* Moved all this stuff here from the WinCb - it shouldn't be there! */
/* try to get the name from the phone book, null the structure out
if we can't find it at all
*/
if ( bookFindNameInPhonebook( (const char *) my->number, &p_pEntry ) )
{
bookCopyPhbName(my, &p_pEntry,PHB_MAX_LEN);
my->name.len = p_pEntry.name.len;
}
else
{
my->name.len = 0;
}
numberText.dcs = ATB_DCS_ASCII;
numberText.data = my->number;
ATB_string_Length(&numberText);
#ifdef EASY_TEXT_ENABLED
if ( my->name.data[0] ==0x80)
{
/* UNICODE */
nameText.dcs = ATB_DCS_UNICODE;
nameText.data = &my->name.data[2];
}
else
#endif /* EASY_TEXT_ENABLED */
{
/* ASCII */
nameText.dcs = ATB_DCS_ASCII;
nameText.data = my->name.data;
}
ATB_string_Length(&nameText);
ATB_edit_ResetMode(data->editor, ED_MODE_READONLY); /* Switch off read only to add text */
ATB_edit_ClearAll(data->editor); /* Blank the editor */
ATB_edit_InsertString(data->editor, &nameText);
ATB_edit_Char(data->editor, ctrlEnter, FALSE);
ATB_edit_InsertString(data->editor, &numberText);
ATB_edit_Char(data->editor, ctrlEnter, FALSE);
if (CphsPresent() == TRUE)
{
sprintf(TempBuffer, "Line %d", my->line);
otherText.dcs = ATB_DCS_ASCII;
otherText.data = (UBYTE *)TempBuffer;
ATB_string_Length(&otherText);
ATB_edit_InsertString(data->editor, &otherText);
ATB_edit_Char(data->editor, ctrlEnter, FALSE);
}
// API - 21-01-03 - 1566 - Date and Time displayed for Recent calls
sprintf((char*)TempBuffer, "%s%d%d%s%d%d%s%d%d", "Date: ", (UBYTE) my->date.day[0], (UBYTE) my->date.day[1], "/",
(UBYTE) my->date.month[0], (UBYTE) my->date.month[1], "/",
(UBYTE) my->date.year[0], (UBYTE) my->date.year[1]);
otherText.dcs = ATB_DCS_ASCII;
otherText.data = (UBYTE *)TempBuffer;
ATB_string_Length(&otherText);
ATB_edit_InsertString(data->editor, &otherText);
ATB_edit_Char(data->editor, ctrlEnter, FALSE);
// API - 21-01-03 - 1566 - Date and Time displayed for Recent calls
sprintf((char*)TempBuffer, "%s%d%d%s%d%d", "Time: ", (UBYTE) my->time.hour[0], (UBYTE) my->time.hour[1], ":",
(UBYTE) my->time.minute[0], (UBYTE) my->time.minute[1]);
otherText.dcs = ATB_DCS_ASCII;
otherText.data = (UBYTE *)TempBuffer;
ATB_string_Length(&otherText);
ATB_edit_InsertString(data->editor, &otherText);
ATB_edit_SetMode(data->editor, ED_MODE_READONLY); /* Switch on read only again */
FREE_MEMORY((void *)TempBuffer, CALLDETAILS_INFO_LEN);
/* show the editor and update the soft keys
*/
/* SH - the string has changed, so we need to refresh the word-wrap */
ATB_edit_Refresh(data->editor);
win_show(data->win);
#else /* NEW_EDITOR */
if ( event == CALL_DETAILS_INIT )
winShow( data->win );
#endif /* NEW_EDITOR */
}
/*******************************************************************************
$Function: bookCallDetailsWinCB
$Description: Window call back function
$Returns: MFW_EVENT_CONSUMED
$Arguments: e, event to be handles, w, window handle
*******************************************************************************/
static int bookCallDetailsWinCB( MfwEvt e, MfwWin *w )
{
tBookStandard * data = (tBookStandard *)w->user;
TRACE_FUNCTION("bookCallDetailsWinCB");
switch( e )
{
case MfwWinVisible:
{
/* SPR#1428 - SH - New Editor changes - Just show editor, calculate text
* string to display in bookCallDetails() */
#ifdef NEW_EDITOR
ATB_edit_Show(data->editor);
resources_setTitleColour(COLOUR_EDITOR);
/* TITLE */
dspl_Clear(0,0, SCREEN_SIZE_X-1, data->editor->attr->win_size.py-1);
PROMPT(0,0,0,TxtDetails);
#else /* NEW_EDITOR */
char TempBuffer[32];
T_MFW_PHB_ENTRY p_pEntry;
tMmiPhbData current = data->phbk->current;
T_MFW_PHB_ENTRY *my = ¤t.entry[ current.selectedName - current.missedCallsOffset ];
/* default screen update prior to painting below
*/
dspl_ClearAll();
/* try to get the name from the phone book, null the structure out
if we can't find it at all
*/
#ifdef NO_ASCIIZ
{
UBYTE result;
if ( bookFindNameInPhonebook( (const char *) my->number, &p_pEntry ) )
{
//GW Copy name and length
bookCopyPhbName(my, &p_pEntry,PHB_MAX_LEN);
my->name.len = p_pEntry.name.len;
}
else
{
TRACE_EVENT(">>>>Length set to zero");
my->name.len = 0;
}
}
#else /* NO_ASCIIZ */
if ( bookFindNameInPhonebook( (const char *) my->number, &p_pEntry ) )
bookCopyPhbName(my, &p_pEntry, NAME_SCREEN_MAX); //GW Copy name
else
memset( (char*) my->name, '\0', NAME_SCREEN_MAX );
#endif /* NO_ASCIIZ */
memset((char*)TempBuffer ,'\0',32);
TRACE_EVENT_P4("TIME = %d%d:%d%d", (UBYTE)my->time.hour[0], (UBYTE)my->time.hour[1],
(UBYTE)my->time.minute[0], (UBYTE)my->time.minute[1]);
TRACE_EVENT_P6("DATE = %d%d/%d%d/%d%d",
(UBYTE)my->date.day[0], (UBYTE)my->date.day[1],
(UBYTE)my->date.month[0], (UBYTE)my->date.month[1],
(UBYTE)my->date.year[0], (UBYTE)my->date.year[1]);
/* API - 1203 - 30/09/02 - Add the Data and the Time to the TempBuffer to be shown when the details of a
LDN, LMN etc is looked at. Currently commented out as the ACI does not store the
numbers at present and garbage would be displayed.
*/
/* API - 1542 - 10/01/03 - Update from issue above Added the values written to the structure by ACI to
display them to the user.
*/
sprintf((char*)TempBuffer,"%s%d%d%s%d%d%s %s%d%d%s%d%d%s%d%d%s",
"Time: ", (UBYTE) my->time.hour[0], (UBYTE) my->time.hour[1], ":",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -