#ifdef __MMI_VCARD_SUPPORT__
#include "widgets_gl03.h"
#include "widgets_wm.h"
#include "widgets_tb.h"
#include "widgets_ge01.h"
#include "mp_driver_lcd_interface.h"
#include "widgets_lb.h"
#include "appglf03.h"
#include "widgets_tm.h"
#include "appmuf07.h"
#include "appvobjf01.h"
#include "appvcardf01.h"
#include "appvcardw01.h"
#include "appglf12.h"
#include "appglf09.h"
#include "mp_mg_type.h"
extern APP_VCARD_CONTENT_STRUCT* g_vcard_content;
LOCAL AppResultType HandleVcardStringEditWinMsg(
WIDGETS_WIN_ID_T win_id,
WidgetsMsgId msg_id,
DPARAM param
);
LOCAL AppResultType HandleVcardContentEditWinMsg
(
WidgetsWinId win_id,
WidgetsMsgId msg_id,
DPARAM param
);
WINDOW_TABLE( MMIVCARD_STRING_EDIT_WIN_TAB ) =
{
WIN_PRIO( WIN_ONE_LEVEL ),
WIN_TITLE_ID( TXT_PB_NAME),
WIN_FUNC((Int32) HandleVcardStringEditWinMsg ),
WIN_ID( MMIVCARD_STRING_EDIT_WIN_ID ),
CREATE_TEXTEDITBOX_CTRL(0,
WIDGETS_CLIENT_RECT_TOP,
WIDGETS_MAINSCREEN_RIGHT_MAX_PIXEL,
WIDGETS_INPUT_EDITBOX_BOTTOM,
0,0,
APP_IM_DEFAULT_ALL_INPUT_MODE_SET,
IM_PINYIN_MODE,
MMIVCARD_STRING_EDITWIN_CTRL_ID),
END_WIN
};
WINDOW_TABLE( MMIVCARD_EDIT_MYVCARD_WIN_TAB ) =
{
CLEAR_LCD,
WIN_PRIO( WIN_ONE_LEVEL ),
WIN_TITLE_ID( TXT_SMS_EDIT),
WIN_FUNC( (Int32)HandleVcardContentEditWinMsg ),
WIN_ID( MMIVCARD_MYVCARD_EDIT_WIN_ID),
CREATE_LISTBOX_CTRL(WIDGETS_LISTBOX_LEFT, WIDGETS_CLIENT_RECT_TOP, WIDGETS_MAINSCREEN_RIGHT_MAX_PIXEL, WIDGETS_CLIENT_RECT_BOTTOM,
LISTBOX_TEXTLIST_E, LISTBOX_TEXT1_E,
MMIVCARD_EDIT_CONTENT_LISTBOX_CTRL_ID),
END_WIN
};
/*****************************************************************************/
// Description : 根据记录设置列表项内容
// Global resource dependence : none
// Author: anweifeng
// Note:
/*****************************************************************************/
void appVcardSetVcardDetailList(APP_VCARD_CONTENT_STRUCT* vcard_content_p
,WIDGETS_CTRL_ID_T ctrl_id)
{
Int16 max_num = 0,list_index=0;
WidgetsStringType disp_str={0};
WidgetsListBoxItemType add_item={0};
if(vcard_content_p == PNULL)
{
WINGTECH_ASSERT(0);
return;
}
WINGTECH_MEMSET(&add_item,0,sizeof(WidgetsListBoxItemType));
WINGTECH_MEMSET(&disp_str,0,sizeof(WidgetsStringType));
widgetsLbGetTotalItemNum(ctrl_id, &max_num);
if(max_num==0)
{//初始化
Int8 i;
max_num = APPVCARD_DETAIL_TYPE_MAX;
widgetsLbSetMaxItem(ctrl_id,max_num);
for(i=0;i<max_num;i++)
{
widgetsLbAppendItem(ctrl_id,&add_item);
}
}
add_item.softkey_id[0] = TXT_EDIT;
add_item.softkey_id[1] = TXT_NULL;
add_item.softkey_id[2] = STXT_RETURN;
add_item.left_icon_id=IMAGE_PHONEBOOK_NAME;
//set 姓名 display string and icon
if(WINGTECH_WSTRLEN(vcard_content_p->name)>0)
{
add_item.is_ucs2 = TRUE;
add_item.str_len = WINGTECH_WSTRLEN(vcard_content_p->name)*2;
WINGTECH_MEMCPY(add_item.str,vcard_content_p->name,add_item.str_len*2);
}
else
{
appglGetLabelTextByLang(TXT_PB_NAME,&disp_str);
add_item.is_ucs2 = disp_str.is_ucs2;
add_item.str_len = disp_str.length;
WINGTECH_MEMCPY(add_item.str,disp_str.str_ptr,disp_str.length);
}
widgetsLbReplaceItem(ctrl_id, &add_item, list_index++);
//set 个人电话display string and icon
add_item.softkey_id[0] = STXT_OK;
add_item.left_icon_id=IMAGE_PHONEBOOK_PHONE;
if(WINGTECH_STRLEN(vcard_content_p->phone_number)>0)
{
add_item.is_ucs2 = FALSE;
add_item.str_len = WINGTECH_STRLEN(vcard_content_p->phone_number);
WINGTECH_MEMCPY(add_item.str,vcard_content_p->phone_number,add_item.str_len);
}
else
{
appglGetLabelTextByLang(TXT_PB_NUM_TYPE_PRIVATE,&disp_str);
add_item.is_ucs2 = disp_str.is_ucs2;
add_item.str_len = disp_str.length;
WINGTECH_MEMCPY(add_item.str,disp_str.str_ptr,disp_str.length);
}
widgetsLbReplaceItem(ctrl_id, &add_item, list_index++);
//set 住宅电话display string and icon
add_item.softkey_id[0] = STXT_OK;
add_item.left_icon_id=IMAGE_PHONEBOOK_HOME_NUMBER;
if(WINGTECH_STRLEN(vcard_content_p->home_number)>0)
{
add_item.is_ucs2 = FALSE;
add_item.str_len = WINGTECH_STRLEN(vcard_content_p->home_number);
WINGTECH_MEMCPY(add_item.str,vcard_content_p->home_number,add_item.str_len);
}
else
{
appglGetLabelTextByLang(TXT_PB_NUM_TYPE_HOME,&disp_str);
add_item.is_ucs2 = disp_str.is_ucs2;
add_item.str_len = disp_str.length;
WINGTECH_MEMCPY(add_item.str,disp_str.str_ptr,disp_str.length);
}
widgetsLbReplaceItem(ctrl_id, &add_item, list_index++);
//set 传真display string and icon
add_item.softkey_id[0] = STXT_OK;
add_item.left_icon_id=IMAGE_PHONEBOOK_HOME_NUMBER;
if(WINGTECH_STRLEN(vcard_content_p->fax_number)>0)
{
add_item.is_ucs2 = FALSE;
add_item.str_len = WINGTECH_STRLEN(vcard_content_p->fax_number);
WINGTECH_MEMCPY(add_item.str,vcard_content_p->fax_number,add_item.str_len);
}
else
{
appglGetLabelTextByLang(TXT_PB_NUM_TYPE_FAX,&disp_str);
add_item.is_ucs2 = disp_str.is_ucs2;
add_item.str_len = disp_str.length;
WINGTECH_MEMCPY(add_item.str,disp_str.str_ptr,disp_str.length);
}
widgetsLbReplaceItem(ctrl_id, &add_item, list_index++);
//set 公司电话display string and icon
add_item.softkey_id[0] = STXT_OK;
add_item.left_icon_id=IMAGE_PHONEBOOK_COMPANY_NUMBER;
if(WINGTECH_STRLEN(vcard_content_p->office_number)>0)
{
add_item.is_ucs2 = FALSE;
add_item.str_len = WINGTECH_STRLEN(vcard_content_p->office_number);
WINGTECH_MEMCPY(add_item.str,vcard_content_p->office_number,add_item.str_len);
}
else
{
appglGetLabelTextByLang(TXT_PB_NUM_TYPE_OFFICE,&disp_str);
add_item.is_ucs2 = disp_str.is_ucs2;
add_item.str_len = disp_str.length;
WINGTECH_MEMCPY(add_item.str,disp_str.str_ptr,disp_str.length);
}
widgetsLbReplaceItem(ctrl_id, &add_item, list_index++);
//set 公司名称display string and icon
add_item.softkey_id[0] = TXT_EDIT;
add_item.left_icon_id=IMAGE_PHONEBOOK_MAIL_ADDRESS;
if(WINGTECH_WSTRLEN(vcard_content_p->company_name)>0)
{
add_item.is_ucs2 = TRUE;
add_item.str_len = WINGTECH_WSTRLEN(vcard_content_p->company_name)*2;
WINGTECH_MEMCPY(add_item.str,vcard_content_p->company_name,add_item.str_len*2);
}
else
{
appglGetLabelTextByLang(TXT_PB_COMPANY_NAME,&disp_str);
add_item.is_ucs2 = disp_str.is_ucs2;
add_item.str_len = disp_str.length;
WINGTECH_MEMCPY(add_item.str,disp_str.str_ptr,disp_str.length);
}
widgetsLbReplaceItem(ctrl_id, &add_item, list_index++);
//set 邮箱display string and icon
add_item.softkey_id[0] = TXT_EDIT;
add_item.left_icon_id=IMAGE_PHONEBOOK_MAIL_ADDRESS;
if(WINGTECH_STRLEN(vcard_content_p->email_address)>0)
{
add_item.is_ucs2 = TRUE;
add_item.str_len = WINGTECH_WSTRLEN(vcard_content_p->email_address)*2;
WINGTECH_MEMCPY(add_item.str,vcard_content_p->email_address,add_item.str_len*2);
}
else
{
appglGetLabelTextByLang(TXT_PB_MAIL,&disp_str);
add_item.is_ucs2 = disp_str.is_ucs2;
add_item.str_len = disp_str.length;
WINGTECH_MEMCPY(add_item.str,disp_str.str_ptr,disp_str.length);
}
widgetsLbReplaceItem(ctrl_id, &add_item, list_index++);
}
/*****************************WINGTECH版权所有!****************************************
* 函数名称: HandleNameEditWinMsg
* 功能描述: 姓名编辑框消息函数
* 参数说明:
* 函数类型: 事件
* 返 回 值: void
* 其它说明:WINGTECH版权所有! add by wingtech-001
******************************WINGTECH版权所有!****************************************/
LOCAL AppResultType HandleVcardStringEditWinMsg(
WIDGETS_WIN_ID_T win_id,
WidgetsMsgId msg_id,
DPARAM param
)
{
WidgetsEditBoxStringInfoType edit_string;
AppResultType r