mrp_fmgr.c 16.3 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717

#ifdef __MMI_DSM_NEW__
#define __NEWSIMULATOR 

#include "MMI_features.h" 
#include "stdC.h"
#include "PixtelDataTypes.h"
#include "GlobalDefs.h"
#include "CommonScreens.h"
#include "SettingDefs.h"
#include "fmt_def.h"
#include "filemgr.h"
#include "SettingProfile.h"
#include "FileManagerDef.h"
#include "FileManagerGProt.h"
#include "filemgrcuigprot.h"
#include "FileMgrType.h"
#include "mrp_include.h"

#if(MTK_VERSION <= 0x0812)
#include "MMIDataType.h "
#endif

#undef __NEWSIMULATOR

static FMGR_FILTER filter;
static MR_T_FMGR_REQ mr_fmgr_req;
mr_fmgrAction dsmFmgrAction;


int32 mr_fmgr_filter_fmgr(void)
{
	FMGR_FILTER_INIT(&filter);
	return MR_SUCCESS;
}

int32 mr_fmgr_filter_clear(int32 fmgr_type)
{
	int32 mtk_fmgr_type = FMGR_TYPE_ALL;

	switch(fmgr_type)
	{
		case MR_FMGR_TYPE_ALL:    
			mtk_fmgr_type = FMGR_TYPE_ALL;
			break;
		case MR_FMGR_TYPE_FOLDER:
			mtk_fmgr_type = FMGR_TYPE_FOLDER;
			break;
		case MR_FMGR_TYPE_FOLDER_DOT:
			mtk_fmgr_type = FMGR_TYPE_FOLDER_DOT;
			break;
		case MR_FMGR_TYPE_UNKNOW:
			mtk_fmgr_type = FMGR_TYPE_UNKNOWN;
			break;
		case MR_FMGR_TYPE_BMP:
			mtk_fmgr_type = FMGR_TYPE_BMP;
			break;
		case MR_FMGR_TYPE_JPG:
			mtk_fmgr_type = FMGR_TYPE_JPG;
			break;
		case MR_FMGR_TYPE_JPEG:
			mtk_fmgr_type = FMGR_TYPE_JPEG;
			break;
		case MR_FMGR_TYPE_GIF:
			mtk_fmgr_type = FMGR_TYPE_GIF;
			break;
		case MR_FMGR_TYPE_PNG:
			mtk_fmgr_type = FMGR_TYPE_PNG;
			break;
		case MR_FMGR_TYPE_EMS :
			mtk_fmgr_type = FMGR_TYPE_EMS;
			break; 
		case MR_FMGR_TYPE_ANM :
			mtk_fmgr_type = FMGR_TYPE_ANM;
			break;
		case MR_FMGR_TYPE_WBMP :
			mtk_fmgr_type = FMGR_TYPE_WBMP;
			break;
		case MR_FMGR_TYPE_WBM :
			mtk_fmgr_type = FMGR_TYPE_WBM;
			break;
		case MR_FMGR_TYPE_IMY :
			mtk_fmgr_type = FMGR_TYPE_IMY;
			break;
		case MR_FMGR_TYPE_MID :
			mtk_fmgr_type = FMGR_TYPE_MID;
			break;
		case MR_FMGR_TYPE_MIDI :
			mtk_fmgr_type = FMGR_TYPE_MIDI;
			break;
		case MR_FMGR_TYPE_WAV :
			mtk_fmgr_type = FMGR_TYPE_WAV;
			break;
		case MR_FMGR_TYPE_AMR :
			mtk_fmgr_type = FMGR_TYPE_AMR;
			break;
		case MR_FMGR_TYPE_AAC :
			mtk_fmgr_type = FMGR_TYPE_AAC;
			break;
		case MR_FMGR_TYPE_DAF :
			mtk_fmgr_type = FMGR_TYPE_DAF;
			break;
		case MR_FMGR_TYPE_VM :
			mtk_fmgr_type = FMGR_TYPE_VM;
			break;
		case MR_FMGR_TYPE_AWB :
			mtk_fmgr_type = FMGR_TYPE_AWB;
			break;
		case MR_FMGR_TYPE_AIF :
			mtk_fmgr_type = FMGR_TYPE_AIF;
			break;
		case MR_FMGR_TYPE_AIFF :
			mtk_fmgr_type = FMGR_TYPE_AIFF;
			break;
		case MR_FMGR_TYPE_AIFC :
			mtk_fmgr_type = FMGR_TYPE_AIFC;
			break;
		case MR_FMGR_TYPE_AU :
			mtk_fmgr_type = FMGR_TYPE_AU;
			break;
		case MR_FMGR_TYPE_SND :
			mtk_fmgr_type = FMGR_TYPE_SND;
			break;
		case MR_FMGR_TYPE_M4A :
			mtk_fmgr_type = FMGR_TYPE_M4A;
			break;
		case MR_FMGR_TYPE_MMF  :
			mtk_fmgr_type = FMGR_TYPE_MMF;
			break;
		case MR_FMGR_TYPE_WMA :
			mtk_fmgr_type = FMGR_TYPE_WMA;
			break;
		case  MR_FMGR_TYPE_3GP :
			mtk_fmgr_type = FMGR_TYPE_3GP;
			break;
		case MR_FMGR_TYPE_MP4 :
			mtk_fmgr_type = FMGR_TYPE_MP4;
			break;
		case MR_FMGR_TYPE_AVI :	
			mtk_fmgr_type = FMGR_TYPE_AVI;
			break;
		case MR_FMGR_TYPE_JAD :
			mtk_fmgr_type = FMGR_TYPE_JAD;
			break;
		case MR_FMGR_TYPE_JAR :
			mtk_fmgr_type = FMGR_TYPE_JAR;
			break;
		case MR_FMGR_TYPE_VCF :
			mtk_fmgr_type = FMGR_TYPE_VCF;
			break;
		case MR_FMGR_TYPE_VCS :
			mtk_fmgr_type = FMGR_TYPE_VCS;
			break;
		case MR_FMGR_TYPE_THEME:
			mtk_fmgr_type = FMGR_TYPE_THEME;
			break;
	#ifndef __MR_CFG_FEATURE_SLIM__			
		case MR_FMGR_TYPE_MRP:
			mtk_fmgr_type = FMGR_TYPE_MRP;
			break;
		case MR_FMGR_TYPE_NES:
			mtk_fmgr_type = FMGR_TYPE_NES;
			break;
		case MR_FMGR_TYPE_ZPK:
			mtk_fmgr_type = FMGR_TYPE_ZPK;
			break;
		case MR_FMGR_TYPE_ZIP:
			mtk_fmgr_type = FMGR_TYPE_ZIP;
			break;
	#endif
	}
	FMGR_FILTER_CLEAR(&filter, mtk_fmgr_type);
	return MR_SUCCESS;
}


