MTK 11A File Manager

本文介绍了文件管理器应用(FileManagerApp)的工作原理和技术实现细节,包括用户界面交互、文件选择上传流程、文件夹选择及通用操作等内容。文章还探讨了不同类别的功能实现及其在系统中的作用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

File Manager App provides a user interface to work with file system 
It also supports to interact with other App. For example, user can select a picture to share via MMS on file manager immediately.

 

void VappBrowserPage::selectUploadFile(void)
{
/* Setup file type filter */
FMGR_FILTER filter;
FMGR_FILTER_INIT(&filter);
FMGR_FILTER_SET(&filter, FMGR_TYPE_ALL);
/* Create CUI */
mmi_id cui_id = vcui_file_selector_create(m_browserAppID, (const WCHAR*)L"root", &filter,
VCUI_FILE_SELECTOR_STYLE_FILE_ONLY, VCUI_FILE_SELECTOR_OPT_FOLDER_TRAVERSE_ALL);
if (cui_id != GRP_ID_INVALID)
{
/* Run CUI */
vcui_file_selector_run(cui_id);
}
}

 

void VappBrowserPage::fmgrCuiCallback(void *param)
{
switch(((mmi_event_struct*)param)->evt_id)
{
case EVT_ID_VCUI_FILE_SELECTOR_RESULT:
{
vcui_file_selector_result_event_struct *evt = (vcui_file_selector_result_event_struct*)param;
/* To check result */
if (evt->result == 1)
{
/* Get selected file path */
}
/* Close CUI */
vcui_file_selector_close(evt->sender_id);
}
}
}

 

void VappFmgrInstance::FolderSelectorTest{
m_fs_id = vcui_folder_selector_create(m_gid, (const WCHAR*)L"root",
VCUI_FOLDER_SELECTOR_STYLE_WRITE, VCUI_FOLDER_SELECTOR_OPT_FIXED_PATH_ON);
if (m_fs_id != GRP_ID_INVALID)
{
vcui_folder_selector_run(m_fs_id);
}
}
void VappFmgrInstance::onProc{
vcui_folder_selector_result_event_struct *evt = (vcui_folder_selector_result_event_struct*)param;
if (evt->result == 1)
{
/* Get selected folder path */
}
vcui_folder_selector_close(evt->sender_id);
}

 

void VappFmgrGeneralOperation::actionRenameDrive(void)
{
VfxS32 maxLen = SRV_FMGR_DRV_MAX_VOLUME_SIZE - 1;
if (m_filename !=)
{
VFX_OBJ_CREATE(m_filename_input, VappFileNameEditorPopup, findScreen());
m_filename_input->setTitle(VFX_WSTR_RES(STR_GLOBAL_RENAME));
m_filename_input->setIsVolumeLabel(VFX_TRUE);
/* Use TextEditor's setText API to set ENCODING method*/
m_filename_input->getInputbox()->setText(VFX_WSTR_MEM((VfxWChar*)m_filename), maxLen,               
VFX_FALSE, VCP_TEXT_ENCODING_ASCII);
m_filename_input->m_signalButtonClicked.connect(this,     
&VappFmgrGeneralOperation::onClickInputButton);
m_filename_input->show(VFX_TRUE);
}
}

 

1.File Structure

 

venusmmi/app/Cosmos/FileMgr                    Application source code
venusmmi/app/Cosmos/FileMgr/res             Application resource file
plutommi/Customer/Images/COSMOS*/MainLCD/Default/FMGR         Image files

 

2. Class

 

1)VappFmgrInstance

FMGR kernel
List menu content provider
Method showpopup– Show popup
Method enterfolder and exitfolder – Enter / Exit a folder
Method backroot – Back to drive page
Method callbackApp – The method will be called when CUI would like to notify caller
Method refreshMenu– Refresh the file list menu

virtual method onProc– Event handler
virtual method error_handler– Error handler
virtual method onTapListMenuItem– Connect to signal m_signalItemTapped of list menu
virtual method onTapGroupListMenuItem – Connect to signal m_signalItemTapped of group list menu
virtual method getOptionItem–Get option menu. The method will be called when page would like to draw toolbar
virtual method isMenuItemDisable–Check if the menu item should be disable

virtual method onActionRsp– To handle the response of file operation .
virtual method onClickCmdButton– Connect to signal m_signalCmdButtonClicked of list menu
virtual method onClickGroupCmdButton – Connect to signal m_signalCmdButtonClicked of group list menu
virtual method onClickUpButton– Connect to signal m_signalClicked of button “Up”

 

 

2)VappFmgrMain

For FMGR App
Support multi option
Support long press
– showLongTapOption
– onLongTapListMenuItem
– onLongTapGroupListMenuItem

 


 3)VappFmgrPage

Essential class of file manager page

virtual method onEnter– Start enter animation. When user switch drive tab, FMGR prepare drive path here

virtual method onEntered– Show on screen. Prepare system folder here.

virtual method onExit– Start exit animation. FMGR call method exitfolder here.

virtual method onBack– Handle back key

virtual method setBounds– Modify bound and position of components in the page

 

Method drawListPage/drawGroupListPage– If there is a list menu in the page, the method will be called

Method drawLoadingPage– If only to display a string loading in the page, the method will be called

Method drawToolBar– If there is a toolbar in the page, the method will be called

Method drawTitleCell– If there is parent folder cell in the page, the method will be called

 

4)VappFmgrCUIInstance

Inherit from class VappFmgrInstance
 Provide FMGR CUI Common variable
– m_select_index
– m_select_pos

 

5)VappFmgrFileSelectorCUI

Inherit from class VappFmgrCUIInstance

Event– Refer to vcui_file_selector_event_enum

Option– Refer to vcui_file_selector_option_enum

Style– Refer to vcui_file_selector_style_enum

Method startPreviewAudio– According to CUI setting, to play audio file which user would like to preview

Method stopPreviewAudio– Stop previewing

 

6)VappFmgrFolderSelectorCUI

Inherit from class VappFmgrCUIInstance

Event– Refer to vcui_folder_selector_event_enum

Option– Refer to vcui_folder_selector_option_enum

Style– Refer to vcui_folder_selector_style_enum

 

7)VappFmgrFolderBrowserLaunch

Inherit from class VappFmgrMain

According to file type filter and identified folder,  to show file list.

Event– Refer to vcui_folder_browser_launch_event_enum

 

8)VappFileNameEditorPopup

Inherit from class VcpInputPopup

Method setPath– Set file path without filename

Method setExt– Set extension name

Method setIsVolumeLabel– Set if the editor is for renaming volume label

Method isValidFilePath– Check if filename is valid

 

9)VappFmgrGeneralOperation

All file operations are handled in the class
Show error popup according to error code

 

10)VappFmgrStorageReport

Handle UI and algorithm of Storage Status

virtual method onEntered–In order to good user experiment, FMGR start to query category information when the page is entered.

virtual method onCreateTabPage–Prepare page phone and memory card

 

11)VappFmgrStorageDetail

The page class is for displaying drive information

virtual method drawStorageDetail– Call for draw storage status

Method queryFirst– Start to get the information of first category

Method prepareNext– Clear job id and increase index

Method queryNext– Query next

Method queryUpdate– Update size and percentage after receiving response

 

12)VappFmgrFSData

–  Load file list
– Get file and folder numbers
– Get drive info
– Get file info

 

13)VappFmgrMultiSelect

Create index array to save what user select

Only support the feature when number of files and folders is less than FS_MAX_SORT_ENTRY

Method add– Select a item

Method remove

Method remove– Unselect a item

Method top– Get the first item

Method pop– Pop the first item

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值