⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmibookcalllistwindow.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 2 页
字号:
/*******************************************************************************

					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:		    MmiBookCallListWindow.c
 $Revision:		1.0                                                       
                                                                              
 $Author:		Condat(UK)                                                         
 $Date:		    25/10/00                                                      
                                                                               
********************************************************************************
                                                                              
 Description:

    This module provides the call list window handling for the phone book.
                        
********************************************************************************
 $History: MmiBookCallListWindow.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"
#include "mfw_edt.h"
#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"

#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 "MmiTimers.h"

#include "MmiBookShared.h"



/*******************************************************************************
                                                                              
                      Local Data Structure Definitions
                                                                              
*******************************************************************************/

#define NO_FAILURE (-1)
int 			idCounter = 0;
static char		missedCalls[40];
char			calls[10];




/*******************************************************************************
                                                                              
                               Private Methods
                                                                              
*******************************************************************************/


/*******************************************************************************

 $Function:    	bookCallListSetupEntries

 $Description:	Populates the call list display with the current values
 
 $Returns:		None

 $Arguments:	Current, pointer to the entry in question
 
*******************************************************************************/

static void bookCallListSetupEntries( tMmiPhbData *Current )
{
    T_MFW_PHB_ENTRY	p_pEntry;
	int				index;

	/* search the phone book(s)
	*/
	for ( index = 0; index < Current->list.num_entries; index++ )
	{
//JVJE		if ( bookFindNameInSDNPhonebook( (const char *) Current->entry[ index ].number, &p_pEntry ) )
//JVJE			memcpy( (char *) Current->entry[ index ].name, (char*) &p_pEntry.name, NAME_SCREEN_MAX);
//JVJE		else 
#ifdef NO_ASCIIZ				

		if ( bookFindNameInPhonebook( (const char *) Current->entry[ index ].number, &p_pEntry ) )
		{
			memcpy( (char *) Current->entry[ index ].name.data, (char*) &p_pEntry.name.data, NAME_SCREEN_MAX);
		    Current->entry[ index ].name.len = p_pEntry.name.len;
		}
#else

		if ( bookFindNameInPhonebook( (const char *) Current->entry[ index ].number, &p_pEntry ) )
		{
			memcpy( (char *) Current->entry[ index ].name, (char*) &p_pEntry.name, NAME_SCREEN_MAX);
			Current->entry[ index ].name = p_pEntry.name;
		}

#endif		
	}
}




/*******************************************************************************

 $Function:    	bookCallListDialog

 $Description:	Dialog functino for the phone book call list window
 
 $Returns:		None

 $Arguments:	win, window handle
                event, event to be handled
				value, not used
				parameter, not used
 
*******************************************************************************/

static void bookCallListDialog( 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;
	tMmiPhbData		*Current    = &data->phbk->current;
	MfwMnu *mnu;
	
	int Failure;

    TRACE_FUNCTION ("bookCallListDialog()");
    TRACE_EVENT ("jgg-bookCallListDialog()");

	/* Handle the dialog events
	*/
    switch (event)
	{
		case CALLS_LIST_INIT:
		{
			/* Initialise message
			*/			
			Current->selectedName = Current->missedCallsOffset;
			data->phbk->current.index		= 1;
			data->phbk->current.status.book = (int)parameter;

			/* If we are currently loading the phone book we can't go any
			   further, so indicate a failure condition
			*/
			Failure = ( phb_get_mode() == PHB_LOADING ) ? TxtPleaseWait : NO_FAILURE;

			/* grab the current status of the phone book, and
			   check that it's okay
			*/
			if ( Failure == NO_FAILURE )
			{
				bookGetCurrentStatus( &data->phbk->current.status );
	
				Failure = ( bookFindName( MAX_SEARCH_CALL_LIST, &data->phbk->current ) != MFW_PHB_OK )
					? TxtReadError : NO_FAILURE;
			}

			/* Check for an empty list
			*/
			if ( Failure == NO_FAILURE )
				Failure = ( data->phbk->current.index == 0 ) ? TxtEmptyList : NO_FAILURE;

			/* api patch 03-04-02
			*/
			if ((Failure != NO_FAILURE) &&  (idCounter > 0))
				Failure = NO_FAILURE;
			
			/* If everything is okay we can try to find the name in the
			   phone book, otherwise Failure will contain an error message
			*/
			if ( Failure == NO_FAILURE )
			{
				bookCallListSetupEntries( &data->phbk->current );
				winShow( data->win );
			}
			else
			{
				/* If we get to here and the failure flag isn't NO_FAILURE then
				   it'll be set to the id of the message we need to present, so
				   show the information dialog and destroy the call list window
				*/
				bookShowInformation( data->phbk->win, Failure, NULL, NULL );
				bookCallListDestroy( data->win );
			}
		}
		break;
		case SEARCH_SCROLL_UP:
		{
			/* Scroll up
			*/
			if(( Current->selectedName == 1) && (Current->status.used_entries == 1))
				Current->selectedName = Current->selectedName;
							
			else if ( ( Current->index == 1 ) && ( Current->selectedName == Current->missedCallsOffset ) )
			{
				if ( (Current->status.used_entries + Current->missedCallsOffset) < MAX_SEARCH_CALL_LIST )
					Current->selectedName = Current->status.used_entries -1;
				else
					Current->selectedName =  MAX_SEARCH_CALL_LIST - 1;
				Current->index = Current->status.used_entries + Current->missedCallsOffset - Current->selectedName;
			}	
			else
			{
				if(Current->selectedName == Current->missedCallsOffset)
				{
					if(Current->index == 1 + Current->missedCallsOffset)
						Current->selectedName = Current->missedCallsOffset;
					Current->index--;
				}
				else
					Current->selectedName--;
			}
			mnu = (MfwMnu *) mfwControl( data->menu );
			mnu->lCursor[mnu->level] = Current->selectedName;
			bookFindName( MAX_SEARCH_CALL_LIST, &data->phbk->current );
			bookCallListSetupEntries( &data->phbk->current );
		}
		break;

		case SEARCH_SCROLL_DOWN:
		{
			/* Scroll Down
			*/		
			if ( ( Current->index + Current->selectedName ) == Current->status.used_entries + Current->missedCallsOffset)
			{
				Current->index = 1;
				Current->selectedName = 0 + Current->missedCallsOffset;
			}
			else
			{
				if ( Current->selectedName == MAX_SEARCH_CALL_LIST - 1 )
					Current->index++;
				else
					Current->selectedName++;
			}
			mnu = (MfwMnu *) mfwControl( data->menu );
			mnu->lCursor[mnu->level] = Current->selectedName;
			bookFindName( MAX_SEARCH_CALL_LIST, &data->phbk->current );
			bookCallListSetupEntries( &data->phbk->current );
		}
		break;

		default:
		{
			/* No need to deal with any other events
			*/
		}
		break;
	}
}


/*******************************************************************************

 $Function:    	bookCallListWinCB

 $Description:	Window Event Handler
 
 $Returns:		MFW_EVENT_CONSUMED if event handled, otherwise MFW_EVENT_PASSED

 $Arguments:	standard window event handler, e, event, w, window handle
 
*******************************************************************************/

static int bookCallListWinCB( MfwEvt e, MfwWin *w )
{
	tBookStandard	*data = (tBookStandard *)w->user;
	tMmiPhbData		*Current    = &data->phbk->current;
	char			*ptr;
	MfwMnu *mnu;	
	int				index, i;
	int				Withheld;
	int				displayStart, missedOutput;


	TRACE_FUNCTION("bookCallListWinCB");
	missedOutput = FALSE;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -