您的位置:首页 > 其它

MTK平台学习--FileManager模块分析

2010-01-29 15:30 246 查看
FileManager模块分析

一、 External Interface

1. 给其他模块使用的接口函数 作用
mmi_fmgr_init initialize file manager context
mmi_fmgr_select_path_and_entry entry point to file manager for other applications
mmi_fmgr_reset_app_select reset selection from other application
GetFileSystemErrorString convert file system return error code to error messgae pop up

2. 分析mmi_fmgr_select_path_and_entry, mmi_fmgr_reset_app_selec
函数原型: void mmi_fmgr_select_path_and_entry(U8 app_id, U8 sel_type, U32 filter, PS8 start_path, PsFuncPtr callback) ;
(1) 主要分析callback函数
A. excute mmi_fmgr_select_path_and_entry(......)
start_path
---> callback(.....)
---> callback内部检查: N
start_path=NULL? ---> the selection is completed
|
| Y
the selection is aborted
B. FMGR_SELECT_REPEAT对于callback函数的影响以及
使用FMGR_SELECT_REPEAT可以多次选择文件/文件夹
a. Each Select
select target
start_path
---> callback(......)
---> callback内部检查 N
start_path=NULL? ---> user abort ( the selection is aborted )
|
| Y Y
reach application's condition? ---> application abort ( the selection is aborted )
|
|
the selection is completed
b. 两种abort
user abort:
will cause a callback with NULL parameter and File Manager will automatically reset ;
application abort:
needs to call the mmi_fmgr_reset_app_select( ) to terminate the process
(2) FMGR_SELECT_BROWSE参数
drive option
folder option
file option

3. Utility Functions
BOOL mmi_fmgr_get_default_folder_path(S8 * folder,S8 * path,U16 length);
void mmi_fmgr_remove_last_dir(S8 * path);
S8 * mmi_fmgr_extract_file_name(S8 * path );
S8 * mmi_fmgr_extract_ext_file_name(S8 * path);
void mmi_fmgr_hide_ext_name(S8 * path);
mmi_fmgr_check_file_present

二、 Cache

1. First Time Enter a Floder
A. 一般流程
first time enter a floder
--> call fmgr_kenmel: init the cache
--> load file frome FS until the cache is filled
--> 不管是否有sort选项, file manager都会获取 file list
B. 关于 sort API
当目录项内文件数超过255, file manager can't use sort API to get file list from file system
but linear find first/find next instead.
C. filter

2. Request for File Info
A. Function: fmgr_kernel_get_file_info
B. call fmgr_kernel_get_file_info with a index
--> get a structe of data filled with useful file information
--> this funciton will use the passed in index to see Y
if the desired file info is already in chached or not ---> from cache
|
| N
|
reload cache and return file info

3. Image Cache
A. File Manger模块的预览图Cache
B. 一般流程
Draw Thumb Image
Y
--> Is in cache? -----> Draw it from cache
|
| N
|
Decord Image -----> Decord Done -----> Cache the Image -----> Draw it from cache

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=2151076
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: