HandleFunc.c
资源名称:MenuList.rar [点击查看]
上传用户:duwei1288
上传日期:2009-12-27
资源大小:451k
文件大小:7k
源码类别:
BREW编程
开发平台:
Visual C++
- #include "HandleFunc.h"
- #include "ISettingFile.h"
- #include "WindowStack.h"
- #include "IInputWindow.h"
- #include "AEEAppGen.h"
- #include "MenuList.brh"
- #include "IBookMark.h"
- //set response function declare
- static boolean WAPSetHdl_SetGatewayIPResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK);
- static boolean WAPSetHdl_SetGatewayPortResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK);
- static boolean WAPSetHdl_SetGatewayUSERResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK);
- static boolean WAPSetHdl_SetGatewayPASSWORDResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK);
- static boolean WAPSetHdl_SetDefHomePageNameResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK);
- static boolean WAPSetHdl_SetDefHomePageUrlResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK);
- static boolean WAPSetHdl_OpenUrlResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK);
- //Set function define
- boolean WAPSetHdl_SetConnectTypeWSPCO()
- {
- return ISETTINGFILE_SetInt(WAP_CONNECTSET,CONNECTION_TYPE_WSP_CO);
- }
- boolean WAPSetHdl_SetConnectTypeWSPCL()
- {
- return ISETTINGFILE_SetInt(WAP_CONNECTSET,CONNECTION_TYPE_WSP_CL);
- }
- boolean WAPSetHdl_SetConnectTypeWSPCOWTLS()
- {
- return ISETTINGFILE_SetInt(WAP_CONNECTSET,CONNECTION_TYPE_WSP_CO_WTLS);
- }
- boolean WAPSetHdl_SetConnectTypeHTTP()
- {
- return ISETTINGFILE_SetInt(WAP_CONNECTSET,CONNECTION_TYPE_HTTP);
- }
- boolean WAPSetHdl_SetConnectTypeHTTPSECURITY()
- {
- return ISETTINGFILE_SetInt(WAP_CONNECTSET,CONNECTION_TYPE_HTTP_SECURITY);
- }
- boolean WAPSetHdl_SetConnectTypeWSPCLWTLS()
- {
- return ISETTINGFILE_SetInt(WAP_CONNECTSET,CONNECTION_TYPE_WSP_CL_WTLS);
- }
- boolean WAPSetHdl_SetBookMark()
- {
- return IWINSTACK_OpenWindow(WAPWINID_BOOKMARK,NULL);
- }
- boolean WAPSetHdl_SetOpenUrl()
- {
- AECHAR pUrl[8];
- InputTextInfo Info;
- AEEApplet* pApp=(AEEApplet*)GETAPPINSTANCE();
- ISHELL_LoadResString(pApp->m_pIShell,MENULIST_RES_FILE, IDS_URL,pUrl,sizeof(pUrl));
- Info.m_inputType=IT_TEXT;
- Info.m_pText=ISETTINGFILE_GetStr(WAP_OPENURL);
- Info.m_pTitle=pUrl;
- return NewTextInputDialog(&Info,NULL,WAPSetHdl_OpenUrlResponse);
- }
- boolean WAPSetHdl_SetDefHomePageName()
- {
- AECHAR pName[8];
- InputTextInfo Info;
- AEEApplet* pApp=(AEEApplet*)GETAPPINSTANCE();
- ISHELL_LoadResString(pApp->m_pIShell,MENULIST_RES_FILE, IDS_DEFAULTHOMEPAGENAME,pName,sizeof(pName));
- Info.m_inputType=IT_TEXT;
- Info.m_pText=ISETTINGFILE_GetStr(WAP_DEFHOMEPAGENAME);
- Info.m_pTitle=pName;
- return NewTextInputDialog(&Info,NULL,WAPSetHdl_SetDefHomePageNameResponse);
- }
- boolean WAPSetHdl_SetDefHomePageUrl()
- {
- AECHAR pUrl[8];
- InputTextInfo Info;
- AEEApplet* pApp=(AEEApplet*)GETAPPINSTANCE();
- ISHELL_LoadResString(pApp->m_pIShell,MENULIST_RES_FILE, IDS_DEFAULTHOMEPAGEURL,pUrl,sizeof(pUrl));
- Info.m_inputType=IT_TEXT;
- Info.m_pText=ISETTINGFILE_GetStr(WAP_DEFHOMEPAGEURL);
- Info.m_pTitle=pUrl;
- return NewTextInputDialog(&Info,NULL,WAPSetHdl_SetDefHomePageUrlResponse);
- }
- boolean WAPSetHdl_SetGatewayIP()
- {
- AECHAR pIP[8];
- InputTextInfo Info;
- AEEApplet* pApp=(AEEApplet*)GETAPPINSTANCE();
- ISHELL_LoadResString(pApp->m_pIShell,MENULIST_RES_FILE, IDS_IP,pIP,sizeof(pIP));
- Info.m_inputType=IT_TEXT;
- Info.m_pText=ISETTINGFILE_GetStr(WAP_GATEWAYIP);
- Info.m_pTitle=pIP;
- return NewTextInputDialog(&Info,NULL,WAPSetHdl_SetGatewayIPResponse);
- }
- boolean WAPSetHdl_SetGatewayPort()
- {
- AECHAR pPort[8];
- InputTextInfo Info;
- int nPort;
- char pBuffer[16];
- AECHAR DestWChar[32];
- AEEApplet* pApp=(AEEApplet*)GETAPPINSTANCE();
- ISHELL_LoadResString(pApp->m_pIShell,MENULIST_RES_FILE, IDS_PORT,pPort,sizeof(pPort));
- Info.m_inputType=IT_TEXT;
- nPort = ISETTINGFILE_GetInt(WAP_GATEWAPPORT);
- SPRINTF(pBuffer,"%d",nPort);
- STRTOWSTR(pBuffer,DestWChar,sizeof(DestWChar));
- Info.m_pText= DestWChar;
- Info.m_pTitle=pPort;
- return NewTextInputDialog(&Info,NULL,WAPSetHdl_SetGatewayPortResponse);
- //return ISETTINGFILE_SetInt(WAP_GATEWAPPORT,16);
- }
- boolean WAPSetHdl_SetGatewayUSER()
- {
- AECHAR pUser[16];
- InputTextInfo Info;
- AEEApplet* pApp=(AEEApplet*)GETAPPINSTANCE();
- ISHELL_LoadResString(pApp->m_pIShell,MENULIST_RES_FILE, IDS_USER,pUser,sizeof(pUser));
- Info.m_inputType=IT_TEXT;
- Info.m_pText=ISETTINGFILE_GetStr(WAP_GATEWAPUSER);
- Info.m_pTitle=pUser;
- return NewTextInputDialog(&Info,NULL,WAPSetHdl_SetGatewayUSERResponse);
- }
- boolean WAPSetHdl_SetGatewayPassword()
- {
- AECHAR pPassword[16];
- InputTextInfo Info;
- AEEApplet* pApp=(AEEApplet*)GETAPPINSTANCE();
- ISHELL_LoadResString(pApp->m_pIShell,MENULIST_RES_FILE, IDS_PASSWORD,pPassword,sizeof(pPassword));
- Info.m_inputType=IT_PASSWORD;
- Info.m_pText=ISETTINGFILE_GetStr(WAP_GATEWAPPASSWORD);
- Info.m_pTitle=pPassword;
- return NewTextInputDialog(&Info,NULL,WAPSetHdl_SetGatewayPASSWORDResponse);
- }
- static boolean WAPSetHdl_OpenUrlResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK)
- {
- if(response1)
- return ISETTINGFILE_SetStr(WAP_OPENURL,(AECHAR*)response1);
- else
- return FALSE;
- }
- static boolean WAPSetHdl_SetDefHomePageUrlResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK)
- {
- if(response1)
- return ISETTINGFILE_SetStr(WAP_DEFHOMEPAGEURL,(AECHAR*)response1);
- else
- return FALSE;
- }
- static boolean WAPSetHdl_SetDefHomePageNameResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK)
- {
- if(response1)
- return ISETTINGFILE_SetStr(WAP_DEFHOMEPAGENAME,(AECHAR*)response1);
- else
- return FALSE;
- }
- //set response function define
- static boolean WAPSetHdl_SetGatewayIPResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK)
- {
- if(response1)
- return ISETTINGFILE_SetStr(WAP_GATEWAYIP,(AECHAR*)response1);
- else
- return FALSE;
- }
- static boolean WAPSetHdl_SetGatewayPortResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK)
- {
- char tmpstr[40];
- int Port;
- WSTRTOUTF8(response1, WSTRLEN(response1), (byte*)tmpstr, 40);
- Port = ATOI(tmpstr);
- Port=(Port<65535)?Port:0;
- if(response1)
- return ISETTINGFILE_SetInt(WAP_GATEWAPPORT,Port);
- else
- return FALSE;
- }
- static boolean WAPSetHdl_SetGatewayUSERResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK)
- {
- if(response1)
- return ISETTINGFILE_SetStr(WAP_GATEWAPUSER,(AECHAR*)response1);
- else
- return FALSE;
- }
- static boolean WAPSetHdl_SetGatewayPASSWORDResponse(const AECHAR *response1, const AECHAR *response2, boolean bOK)
- {
- if(response1)
- return ISETTINGFILE_SetStr(WAP_GATEWAPPASSWORD,(AECHAR*)response1);
- else
- return FALSE;
- }