#include "StdAfx.h" #include "MBThumbnailType.h" CMBThumbnailType::CMBThumbnailType(void) { } CMBThumbnailType::~CMBThumbnailType(void) { } SStringT CMBThumbnailType::GetSThumbnailSkin( CString &strDocType ) { if( 0 == _tcscmp(strDocType,_T(".apk") )) { return _T("skin_file_icon_s_apktype"); } else if( 0 == _tcscmp(strDocType,_T(".doc") ) || 0 == _tcscmp(strDocType,_T(".docx") ) ) { return _T("skin_file_icon_s_doctype"); } else if( 0 == _tcscmp(strDocType,_T(".exe") )) { return _T("skin_file_icon_s_exetype"); } else if( 0 == _tcscmp(strDocType,_T(".folder") )) { return _T("skin_file_icon_s_foldertype"); } else if( 0 == _tcscmp(strDocType,_T(".img") ) || 0 == _tcscmp(strDocType,_T(".jpeg")) || 0 == _tcscmp(strDocType,_T(".bmp")) || 0 == _tcscmp(strDocType,_T(".jpg")) || 0 == _tcscmp(strDocType,_T(".png")) || 0 == _tcscmp(strDocType,_T(".gif")) ) { return _T("skin_file_icon_s_imgtype"); } else if( 0 == _tcscmp(strDocType,_T(".ipa") ) ) { return _T("skin_file_icon_s_ipatype"); } else if( 0 == _tcscmp(strDocType,_T(".music") )) { return _T("skin_file_icon_s_musictype"); } else if( 0 == _tcscmp(strDocType,_T(".pdf") )) { return _T("skin_file_icon_s_pdftype"); } else if( 0 == _tcscmp(strDocType,_T(".ppt") )) { return _T("skin_file_icon_s_ppttype"); } else if( 0 == _tcscmp(strDocType,_T(".rar") )) { return _T("skin_file_icon_s_rartype"); } else if( 0 == _tcscmp(strDocType,_T(".torrent") )) { return _T("skin_file_icon_s_torrenttype"); } else if( 0 == _tcscmp(strDocType,_T(".txt") )) { return _T("skin_file_icon_s_txttype"); } else if( 0 == _tcscmp(strDocType,_T(".video") ) || 0 == _tcscmp(strDocType,_T(".mp4") )) { return _T("skin_file_icon_s_videotype"); } else if( 0 == _tcscmp(strDocType,_T(".vsd") )) { return _T("skin_file_icon_s_apktype"); } else if( 0 == _tcscmp(strDocType,_T(".xls") ) || 0 == _tcscmp(strDocType,_T(".xlsx") ) ) { return _T("skin_file_icon_s_xlstype"); } else // other { return _T("skin_file_icon_s_othertype"); } } SStringT CMBThumbnailType::GetBThumbnailSkin( CString &strDocType ) { if( 0 == _tcscmp(strDocType,_T(".apk") )) { return _T("skin_file_icon_b_apktype"); } else if( 0 == _tcscmp(strDocType,_T(".doc") ) || 0 == _tcscmp(strDocType,_T(".docx") ) ) { return _T("skin_file_icon_b_doctype"); } else if( 0 == _tcscmp(strDocType,_T(".exe") )) { return _T("skin_file_icon_b_exetype"); } else if( 0 == _tcscmp(strDocType,_T(".folder") )) { return _T("skin_file_icon_b_foldertype"); } else if( 0 == _tcscmp(strDocType,_T(".img") ) || 0 == _tcscmp(strDocType,_T(".jpeg")) || 0 == _tcscmp(strDocType,_T(".bmp")) || 0 == _tcscmp(strDocType,_T(".jpg")) || 0 == _tcscmp(strDocType,_T(".png")) || 0 == _tcscmp(strDocType,_T(".gif")) ) { return _T("skin_file_icon_b_imgtype"); } else if( 0 == _tcscmp(strDocType,_T(".ipa") ) ) { return _T("skin_file_icon_b_ipatype"); } else if( 0 == _tcscmp(strDocType,_T(".music") )) { return _T("skin_file_icon_b_musictype"); } else if( 0 == _tcscmp(strDocType,_T(".pdf") )) { return _T("skin_file_icon_b_pdftype"); } else if( 0 == _tcscmp(strDocType,_T(".ppt") )) { return _T("skin_file_icon_b_ppttype"); } else if( 0 == _tcscmp(strDocType,_T(".rar") )) { return _T("skin_file_icon_b_rartype"); } else if( 0 == _tcscmp(strDocType,_T(".torrent") )) { return _T("skin_file_icon_b_torrenttype"); } else if( 0 == _tcscmp(strDocType,_T(".txt") )) { return _T("skin_file_icon_b_txttype"); } else if( 0 == _tcscmp(strDocType,_T(".video") ) || 0 == _tcscmp(strDocType,_T(".mp4") )) { return _T("skin_file_icon_b_videotype"); } else if( 0 == _tcscmp(strDocType,_T(".vsd") )) { return _T("skin_file_icon_b_apktype"); } else if( 0 == _tcscmp(strDocType,_T(".xls") ) || 0 == _tcscmp(strDocType,_T(".xlsx") ) ) { return _T("skin_file_icon_b_xlstype"); } else // other { return _T("skin_file_icon_b_othertype"); } } // 0 ¨C ÏÂÔØ 1 ¨C ÉÏ´« SStringT CMBThumbnailType::GetFileTypeThumbnailSkin(int nFileType) { if( nFileType == 0 ) { return _T("skin_lvimg_download"); }else if( nFileType == 1 ) { return _T("skin_lvimg_upload"); } return _T(""); } SStringT CMBThumbnailType::GetFileTypeName(int nFileType) { if( nFileType == 0 ) { return _T("ÏÂÔØÍê³É"); }else if( nFileType == 1 ) { return _T("ÉÏ´«Íê³É"); } return _T(""); } SStringT CMBThumbnailType::ErrGetFileTypeName(int nFileType) { if( nFileType == 0 ) { return _T("ÏÂÔØ³ö´í"); }else if( nFileType == 1 ) { return _T("ÉÏ´«³ö´í"); } return _T(""); } bool CMBThumbnailType::IsImageType( CString strFileType ) { strFileType = strFileType.Trim(); strFileType = strFileType.MakeLower(); if( 0 == _tcscmp(strFileType,_T(".img") ) || 0 == _tcscmp(strFileType,_T(".jpeg")) || 0 == _tcscmp(strFileType,_T(".bmp")) || 0 == _tcscmp(strFileType,_T(".jpg")) || 0 == _tcscmp(strFileType,_T(".png")) || 0 == _tcscmp(strFileType,_T(".gif")) ) { return true; } return false; } bool CMBThumbnailType::IsOfficeType( CString strFileType ) { strFileType = strFileType.Trim(); strFileType = strFileType.MakeLower(); if( 0 == _tcscmp(strFileType,_T(".doc") ) || 0 == _tcscmp(strFileType,_T(".docx") ) || 0 == _tcscmp(strFileType,_T(".xls") ) || 0 == _tcscmp(strFileType,_T(".xlsx") ) || 0 == _tcscmp(strFileType,_T(".ppt")) || 0 == _tcscmp(strFileType,_T(".pptx")) ) { return true; } return false; } bool CMBThumbnailType::IsExcelType( CString strFileType ) { strFileType = strFileType.Trim(); strFileType = strFileType.MakeLower(); if( 0 == _tcscmp(strFileType,_T(".xls") ) || 0 == _tcscmp(strFileType,_T(".xlsx") ) ) { return true; } return false; } bool CMBThumbnailType::IsTxtType( CString strFileType ) { strFileType = strFileType.Trim(); strFileType = strFileType.MakeLower(); if( 0 == _tcscmp(strFileType,_T(".txt") ) || 0 == _tcscmp(strFileType,_T(".sql") ) || 0 == _tcscmp(strFileType,_T(".xml") ) || 0 == _tcscmp(strFileType,_T(".log") )) { return true; } return false; }