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

📄 plxbrowpublic.c

📁 mtk wap和mms代码。。适应mtk 25。26平台
💻 C
📖 第 1 页 / 共 2 页
字号:
\****************************************************************************/
char* GetPBUIBookmarkFilePath(void)
{
#ifdef __PLXBROW_DIR_SYSTEM_
	strcpy(TempUIPath,(const char*)BrowserUISysRoot);
#else
	strcpy(TempUIPath,(const char*)BrowserUIAppRoot);
#endif
	strcat(TempUIPath,(const char*)PLXBROW_BOOKMARK_FILENAME);
	return TempUIPath;
}


/****************************************************************************
* Function	char* GetPBUISavePageDirectory(void)
* Purpose		 
* Params	
* Return	
* Remarks	
\****************************************************************************/
char* GetPBUISavePageDirectory(void)
{
	strcpy(TempUIPath,(const char*)BrowserUIAppRoot);
	strcat(TempUIPath,(const char*)PLXBROW_FILE_DOWNLOAD_PATH);
	return TempUIPath;
}


/****************************************************************************
* Function	char* GetPBUISettingFilePath(void)
* Purpose		 
* Params	
* Return	
* Remarks	
\****************************************************************************/
char* GetPBUISettingFilePath(void)
{
#ifdef __PLXBROW_DIR_SYSTEM_
	strcpy(TempUIPath,(const char*)BrowserUISysRoot);
#else
	strcpy(TempUIPath,(const char*)BrowserUIAppRoot);
#endif
	strcat(TempUIPath,(const char*)PLXBROW_SETTING_FILENAME);
	return TempUIPath;
}


/****************************************************************************
* Function	char* GetPBUIPushBoxDirectory(void)
* Purpose		 
* Params	
* Return	
* Remarks	
\****************************************************************************/
char* GetPBUIPushBoxDirectory(void)
{
	strcpy(TempUIPath,(const char*)BrowserUIAppRoot);
	strcat(TempUIPath,(const char*)PLXBROW_PUSHBOX_DIR_PATH);
	return TempUIPath;
}


/****************************************************************************
* Function	char* GetPBUICacheFilePath(void)
* Purpose		 
* Params	
* Return	
* Remarks	
\****************************************************************************/
char* GetPBUICacheFilePath(void)
{
	strcpy(TempUIPath,(const char*)BrowserUIAppRoot);
	strcat(TempUIPath,(const char*)PLXBROW_CACHE_FILENAME);
	return TempUIPath;
}


/****************************************************************************
* Function	char* GetPBUICookieFilePath(void)
* Purpose		 
* Params	
* Return	
* Remarks	
\****************************************************************************/
char* GetPBUICookieFilePath(void)
{
	strcpy(TempUIPath,(const char*)BrowserUIAppRoot);
	strcat(TempUIPath,(const char*)PLXBROW_COOKIE_FILENAME);
	return TempUIPath;
}



/****************************************************************************
* Function	
* Purpose		 
* Params	
* Return	
* Remarks	
\****************************************************************************/
static void RemoveDirWithFile(const WCHAR* strDir)
{
	FS_HANDLE		handle;
	FS_DOSDirEntry	file_info;
	char			strFindMode[40];
	int				nAttrib;
	char*			strPath;
	char*			strCurrPath;
	static  int		nNum = 0;

	if(nNum > 10)   
		return; 
	if(NULL == (strCurrPath = PlxAppMalloc(PLXBROW_MAX_PATH)))
		return;
	if(NULL == (strPath = PlxAppMalloc(PLXBROW_MAX_PATH)))
	{
		PlxAppFree(strCurrPath);
		return;
	}
	FS_GetCurrentDir((WCHAR*)strCurrPath,PLXBROW_MAX_PATH);
	FS_SetCurrentDir((const WCHAR*)strDir);
	AnsiiToUnicodeString((S8 *)strFindMode, (S8 *)"*.*");
	if(0 > (handle = FS_FindFirst((WCHAR *)strFindMode, 0, 0, &file_info, (WCHAR *)strPath, PLXBROW_MAX_PATH)))
	{
		FS_SetCurrentDir((const WCHAR*)strCurrPath);
		PlxAppFree(strCurrPath);
		PlxAppFree(strPath);
		return;
	}
	nAttrib = FS_GetAttributes((const WCHAR*) strPath);
	if(FS_ATTR_DIR & nAttrib)
	{
		nNum ++;
		RemoveDirWithFile((const WCHAR*)strPath);
		nNum --;
		FS_RemoveDir((const WCHAR*)strPath);
	}
	else
		FS_Delete((const WCHAR*)strPath);
	
	while(FS_NO_ERROR == FS_FindNext(handle,&file_info,(WCHAR*)strPath,PLXBROW_MAX_PATH))
	{
		nAttrib = FS_GetAttributes((const WCHAR*) strPath);
		if(FS_ATTR_DIR & nAttrib)
		{
			nNum ++;
			RemoveDirWithFile((const WCHAR*)strPath);
			nNum --;
			FS_RemoveDir((const WCHAR*)strPath);
		}
		else
			FS_Delete((const WCHAR*)strPath);
	}
	FS_FindClose(handle);
	FS_SetCurrentDir((const WCHAR*)strCurrPath);
	PlxAppFree(strCurrPath);
	PlxAppFree(strPath);
}


