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