int32 mr_fmgr_filter_set(int32 fmgr_type)
{
	int32 mtk_fmgr_type = FMGR_TYPE_ALL;

	
	switch(fmgr_type)
	{
		case MR_FMGR_TYPE_ALL:    
			mtk_fmgr_type = FMGR_TYPE_ALL;
			break;
		case MR_FMGR_TYPE_FOLDER:
			mtk_fmgr_type = FMGR_TYPE_FOLDER;
			break;
		case MR_FMGR_TYPE_FOLDER_DOT:
			mtk_fmgr_type = FMGR_TYPE_FOLDER_DOT;
			break;
		case MR_FMGR_TYPE_UNKNOW:
			mtk_fmgr_type = FMGR_TYPE_UNKNOWN;
			break;
		case MR_FMGR_TYPE_BMP:
			mtk_fmgr_type = FMGR_TYPE_BMP;
			break;
		case MR_FMGR_TYPE_JPG:
			mtk_fmgr_type = FMGR_TYPE_JPG;
			break;
		case MR_FMGR_TYPE_JPEG:
			mtk_fmgr_type = FMGR_TYPE_JPEG;
			break;
		case MR_FMGR_TYPE_GIF:
			mtk_fmgr_type = FMGR_TYPE_GIF;
			break;
		case MR_FMGR_TYPE_PNG:
			mtk_fmgr_type = FMGR_TYPE_PNG;
			break;
		case MR_FMGR_TYPE_EMS :
			mtk_fmgr_type = FMGR_TYPE_EMS;
			break;
		case MR_FMGR_TYPE_ANM :
			mtk_fmgr_type = FMGR_TYPE_ANM;
			break;
		case MR_FMGR_TYPE_WBMP :
			mtk_fmgr_type = FMGR_TYPE_WBMP;
			break;
		case MR_FMGR_TYPE_WBM :
			mtk_fmgr_type = FMGR_TYPE_WBM;
			break;
		case MR_FMGR_TYPE_IMY :
			mtk_fmgr_type = FMGR_TYPE_IMY;
			break;
		case MR_FMGR_TYPE_MID :
			mtk_fmgr_type = FMGR_TYPE_MID;
			break;
		case MR_FMGR_TYPE_MIDI :
			mtk_fmgr_type = FMGR_TYPE_MIDI;
			break;
		case MR_FMGR_TYPE_WAV :
			mtk_fmgr_type = FMGR_TYPE_WAV;
			break;
		case MR_FMGR_TYPE_AMR :
			mtk_fmgr_type = FMGR_TYPE_AMR;
			break;
		case MR_FMGR_TYPE_AAC :
			mtk_fmgr_type = FMGR_TYPE_AAC;
			break;
		case MR_FMGR_TYPE_DAF :
			mtk_fmgr_type = FMGR_TYPE_DAF;
			break;
		case MR_FMGR_TYPE_VM :
			mtk_fmgr_type = FMGR_TYPE_VM;
			break;
		case MR_FMGR_TYPE_AWB :
			mtk_fmgr_type = FMGR_TYPE_AWB;
			break;
		case MR_FMGR_TYPE_AIF :
			mtk_fmgr_type = FMGR_TYPE_AIF;
			break;
		case MR_FMGR_TYPE_AIFF :
			mtk_fmgr_type = FMGR_TYPE_AIFF;
			break;
		case MR_FMGR_TYPE_AIFC :
			mtk_fmgr_type = FMGR_TYPE_AIFC;
			break;
		case MR_FMGR_TYPE_AU :
			mtk_fmgr_type = FMGR_TYPE_AU;
			break;
		case MR_FMGR_TYPE_SND :
			mtk_fmgr_type = FMGR_TYPE_SND;
			break;
		case MR_FMGR_TYPE_M4A :
			mtk_fmgr_type = FMGR_TYPE_M4A;
			break;
		case MR_FMGR_TYPE_MMF  :
			mtk_fmgr_type = FMGR_TYPE_MMF;
			break;
		case MR_FMGR_TYPE_WMA :
			mtk_fmgr_type = FMGR_TYPE_WMA;
			break;
		case MR_FMGR_TYPE_3GP :
			mtk_fmgr_type = FMGR_TYPE_3GP;
			break;
		case MR_FMGR_TYPE_MP4 :
			mtk_fmgr_type = FMGR_TYPE_MP4;
			break;
		case MR_FMGR_TYPE_AVI :	
			mtk_fmgr_type = FMGR_TYPE_AVI;
			break;
		case MR_FMGR_TYPE_JAD :
			mtk_fmgr_type = FMGR_TYPE_JAD;
			break;
		case MR_FMGR_TYPE_JAR :
			mtk_fmgr_type = FMGR_TYPE_JAR;
			break;
		case MR_FMGR_TYPE_VCF :
			mtk_fmgr_type = FMGR_TYPE_VCF;
			break;
		case MR_FMGR_TYPE_VCS :
			mtk_fmgr_type = FMGR_TYPE_VCS;
			break;
		case MR_FMGR_TYPE_THEME:
			mtk_fmgr_type = FMGR_TYPE_THEME;
			break;
	#ifndef __MR_CFG_FEATURE_SLIM__
		case MR_FMGR_TYPE_MRP:
			mtk_fmgr_type = FMGR_TYPE_MRP;
			break;
		case MR_FMGR_TYPE_NES:
			mtk_fmgr_type = FMGR_TYPE_NES;
			break;
		case MR_FMGR_TYPE_ZIP:	
			mtk_fmgr_type = FMGR_TYPE_ZIP;
			break;
		case MR_FMGR_TYPE_ZPK:
			mtk_fmgr_type = FMGR_TYPE_ZPK;
			break;
	#endif
	}
	
	FMGR_FILTER_SET(&filter, mtk_fmgr_type);	
	return MR_SUCCESS;
}

