FileManager=E6=A8=A1=E5=9D=97=E5=88=86=E6=9E=90
=E4=B8=80=E3=80=81 External Interface
=20
1. =20
=E7=BB=99=E5=85=B6=E4=BB=96=E6=A8=A1=E5=9D=97=E4=BD=BF=E7=94=A8=E7=9A=84=E6=
=8E=A5=E5=8F=A3=E5=87=BD=E6=95=B0 &nbs=
p;  =
;=20
=E4=BD=9C=E7=94=A8
=20
mmi_fmgr_init =
initialize=20
file manager context
=
=20
mmi_fmgr_select_path_and_entry entry point to file manager for =
other=20
applications
=20
mmi_fmgr_reset_app_select reset =
selection=20
from other application
=
=20
GetFileSystemErrorString =
convert file=20
system return error code to error messgae pop =
up
=20
2. =
=E5=88=86=E6=9E=90mmi_fmgr_select_path_and_entry,=20
mmi_fmgr_reset_app_selec
=
=20
=E5=87=BD=E6=95=B0=E5=8E=9F=E5=9E=8B: void =
mmi_fmgr_select_path_and_entry(U8 app_id, U8 sel_type, U32=20
filter, PS8 start_path, PsFuncPtr callback) =
;
=20
(1) =
=E4=B8=BB=E8=A6=81=E5=88=86=E6=9E=90callback=E5=87=BD=E6=95=B0
&=
nbsp; =20
A. =
excute=20
mmi_fmgr_select_path_and_entry(......)
=20
=20
start_path
=20
---> =20
callback(.....)
=20
---> =
callback=E5=86=85=E9=83=A8=E6=A3=80=E6=9F=A5: =20
N
=20
start_path=3D=
NULL? =20
---> the selection is completed
=20
=20
&=
nbsp; =20
|
=20
&=
nbsp; =20
| Y
=20
the selection is=20
aborted
=20
B. =20
FMGR_SELECT_REPEAT=E5=AF=B9=E4=BA=8Ecallback=E5=87=BD=E6=95=B0=E7=9A=84=E5=
=BD=B1=E5=93=8D=E4=BB=A5=E5=8F=8A
=20
=20
=E4=BD=BF=E7=94=A8FMGR_SELECT_REPEAT=E5=8F=AF=E4=BB=
=A5=E5=A4=9A=E6=AC=A1=E9=80=89=E6=8B=A9=E6=96=87=E4=BB=B6/=E6=96=87=E4=BB=
=B6=E5=A4=B9
=20
=
a. Each=20
Select
=20
=20
select target=20
=
=20
start_path
=20
=
--->=20
callback(......)
=20
=
--->=20
callback=E5=86=85=E9=83=A8=E6=A3=80=E6=9F=A5 =
N
=20
=20
start_path=3DNULL? =
---> user=20
abort ( the selection is aborted )
=20
=20
&=
nbsp;=20
|
=
=20
&=
nbsp; |=20
Y =
=20
Y
=
=20
reach application's =
condition?=20
---> application abort ( the selection is aborted=20
)
=
=20
&=
nbsp;=20
|
=
=20
&=
nbsp;=20
|
=
=20
the selection is=20
completed
=20
b. =
=E4=B8=A4=E7=A7=8Dabort
=20
=20
user abort:
=20
=20
will cause a callback with NULL parameter and File =
Manager=20
will automatically reset ;
=20
=20
application abort:
=20
=20
needs to call the mmi_fmgr_reset_app_select( ) to =
terminate=20
the process
(2)=20
FMGR_SELECT_BROWSE=E5=8F=82=E6=95=B0
=
=20
drive option
=20
folder=20
option
=20
file option
=20
3. Utility=20
Functions
=
BOOL =20
mmi_fmgr_get_default_folder_path(S8 * folder,S8 * path,U16=20
length);
void =
mmi_fmgr_remove_last_dir(S8 * path);
=20
S8 * mmi_fmgr_extract_file_name(S8 * path =
);
S8 * =20
mmi_fmgr_extract_ext_file_name(S8 * path);
=20
void mmi_fmgr_hide_ext_name(S8 *=20
path);
=20
=20
mmi_fmgr_check_file_present
=
=20
=E4=BA=8C=E3=80=81=20
Cache
=
1. =20
First Time Enter a Floder
A. =20
=E4=B8=80=E8=88=AC=E6=B5=81=E7=A8=8B
&nb=
sp; first time enter a=20
floder
--> call fmgr_kenmel: init the=20
cache
--> load file frome FS until the =
cache is=20
filled
--> =
=E4=B8=8D=E7=AE=A1=E6=98=AF=E5=90=A6=E6=9C=89sort=E9=80=89=E9=A1=B9, =
file manager=E9=83=BD=E4=BC=9A=E8=8E=B7=E5=8F=96 file=20
list
B. =E5=85=B3=E4=BA=8E sort=20
API
=
=E5=BD=93=E7=9B=AE=E5=BD=95=E9=A1=B9=E5=86=85=E6=96=87=E4=BB=B6=E6=95=B0=E8=
=B6=85=E8=BF=87255, file=20
manager can't use sort API to get file list from file=20
system
but linear find first/find next=20
instead.
C. =
filter
=20
2. Request for File =
Info
=20
A. Function: fmgr_kernel_get_file_info
=
B. call fmgr_kernel_get_file_info with a=20
index
--> get a =
structe of=20
data filled with useful file information
--> =
this=20
funciton will use the passed in index to =
see =20
Y
if the desired file info =
is=20
already in chached or not ---> from=20
cache
&nbs=
p;  =
; =20
|
&n=
bsp; &nb=
sp; =20
|=20
N
&n=
bsp; &nb=
sp; =20
|
&n=
bsp; =20
reload cache and return file info
3. Image Cache
A. File =
Manger=E6=A8=A1=E5=9D=97=E7=9A=84=E9=A2=84=E8=A7=88=E5=9B=BECache
&nbs=
p; B.=20
=E4=B8=80=E8=88=AC=E6=B5=81=E7=A8=8B
&nb=
sp; Draw Thumb=20
Image
&nbs=
p; =20
Y
--> Is in cache? -----> Draw it from=20
cache
&nbs=
p;=20
|
=
|=20
N
=20
| =20
Decord Image -----> =
Decord=20
Done -----> Cache the Image -----> Draw it from=20
cache
Trackback:=20 http://tb.blog.csdn.net/TrackBack.aspx?PostId=3D2151076