📄 jpim_phonebook.c
字号:
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2001
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* jpim_phonebook.c
*
* Project:
* --------
* Maui_Software
*
* Description:
* ------------
* This file defines CMCC phonebook native API
*
* Author:
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
*****************************************************************************/
/*************************************************************************
* Include Statements
*************************************************************************/
#include "j2me_custom_option.h"
#if defined(SUPPORT_JSR_75_PIM) || defined(SUPPORT_CMCC)
#include "MMI_features.h"
#include "kal_release.h"
#include "stack_common.h"
#include "stack_msgs.h"
#include "task_main_func.h"
#include "app_ltlcom.h"
#include "j2me_trace.h"
#include "jvm_interface.h"
#include "jpim_interface.h"
#include "jpim_internal.h"
#include "jvm_adaptor.h"
#include "app_str.h"
#ifdef __MMI_DUAL_SIM_MASTER__
#include "MTPNP_AD_resdef.h"
#endif
/*************************************************************************
* Function Definition
*************************************************************************/
extern kal_eventgrpid J2ME_pim_event_group;
//===========================================================================
// PIM GLOBAL USE
//===========================================================================
/*****************************************************************************
* FUNCTION
* jpim_transfer_error_code
* DESCRIPTION
* PARAMETERS
* type [IN]
* code [IN]
* RETURNS
*****************************************************************************/
kal_int32 jpim_transfer_error_code(kal_int32 type, kal_int32 code)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if(type == JPIM_PHONEBOOK)
{
switch(code)
{
case MMI_PHB_JAVA_ERROR: return JPIM_ERROR;
case MMI_PHB_JAVA_SUCCESS: return JPIM_SUCCESS;
case MMI_PHB_JAVA_NOT_READY: return JPIM_NOT_READY;
case MMI_PHB_JAVA_NOT_SUPPORT: return JPIM_NOT_SUPPORT;
case MMI_PHB_JAVA_NOT_FOUND: return JPIM_NOT_FOUND;
case MMI_PHB_JAVA_STORAGE_FULL: return JPIM_STORAGE_FULL;
case MMI_PHB_JAVA_NUMBER_TOO_LONG: return JPIM_NUMBER_TOO_LONG;
case MMI_PHB_JAVA_FDN_ON: return JPIM_FDN_ON;
case MMI_PHB_JAVA_OUT_OF_INDEX: return JPIM_OUT_OF_INDEX;
case MMI_PHB_JAVA_EMAIL_FULL: return JPIM_EMAIL_FULL;
case MMI_PHB_JAVA_ANR_FULL: return JPIM_ANR_FULL;
default:
return JPIM_ERROR;
}
}
#if defined(SUPPORT_JSR_75_PIM)
else if(type == JPIM_EVENTDB)
{
switch(code)
{
case MMI_EVTDB_JAVA_TDL_EXPIRED_ALARM : return JPIM_SUCCESS;
case MMI_EVTDB_JAVA_SUCCESS: return JPIM_SUCCESS;
case MMI_EVTDB_JAVA_NOT_SUPPORT: return JPIM_NOT_SUPPORT;
case MMI_EVTDB_JAVA_TDL_NOT_READY: return JPIM_NOT_READY;
case MMI_EVTDB_JAVA_NOT_FOUND: return JPIM_NOT_FOUND;
case MMI_EVTDB_JAVA_STORAGE_FULL: return JPIM_STORAGE_FULL;
case MMI_EVTDB_JAVA_DELETE_FAIL: return JPIM_DELETE_FAIL;
case MMI_EVTDB_JAVA_OUT_OF_INDEX: return JPIM_OUT_OF_INDEX;
case MMI_EVTDB_JAVA_INVALID_HANDLE: return JPIM_INVALID_HANDLE;
case MMI_EVTDB_JAVA_INVALID_DATE: return JPIM_INVALID_DATE;
case MMI_EVTDB_JAVA_TDL_INVALID_START_TIME: return JPIM_INVALID_START_TIME;
case MMI_EVTDB_JAVA_TDL_INVALID_END_TIME: return JPIM_INVALID_END_TIME;
case MMI_EVTDB_JAVA_TDL_INVALID_NOTES: return JPIM_INVALID_NOTES;
case MMI_EVTDB_JAVA_TDL_INVALID_ALARM: return JPIM_INVALID_ALARM;
case MMI_EVTDB_JAVA_TDL_INVALID_REPEAT: return JPIM_INVALID_REPEAT;
case MMI_EVTDB_JAVA_ERROR: return JPIM_ERROR;
default:
return JPIM_ERROR;
}
}
#endif
else
{
ASSERT(0);
}
return code;
}
/*****************************************************************************
* FUNCTION
* jpim_transfer_error_code
* DESCRIPTION
* PARAMETERS
* type [IN]
* code [IN]
* RETURNS
*****************************************************************************/
kal_int32 jpim_transfer_phb_sort(kal_int32 sort)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
switch(sort)
{
case JPIM_PHB_NO_SORT: return MMI_PHB_NO_SORT;
case JPIM_PHB_SORT_BY_NAME: return MMI_PHB_BY_NAME;
case JPIM_PHB_SORT_BY_EMAIL: return MMI_PHB_BY_EMAIL;
case JPIM_PHB_SORT_BY_NUMBER: return MMI_PHB_BY_NUMBER;
default:
ASSERT(0);
return MMI_PHB_BY_NAME;
}
}
/*****************************************************************************
* FUNCTION
* jpim_transfer_error_code
* DESCRIPTION
* PARAMETERS
* type [IN]
* code [IN]
* RETURNS
*****************************************************************************/
kal_int32 jpim_transfer_phb_storage(kal_int32 storage)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
switch(storage)
{
case JPIM_PHB_STORAGE_NONE: return MMI_STORAGE_NONE;
case JPIM_PHB_SIM: return MMI_SIM;
#ifdef __MMI_DUAL_SIM_MASTER__
case JPIM_PHB_SIM2: return MMI_SIM2;
#endif
case JPIM_PHB_NVRAM: return MMI_NVRAM;
case JPIM_PHB_STORAGE_BOTH: return MMI_STORAGE_BOTH;
default:
ASSERT(0);
return MMI_STORAGE_BOTH;
}
}
/*****************************************************************************
* FUNCTION
* jpim_transfer_error_code
* DESCRIPTION
* PARAMETERS
* type [IN]
* code [IN]
* RETURNS
*****************************************************************************/
kal_bool jpim_check_vm_state(kal_bool write)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
kal_int32 state;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
state = jvm_get_state();
if (state == JVM_PAUSED_STATE || state == JVM_TERMINATE_STATE)
{
JPIM_DEBUG(TRACE_GROUP_2, JPIM_CHECK_VM_STATE, write, state);
return KAL_FALSE;
}
if (write)
{
if (state == JVM_FG_RUNNING_STATE || state == JVM_SHORT_EVENT_STATE)
{
return KAL_TRUE;
}
else
{
JPIM_DEBUG(TRACE_GROUP_2, JPIM_CHECK_VM_STATE, write, state);
return KAL_FALSE;
}
}
return KAL_TRUE;
}
/*****************************************************************************
* FUNCTION
* jpim_send_ilm
* DESCRIPTION
* PARAMETERS
* local_para_ptr [?]
* msg_id [IN]
* RETURNS
* void
*****************************************************************************/
void jpim_send_ilm(void *local_para_ptr, msg_type msg_id)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
ilm_struct *ilm_ptr;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
ilm_ptr = allocate_ilm(MOD_J2ME);
ilm_ptr->src_mod_id = MOD_J2ME;
ilm_ptr->dest_mod_id = MOD_MMI;
ilm_ptr->msg_id = msg_id;
ilm_ptr->local_para_ptr = (local_para_struct*) local_para_ptr;
ilm_ptr->peer_buff_ptr = (peer_buff_struct*) NULL;
SEND_ILM(MOD_J2ME, MOD_MMI, MMI_J2ME_SAP, ilm_ptr);
}
//===========================================================================
// PHONEBOOK
//===========================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -