486 |
486 |
487 const wstring AppMngr2MidletSettingsUtil::getLocalizedSettingsName(wstring aSettingsName) |
487 const wstring AppMngr2MidletSettingsUtil::getLocalizedSettingsName(wstring aSettingsName) |
488 { |
488 { |
489 wstring ret = aSettingsName; |
489 wstring ret = aSettingsName; |
490 TRAP_IGNORE( |
490 TRAP_IGNORE( |
491 HBufC* localizedName = NULL; |
491 HBufC* localizedName = getLocalizedSettingsNameLC(aSettingsName); |
492 if (aSettingsName == ACCESS_POINT_SETTINGS) |
|
493 { |
|
494 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NETWORK_DESTINATION); |
|
495 } |
|
496 else if (aSettingsName == ON_SCREEN_KEYPAD_SETTINGS) |
|
497 { |
|
498 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_KEYPAD); |
|
499 } |
|
500 else if (aSettingsName == SECURITY_WARNINGS_SETTINGS) |
|
501 { |
|
502 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_SECURITY_WARNINGS); |
|
503 } |
|
504 else if (aSettingsName == NET_ACCESS_SETTINGS) |
|
505 { |
|
506 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NET_ACCESS); |
|
507 } |
|
508 else if (aSettingsName == LOW_LEVEL_NET_ACCESS_SETTINGS) |
|
509 { |
|
510 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOW_LEVEL_NET_ACCESS); |
|
511 } |
|
512 else if (aSettingsName == CALL_CONTROL_SETTINGS) |
|
513 { |
|
514 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_RESTRICTED_CALL_CONTROL); |
|
515 } |
|
516 else if (aSettingsName == MESSAGING_SETTINGS) |
|
517 { |
|
518 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_MESSAGING); |
|
519 } |
|
520 else if (aSettingsName == RESTRICTED_MESSAGING_SETTINGS) |
|
521 { |
|
522 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_RESTRICTED_MESSAGING); |
|
523 } |
|
524 else if (aSettingsName == APPLICATION_AUTO_INVOCATION_SETTINGS) |
|
525 { |
|
526 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_APP_AUTO_INVOCAT); |
|
527 } |
|
528 else if (aSettingsName == LOCAL_CONNECTIVITY_SETTINGS) |
|
529 { |
|
530 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOCAL_CONN); |
|
531 } |
|
532 else if (aSettingsName == MULTIMEDIA_RECORDING_SETTINGS) |
|
533 { |
|
534 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_MM_RECORD); |
|
535 } |
|
536 else if (aSettingsName == READ_USER_DATA_ACCESS_SETTINGS) |
|
537 { |
|
538 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_READ_DATA); |
|
539 } |
|
540 else if (aSettingsName == WRITE_USER_DATA_ACCESS_SETTINGS) |
|
541 { |
|
542 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_WRITE_DATA); |
|
543 } |
|
544 else if (aSettingsName == LOCATION_SETTINGS) |
|
545 { |
|
546 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOCATION); |
|
547 } |
|
548 else if (aSettingsName == LANDMARK_SETTINGS) |
|
549 { |
|
550 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LANDMARKS); |
|
551 } |
|
552 else if (aSettingsName == AUTHENTICATION_SETTINGS) |
|
553 { |
|
554 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_AUT); |
|
555 } |
|
556 else if (aSettingsName == SMART_CARD_COMMUNICATION_SETTINGS) |
|
557 { |
|
558 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_SMARTCARD); |
|
559 } |
|
560 else if (aSettingsName == BROADCAST_SETTINGS) |
|
561 { |
|
562 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_BROADCAST); |
|
563 } |
|
564 else if (aSettingsName == NFC_WRITE_ACCESS_SETTINGS) |
|
565 { |
|
566 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NFC_WRITE_ACCESS); |
|
567 } |
|
568 else if (aSettingsName == URL_START_SETTINGS) |
|
569 { |
|
570 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_URL_START); |
|
571 } |
|
572 if (localizedName != NULL) |
492 if (localizedName != NULL) |
573 { |
493 { |
574 ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); |
494 ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); |
575 CleanupStack::PopAndDestroy(localizedName); |
495 CleanupStack::PopAndDestroy(localizedName); |
576 } |
496 } |
577 ); |
497 ); |
578 return ret; |
498 return ret; |
579 } |
499 } |
580 |
500 |
|
501 HBufC* AppMngr2MidletSettingsUtil::getLocalizedSettingsNameLC(wstring aSettingsName) |
|
502 { |
|
503 HBufC* localizedName = NULL; |
|
504 if (aSettingsName == ACCESS_POINT_SETTINGS) |
|
505 { |
|
506 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NETWORK_DESTINATION); |
|
507 } |
|
508 else if (aSettingsName == ON_SCREEN_KEYPAD_SETTINGS) |
|
509 { |
|
510 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_KEYPAD); |
|
511 } |
|
512 else if (aSettingsName == SECURITY_WARNINGS_SETTINGS) |
|
513 { |
|
514 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_SECURITY_WARNINGS); |
|
515 } |
|
516 else if (aSettingsName == NET_ACCESS_SETTINGS) |
|
517 { |
|
518 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NET_ACCESS); |
|
519 } |
|
520 else if (aSettingsName == LOW_LEVEL_NET_ACCESS_SETTINGS) |
|
521 { |
|
522 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOW_LEVEL_NET_ACCESS); |
|
523 } |
|
524 else if (aSettingsName == CALL_CONTROL_SETTINGS) |
|
525 { |
|
526 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_RESTRICTED_CALL_CONTROL); |
|
527 } |
|
528 else if (aSettingsName == MESSAGING_SETTINGS) |
|
529 { |
|
530 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_MESSAGING); |
|
531 } |
|
532 else if (aSettingsName == RESTRICTED_MESSAGING_SETTINGS) |
|
533 { |
|
534 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_RESTRICTED_MESSAGING); |
|
535 } |
|
536 else if (aSettingsName == APPLICATION_AUTO_INVOCATION_SETTINGS) |
|
537 { |
|
538 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_APP_AUTO_INVOCAT); |
|
539 } |
|
540 else if (aSettingsName == LOCAL_CONNECTIVITY_SETTINGS) |
|
541 { |
|
542 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOCAL_CONN); |
|
543 } |
|
544 else if (aSettingsName == MULTIMEDIA_RECORDING_SETTINGS) |
|
545 { |
|
546 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_MM_RECORD); |
|
547 } |
|
548 else if (aSettingsName == READ_USER_DATA_ACCESS_SETTINGS) |
|
549 { |
|
550 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_READ_DATA); |
|
551 } |
|
552 else if (aSettingsName == WRITE_USER_DATA_ACCESS_SETTINGS) |
|
553 { |
|
554 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_WRITE_DATA); |
|
555 } |
|
556 else if (aSettingsName == LOCATION_SETTINGS) |
|
557 { |
|
558 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOCATION); |
|
559 } |
|
560 else if (aSettingsName == LANDMARK_SETTINGS) |
|
561 { |
|
562 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LANDMARKS); |
|
563 } |
|
564 else if (aSettingsName == AUTHENTICATION_SETTINGS) |
|
565 { |
|
566 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_AUT); |
|
567 } |
|
568 else if (aSettingsName == SMART_CARD_COMMUNICATION_SETTINGS) |
|
569 { |
|
570 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_SMARTCARD); |
|
571 } |
|
572 else if (aSettingsName == BROADCAST_SETTINGS) |
|
573 { |
|
574 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_BROADCAST); |
|
575 } |
|
576 else if (aSettingsName == NFC_WRITE_ACCESS_SETTINGS) |
|
577 { |
|
578 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NFC_WRITE_ACCESS); |
|
579 } |
|
580 else if (aSettingsName == URL_START_SETTINGS) |
|
581 { |
|
582 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_URL_START); |
|
583 } |
|
584 return localizedName; |
|
585 } |
|
586 |
581 const wstring AppMngr2MidletSettingsUtil::getLocalizedSettingsInteractionMode(int aInteractionMode) |
587 const wstring AppMngr2MidletSettingsUtil::getLocalizedSettingsInteractionMode(int aInteractionMode) |
582 { |
588 { |
583 HBufC* localizedName = NULL; |
589 wstring ret = L""; |
584 switch (aInteractionMode) |
590 TRAP_IGNORE( |
585 { |
591 HBufC* localizedName = NULL; |
586 case INTERACTION_MODE_BLANKET: |
592 switch (aInteractionMode) |
587 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_BLANK); |
593 { |
588 break; |
594 case INTERACTION_MODE_BLANKET: |
589 case INTERACTION_MODE_SESSION: |
595 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_BLANK); |
590 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_SESSION); |
596 break; |
591 break; |
597 case INTERACTION_MODE_SESSION: |
592 case INTERACTION_MODE_ONESHOT: |
598 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_SESSION); |
593 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_ONESHOT); |
599 break; |
594 break; |
600 case INTERACTION_MODE_ONESHOT: |
595 case INTERACTION_MODE_DENIED: |
601 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_ONESHOT); |
596 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_NO); |
602 break; |
597 break; |
603 case INTERACTION_MODE_DENIED: |
598 default: |
604 localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_NO); |
599 return L""; |
605 break; |
600 } |
606 } |
601 wstring ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); |
607 if (localizedName != NULL) |
602 CleanupStack::PopAndDestroy(localizedName); |
608 { |
|
609 ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); |
|
610 CleanupStack::PopAndDestroy(localizedName); |
|
611 } |
|
612 ); |
603 return ret; |
613 return ret; |
604 } |
614 } |
605 |
615 |
606 const wstring AppMngr2MidletSettingsUtil::getLocalizedSecurityWarningsModeValue(wstring aSecurityWarningsModeValue) |
616 const wstring AppMngr2MidletSettingsUtil::getLocalizedSecurityWarningsModeValue(wstring aSecurityWarningsModeValue) |
607 { |
617 { |
608 HBufC* localizedName = NULL; |
618 wstring ret = L""; |
609 if (aSecurityWarningsModeValue == SECURITY_WARNINGS_DEFAULT_MODE) |
619 TRAP_IGNORE( |
610 { |
620 HBufC* localizedName = NULL; |
611 localizedName = StringLoader::LoadLC(R_JAVA_SECURITY_WARNINGS_SETTING_VALUE_DEFAULT); |
621 if (aSecurityWarningsModeValue == SECURITY_WARNINGS_DEFAULT_MODE) |
612 } |
622 { |
613 else if (aSecurityWarningsModeValue == SECURITY_WARNINGS_USER_DEFINED_MODE) |
623 localizedName = StringLoader::LoadLC(R_JAVA_SECURITY_WARNINGS_SETTING_VALUE_DEFAULT); |
614 { |
624 } |
615 localizedName = StringLoader::LoadLC(R_JAVA_SECURITY_WARNINGS_SETTING_VALUE_USER_DEFINED); |
625 else if (aSecurityWarningsModeValue == SECURITY_WARNINGS_USER_DEFINED_MODE) |
616 } |
626 { |
617 else |
627 localizedName = StringLoader::LoadLC(R_JAVA_SECURITY_WARNINGS_SETTING_VALUE_USER_DEFINED); |
618 { |
628 } |
619 return L""; |
629 if (localizedName != NULL) |
620 } |
630 { |
621 wstring ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); |
631 ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); |
622 CleanupStack::PopAndDestroy(localizedName); |
632 CleanupStack::PopAndDestroy(localizedName); |
|
633 } |
|
634 ); |
623 return ret; |
635 return ret; |
624 } |
636 } |
625 |
637 |
626 const wstring AppMngr2MidletSettingsUtil::getLocalizedOnScreenKeypadValue(wstring aOnScreenKeypadValue) |
638 const wstring AppMngr2MidletSettingsUtil::getLocalizedOnScreenKeypadValue(wstring aOnScreenKeypadValue) |
627 { |
639 { |
628 HBufC* localizedName = NULL; |
640 wstring ret = L""; |
629 if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_NO) |
641 TRAP_IGNORE( |
630 { |
642 HBufC* localizedName = NULL; |
631 localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_NO); |
643 if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_NO) |
632 } |
644 { |
633 else if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_GAMEACTIONS) |
645 localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_NO); |
634 { |
646 } |
635 localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_GAME); |
647 else if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_GAMEACTIONS) |
636 } |
648 { |
637 else if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_NAVIGATION) |
649 localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_GAME); |
638 { |
650 } |
639 localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_NAVIGATION); |
651 else if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_NAVIGATION) |
640 } |
652 { |
641 else |
653 localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_NAVIGATION); |
642 { |
654 } |
643 return L""; |
655 if (localizedName != NULL) |
644 } |
656 { |
645 wstring ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); |
657 ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); |
646 CleanupStack::PopAndDestroy(localizedName); |
658 CleanupStack::PopAndDestroy(localizedName); |
|
659 } |
|
660 ); |
647 return ret; |
661 return ret; |
648 } |
662 } |