/****************************************************************************
* Function	
* Purpose		 
* Params	
* Return	
* Remarks	
\****************************************************************************/
void PlxWapDeleteFile(WIEFILETYPE  nType)
{
	char			strWidePath[100];

	if(nType < WAPFILE_HISTORY || nType > WAPFILE_PUSH)
		return;
	switch(nType)
	{
	case WAPFILE_HISTORY:
		AnsiiToUnicodeString((S8 *)strWidePath, (S8 *)GetPBUIHistoryFilePath());
		break;
	case WAPFILE_BOOKMARK:
		AnsiiToUnicodeString((S8 *)strWidePath, (S8 *)GetPBUIBookmarkFilePath());
		break;
	case WAPFILE_SETTING:
		AnsiiToUnicodeString((S8 *)strWidePath, (S8 *)GetPBUISettingFilePath());
		break;
	case WAPFILE_COOKIE:
		AnsiiToUnicodeString((S8 *)strWidePath, (S8 *)GetPBUICookieFilePath());
		break;
	case WAPFILE_CACHE:
		AnsiiToUnicodeString((S8 *)strWidePath, (S8 *)GetPBUICacheFilePath());
		break;
	case WAPFILE_PAGE:
		AnsiiToUnicodeString((S8 *)strWidePath, (S8 *)GetPBUISavePageDirectory());
		break;
	case WAPFILE_PUSH:
		AnsiiToUnicodeString((S8 *)strWidePath, (S8 *)GetPBUIPushBoxDirectory());
		break;
	default:
		return;
	}
	if(WAPFILE_PAGE != nType && WAPFILE_PUSH != nType)
		FS_Delete((const WCHAR*)strWidePath);
	else if(WAPFILE_PAGE == nType || WAPFILE_PUSH == nType)
		RemoveDirWithFile((const WCHAR*)strWidePath);
	return;
}


/****************************************************************************
* Function	
* Purpose		 
* Params	
* Return	
* Remarks	
\****************************************************************************/
void PAPP_WapCleanup(WIEFILETYPE nType)
{
	PlxWapDeleteFile(nType);
}


/****************************************************************************
* Function	BOOL PlxBrowIsFlashAvailabe(unsigned long lSize, const char* dir)
* Purpose		 
* Params	
* Return	
* Remarks	
\****************************************************************************/
BOOL PlxBrowIsFlashAvailabe(unsigned long lSize, const char* dir)
{
	return WB_IsFlashAvailable(lSize, dir);
}


/****************************************************************************
* Function	void ExecGeneralKeyEndHandler (FuncPtr handler)
* Purpose		 
* Params	
* Return	
* Remarks	
\****************************************************************************/
#include "..\..\setting\settinginc\Settingdefs.h"
#include "..\..\setting\settinginc\Settingsgdcl.h"
extern pBOOL isInCall(void);
extern void HangupAllCalls(void);
extern SecuritySetupContext gSecuritySetupContext;
extern pBOOL GetWapCallPresent(void);

#ifdef __MMI_EMAIL__
#include "..\..\emailapp\emailappinc\Emailappgprot.h"
extern U8 mmi_email_util_get_stop_cause(void);
extern void mmi_email_main_goto_idle (void);
#endif


void ExecGeneralKeyEndHandler (FuncPtr handler)
{
	if ( isInCall() && !GetWapCallPresent() ) {
		HangupAllCalls();
	}
    else
	{
#ifdef __MMI_EMAIL__
		if (mmi_email_util_get_stop_cause()==EMAIL_MODULE_ACTIVE_NOW)
		{
			mmi_email_main_goto_idle();
		}
		else if (!gSecuritySetupContext.PINBlocked) 
#else
			if (!gSecuritySetupContext.PINBlocked) 
#endif
			{
				handler ();
			}
	}
}


/****************************************************************************
* Function	void BROW_RepaintSpecialArea (int x1, int y1, int x2, int y2)
* Purpose		 
* Params	
* Return	
* Remarks	
\****************************************************************************/
extern BROWINFO plxBrowInfo;
/* to solve the problem of some platform clip can not be effect*/
void BROW_RepaintSpecialArea (int x1, int y1, int x2, int y2)
{
#ifdef _PLXBROW_NO_GIF_CLIP_
	WB_RECT rcClip;
	
	rcClip.left = plxBrowInfo.rcInScreen.left;
	rcClip.top = plxBrowInfo.rcInScreen.top;
	rcClip.right = plxBrowInfo.rcInScreen.right;
	rcClip.bottom = plxBrowInfo.rcInScreen.bottom;
	
	pixtel_UI_lock_double_buffer();
	pixtel_UI_push_clip();
	pixtel_UI_set_clip (0, 0, UI_device_width-1,UI_device_height-1);
	
	if ( y1 < rcClip.top ) {
		show_status_icons ();
		draw_title();
		show_title_status_icon();

		/* fill top invalid area */
		gdi_draw_solid_rect (rcClip.left, MMI_title_y+MMI_title_height, rcClip.right, rcClip.top-1, 
			GDI_RGB_TO_BUFFER_FORMAT(255,255,255));
	}
	if ( y2 > rcClip.bottom ) {
		show_softkey_background();
		show_left_softkey();
		show_right_softkey();
		gdi_draw_solid_rect (rcClip.left, rcClip.bottom + 1, rcClip.right, UI_device_height-MMI_button_bar_height-1,
			GDI_RGB_TO_BUFFER_FORMAT(255,255,255));
	}

	pixtel_UI_pop_clip ();
	pixtel_UI_unlock_double_buffer();
	pixtel_UI_BLT_double_buffer(0,MMI_title_y,UI_device_width-1,UI_device_height-1);
#endif
}

/********************** Hot Swap *************************/
#ifdef __PLXBROW_SUPPORT_HOTPLUG_

#ifdef  MMI_ON_HARDWARE_P
#include "Kal_release.h"
#include "msdc_def.h"
#endif


#ifndef  MMI_ON_HARDWARE_P
static  int  g_PlxBrowMemoryCardId =  1;// 1 :  SD_CARD ;  
#else
static  int  g_PlxBrowMemoryCardId = SD_CARD ;  
#endif // MMI_ON_HARDWARE_P




/****************************************************************************
* Function	void PAPP_WapOnHotPlugging(int bPlug, int nCardId)
* Purpose		 
* Params	
* Return	
* Remarks	Call this function when the memory card is plug in out pull out
\****************************************************************************/
extern void PlxBrowSetWapStatusIcon(void);
extern int  PlxBrowIsBrowserInit(void);

void PAPP_WapOnHotPlugging(int bPlug, int nCardId)
{
	if(1 == bPlug)  //  插卡 
	{
		if(0 <= nCardId)
			g_PlxBrowMemoryCardId = nCardId;
	}
	if(0 != PlxBrowIsBrowserInit())
		PlxBrowSetWapStatusIcon();
	return;
}


/****************************************************************************
* Function	int PlxBrowIsMemCardPluged(void)
* Purpose		 
* Params	
* Return	
* Remarks	
\****************************************************************************/
int PlxBrowIsMemCardPluged(void)
{
//	return FS_NO_ERROR == FS_TestMSDC(g_PlxBrowMemoryCardId);
//    return PLIB_IsMSDCPresent();
    return PLIB_TestMSDC();
}

#endif// __PLXBROW_SUPPORT_HOTPLUG_

⌨️ 快捷键说明

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