void mr_set_fmgr_req(MR_T_FMGR_REQ *fmgr_req)
{
	memcpy(&mr_fmgr_req,fmgr_req,sizeof(MR_T_FMGR_REQ));	
}

MR_T_FMGR_REQ* mr_get_fmgr_req()
{
	return &mr_fmgr_req;
}

void mmi_dsm_exit_from_fmgr_emptry_folder(void)
{
#if 0
	DeleteUptoScrID(MENU_DSM_FMGR_APP);
	DeleteNHistory(1);
	GoBackHistory();
#endif	
}

static void mmi_dsm_fmgr_select_result_callback(void *filepath, int is_short)
{
#if 0
       S32	str_len;
	   
  	extern mr_fmgrAction dsmFmgrAction;


	str_len = mmi_ucs2strlen((PS8)filepath);
		
	if(str_len + 3 > FMGR_PATH_CHAR_COUNT)
	{
		memset(dsmFmgrAction.dir,0,sizeof(dsmFmgrAction.dir));
		dsmFmgrAction.fmgrAction = MR_DIALOG_KEY_CANCEL;
		DisplayPopup((PU8)GetString(FMGR_FS_PATH_OVER_LEN_ERROR_TEXT),
						 IMG_GLOBAL_WARNING, 
						 1, 
						 __MR_CFG_VAR_NOTIFY_DURATION__, 
						 WARNING_TONE);
		DeleteUptoScrID(MENU_DSM_FMGR_APP);
		return;	
	}
	
   	if(filepath == NULL)
   	{
		memset(dsmFmgrAction.dir,0,sizeof(dsmFmgrAction.dir));
		dsmFmgrAction.fmgrAction = MR_DIALOG_KEY_CANCEL;
		mr_app_send_event_wrapper(MR_LOCALUI_EVENT,MR_DIALOG_KEY_CANCEL,0);
		return;
   	}
	else if(str_len > 0)
	{
		char temppath[FMGR_MAX_PATH_LEN] = {0};
		
		mmi_ucs2ncpy((PS8)temppath, (PS8)filepath, str_len);

		if(temppath[0] == MMI_SYSTEM_DRV)
			temppath[0] = 'A';
		else if(temppath[0] == MMI_PUBLIC_DRV)
		{
			if(MMI_PUBLIC_DRV == MMI_CARD_DRV)
			{
				temppath[0] = 'C';
			}
			else
			{
				temppath[0] = 'B';
			}
		}
		else 
			temppath[0] = 'C';

		mr_str_ucs2_to_gb((char*)temppath,(char *)dsmFmgrAction.dir,0);
		mr_fs_separator_local_to_vm((U8 *)(dsmFmgrAction.dir));

		dsmFmgrAction.fmgrAction = MR_DIALOG_KEY_OK;
#ifdef MMI_ON_HARDWARE_P
		kal_prompt_trace(MOD_MMI,"Select File Name = %s",dsmFmgrAction.dir);
#endif		
		mr_app_send_event_wrapper(MR_LOCALUI_EVENT,MR_DIALOG_KEY_OK,0);
		
	}
#endif	
}

