81 _LIT8( KErrDescrSetSizeTempFile, "Error allocating size for temp file" ); |
87 _LIT8( KErrDescrSetSizeTempFile, "Error allocating size for temp file" ); |
82 _LIT8( KErrDescrDeleteTempFile, "Error deleting temp file" ); |
88 _LIT8( KErrDescrDeleteTempFile, "Error deleting temp file" ); |
83 _LIT8( KErrDescrSysUtil, "SysUtil failed" ); |
89 _LIT8( KErrDescrSysUtil, "SysUtil failed" ); |
84 _LIT8( KErrDescrSetTime, "Setting time failed" ); |
90 _LIT8( KErrDescrSetTime, "Setting time failed" ); |
85 _LIT8( KErrDescrDateTimeFormat, "Setting date and time formats failed" ); |
91 _LIT8( KErrDescrDateTimeFormat, "Setting date and time formats failed" ); |
|
92 _LIT8( KErrDescrSetLanguage, "Setting language failed"); |
86 _LIT8( KErrDescrGetNetworkModes, "Getting network modes failed" ); |
93 _LIT8( KErrDescrGetNetworkModes, "Getting network modes failed" ); |
87 _LIT8( KErrDescrSetNetworkMode, "Setting network mode failed" ); |
94 _LIT8( KErrDescrSetNetworkMode, "Setting network mode failed" ); |
88 _LIT8( KErrDescrIrActivation, "IR activation failed" ); |
95 _LIT8( KErrDescrIrActivation, "IR activation failed" ); |
89 _LIT8( KErrDescrGetBtPower, "Getting BT power state failed" ); |
96 _LIT8( KErrDescrGetBtPower, "Getting BT power state failed" ); |
90 _LIT8( KErrDescrSetBtPower, "Setting BT power state failed" ); |
97 _LIT8( KErrDescrSetBtPower, "Setting BT power state failed" ); |
209 } |
229 } |
210 #if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 ) |
230 #if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 ) |
211 iAllowSSProperty.Close(); |
231 iAllowSSProperty.Close(); |
212 #endif |
232 #endif |
213 delete iAllowSSSubscriber; |
233 delete iAllowSSSubscriber; |
|
234 |
|
235 FeatureManager::UnInitializeLib(); |
214 } |
236 } |
215 |
237 |
216 //------------------------------------------------------------------------------ |
238 //------------------------------------------------------------------------------ |
217 // Second phase construction |
239 // Second phase construction |
218 //------------------------------------------------------------------------------ |
240 //------------------------------------------------------------------------------ |
219 void CHtiSysInfoServicePlugin::ConstructL() |
241 void CHtiSysInfoServicePlugin::ConstructL() |
220 { |
242 { |
221 HTI_LOG_TEXT( "CHtiSysInfoServicePlugin::ConstructL" ); |
243 HTI_LOG_TEXT( "CHtiSysInfoServicePlugin::ConstructL" ); |
222 User::LeaveIfError( iFs.Connect() ); |
244 User::LeaveIfError( iFs.Connect() ); |
223 iFileMan = CFileMan::NewL( iFs ); |
245 iFileMan = CFileMan::NewL( iFs ); |
|
246 |
|
247 FeatureManager::InitializeLibL(); |
224 } |
248 } |
225 |
249 |
226 //------------------------------------------------------------------------------ |
250 //------------------------------------------------------------------------------ |
227 // CHtiSysInfoServicePlugin::ProcessMessageL |
251 // CHtiSysInfoServicePlugin::ProcessMessageL |
228 //------------------------------------------------------------------------------ |
252 //------------------------------------------------------------------------------ |
2849 |
2879 |
2850 HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::HandleActivateSkinL" ); |
2880 HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::HandleActivateSkinL" ); |
2851 } |
2881 } |
2852 |
2882 |
2853 //------------------------------------------------------------------------------ |
2883 //------------------------------------------------------------------------------ |
|
2884 // CHtiSysInfoServicePlugin::HandleSetLanguageL |
|
2885 //------------------------------------------------------------------------------ |
|
2886 void CHtiSysInfoServicePlugin::HandleSetLanguageL( const TDesC8& aMessage ) |
|
2887 { |
|
2888 HTI_LOG_FUNC_IN( "CHtiSysInfoServicePlugin::HandleSetLanguageL" ); |
|
2889 if ( aMessage.Length() != 3 ) |
|
2890 { |
|
2891 iDispatcher->DispatchOutgoingErrorMessage( KErrArgument, |
|
2892 KErrDescrArgument, KSysInfoServiceUid ); |
|
2893 return; |
|
2894 } |
|
2895 |
|
2896 TInt language = aMessage[1] + ( aMessage[2] << 8 ); |
|
2897 if(language < 0) |
|
2898 { |
|
2899 iDispatcher->DispatchOutgoingErrorMessage( KErrArgument, |
|
2900 KErrDescrSetLanguage, KSysInfoServiceUid ); |
|
2901 return; |
|
2902 } |
|
2903 HTI_LOG_FORMAT( "Set language to %d", language ); |
|
2904 |
|
2905 // Never set Language code 0 to HAL |
|
2906 if (language != 0) |
|
2907 { |
|
2908 User::LeaveIfError(HAL::Set(HAL::ELanguageIndex, language)); |
|
2909 } |
|
2910 |
|
2911 CRepository* commonEngineRepository = CRepository::NewL( |
|
2912 KCRUidCommonEngineKeys); |
|
2913 CleanupStack::PushL(commonEngineRepository); |
|
2914 |
|
2915 User::LeaveIfError(commonEngineRepository->Set(KGSDisplayTxtLang, language)); |
|
2916 |
|
2917 CleanupStack::PopAndDestroy(); |
|
2918 |
|
2919 TBool nbrModeSaved = EFalse; |
|
2920 if (language == ELangArabic || User::Language() == ELangArabic) |
|
2921 { |
|
2922 //numberMode = EGSNumberModeArabicIndic; |
|
2923 SetDefaultNumberModeL(EGSNbrModeArabic, EGSNbrModeTypeArabic); |
|
2924 nbrModeSaved = ETrue; |
|
2925 } |
|
2926 else if ((language == ELangUrdu || User::Language() == ELangUrdu) |
|
2927 || (language == ELangFarsi || User::Language() == ELangFarsi)) |
|
2928 { |
|
2929 //numberMode = EGSNumberModeEasternArabicIndic; |
|
2930 SetDefaultNumberModeL(EGSNbrModeLatin, EGSNbrModeTypeEasternArabic); |
|
2931 nbrModeSaved = ETrue; |
|
2932 } |
|
2933 else if (language == ELangHindi || User::Language() == ELangHindi |
|
2934 || language == ELangMarathi || User::Language() == ELangMarathi) |
|
2935 { |
|
2936 //numberMode = EGSNumberModeIndic; |
|
2937 SetDefaultNumberModeL(EGSNbrModeLatin, EGSNbrModeTypeIndic); |
|
2938 nbrModeSaved = ETrue; |
|
2939 } |
|
2940 |
|
2941 //if number mode is not set above, then set it to Latin with respective |
|
2942 //number mode types. This part might be executed when Automatic is |
|
2943 //selected and the SIM card does not support the language. |
|
2944 if (!nbrModeSaved) |
|
2945 { |
|
2946 TInt nbrModeType = EGSNbrModeTypeIndic; |
|
2947 if (language == ELangArabic || User::Language() == ELangArabic) |
|
2948 { |
|
2949 nbrModeType = EGSNbrModeTypeArabic; |
|
2950 } |
|
2951 else if ((language == ELangUrdu || User::Language() == ELangUrdu) |
|
2952 || (language == ELangFarsi || User::Language() == ELangFarsi)) |
|
2953 { |
|
2954 nbrModeType = EGSNbrModeTypeEasternArabic; |
|
2955 } |
|
2956 |
|
2957 //EGSNumberModeLatin is true in both cases; |
|
2958 SetDefaultNumberModeL(EGSNbrModeLatin, nbrModeType); |
|
2959 } |
|
2960 |
|
2961 // Change input language |
|
2962 CRepository* aknFepRepository = CRepository::NewL( KCRUidAknFep ); |
|
2963 CleanupStack::PushL(aknFepRepository); |
|
2964 User::LeaveIfError( aknFepRepository->Set( KAknFepInputTxtLang, |
|
2965 language )); |
|
2966 // Change input method for Chinese variants |
|
2967 if( FeatureManager::FeatureSupported( KFeatureIdChinese ) ) |
|
2968 { |
|
2969 TBuf<KFepChineseInputModeLength> conversion; |
|
2970 if( language == ELangPrcChinese ) |
|
2971 { |
|
2972 conversion.Num( EPinyin, EHex ); |
|
2973 User::LeaveIfError( aknFepRepository->Set( KAknFepChineseInputMode, conversion ) ); |
|
2974 } |
|
2975 else if( language == ELangHongKongChinese ) |
|
2976 { |
|
2977 conversion.Num( EStroke, EHex ); |
|
2978 User::LeaveIfError( aknFepRepository->Set( KAknFepChineseInputMode, conversion ) ); |
|
2979 } |
|
2980 else if( language == ELangTaiwanChinese ) |
|
2981 { |
|
2982 conversion.Num( EZhuyin, EHex ); |
|
2983 User::LeaveIfError( aknFepRepository->Set( KAknFepChineseInputMode, conversion ) ); |
|
2984 } |
|
2985 } |
|
2986 CleanupStack::PopAndDestroy(); |
|
2987 |
|
2988 iReply = HBufC8::NewL( 1 ); |
|
2989 iReply->Des().Append( 0 ); |
|
2990 HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::HandleSetLanguageL" ); |
|
2991 } |
|
2992 |
|
2993 void CHtiSysInfoServicePlugin::SetDefaultNumberModeL(TInt aMode, TInt aNbrModeType) |
|
2994 { |
|
2995 |
|
2996 CRepository* localeRepository = CRepository::NewL(KCRUidLocaleSettings); |
|
2997 CleanupStack::PushL(localeRepository); |
|
2998 if (aNbrModeType == EGSNbrModeTypeArabic || aNbrModeType |
|
2999 == EGSNbrModeTypeEasternArabic) |
|
3000 { |
|
3001 localeRepository->Set(KSettingsDefaultNumberMode, aMode); |
|
3002 } |
|
3003 else |
|
3004 { |
|
3005 localeRepository->Set(KSettingsIndicDefaultNumberMode, aMode); |
|
3006 } |
|
3007 CleanupStack::PopAndDestroy(); |
|
3008 |
|
3009 TLocale locale; |
|
3010 if (aMode == EGSNbrModeLatin) |
|
3011 { |
|
3012 locale.SetDigitType(EDigitTypeWestern); |
|
3013 } |
|
3014 else |
|
3015 { |
|
3016 //if aMode <> EGSNbrModeLatin, then it should be either latin or arabic. However |
|
3017 //as EGSNbrModeArabic and EGsNbrModeIndic both have a value = 1, we can't use |
|
3018 //that constant for below comparison. Hence, need to depend on the 2nd param. |
|
3019 switch (aNbrModeType) |
|
3020 { |
|
3021 case EGSNbrModeTypeArabic: |
|
3022 locale.SetDigitType(EDigitTypeArabicIndic); |
|
3023 break; |
|
3024 case EGSNbrModeTypeIndic: |
|
3025 locale.SetDigitType(EDigitTypeDevanagari); |
|
3026 break; |
|
3027 case EGSNbrModeTypeEasternArabic: |
|
3028 locale.SetDigitType(EDigitTypeEasternArabicIndic); |
|
3029 break; |
|
3030 default: |
|
3031 break; |
|
3032 } |
|
3033 } |
|
3034 |
|
3035 locale.Set(); |
|
3036 } |
|
3037 //------------------------------------------------------------------------------ |
2854 // CHtiSysInfoServicePlugin::ParseTimeDataL |
3038 // CHtiSysInfoServicePlugin::ParseTimeDataL |
2855 //------------------------------------------------------------------------------ |
3039 //------------------------------------------------------------------------------ |
2856 void CHtiSysInfoServicePlugin::ParseTimeDataL( const TDesC8& aTimeData, |
3040 void CHtiSysInfoServicePlugin::ParseTimeDataL( const TDesC8& aTimeData, |
2857 TTime& aResult ) |
3041 TTime& aResult ) |
2858 { |
3042 { |