static mmi_id dsm_fmgr_cui_id = GRP_ID_INVALID;

mmi_ret dsm_fmgr_proc(mmi_event_struct* evt)
{
	switch (evt->evt_id)
	{
		case EVT_ID_CUI_FILE_SELECTOR_RESULT:
		{
			cui_file_selector_result_event_struct* file_event = (cui_file_selector_result_event_struct*)evt;
			srv_fmgr_fileinfo_struct info;
			WCHAR path[SRV_FMGR_PATH_MAX_LEN + 1];
			
			if (file_event->result > 0)
			{
				cui_file_selector_get_selected_filepath(dsm_fmgr_cui_id, &info, path, (SRV_FMGR_PATH_MAX_LEN + 1) * 2);
				
				if (path[0] == SRV_FMGR_SYSTEM_DRV)
					path[0] = 'A';
				else if (path[0] == SRV_FMGR_PUBLIC_DRV)
					path[0] = 'B';
				else
					path[0] = 'C';
					
				mr_str_ucs2_to_gb((char*)path, (char*)dsmFmgrAction.dir, 0);
			
				mr_fs_separator_local_to_vm((U8 *)(dsmFmgrAction.dir));
				mr_app_resume();
				mr_app_send_event_wrapper(MR_LOCALUI_EVENT,MR_DIALOG_KEY_OK,0); 
			}
			else
			{
				mr_app_resume();
				mr_app_send_event_wrapper(MR_LOCALUI_EVENT,MR_DIALOG_KEY_CANCEL,0); 
			}
			
			break;
		}
		
		case EVT_ID_CUI_FOLDER_SELECTOR_RESULT:
		{
			cui_folder_selector_result_event_struct* folder_event = (cui_folder_selector_result_event_struct*)evt;
			srv_fmgr_fileinfo_struct info;
			WCHAR path[SRV_FMGR_PATH_MAX_LEN + 1]; 
			
			if (folder_event->result > 0)
			{
				cui_folder_selector_get_selected_filepath(dsm_fmgr_cui_id, &info, path, (SRV_FMGR_PATH_MAX_LEN + 1) * 2);
				
				if (path[0] == SRV_FMGR_SYSTEM_DRV)
					path[0] = 'A';
				else if (path[0] == SRV_FMGR_PUBLIC_DRV)
					path[0] = 'B';
				else
					path[0] = 'C';
					
				mr_str_ucs2_to_gb((char*)path, (char*)dsmFmgrAction.dir, 0);
				mr_fs_separator_local_to_vm((U8 *)(dsmFmgrAction.dir));
				mr_app_resume();
				mr_app_send_event_wrapper(MR_LOCALUI_EVENT,MR_DIALOG_KEY_OK,0); 
			}
			else
			{
				mr_app_resume();
				mr_app_send_event_wrapper(MR_LOCALUI_EVENT,MR_DIALOG_KEY_CANCEL,0); 
			}
			
			break;
		}
	}
	
	return MMI_RET_OK;
}

void mmi_dsm_entry_fmgr_screen(void)
{
#if 1
	UI_character_type storagePath[FMGR_MAX_PATH_LEN+1]={0};
	MR_T_FMGR_REQ* fmgr_req = NULL;
	U8 tempdrv;
	char switchbuf[DSM_MAX_FILE_LEN]={0};
	
	fmgr_req = mr_get_fmgr_req();
	
	if(fmgr_req->dft_list == MR_DSPL_NES)
	{
		sprintf((char *)switchbuf, "%c:\\%s\\",MR_DEFAULT_NES_DRV,MR_DEFAULT_NES_DIR);
		mr_str_gb_to_ucs2(switchbuf,(char *)storagePath);
	}
	else if (fmgr_req->dft_list == MR_DSPL_IMAGE)
	{
		mmi_imgview_get_storage_file_path((PS8)storagePath);
	}
	else if (fmgr_req->dft_list == MR_DSPL_AUDIO)
	{
		mmi_ucs2cpy((PS8)storagePath, (PS8)L"root");
	}
	else if(fmgr_req->dft_list == MR_DSPL_VIDEO)
	{
		mmi_vdoply_get_storage_file_path((PS8)storagePath);
	}
	else if(fmgr_req->dft_list == MR_DSPL_NONE)
	{
		U8 drv = (U8)(fmgr_req->list_path[0]);

		if(strlen(fmgr_req->list_path) > 0)
		{
			if (drv == 'A'||drv == 'a')
			{
				tempdrv = MMI_SYSTEM_DRV;
			}
			else if(drv == 'B'||drv == 'b')
			{
				tempdrv = MMI_PUBLIC_DRV;
			}
			else if(drv == 'C'||drv == 'c')
			{
				tempdrv =MMI_CARD_DRV;
			}
			else
			{
				ASSERT(0);
				return;
			}
				
			sprintf((char *)switchbuf,"%c:\\%s\\",(S8)tempdrv,(fmgr_req->list_path+3));
			mr_fs_separator_vm_to_local((U8 *)switchbuf);
			mr_str_gb_to_ucs2(switchbuf,(char*)storagePath);
		}
		else
		{
			mmi_ucs2cpy((PS8)storagePath, (PS8)L"root");
		}
	}
	else if(fmgr_req->dft_list == MR_DSPL_FOLDER)
	{
		mmi_ucs2cpy((PS8)storagePath, (PS8)L"root");
	}

	internalCovered = MR_TRUE;

	//mmi_frm_group_create(GRP_ID_ROOT, GRP_ID_MYTHROAD, dsm_fmgr_proc, NULL);
	//mmi_frm_group_enter(GRP_ID_MYTHROAD, MMI_FRM_NODE_SMART_CLOSE_FLAG);
	
	dsm_fmgr_cui_id = cui_file_selector_create(mr_app_get_group(), storagePath, &filter, CUI_FILE_SELECTOR_STYLE_FILE_ONLY, CUI_FILE_SELECTOR_OPT_FIXED_PATH_ON);

	if (dsm_fmgr_cui_id == GRP_ID_INVALID) return;

	cui_file_selector_run(dsm_fmgr_cui_id);
	
#elif 0
	internalCovered = MR_TRUE;

	mmi_frm_group_create(GRP_ID_ROOT, GRP_ID_MYTHROAD, dsm_fmgr_proc, NULL);
	mmi_frm_group_enter(GRP_ID_MYTHROAD, MMI_FRM_NODE_SMART_CLOSE_FLAG);

	dsm_fmgr_cui_id = cui_file_selector_create(GRP_ID_MYTHROAD, L"root", &filter, CUI_FILE_SELECTOR_STYLE_FILE_AND_PATH, 0);

	if (dsm_fmgr_cui_id == GRP_ID_INVALID) return;

	cui_file_selector_run(dsm_fmgr_cui_id);
#else
	UI_character_type storagePath[FMGR_MAX_PATH_LEN+1]={0};
	MR_T_FMGR_REQ* fmgr_req = NULL;
	U8 tempdrv;
	char switchbuf[DSM_MAX_FILE_LEN]={0};
	extern pBOOL IsBackHistory;


	if(IsBackHistory == MMI_TRUE)
	{
		if(dsmFmgrAction.fmgrAction == MR_DIALOG_KEY_CANCEL)
		{
			mr_app_send_event_wrapper(MR_LOCALUI_EVENT,MR_DIALOG_KEY_CANCEL,0);
		}
		else
		{
			mr_app_send_event_wrapper(MR_LOCALUI_EVENT,MR_DIALOG_KEY_OK,0);
		}
		
		return;
	}
	
	fmgr_req = mr_get_fmgr_req();

	EntryNewScreen(MENU_DSM_FMGR_APP, NULL, mmi_dsm_entry_fmgr_screen, NULL);
	
	if(fmgr_req->dft_list == MR_DSPL_NES)
	{
		sprintf((char *)switchbuf, "%c:\\%s\\",MR_DEFAULT_NES_DRV,MR_DEFAULT_NES_DIR);
		mr_str_gb_to_ucs2(switchbuf,(char *)storagePath);
	}
	else if (fmgr_req->dft_list == MR_DSPL_IMAGE)
	{
		mmi_imgview_get_storage_file_path((PS8)storagePath);
	}
	else if (fmgr_req->dft_list == MR_DSPL_AUDIO)
	{
		mmi_ucs2cpy((PS8)storagePath, (PS8)L"root");
	}
	else if(fmgr_req->dft_list == MR_DSPL_VIDEO)
	{
            #if defined(__MMI_VIDEO_PLAY_SUPPORT__) || (defined(__MMI_VIDEO_RECORDER__) && !defined(__MMI_CAMCORDER__))
		mmi_vdoply_get_storage_file_path((PS8)storagePath);
            #endif
	}
	else if(fmgr_req->dft_list == MR_DSPL_NONE)
	{
		U8 drv = (U8)(fmgr_req->list_path[0]);

		if(strlen(fmgr_req->list_path) > 0)
		{
			if (drv == 'A'||drv == 'a')
			{
				tempdrv = MMI_SYSTEM_DRV;
			}
			else if(drv == 'B'||drv == 'b')
			{
				tempdrv = MMI_PUBLIC_DRV;
			}
			else if(drv == 'C'||drv == 'c')
			{
				tempdrv =MMI_CARD_DRV;
			}
			else
			{
				ASSERT(0);
				return;
			}
				
			sprintf((char *)switchbuf,"%c:\\%s\\",(S8)tempdrv,(fmgr_req->list_path+3));
			mr_fs_separator_vm_to_local((U8 *)switchbuf);
			mr_str_gb_to_ucs2(switchbuf,(char*)storagePath);
		}
		else
		{
			mmi_ucs2cpy((PS8)storagePath, (PS8)L"root");
		}
	}
	else if(fmgr_req->dft_list == MR_DSPL_FOLDER)
	{
		mmi_ucs2cpy((PS8)storagePath, (PS8)L"root");
		mmi_fmgr_select_path_and_enter(APP_DSM, 
									FMGR_SELECT_FOLDER|FMGR_SELECT_REPEAT,  
									filter, 
									(PS8)storagePath,
									(PsExtFuncPtr)mmi_dsm_fmgr_select_result_callback);
		return;
	}

	mmi_fmgr_select_path_and_enter(APP_DSM, 
									FMGR_SELECT_FILE|FMGR_SELECT_REPEAT,  
									filter, 
									(PS8)storagePath,
									(PsExtFuncPtr)mmi_dsm_fmgr_select_result_callback);
	/* check if device is busy or not */
#endif
}


int32 mr_fmgr_exit(void)
{
	cui_file_selector_close(dsm_fmgr_cui_id);
	//mmi_frm_group_close(GRP_ID_MYTHROAD);
	dsm_fmgr_cui_id = GRP_ID_INVALID;

#if 0
	dsmFmgrAction.fmgrAction = MR_DIALOG_KEY_CANCEL;
	
	if(IsScreenPresent(MENU_DSM_FMGR_APP))
	{
		DeleteUptoScrID(MENU_DSM_FMGR_APP);
		DeleteNHistory(1);
		GoBackHistory();
	}
	else if(GetActiveScreenId() == MENU_DSM_FMGR_APP)
	{
		GoBackHistory();
	}
#endif	
	return MR_SUCCESS;
}

int32 dsmCheckBrowerExit(void)
{
#if 0
	if((GetActiveScreenId() == SCR_FMGR_MAIN) 
		||(GetActiveScreenId() == SCR_FMGR_EXPLORER)
		||IsScreenPresent(SCR_FMGR_MAIN)
		||IsScreenPresent(SCR_FMGR_EXPLORER))
	{
		return 1;
	}else{
		return 0;
	}
#endif	
}

int32 mr_fmgr_show(uint8* input, int32 input_len, uint8** output, int32* output_len, MR_PLAT_EX_CB *cb)
{
		dsmFmgrAction.fmgrAction = MR_DIALOG_KEY_CANCEL;
		memset(dsmFmgrAction.dir,0,sizeof(dsmFmgrAction.dir));
		mr_set_fmgr_req((MR_T_FMGR_REQ*)input);
		mmi_dsm_entry_fmgr_screen();
		return MR_SUCCESS;
}


int32 mr_fmgr_get_selected_path(uint8* input, int32 input_len, uint8** output, int32* output_len, MR_PLAT_EX_CB *cb)
{
	*output =(uint8 *)(dsmFmgrAction.dir);
	*output_len = strlen(dsmFmgrAction.dir);
	return MR_SUCCESS;
}

#endif