# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1272880905 -10800 # Node ID d7fc66ccd6fb6ab43a361d08be165865495af500 # Parent e32024264ebb5849e33dc806e7cb26d3870d7c96 Revision: 201015 Kit: 201018 diff -r e32024264ebb -r d7fc66ccd6fb cbs/CbsServer/ServerSrc/CCbsSatRefresh.cpp --- a/cbs/CbsServer/ServerSrc/CCbsSatRefresh.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/cbs/CbsServer/ServerSrc/CCbsSatRefresh.cpp Mon May 03 13:01:45 2010 +0300 @@ -21,8 +21,8 @@ // INCLUDE FILES #include "CCbsSatRefresh.h" #include "CCbsServer.h" -#include -#include +#include +#include #include "CbsLogger.h" diff -r e32024264ebb -r d7fc66ccd6fb cellular/SSSettings/src/CSSSettingsRefreshHandler.cpp --- a/cellular/SSSettings/src/CSSSettingsRefreshHandler.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/SSSettings/src/CSSSettingsRefreshHandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -231,6 +231,17 @@ iRSSSettings.HandleRefresh(); } + TBool cspEfFound = + aFiles.Locate( KCsp1Ef ) != KErrNotFound || + aFiles.Locate( KCsp2Ef ) != KErrNotFound; + + // KCspEf is no longer provided by SAT but GS and PS seem to depend on it, + // handled here for now. + TBool fileFound = + aFiles.Locate( iNotifyInfo->iObservedFile ) != KErrNotFound || + cspEfFound && iNotifyInfo->iObservedFile == KCspEf; + + // By default refresh is allowed. TBool allow(ETrue); @@ -240,97 +251,47 @@ // Handle only if observer wants to listen this event. if ( iNotifyInfo->iObservedRefreshType & aType ) { - TInt changedFiles(0); - // Only change notification will contain file list. - if ( aType == EFileChangeNotification ) - { - if ( aFiles.Locate( KCspEf ) != KErrNotFound ) - { - changedFiles += KCspEf; - } - // Check if the changed files is what is wanted to be listened. - changedFiles = changedFiles & iNotifyInfo->iObservedFile; - } - - // For change notification the filelist must contain files, for - // other refresh types it is empty. - if ( ( aType != EFileChangeNotification ) || - ( ( aType == EFileChangeNotification ) && - changedFiles ) ) + if ( aType != EFileChangeNotification || fileFound ) { if ( aFunctionality == ESSSettingsRefresh ) { // Inform the observer about the refresh event. iNotifyInfo->iObserver->Refresh( - aType, - ( TSatElementaryFiles ) changedFiles ); - - if ( aFiles.Locate( KCsp1Ef ) != KErrNotFound ) - { - iRSatRefresh->RefreshEFRead( ETrue ); - } - else if( aFiles.Locate( KCsp2Ef ) != KErrNotFound ) - { - iRSatRefresh->RefreshEFRead( ETrue ); - } - else - { - iRSatRefresh->RefreshEFRead( EFalse ); - } + aType, iNotifyInfo->iObservedFile ); + iRSatRefresh->RefreshEFRead( cspEfFound ); } else // ESSSettingsAllowRefresh { // Inform the observer about the coming refresh event. allow = iNotifyInfo->iObserver->AllowRefresh( - aType, - ( TSatElementaryFiles ) changedFiles ); + aType, iNotifyInfo->iObservedFile ); } } // If there is no client listening changed files SSSettings has to // check if some CSP file is into the list and send right response // since itself reads CSP files. - if ( !changedFiles ) - { - if ( aFiles.Locate( KCsp1Ef ) != KErrNotFound ) - { - iRSatRefresh->RefreshEFRead( EFalse ); - } - else if( aFiles.Locate( KCsp2Ef ) != KErrNotFound ) - { - iRSatRefresh->RefreshEFRead( EFalse ); - } - else - { - iRSatRefresh->RefreshEFRead( ETrue ); - } + if ( !fileFound ) + { + iRSatRefresh->RefreshEFRead( !cspEfFound ); } - __SSSLOGSTRING1("[SSS] DoHandleRefresh: changedFiles: %d", changedFiles); } else { - iRSatRefresh->RefreshEFRead( EFalse ); + iRSatRefresh->RefreshEFRead( EFalse ); } } - - if ( !iNotifyInfo->iObserver && ( aType == EFileChangeNotification + else if ( aType == EFileChangeNotification || aType == ESimInitFileChangeNotification - || aType == ESimInit ) ) + || aType == ESimInit ) { - if ( aFiles.Locate( KCsp1Ef ) != KErrNotFound ) - { - iRSatRefresh->RefreshEFRead( EFalse ); - } - else if( aFiles.Locate( KCsp2Ef ) != KErrNotFound ) - { - iRSatRefresh->RefreshEFRead( EFalse ); - } - else - { - iRSatRefresh->RefreshEFRead( ETrue ); - } - } - + iRSatRefresh->RefreshEFRead( !cspEfFound ); + } + else + { + // Do nothing + } + __SSSLOGSTRING("[SSS] <--CSSSettingsRefreshHandler::DoHandleRefresh"); return allow; } diff -r e32024264ebb -r d7fc66ccd6fb cellular/SSSettings/xqbindings/sssettingswrapper/src/sssettingswrapper.cpp --- a/cellular/SSSettings/xqbindings/sssettingswrapper/src/sssettingswrapper.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/SSSettings/xqbindings/sssettingswrapper/src/sssettingswrapper.cpp Mon May 03 13:01:45 2010 +0300 @@ -17,7 +17,7 @@ #include -#include +#include #include "sssettingswrapper_p.h" #include "logging.h" diff -r e32024264ebb -r d7fc66ccd6fb cellular/SSSettings/xqbindings/sssettingswrapper/src/sssettingswrapper_p.cpp --- a/cellular/SSSettings/xqbindings/sssettingswrapper/src/sssettingswrapper_p.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/SSSettings/xqbindings/sssettingswrapper/src/sssettingswrapper_p.cpp Mon May 03 13:01:45 2010 +0300 @@ -18,7 +18,7 @@ #include "sssettingswrapper_p.h" #include "sssettingswrapper.h" #include "logging.h" -#include +#include /*! SsSettingsWrapperPrivate::SsSettingsWrapperPrivate diff -r e32024264ebb -r d7fc66ccd6fb cellular/SSSettings/xqbindings/sssettingswrapper/src/sssettingswrapper_p.h --- a/cellular/SSSettings/xqbindings/sssettingswrapper/src/sssettingswrapper_p.h Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/SSSettings/xqbindings/sssettingswrapper/src/sssettingswrapper_p.h Mon May 03 13:01:45 2010 +0300 @@ -18,8 +18,8 @@ #ifndef SSSETTINGSWRAPPER_P_H #define SSSETTINGSWRAPPER_P_H -#include -#include +#include +#include class SsSettingsWrapper; diff -r e32024264ebb -r d7fc66ccd6fb cellular/SSSettings/xqbindings/sssettingswrapper/tsrc/run_auto_tests_qt.bat --- a/cellular/SSSettings/xqbindings/sssettingswrapper/tsrc/run_auto_tests_qt.bat Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/SSSettings/xqbindings/sssettingswrapper/tsrc/run_auto_tests_qt.bat Mon May 03 13:01:45 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,12 +137,11 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs --config winscw_udeb --keepgoing CLEAN if [%INSTRUMENT%] EQU [TRUE] ( -call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% +call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%" ) else ( -call %ABLD_CALL% +call %SBS_CALL% ) popd @@ -152,7 +156,10 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::: :RUNTESTS echo Running tests -for /f %%a in ('dir /b ut_*') do call %PATH_TO_DLL%\%%a.exe -dtextshell -- +for /f %%a in ('dir /b ut_*') do ( + call %PATH_TO_DLL%\%%a.exe -dtextshell -- + move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log +) goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/inc/MCallDiverting.h --- a/cellular/telephonysettings/inc/MCallDiverting.h Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/inc/MCallDiverting.h Mon May 03 13:01:45 2010 +0300 @@ -29,12 +29,10 @@ class MCallDiverting { public: -// <-- QT PHONE START --> /** * Sets observer which informs when request is completed */ virtual void SetRequestObserver( MPsetRequestObserver* aObs ) = 0; -// <-- QT PHONE END --> /** * Sets diverting to the network. @@ -114,16 +112,6 @@ */ virtual TInt SaveKey( TUint32 aKeyId, const TDesC& aKeyValue ) = 0; - /** - * Opens Vmbx connection. Leaves vmbx to the stack. - * - * @param aTelNumber vmbx number. - * @param aVmbx vmbx connection. - * @return used vmbx number. - */ - // <-- QT PHONE START--> - //virtual TInt OpenVmbxLC( TDes& aTelNumber, RVmbxNumber& aVmbx ) = 0; - // <-- QT PHONE END--> /* * Virtual destructor. */ diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/inc/PSetCallDivertingBasicImpl.h --- a/cellular/telephonysettings/inc/PSetCallDivertingBasicImpl.h Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/inc/PSetCallDivertingBasicImpl.h Mon May 03 13:01:45 2010 +0300 @@ -101,6 +101,10 @@ const TBasicServiceGroups aBsc ); TSelectedLine GetSAAls(); + + private: + // Memorize requested service group + TServiceGroup iRequestedServiceGroup; }; #endif // CPSETCALLDIVERTINGBASICIMPL_H diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/inc/PSetUtility.h --- a/cellular/telephonysettings/inc/PSetUtility.h Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/inc/PSetUtility.h Mon May 03 13:01:45 2010 +0300 @@ -87,10 +87,9 @@ *****************************************************/ static RMobilePhone::TMobilePhoneCFCondition GetDivertReason( TCallDivertingCondition aCondition ); -// <-- QT PHONE START --> + static TCallDivertingCondition GetDivertReason( RMobilePhone::TMobilePhoneCFCondition aCondition ); -// <-- QT PHONE END --> static RMobilePhone::TMobileService VerifyAltLineUseL(); }; diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/src/PSetCallDivertingBasicImpl.cpp --- a/cellular/telephonysettings/src/PSetCallDivertingBasicImpl.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/src/PSetCallDivertingBasicImpl.cpp Mon May 03 13:01:45 2010 +0300 @@ -104,6 +104,7 @@ User::Leave( KErrInUse ); } iBsc = aBsc; + iRequestedServiceGroup = aDivert.iServiceGroup; CPsetTelephony::CheckLineModeL( aDivert.iServiceGroup, &iPhone, iLine ); if ( !iLine->SubSessionHandle() ) @@ -205,6 +206,8 @@ iDivertStatus.iNumber = iChangeInfo.iNumber.iTelNumber; iDivertStatus.iCondition = PSetUtility::GetDivertReason(iReason); iDivertStatus.iNoReplyTimer = iChangeInfo.iTimeout; + iDivertStatus.iServiceGroup = iRequestedServiceGroup; + // Check is done because of VOIP notification functionality(PSetNotesUI). if ( iVoiceDivert && !iVideoDivert ) { diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/xqbindings/bwins/psetwrapperu.def --- a/cellular/telephonysettings/xqbindings/bwins/psetwrapperu.def Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/xqbindings/bwins/psetwrapperu.def Mon May 03 13:01:45 2010 +0300 @@ -125,4 +125,6 @@ ??0PSetCallWaitingWrapper@@QAE@AAVCPsetContainer@@PAVQObject@@@Z @ 124 NONAME ; PSetCallWaitingWrapper::PSetCallWaitingWrapper(class CPsetContainer &, class QObject *) ??_EPSetCallWaitingWrapper@@UAE@I@Z @ 125 NONAME ; PSetCallWaitingWrapper::~PSetCallWaitingWrapper(unsigned int) ?getStaticMetaObject@PSetNetworkWrapper@@SAABUQMetaObject@@XZ @ 126 NONAME ; struct QMetaObject const & PSetNetworkWrapper::getStaticMetaObject(void) + ?barringPasswordChangeRequestCompleted@PSetCallBarringWrapper@@IAEXH@Z @ 127 NONAME ; void PSetCallBarringWrapper::barringPasswordChangeRequestCompleted(int) + ?changeBarringPassword@PSetCallBarringWrapper@@QAEXABVQString@@00@Z @ 128 NONAME ; void PSetCallBarringWrapper::changeBarringPassword(class QString const &, class QString const &, class QString const &) diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/xqbindings/eabi/psetwrapperu.def --- a/cellular/telephonysettings/xqbindings/eabi/psetwrapperu.def Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/xqbindings/eabi/psetwrapperu.def Mon May 03 13:01:45 2010 +0300 @@ -125,4 +125,6 @@ _ZTV22PSetCallBarringWrapper @ 124 NONAME _ZTV22PSetCallWaitingWrapper @ 125 NONAME _ZTV24PSetCallDivertingWrapper @ 126 NONAME + _ZN22PSetCallBarringWrapper21changeBarringPasswordERK7QStringS2_S2_ @ 127 NONAME + _ZN22PSetCallBarringWrapper37barringPasswordChangeRequestCompletedEi @ 128 NONAME diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/xqbindings/psetwrapper/src/psetcallbarringwrapper.cpp --- a/cellular/telephonysettings/xqbindings/psetwrapper/src/psetcallbarringwrapper.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/xqbindings/psetwrapper/src/psetcallbarringwrapper.cpp Mon May 03 13:01:45 2010 +0300 @@ -80,4 +80,18 @@ m_privateImpl->disableBarring(serviceGroup, barringType, barringPassword); } +/*! + PSetCallBarringWrapper::changeBarringPassword + */ +void PSetCallBarringWrapper::changeBarringPassword( + const QString &oldPassword, + const QString &newPassword, + const QString &verifiedPassword) +{ + DPRINT; + + m_privateImpl->changeBarringPassword( + oldPassword, newPassword, verifiedPassword); +} + // End of File. diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/xqbindings/psetwrapper/src/psetcallbarringwrapper_p.cpp --- a/cellular/telephonysettings/xqbindings/psetwrapper/src/psetcallbarringwrapper_p.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/xqbindings/psetwrapper/src/psetcallbarringwrapper_p.cpp Mon May 03 13:01:45 2010 +0300 @@ -262,6 +262,27 @@ /*! + PSetCallBarringWrapperPrivate::changeBarringPassword + */ +void PSetCallBarringWrapperPrivate::changeBarringPassword( + const QString &oldPassword, + const QString &newPassword, + const QString &verifiedPassword) +{ + RMobilePhone::TMobilePhonePasswordChangeV2 passwordChange; + passwordChange.iOldPassword.Copy(oldPassword.utf16()); + passwordChange.iNewPassword.Copy(newPassword.utf16()); + passwordChange.iVerifiedPassword.Copy(verifiedPassword.utf16()); + + QT_TRAP_THROWING( + m_callBarring->ChangePasswordL(passwordChange); + ) + + m_currentRequest = RequestChangePassword; +} + + +/*! From MPsetBarringObserver. PSetCallBarringWrapperPrivate::HandleBarringModeChangedL */ @@ -360,7 +381,11 @@ { DPRINT; - Q_UNUSED(aSuccess) + if (aSuccess) { + m_barringError = PSetCallBarringWrapper::BarringErrorNone; + } else { + m_barringError = KErrGsmSSNegativePasswordCheck; + } } @@ -417,6 +442,18 @@ DPRINT << "RequestDisableBarring ERROR:" << errorCode; break; } + + case RequestChangePassword: + { + int errorCode = 0; + QT_TRYCATCH_ERROR( errorCode, + emit m_owner.barringPasswordChangeRequestCompleted( + m_barringError); + ) + DPRINT << "RequestChangePassword ERROR:" << errorCode; + break; + } + default: break; } diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/xqbindings/psetwrapper/src/psetcallbarringwrapper_p.h --- a/cellular/telephonysettings/xqbindings/psetwrapper/src/psetcallbarringwrapper_p.h Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/xqbindings/psetwrapper/src/psetcallbarringwrapper_p.h Mon May 03 13:01:45 2010 +0300 @@ -18,8 +18,8 @@ #ifndef PSETCALLBARRINGWRAPPER_P_H #define PSETCALLBARRINGWRAPPER_P_H -#include -#include +#include +#include #include #include @@ -38,7 +38,8 @@ RequestNone, RequestBarringStatus, RequestEnableBarring, - RequestDisableBarring + RequestDisableBarring, + RequestChangePassword }; public: @@ -63,6 +64,11 @@ PSetCallBarringWrapper::BarringType barringType, QString barringPassword); + void changeBarringPassword( + const QString &oldPassword, + const QString &newPassword, + const QString &verifiedPassword); + public: // From MPsetBarringObserver /** diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/xqbindings/psetwrapper/src/psetcalldivertingwrapper_p.cpp --- a/cellular/telephonysettings/xqbindings/psetwrapper/src/psetcalldivertingwrapper_p.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/xqbindings/psetwrapper/src/psetcalldivertingwrapper_p.cpp Mon May 03 13:01:45 2010 +0300 @@ -88,7 +88,7 @@ PSCallDivertingStatus* divertingStatus = new (ELeave) PSCallDivertingStatus(); divertingStatus->iCondition = convert(cfInfo.iCondition); - divertingStatus->iServiceGroup = cfInfo.iServiceGroup; + divertingStatus->iServiceGroup = convert(cfInfo.iServiceGroup); divertingStatus->iStatus = convert(cfInfo.iStatus); divertingStatus->iNumber = QString::fromUtf16( cfInfo.iNumber.iTelNumber.Ptr(), @@ -335,11 +335,14 @@ return ret; } +/*! + PSetCallDivertingWrapperPrivate::convert + */ TDivertingSetting PSetCallDivertingWrapperPrivate::convert( PsCallDivertingSetting type) { switch(type){ - case ActivateDiverting: + case ActivateDiverting: return EActivateDiverting; case CancelDiverting: return ECancelDiverting; @@ -353,4 +356,88 @@ } } +/*! + PSetCallDivertingWrapperPrivate::convert + */ +PsServiceGroup PSetCallDivertingWrapperPrivate::convert( + RMobilePhone::TMobileService service ) +{ + PsServiceGroup ret(0); + switch (service) { + case RMobilePhone::EAllServices: + ret |= ServiceGroupData; + ret |= ServiceGroupVoice; + ret |= ServiceGroupFax; + break; + case RMobilePhone::EAllTele: + case RMobilePhone::EAllTeleExcSms: + ret |= ServiceGroupVoice; + ret |= ServiceGroupFax; + break; + case RMobilePhone::ECircuitDataService: + case RMobilePhone::EPacketDataService: + case RMobilePhone::EAllDataExSms: + case RMobilePhone::ESyncData: + case RMobilePhone::EAsyncData: + case RMobilePhone::EPacketData: + case RMobilePhone::EAllGprsBearer: + case RMobilePhone::EAllPlmnBearer: + case RMobilePhone::EPlmnBearerServ1: + case RMobilePhone::EPlmnBearerServ2: + case RMobilePhone::EPlmnBearerServ3: + case RMobilePhone::EPlmnBearerServ4: + case RMobilePhone::EPlmnBearerServ5: + case RMobilePhone::EPlmnBearerServ6: + case RMobilePhone::EPlmnBearerServ7: + case RMobilePhone::EPlmnBearerServ8: + case RMobilePhone::EPlmnBearerServ9: + case RMobilePhone::EPlmnBearerServA: + case RMobilePhone::EPlmnBearerServB: + case RMobilePhone::EPlmnBearerServC: + case RMobilePhone::EPlmnBearerServD: + case RMobilePhone::EPlmnBearerServE: + case RMobilePhone::EPlmnBearerServF: + case RMobilePhone::EAllBearer: + case RMobilePhone::EPadAccess: + case RMobilePhone::EAllAsync: + case RMobilePhone::EAllSync: + ret |= ServiceGroupData; + break; + case RMobilePhone::ETelephony: + case RMobilePhone::EVoiceService: + case RMobilePhone::EAuxVoiceService: + case RMobilePhone::EAllPlmnTele: + case RMobilePhone::EPlmnTele1: + case RMobilePhone::EPlmnTele2: + case RMobilePhone::EPlmnTele3: + case RMobilePhone::EPlmnTele4: + case RMobilePhone::EPlmnTele5: + case RMobilePhone::EPlmnTele6: + case RMobilePhone::EPlmnTele7: + case RMobilePhone::EPlmnTele8: + case RMobilePhone::EPlmnTele9: + case RMobilePhone::EPlmnTeleA: + case RMobilePhone::EPlmnTeleB: + case RMobilePhone::EPlmnTeleC: + case RMobilePhone::EPlmnTeleD: + case RMobilePhone::EPlmnTeleE: + case RMobilePhone::EPlmnTeleF: + case RMobilePhone::EAltTele: + ret |= ServiceGroupVoice; + break; + case RMobilePhone::EAllDataTele: + case RMobilePhone::EFaxService: + ret |= ServiceGroupFax; + break; + case RMobilePhone::EVoiceGroupCall: + case RMobilePhone::EVoiceBroadcast: + case RMobilePhone::EShortMessageService: + case RMobilePhone::EServiceUnspecified: + default: + // Not supported, skip + break; + } + return ret; +} + // end of file diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/xqbindings/psetwrapper/src/psetcalldivertingwrapper_p.h --- a/cellular/telephonysettings/xqbindings/psetwrapper/src/psetcalldivertingwrapper_p.h Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/xqbindings/psetwrapper/src/psetcalldivertingwrapper_p.h Mon May 03 13:01:45 2010 +0300 @@ -114,6 +114,7 @@ PsCallDivertingStatus convert(TDivertingStatus type); PsCallDivertingStatus convert(RMobilePhone::TMobilePhoneCFStatus type); PsServiceGroup convert(TServiceGroup type); + PsServiceGroup convert(RMobilePhone::TMobileService service); private: diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/xqbindings/psetwrapper/tsrc/mocks/mock_psetcallbarringwrapper.cpp --- a/cellular/telephonysettings/xqbindings/psetwrapper/tsrc/mocks/mock_psetcallbarringwrapper.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/xqbindings/psetwrapper/tsrc/mocks/mock_psetcallbarringwrapper.cpp Mon May 03 13:01:45 2010 +0300 @@ -94,3 +94,18 @@ SMC_MOCK_METHOD3( void, int/*PsServiceGroup*/, static_cast(serviceGroup), BarringType, barringType, QString, barringPassword ) } + +// ----------------------------------------------------------------------------- +// PSetCallBarringWrapper::changeBarringPassword +// ----------------------------------------------------------------------------- +// +void PSetCallBarringWrapper::changeBarringPassword( + const QString &oldPassword, + const QString &newPassword, + const QString &verifiedPassword) +{ + SMC_MOCK_METHOD3( void, + const QString &, oldPassword, + const QString &, newPassword, + const QString &, verifiedPassword ) +} diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/xqbindings/psetwrapper/tsrc/run_auto_tests_qt.bat --- a/cellular/telephonysettings/xqbindings/psetwrapper/tsrc/run_auto_tests_qt.bat Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/xqbindings/psetwrapper/tsrc/run_auto_tests_qt.bat Mon May 03 13:01:45 2010 +0300 @@ -54,14 +54,19 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld build winscw udeb -keepgoing +set SBS_CALL=sbs --config winscw_udeb --keepgoing BUILD set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_COVERAGE_DATA=\coverage_data +set PATH_TO_RESULT=\test_result if not exist %PATH_TO_COVERAGE_DATA% ( mkdir %PATH_TO_COVERAGE_DATA% ) +if not exist %PATH_TO_RESULT% ( +mkdir %PATH_TO_RESULT% +) + if [%1] EQU [] ( goto default ) call :%1 @@ -132,12 +137,11 @@ pushd . call cd %1 call qmake -call bldmake bldfiles -call abld clean winscw udeb +call sbs --config winscw_udeb --keepgoing CLEAN if [%INSTRUMENT%] EQU [TRUE] ( -call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% +call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%" ) else ( -call %ABLD_CALL% +call %SBS_CALL% ) popd @@ -152,7 +156,10 @@ :::::::::::::::::::::::::::::::::::::::::::::::::::::: :RUNTESTS echo Running tests -for /f %%a in ('dir /b ut_*') do call %PATH_TO_DLL%\%%a.exe -dtextshell -- +for /f %%a in ('dir /b ut_*') do ( + call %PATH_TO_DLL%\%%a.exe -dtextshell -- + move \epoc32\winscw\c\data\%%a.log %PATH_TO_RESULT%\%%a.log +) goto end :::::::::::::::::::::::::::::::::::::::::::::::::::::: diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/xqbindings/psetwrapper/tsrc/ut_psetcallbarringwrapper/ut_psetcallbarringwrapper.cpp --- a/cellular/telephonysettings/xqbindings/psetwrapper/tsrc/ut_psetcallbarringwrapper/ut_psetcallbarringwrapper.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/xqbindings/psetwrapper/tsrc/ut_psetcallbarringwrapper/ut_psetcallbarringwrapper.cpp Mon May 03 13:01:45 2010 +0300 @@ -74,6 +74,10 @@ } }; +void simulateLeaveL() +{ + User::Leave(KErrGeneral); +} /*! UT_PSetCallBarringWrapper::UT_PSetCallBarringWrapper @@ -325,6 +329,16 @@ ServiceGroupVoice, PSetCallBarringWrapper::BarringTypeAllIncomingServices, QString("1234")); + +// error handling + EXPECT(CPsetCallBarring::SetBarringL) + .willOnce(invokeWithoutArguments(simulateLeaveL)); + EXPECT_EXCEPTION( + m_wrapper->enableBarring( + ServiceGroupVoice, + PSetCallBarringWrapper::BarringTypeAllIncomingServices, + QString("1234")); + ) QVERIFY(verify()); } @@ -412,6 +426,46 @@ PSetCallBarringWrapper::BarringTypeAllIncomingServices, QString("1234")); +// error handling + EXPECT(CPsetCallBarring::SetBarringL) + .willOnce(invokeWithoutArguments(simulateLeaveL)); + EXPECT_EXCEPTION( + m_wrapper->disableBarring( + ServiceGroupVoice, + PSetCallBarringWrapper::BarringTypeAllIncomingServices, + QString("1234")); + ) + + QVERIFY(verify()); +} + + +/*! + UT_PSetCallBarringWrapper::t_changeBarringPassword + */ +void UT_PSetCallBarringWrapper::t_changeBarringPassword() +{ + QString oldPassword = "1234"; + QString newPassword = "4321"; + QString verifiedPassword = "4321"; + RMobilePhone::TMobilePhonePasswordChangeV2 passwordChange; + passwordChange.iOldPassword.Copy(oldPassword.utf16()); + passwordChange.iNewPassword.Copy(newPassword.utf16()); + passwordChange.iVerifiedPassword.Copy(verifiedPassword.utf16()); + EXPECT(CPsetCallBarring::ChangePasswordL) + .with(passwordChange); + + m_wrapper->changeBarringPassword( + oldPassword, newPassword, verifiedPassword); + +// error handling + EXPECT(CPsetCallBarring::ChangePasswordL) + .willOnce(invokeWithoutArguments(simulateLeaveL)); + EXPECT_EXCEPTION( + m_wrapper->changeBarringPassword( + oldPassword, newPassword, verifiedPassword); + ) + QVERIFY(verify()); } @@ -484,10 +538,10 @@ */ void UT_PSetCallBarringWrapper::t_CbPasswordChangedL() { - // TODO: dummy test as functionality not yet implemented TBool success = EFalse; QT_TRAP_THROWING( - m_wrapper->m_privateImpl->CbPasswordChangedL(success); + m_wrapper->m_privateImpl->CbPasswordChangedL(ETrue); + m_wrapper->m_privateImpl->CbPasswordChangedL(EFalse); ) } @@ -713,6 +767,34 @@ /*! + UT_PSetCallBarringWrapper::t_changeBarringPasswordRequestComplete + */ +void UT_PSetCallBarringWrapper::t_changeBarringPasswordRequestComplete() +{ + QSignalSpy spy( + m_wrapper, + SIGNAL(barringPasswordChangeRequestCompleted(int))); + + QString oldPassword = "1234"; + QString newPassword = "4321"; + QString verifiedPassword = "4321"; + m_wrapper->changeBarringPassword( + oldPassword, newPassword, verifiedPassword); + + m_wrapper->m_privateImpl->RequestComplete(); + + if (qstrcmp(QTest::currentTestFunction(), "t_exceptionSafety") == 0) { + // Signal emissions from RequestComplete will fail with exception safety + // tests so it's not possible to verify signal data. + return; + } + + QCOMPARE(spy.count(), 1); + QCOMPARE(spy.at(0).at(0).toInt(), 0); +} + + +/*! UT_PSetCallBarringWrapper::t_RequestStatusChanged */ void UT_PSetCallBarringWrapper::t_RequestStatusChanged() diff -r e32024264ebb -r d7fc66ccd6fb cellular/telephonysettings/xqbindings/psetwrapper/tsrc/ut_psetcallbarringwrapper/ut_psetcallbarringwrapper.h --- a/cellular/telephonysettings/xqbindings/psetwrapper/tsrc/ut_psetcallbarringwrapper/ut_psetcallbarringwrapper.h Fri Apr 16 15:31:58 2010 +0300 +++ b/cellular/telephonysettings/xqbindings/psetwrapper/tsrc/ut_psetcallbarringwrapper/ut_psetcallbarringwrapper.h Mon May 03 13:01:45 2010 +0300 @@ -43,6 +43,7 @@ void t_barringStatusExceptionOccurs(); void t_enableBarring(); void t_disableBarring(); + void t_changeBarringPassword(); // private implementation tests void t_HandleBarringModeStatusL(); @@ -56,6 +57,7 @@ void t_enableBarringRequestComplete(); void t_disableBarringRequestComplete(); + void t_changeBarringPasswordRequestComplete(); void t_RequestStatusChanged(); void t_exceptionSafety(); diff -r e32024264ebb -r d7fc66ccd6fb convergedcallengine/group/bld.inf --- a/convergedcallengine/group/bld.inf Fri Apr 16 15:31:58 2010 +0300 +++ b/convergedcallengine/group/bld.inf Mon May 03 13:01:45 2010 +0300 @@ -27,9 +27,6 @@ #include "../spsettings/group/bld.inf" #include "../cenrepdatabase/group/bld.inf" #include "../serviceselector/group/bld.inf" -// <-- QT PHONE START --> -//#include "../csplugin/group/bld.inf" -// <-- QT PHONE END --> PRJ_TESTMMPFILES diff -r e32024264ebb -r d7fc66ccd6fb convergedcallengine/serviceselector/inc/cssconnectionhandler.h --- a/convergedcallengine/serviceselector/inc/cssconnectionhandler.h Fri Apr 16 15:31:58 2010 +0300 +++ b/convergedcallengine/serviceselector/inc/cssconnectionhandler.h Mon May 03 13:01:45 2010 +0300 @@ -22,9 +22,6 @@ // INCLUDES #include -// <-- QT PHONE START --> -//#include -// <-- QT PHONE END--> // FORWARD DECLARATIONS // None @@ -75,11 +72,6 @@ private: // Data - // Converged Connection Handler client interface - // <-- QT PHONE START --> - //CCch* iCch; - // <-- QT PHONE END--> - }; diff -r e32024264ebb -r d7fc66ccd6fb convergedcallengine/serviceselector/src/cssconnectionhandler.cpp --- a/convergedcallengine/serviceselector/src/cssconnectionhandler.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/convergedcallengine/serviceselector/src/cssconnectionhandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -57,19 +57,11 @@ // void CSsConnectionHandler::ConstructL() { - // <-- QT PHONE START --> - //iCch = CCch::NewL(); - // <-- QT PHONE END --> - } // Destructor CSsConnectionHandler::~CSsConnectionHandler() { - // <-- QT PHONE START --> - //delete iCch; - // <-- QT PHONE END--> - } // ----------------------------------------------------------------------------- @@ -83,27 +75,7 @@ ) const { - TBool registered( EFalse ); - // <-- QT PHONE START --> -/* - TCchServiceStatus serviceStatus; - CCchService* service = iCch->GetService( aServiceId ); - if ( service ) - { - service->GetStatus( ECCHVoIPSub, serviceStatus ); - registered = ( KErrNone == serviceStatus.Error() ) && - ( ECCHEnabled == serviceStatus.State() ); - } - - CSSLOGSTRING4("CSSelector::IsRegistered: id:%d ,enabled:%d ,error:%d", - (TInt) aServiceId, - (TInt) ECCHEnabled == serviceStatus.State(), - (TInt) serviceStatus.Error()); - */ - - // <-- QT PHONE END--> - - + TBool registered( EFalse ); return registered; } diff -r e32024264ebb -r d7fc66ccd6fb networkhandling/networkhandlingengine/Group/networkhandling.mmp --- a/networkhandling/networkhandlingengine/Group/networkhandling.mmp Fri Apr 16 15:31:58 2010 +0300 +++ b/networkhandling/networkhandlingengine/Group/networkhandling.mmp Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -46,6 +46,7 @@ #ifdef RD_PHONE_NG SOURCE cnwnetworkselectionsettingmonitor.cpp #endif +SOURCE CNWDynamicCapsMonitor.cpp #ifdef __PROTOCOL_GSM #include "Networkhandlinggsm.mmp" @@ -65,6 +66,8 @@ LIBRARY charconv.lib LIBRARY centralrepository.lib +LIBRARY etelpckt.lib +LIBRARY FeatMgr.lib #ifdef WINSCW DEFFILE ../Bwins/NETWORKHANDLING.DEF diff -r e32024264ebb -r d7fc66ccd6fb networkhandling/networkhandlingengine/NetworkHandlingGsmSrc/CNWNetworkMCNEngine.cpp --- a/networkhandling/networkhandlingengine/NetworkHandlingGsmSrc/CNWNetworkMCNEngine.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/networkhandling/networkhandlingengine/NetworkHandlingGsmSrc/CNWNetworkMCNEngine.cpp Mon May 03 13:01:45 2010 +0300 @@ -16,8 +16,6 @@ * */ - - // INCLUDE FILES #include "CNWGsmSessionImplementation.h" #include "CNWGsmMessageHandler.h" @@ -35,7 +33,6 @@ const TInt KMCNOn = 1; const TInt KMCNOff = 0; - // ============================ MEMBER FUNCTIONS ============================== // ---------------------------------------------------------------------------- diff -r e32024264ebb -r d7fc66ccd6fb networkhandling/networkhandlingengine/NetworkHandlingGsmSrc/CNWNetworkViagRefresh.cpp --- a/networkhandling/networkhandlingengine/NetworkHandlingGsmSrc/CNWNetworkViagRefresh.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/networkhandling/networkhandlingengine/NetworkHandlingGsmSrc/CNWNetworkViagRefresh.cpp Mon May 03 13:01:45 2010 +0300 @@ -22,8 +22,8 @@ #include "CNWNetworkViagRefresh.h" #include "CNWNetworkViagBaseEngine.h" #include "NWLogger.h" -#include -#include +#include +#include #include "CNWNetworkViagSimReader.h" diff -r e32024264ebb -r d7fc66ccd6fb networkhandling/networkhandlingengine/NetworkHandlingInc/CNWDynamicCapsMonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkhandling/networkhandlingengine/NetworkHandlingInc/CNWDynamicCapsMonitor.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The header file of CNWDynamicCapsMonitor +* +*/ + + + +#ifndef CNWDYNAMICCAPSMONITOR_H +#define CNWDYNAMICCAPSMONITOR_H + +// INCLUDES +#include "CNWNetworkMonitorBase.h" + +// FORWARD DECLARATIONS +class CNWMessageHandler; + +// CLASS DECLARATION + +/** +* Monitors dynamic caps change events from MMEtel. +* Ensures that alpha tag is displayed only when CS registration is successful. +* If PS registration is successful but CS registration failed, the alpha tag +* should not be shown so users do not think they can make voice calls. +* +* @lib networkhandling.lib +* @since Series 60_5.0 +*/ +NONSHARABLE_CLASS( CNWDynamicCapsMonitor ) : public CNWNetworkMonitorBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CNWDynamicCapsMonitor* NewL( + CNWMessageHandler& aOwner, + RMobilePhone& aPhone, + TNWInfo& aNetworkInfo, + RMmCustomAPI& aCustomAPI ); + + /** + * Destructor. + */ + virtual ~CNWDynamicCapsMonitor(); + + + + protected: // Functions from CActive + /** + * Cancels asyncronous request(s). + * + */ + void DoCancel(); + + /** + * Informs object that asyncronous request is ready. + * + */ + void RunL(); + + /** + * From CActive, RunError. + * Processes any errors. + * @param aError The leave code reported. + * @result return KErrNone if leave is handled. + */ + TInt RunError( TInt aError ); + + private: + + /** + * Update Dynamic Caps Flags field of TNWInfo + * @param aDynamicCapsFlags The current dynamic caps flags. + */ + void UpdateDynamicCapsFlags( + const RPacketService::TDynamicCapsFlags aDynamicCapsFlags); + + /** + * Executes the NotifyDynamicCapsChange() function. + * + */ + void IssueRequest(); + + /** + * C++ default constructor. + */ + CNWDynamicCapsMonitor( + CNWMessageHandler& aOwner, + RMobilePhone& aPhone, + TNWInfo& aNetworkInfo, + RMmCustomAPI& aCustomAPI + ); + + /** + * Second-phase constructor. + */ + void ConstructL(); + + // Data: + + // For RPacketService call + RPacketService iPacketService; + // Current dynamic caps flags. + RPacketService::TDynamicCapsFlags iDynamicCapsFlags; + + }; + +#endif // CNWDYNAMICCAPSMONITOR_H + +// End of File diff -r e32024264ebb -r d7fc66ccd6fb networkhandling/networkhandlingengine/NetworkHandlingSrc/CNWDynamicCapsMonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkhandling/networkhandlingengine/NetworkHandlingSrc/CNWDynamicCapsMonitor.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,197 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This module contains the implementation of +* CNWDynamicCapsMonitor +* +*/ + +// INCLUDE FILES +#include // for EPacketGetDynamicCaps +#include // for RPacketService +#include "CNWDynamicCapsMonitor.h" +#include "CNWMessageHandler.h" +#include "NWLogger.h" + +// ================= MEMBER FUNCTIONS ======================================= + +// ----------------------------------------------------------------------------- +// CNWDynamicCapsMonitor::CNWDynamicCapsMonitor +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CNWDynamicCapsMonitor::CNWDynamicCapsMonitor( + CNWMessageHandler& aOwner, // ref. to owner class + RMobilePhone& aPhone, // ref. to phone + TNWInfo& aNetworkInfo, // ref. to network info struct + RMmCustomAPI& aCustomAPI ) //ref. to customAPI + : CNWNetworkMonitorBase( aOwner, + aPhone, + aNetworkInfo, + aCustomAPI ) + { + NWLOGSTRING( KNWOBJECT, "NW: CNWDynamicCapsMonitor::CNWDynamicCapsMonitor -START" ); + CActiveScheduler::Add( this ); + } + + +// ----------------------------------------------------------------------------- +// CNWDynamicCapsMonitor::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CNWDynamicCapsMonitor::ConstructL() + { + NWLOGSTRING( KNWOBJECT, "NW: CNWDynamicCapsMonitor::ConstructL -START" ); + User::LeaveIfError( iPacketService.Open( iPhone ) ); + // Assign lower priority than other networkhandling monitors. + // (Default in CNWNetworkMonitorBase is EPriorityStandard) + SetPriority( EPriorityIdle ); + + NWLOGSTRING( KNWOBJECT, "NW: CNWDynamicCapsMonitor::ConstructL -END" ); + } + +// ----------------------------------------------------------------------------- +// CNWDynamicCapsMonitor::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CNWDynamicCapsMonitor* CNWDynamicCapsMonitor::NewL( + CNWMessageHandler& aOwner, + RMobilePhone& aPhone, + TNWInfo& aNetworkInfo, + RMmCustomAPI& aCustomAPI ) + { + NWLOGSTRING( KNWOBJECT, "NW: CNWDynamicCapsMonitor::NewL -START" ); + CNWDynamicCapsMonitor* self = + new( ELeave ) CNWDynamicCapsMonitor( aOwner, + aPhone, + aNetworkInfo, + aCustomAPI ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + NWLOGSTRING( KNWOBJECT, "NW: CNWDynamicCapsMonitor::NewL -END" ); + return self; + } + + +// Destructor +CNWDynamicCapsMonitor::~CNWDynamicCapsMonitor() + { + Cancel(); + iPacketService.Close(); + + NWLOGSTRING( KNWOBJECT, "NW: CNWDynamicCapsMonitor::~CNWDynamicCapsMonitor -END" ); + } + +// ----------------------------------------------------------------------------- +// CNWDynamicCapsMonitor::DoCancel +// Cancels the pending async. command. +// ----------------------------------------------------------------------------- +// +void CNWDynamicCapsMonitor::DoCancel() + { + NWLOGSTRING( KNWREQEND, "NW: CNWDynamicCapsMonitor::DoCancel: Request CancelAsyncRequest( EPacketNotifyDynamicCapsChange )" ); + iPacketService.CancelAsyncRequest( EPacketNotifyDynamicCapsChange ); + } + +// ----------------------------------------------------------------------------- +// CNWDynamicCapsMonitor::RunL +// Receives notification that the dynamic packet data capabilities changed. +// Saves new value in TNWInfo object. (This will be used by active idle to +// hide the alpha tag if CS registration is unsuccessful.) +// ----------------------------------------------------------------------------- +// +void CNWDynamicCapsMonitor::RunL() + { + NWLOGSTRING2( KNWREQEND, + "NW: CNWDynamicCapsMonitor::RunL, iStatus = %d", iStatus.Int() ); + + if( iStatus.Int() == KErrNone ) + { + if ( iNWNetworkInfo.iDynamicCapsFlags != iDynamicCapsFlags ) + { + // Update dynamic caps info + UpdateDynamicCapsFlags( iDynamicCapsFlags ); + iOwner.SendMessage( + MNWMessageObserver::ENWMessageDynamicCapsChange ); + } + IssueRequest(); + } + // Check if monitor can be restarted. + else if ( iStatus != KErrCancel && iStatus != KErrServerTerminated ) + { + NWLOGSTRING2( KNWERROR, + "NW: CNWDynamicCapsMonitor::RunL, Unknown error situation, iStatus = %d", iStatus.Int() ); + IssueRequest(); + } + else + { + NWLOGSTRING2( KNWERROR, + "NW: CNWDynamicCapsMonitor::RunL, Server Terminated or request Cancelled, iStatus = %d", iStatus.Int() ); + } + } + + +// ----------------------------------------------------------------------------- +// CNWDynamicCapsMonitor::IssueRequest +// Request a notification when the dynamic packet data capabilities change. +// ----------------------------------------------------------------------------- +// +void CNWDynamicCapsMonitor::IssueRequest() + { + NWLOGSTRING( KNWOBJECT, "NW: CNWDynamicCapsMonitor::IssueRequest() -START" ); + + if( !IsActive() ) + { + NWLOGSTRING( KNWREQIN, + "NW:CNWDynamicCapsMonitor::IssueRequest > RPacketService::NotifyDynamicCapsChange" ); + iPacketService.NotifyDynamicCapsChange( iStatus, iDynamicCapsFlags ); + SetActive(); + } + else + { + NWLOGSTRING( KNWERROR, + "NW: CNWDynamicCapsMonitor::IssueRequest: Already active" ); + } + + NWLOGSTRING( KNWOBJECT, "NW: CNWDynamicCapsMonitor::IssueRequest() -END" ); + } + + +// ----------------------------------------------------------------------------- +// CNWDynamicCapsMonitor::UpdateDynamicCapsFlags() +// Update the value of iNWNetworkInfo.iDynamicCapsFlags +// ----------------------------------------------------------------------------- +// +void CNWDynamicCapsMonitor::UpdateDynamicCapsFlags( + const RPacketService::TDynamicCapsFlags aDynamicCapsFlags ) + { + NWLOGSTRING( KNWOBJECT, "NW: CNWDynamicCapsMonitor::UpdateDynamicCapsFlags()" ); + iNWNetworkInfo.iDynamicCapsFlags = aDynamicCapsFlags; + } + + +// ----------------------------------------------------------------------------- +// CNWDynamicCapsMonitor::RunError() +// Processes any errors. +// ----------------------------------------------------------------------------- +// +TInt CNWDynamicCapsMonitor::RunError( TInt /*aError*/ ) + { + return KErrNone; // Handled the error fully + } + +// end of file diff -r e32024264ebb -r d7fc66ccd6fb networkhandling/networkhandlingengine/NetworkHandlingSrc/CNWMessageHandler.cpp --- a/networkhandling/networkhandlingengine/NetworkHandlingSrc/CNWMessageHandler.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/networkhandling/networkhandlingengine/NetworkHandlingSrc/CNWMessageHandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,6 +18,7 @@ // INCLUDE FILES +#include #include "NWHandlingEngine.h" #include "CNWMessageHandler.h" #include "CNWNetworkCurrentNetworkMonitor.h" @@ -31,15 +32,18 @@ #ifdef RD_PHONE_NG #include "cnwnetworkselectionsettingmonitor.h" #endif // RD_PHONE_NG +#include "CNWDynamicCapsMonitor.h" // CONSTANTS const TInt KNWNetworkMonitorCurrent = 0; const TInt KNWNetworkMonitorMode = 1; const TInt KNWNetworkMonitorRegistration = 2; #ifdef RD_PHONE_NG const TInt KNWNetworkMonitorSettingSelection = 3; +const TInt KNWNetworkMonitorDynamicCaps = 4; +#else // RD_PHONE_NG +const TInt KNWNetworkMonitorDynamicCaps = 3; #endif // RD_PHONE_NG - // ============================ MEMBER FUNCTIONS ============================== // ---------------------------------------------------------------------------- @@ -207,6 +211,32 @@ // Start initialising network handling module. iMonitorContainer[ KNWNetworkMonitorRegistration ]->Initialise(); + + // Create CNWDynamicCapsMonitor object and insert it to monitor container. + // Will be used to hide alpha tag when CS registration is unsuccessful + FeatureManager::InitializeLibL(); + TInt err( KErrNone ); + if( FeatureManager::FeatureSupported( + KFeatureIdFfDisplayNetworkNameAfterCsRegistration )) + { + TRAP(err, + CNWDynamicCapsMonitor* tempDynamicCapsMonitor = + CNWDynamicCapsMonitor::NewL( *this, iPhone, iNetworkInfo, + iCustomAPI ); + CleanupStack::PushL( tempDynamicCapsMonitor ); + + User::LeaveIfError( iMonitorContainer.Insert( + tempDynamicCapsMonitor, + KNWNetworkMonitorDynamicCaps ) ); + CleanupStack::Pop( tempDynamicCapsMonitor ); ); + if( err == KErrNone ) + { + iMonitorContainer + [ KNWNetworkMonitorDynamicCaps ]->Initialise(); + } + } + FeatureManager::UnInitializeLib(); + User::LeaveIfError(err); NWLOGSTRING( KNWOBJECT, "NW: CNWMessageHandler::BaseConstructL() End" ); @@ -399,6 +429,11 @@ return _L("ENWMessageNetworkProviderNameUpdating"); case MNWMessageObserver::ENWMessageServiceProviderNameUpdating: return _L("ENWMessageServiceProviderNameUpdating"); + case MNWMessageObserver::ENWMessageDynamicCapsChange: + { + return _L("ENWMessageDynamicCapsChange"); + break; + } default: NWLOGSTRING2( KNWINT, "NW: CNWMessageHandler::GetNameByMessage, unknown message = %d", diff -r e32024264ebb -r d7fc66ccd6fb networkhandling/networkhandlingengine/NetworkHandlingSrc/CNWNetworkRegistrationStatusMonitor.cpp --- a/networkhandling/networkhandlingengine/NetworkHandlingSrc/CNWNetworkRegistrationStatusMonitor.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/networkhandling/networkhandlingengine/NetworkHandlingSrc/CNWNetworkRegistrationStatusMonitor.cpp Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,6 +18,7 @@ // INCLUDE FILES +#include #include "CNWNetworkRegistrationStatusMonitor.h" #include "CNWMessageHandler.h" #include "NetworkHandlingDomainPSKeys.h" @@ -66,6 +67,7 @@ "NW: CNWNetworkRegistrationStatusMonitor::\ ConstructL() Begin." ); + FeatureManager::InitializeLibL(); RProperty::TType type( RProperty::EInt ); TSecurityPolicy readPolicy( ECapability_None ); TSecurityPolicy writePolicy( ECapabilityWriteDeviceData ); @@ -146,6 +148,8 @@ NWLOGSTRING( KNWOBJECT, "NW: CNWNetworkRegistrationStatusMonitor::\ ~CNWNetworkRegistrationStatusMonitor() End." ); + FeatureManager::UnInitializeLib(); + NWLOGSTRING( KNWOBJECT, "NW: CNWNetworkRegistrationStatusMonitor::~CNWNetworkRegistrationStatusMonitor complete." ); } // ---------------------------------------------------------------------------- @@ -209,6 +213,13 @@ NWLOGSTRING2( KNWERROR, "NW: CNWNetworkRegistrationStatusMonitor::RunL, Unknown error \ situation, iStatus = %d", iStatus.Int() ); + + if ( FeatureManager::FeatureSupported( KFeatureIdFfManualSelectionPopulatedPlmnList ) ) + { + iOwner.SendErrorMessage( MNWMessageObserver::ENWNotifyNetworkRegistrationStatusChange, + iStatus.Int() ); + } + IssueRequest(); } else diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Rom/CallUI.iby --- a/phoneclientserver/CallUI/Rom/CallUI.iby Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: CallUi's iby definitions. - * -*/ - - -#ifndef __CALLUI_IBY__ -#define __CALLUI_IBY__ - -REM CallUI Plugin -ECOM_PLUGIN(cauiplugin.dll,101f868e.rsc) - -REM CallUI Engine -file=ABI_DIR\BUILD_DIR\cauiengine.dll SHARED_LIB_DIR\cauiengine.dll - -REM Enabler for exlipsing ROM binaries -data=ZSYSTEM\install\callui_stub.sis system\install\callui_stub.sis -#endif diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Rom/CallUIResources.iby --- a/phoneclientserver/CallUI/Rom/CallUIResources.iby Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: CallUIResource's iby definitions. - * -*/ - - -#ifndef __CALLUI_RESOURCES_IBY__ -#define __CALLUI_RESOURCES_IBY__ - -data=DATAZ_\RESOURCE_FILES_DIR\CallUI.rsc RESOURCE_FILES_DIR\CallUI.rsc - -#endif \ No newline at end of file diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Rom/CallUI_Variant.iby --- a/phoneclientserver/CallUI/Rom/CallUI_Variant.iby Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: CallUi's iby definitions. - * -*/ - - -#ifndef __CALLUI_VARIANT_IBY__ -#define __CALLUI_VARIANT_IBY__ - -#ifdef __JAPAN_PREFIX_CHANGE -file=ABI_DIR\BUILD_DIR\dialutils.dll SHARED_LIB_DIR\dialutils.dll -#endif // __JAPAN_PREFIX_CHANGE - -#endif diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiEngine/CaUiActiveObject.cpp --- a/phoneclientserver/CallUI/Src/CaUiEngine/CaUiActiveObject.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,467 +0,0 @@ -/* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Active object to handle global list query results. -* -*/ - - - - -// INCLUDE FILES -#include "cauiactiveobject.h" -#include "cauiqueryobserver.h" -#include - -#include -#include -#include -#include -#include "cauimessagesender.h" -#include "cauilogger.h" -// CONSTANTS - - - -// The message editor granularity. -const TInt KCaUiMessageEditorArrayGranularity = 1; - -// The reconnect query options granularity. -#ifdef RD_UNIFIED_EDITOR -const TInt KCaUiReConQueryOptionsArrayGranularity = 3; -#else // RD_UNIFIED_EDITOR -const TInt KCaUiReConQueryOptionsArrayGranularity = 4; -#endif // RD_UNIFIED_EDITOR -// The editor values that this active object supports. -enum - { -#ifdef RD_UNIFIED_EDITOR - ECaUiEditorMSG = 0 // Unified editor. -#else // RD_UNIFIED_EDITOR - ECaUiEditorSMS = 0, // SMS editor. - ECaUiEditorMMS = 1 // MMS editor. -#endif // RD_UNIFIED_EDITOR - }; - - -// ============================ MEMBER FUNCTIONS =============================== - - -// ----------------------------------------------------------------------------- -// CCaUiGlnActiveObject::CCaUiGlnActiveObject -// -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CCaUiGlnActiveObject::CCaUiGlnActiveObject( - MCaUiReconnectQueryObserver& aObserver ) -: CActive( EPriorityStandard ), - iObserver( &aObserver ) - { - CActiveScheduler::Add( this ); - } - - -// ----------------------------------------------------------------------------- -// CCaUiGlnActiveObject::ConstructL -// -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CCaUiGlnActiveObject::ConstructL( - CPhCntMatcher* aPhCntMatcher, - const TPtrC aPhoneNumber, - const TPtrC aAlias ) - { - CAUILOGSTRING("CALLUI: >>> CCaUiGlnActiveObject::ConstructL() begin"); - iReConQueryOptions = new ( ELeave ) CCaUiTIntArray( - KCaUiReConQueryOptionsArrayGranularity ); - - // Get recipient info - is always available here - iRealAddress = - new ( ELeave ) CDesCArrayFlat( KCaUiMessageEditorArrayGranularity ); - iRealAddress->AppendL( aPhoneNumber ); - - iAliases = new ( ELeave ) CDesC16ArrayFlat( - KCaUiMessageEditorArrayGranularity ); - - if ( aAlias.Length() != 0 ) - { - // Alias was given, so matcher is not needed. - iAliases->AppendL( aAlias ); - - // Matcher does not exist. - iOwnMatcher = EFalse; - } - else - { - // Create matcher objects if needed. - if ( !aPhCntMatcher ) - { - iOwnMatcher = ETrue; - iPhCntFactory = CreateCntFactoryL(); - iPhCntMatcher = iPhCntFactory->CreateContactMatcherL(); - } - else - { - iOwnMatcher = EFalse; - iPhCntMatcher = aPhCntMatcher; - } - } - CAUILOGSTRING("CALLUI: >>> CCaUiGlnActiveObject::ConstructL() end"); - } - - -// ----------------------------------------------------------------------------- -// CCaUiGlnActiveObject::NewL -// -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCaUiGlnActiveObject* CCaUiGlnActiveObject::NewL( - MCaUiReconnectQueryObserver& aObserver, - CPhCntMatcher* aPhCntMatcher, - const TPtrC aPhoneNumber, - const TPtrC aAlias ) - { - CCaUiGlnActiveObject* self = new( ELeave ) CCaUiGlnActiveObject ( - aObserver ); - - CleanupStack::PushL( self ); - self->ConstructL( - aPhCntMatcher, - aPhoneNumber, - aAlias ); - CleanupStack::Pop(); - - return self; - } - - -// ----------------------------------------------------------------------------- -// CCaUiGlnActiveObject::~CCaUiGlnActiveObject -// -// Destructor. -// ----------------------------------------------------------------------------- -// -CCaUiGlnActiveObject::~CCaUiGlnActiveObject() - { - Cancel(); - - delete iReConQueryOptions; - - // Delete arrays. - delete iRealAddress; - delete iAliases; - - // Delete Phone Contact Finder objects if owned. - if ( iOwnMatcher ) - { - delete iPhCntMatcher; - delete iPhCntFactory; - } - - if( iMessageSender ) - { - delete iMessageSender; - } - - } - - -// ----------------------------------------------------------------------------- -// CCaUiGlnActiveObject::ReconQueryOptionsArray -// -// -// ----------------------------------------------------------------------------- -// -CCaUiTIntArray* CCaUiGlnActiveObject::ReconQueryOptionsArray() - { - return iReConQueryOptions; - } - - -// ----------------------------------------------------------------------------- -// CCaUiGlnActiveObject::DoCancel -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiGlnActiveObject::DoCancel() - { - iObserver = NULL; - } - - -// ----------------------------------------------------------------------------- -// CCaUiGlnActiveObject::RunL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiGlnActiveObject::RunL() - { - CAUILOGSTRING("CALLUI: >>> CCaUiGlnActiveObject::RunL() Begin"); - - MCaUiReconnectQueryObserver::TCaUiReconType recontype = - MCaUiReconnectQueryObserver::ECallUiReconTypeCancel; - TInt result = iStatus.Int(); - TInt count = ReconQueryOptionsArray()->Count(); - - // If some option was chosen, change the result to contain right value. - if ( result >= 0 && result <= count ) - { - result = ( *ReconQueryOptionsArray() )[ result ]; - } - else - { - result = KErrCancel; - } - - CAUILOGSTRING2("CALLUI: CCaUiGlnActiveObject::RunL(): result: %d", result); - switch ( result ) - { - case ECaUiVoiceCall: - recontype = MCaUiReconnectQueryObserver::ECallUiReconTypeVoice; - break; - - case ECaUiVideoCall: - recontype = MCaUiReconnectQueryObserver::ECallUiReconTypeVideo; - break; -#ifndef RD_UNIFIED_EDITOR - case ECaUiMms: - CAUILOGSTRING("CALLUI: <<< CCaUiGlnActiveObject::RunL() ECaUiMms"); - recontype = MCaUiReconConfQueryObserver::ECallUiReconTypeMms; - LaunchEditorL( ECaUiEditorMMS ); - break; - - case ECaUiSms: - CAUILOGSTRING("CALLUI: <<< CCaUiGlnActiveObject::RunL() ECaUiSms"); - recontype = MCaUiReconConfQueryObserver::ECallUiReconTypeSms; - LaunchEditorL( ECaUiEditorSMS ); - break; -#else // RD_UNIFIED_EDITOR - case ECaUiMsg: - CAUILOGSTRING("CALLUI: <<< CCaUiGlnActiveObject::RunL() ECaUiMsg"); - recontype = MCaUiReconnectQueryObserver::ECallUiReconTypeMsg; - LaunchEditorL( ECaUiEditorMSG ); - break; -#endif // RD_UNIFIED_EDITOR - default: - break; - } - - iObserver->OptionSelected( recontype ); - - Cancel(); - - CAUILOGSTRING("CALLUI: <<< CCaUiGlnActiveObject::RunL() end"); - } - - -// ----------------------------------------------------------------------------- -// CCaUiGlnActiveObject::SetActive -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiGlnActiveObject::SetActive() - { - if( !IsActive() ) - { - CActive::SetActive(); - } - } - -// --------------------------------------------------------- -// CCaUiGlnActiveObject::CreateMessageSenderL -// --------------------------------------------------------- -// -void CCaUiGlnActiveObject::CreateMessageSenderL() - { - // Create instance of send ui. - if( !iMessageSender ) - { - iMessageSender = CCaUiMessageSender::NewL(); - } - } - - -// ----------------------------------------------------------------------------- -// CCaUiGlnActiveObject::LaunchEditorL -// ----------------------------------------------------------------------------- -// -void CCaUiGlnActiveObject::LaunchEditorL( TCaUiEditorType aEditorType ) - { - CAUILOGSTRING("CALLUI: >>> CCaUiGlnActiveObject::LaunchEditorL()"); - - CreateMessageSenderL(); - - const CUidNameArray& msgTypes = iMessageSender->MessageTypesArrayL(); - - if ( !( iAliases->Count() ) ) - { - // Name not yet known, so try to solve it. - MPhCntMatch* match = NULL; - TInt ret = iPhCntMatcher->MatchNumber( - match, - ( *iRealAddress )[0] ); // First and only phonenumber. - CleanupStack::PushL( match ); - - if ( ret == KErrNone && match ) - { - HBufC* cliText = NULL; - - MPhCntMatch::TCliType cliType = match->Cli( cliText ); - CleanupStack::PushL( cliText ); - - if ( cliType == MPhCntMatch::ECliName ) - { - iAliases->AppendL( *cliText ); - } - CleanupStack::PopAndDestroy( cliText ); - } - - // Pop and destroy match. - CleanupStack::Pop( match ); - if ( match ) - { - match->Release(); - } - } - - - TInt messageType = 0; // Editor type, default value. - TBool launchQuery = EFalse; - - switch ( aEditorType ) - { - #ifndef RD_UNIFIED_EDITOR - case ECaUiEditorSMS: - messageType = msgTypes[ ECaUiEditorSMS ].iUid.iUid; // SMS editor. - launchQuery = ETrue; - break; - - case ECaUiEditorMMS: - messageType = msgTypes[ ECaUiEditorMMS ].iUid.iUid; // MMS editor. - launchQuery = ETrue; - break; - #else // RD_UNIFIED_EDITOR - case ECaUiEditorMSG: - messageType = msgTypes[ ECaUiEditorMSG ].iUid.iUid; // Unified message editor. - launchQuery = ETrue; - break; - #endif // RD_UNIFIED_EDITOR - default: - break; - } - - CAUILOGSTRING2("CALLUI: CCaUiGlnActiveObject::LaunchEditorL(): Message type: %d", messageType); - CAUILOGSTRING2("CALLUI: CCaUiGlnActiveObject::LaunchEditorL(): Launch query: %d", launchQuery); - - // If the editor type was valid, launch the editor. - if ( launchQuery ) - { - //Launch SMS Editor. - iMessageSender->CreateNewMessageL( - messageType, - iRealAddress, - iAliases, - NULL ); - } - - CAUILOGSTRING("CALLUI: <<< CCaUiGlnActiveObject::LaunchEditorL()"); - } - -// ============================ MEMBER FUNCTIONS =============================== - - -// ----------------------------------------------------------------------------- -// CCaUiNoteActiveObject::CCaUiNoteActiveObject -// -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CCaUiNoteActiveObject::CCaUiNoteActiveObject() -: CActive( EPriorityStandard ) - { - CActiveScheduler::Add( this ); - } - - -// ----------------------------------------------------------------------------- -// CCaUiNoteActiveObject::NewL -// -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCaUiNoteActiveObject* CCaUiNoteActiveObject::NewL() - { - CCaUiNoteActiveObject* self = new( ELeave ) CCaUiNoteActiveObject (); - - return self; - } - - -// ----------------------------------------------------------------------------- -// CCaUiNoteActiveObject::~CCaUiNoteActiveObject -// -// Destructor. -// ----------------------------------------------------------------------------- -// -CCaUiNoteActiveObject::~CCaUiNoteActiveObject() - { - Cancel(); - } - - -// ----------------------------------------------------------------------------- -// CCaUiNoteActiveObject::DoCancel -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiNoteActiveObject::DoCancel() - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiNoteActiveObject::RunL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiNoteActiveObject::RunL() - { - Cancel(); - } - - - -// ----------------------------------------------------------------------------- -// CCaUiNoteActiveObject::SetActive -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiNoteActiveObject::SetActive() - { - if( !IsActive() ) - { - CActive::SetActive(); - } - } - - -// End of File diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiEngine/CaUiDialDataContainer.cpp --- a/phoneclientserver/CallUI/Src/CaUiEngine/CaUiDialDataContainer.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Contains PhoneClient Dial Data. -* -*/ - - - -// INCLUDE FILES -#include "cauidialdatacontainer.h" - - -// ============================ MEMBER FUNCTIONS =============================== - - -// ----------------------------------------------------------------------------- -// CCaUiDialDataContainer::CCaUiDialDataContainer -// -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CCaUiDialDataContainer::CCaUiDialDataContainer() - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiDialDataContainer::NewL -// -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCaUiDialDataContainer* CCaUiDialDataContainer::NewL() - { - CCaUiDialDataContainer* self = new( ELeave ) CCaUiDialDataContainer; - - return self; - } - - -// ----------------------------------------------------------------------------- -// CCaUiDialDataContainer::~CCaUiDialDataContainer -// -// Destructor. -// ----------------------------------------------------------------------------- -// -CCaUiDialDataContainer::~CCaUiDialDataContainer() - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiDialDataContainer::DialData -// -// -// ----------------------------------------------------------------------------- -// -TPhCltExtPhoneDialData& CCaUiDialDataContainer::DialData() - { - return iDialData; - } - - -// End of File diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiEngine/CaUiDialogs.cpp --- a/phoneclientserver/CallUI/Src/CaUiEngine/CaUiDialogs.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,658 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CallUIEngine. -* -*/ - - -// INCLUDES - -#include -#include -#include -#include -#include // Resources. -#include -#include -#include -#include -#include -#include "cauidialogs.h" -#include "cauilogger.h" -#include "cauiquery.h" -#include "cauiengine.h" -#include "cphcntmatcher.h" -#include "cauiactiveobject.h" - -// CLASS DECLARATION - -/** -* Container for informatioin needed in Reconnection query. -* -* @lib CaUiEngine.lib -* @since 2.6 -*/ -NONSHARABLE_CLASS( CCaUiReConQueryInformation ) - : public CBase - { - public: // Constructors and destructor - - /** - * C++ constructor. - * - * @see CCaUiEngApi::LaunchNoteAndReconConfQueryL(). - */ - CCaUiReConQueryInformation( - MCaUiReconnectQueryObserver& aObserver, - CPhCntMatcher* aPhCntMatcher, - const TPtrC aPhoneNumber, - const TBool aIncludeVideoCallOption, - const TPtrC aNoteText ); - - /** - * Destructor. - */ - ~CCaUiReConQueryInformation(); - - - public: // Data - - // Observer storage. - MCaUiReconnectQueryObserver& iObserver; - - // Matcher storage. - CPhCntMatcher* iPhCntMatcher; - - // Phone number storage. - const TPtrC iPhoneNumber; - - // Video call option storage. - const TBool iIncludeVideoCallOption; - - // The name corresponding the phone number. - const TPtrC iAlias; - - }; - - -// ----------------------------------------------------------------------------- -// CCaUiReConQueryInformation::CCaUiReConQueryInformation -// -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CCaUiReConQueryInformation::CCaUiReConQueryInformation( - MCaUiReconnectQueryObserver& aObserver, - CPhCntMatcher* aPhCntMatcher, - const TPtrC aPhoneNumber, - const TBool aIncludeVideoCallOption, - const TPtrC aAlias ) - : iObserver( aObserver ), - iPhCntMatcher( aPhCntMatcher ), - iPhoneNumber( aPhoneNumber ), - iIncludeVideoCallOption( aIncludeVideoCallOption ), - iAlias( aAlias ) - { - } - -// ----------------------------------------------------------------------------- -// CCaUiReConQueryInformation::~CCaUiReConQueryInformation -// -// Destructor. -// ----------------------------------------------------------------------------- -// -CCaUiReConQueryInformation::~CCaUiReConQueryInformation() - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiDialogs::CCaUiDialogs -// -// -// ----------------------------------------------------------------------------- -// -CCaUiDialogs::CCaUiDialogs( CCaUiEngine& aCaUiEngine ) - : iCaUiEngine( aCaUiEngine ) - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiDialogs::NewL -// -// -// ----------------------------------------------------------------------------- -// -CCaUiDialogs* CCaUiDialogs::NewL( CCaUiEngine& aCaUiEngine ) - { - CCaUiDialogs* self = new( ELeave ) CCaUiDialogs( aCaUiEngine ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - - -// ----------------------------------------------------------------------------- -// CCaUiDialogs::ConstructL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiDialogs::ConstructL() - { - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::ConstructL() Begin"); - // Create reconnect query, not visible yet. - iReconListQuery = CAknGlobalListQuery::NewL(); - - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::ConstructL() End"); - } - - -// ----------------------------------------------------------------------------- -// CCaUiDialogs::~CCaUiDialogs -// -// -// ----------------------------------------------------------------------------- -// -CCaUiDialogs::~CCaUiDialogs() - { - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::~CCaUiDialogs() Begin"); - // Cancel confirmation query if exists. - CancelReconConfQuery(); - delete iReconListQuery; - - // Delete reconnection query information. - delete iReConQueryInformation; - - // Cancel and delete note timer if exists. - if ( iNoteTimer ) - { - iNoteTimer->Cancel(); - delete iNoteTimer; - } - - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::~CCaUiDialogs() End"); - } - - -// ----------------------------------------------------------------------------- -// CCaUiDialogs::QueryVideoCallDefaultActionL -// -// -// ----------------------------------------------------------------------------- -// -TInt CCaUiDialogs::QueryVideoCallDefaultActionL() - { - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::QueryVideoCallDefaultActionL() Begin"); - HBufC* vtstring = NULL; - HBufC* header = NULL; - vtstring = StringLoader::LoadLC( R_CALLUI_VT_SETTING_NOTE ); - header = StringLoader::LoadLC( R_CALLUI_POPUP_VT_TITLE_SETTING ); - - CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL( *vtstring ); - CleanupStack::PushL( dlg ); - dlg->SetHeaderTextL( *header ); - CleanupStack::Pop( dlg ); - - // Show query note to user - TInt result = dlg->ExecuteLD( R_CALLUI_VT_SETTING_QUERY ); - - CleanupStack::PopAndDestroy( 2, vtstring ); // header, vtstring - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::QueryVideoCallDefaultActionL() End"); - - return result; - } - - -// ----------------------------------------------------------------------------- -// CCaUiDialogs::LaunchCreateListQueryL -// -// -// ----------------------------------------------------------------------------- -// -TBool CCaUiDialogs::LaunchCreateListQueryL( TPhCltCallType& aCallType ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::LaunchCreateListQueryL() Begin"); - - TInt choice = KErrNotFound; - - CListMappingArray* mappingList = new ( ELeave ) CListMappingArray( 4 ); - CleanupStack::PushL( mappingList ); - - // Create query dialog. - CCaUiCreateListQuery* dlg = - new ( ELeave ) CCaUiCreateListQuery( &choice ); - dlg->PrepareLC( R_CALLUI_CREATE_LIST_QUERY ); - - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::LaunchCreateListQueryL() 1"); - - // new clean list item array - CDesCArray* textArray = new( ELeave ) CDesCArrayFlat( 4 ); - CleanupStack::PushL( textArray ); - - FillListQueryItemsL( *textArray, *mappingList ); - - CleanupStack::Pop( textArray ); - - // Dialog takes the ownership of textArray - if( textArray ) - { - dlg->SetOwnershipType( ELbmOwnsItemArray ); - dlg->SetItemTextArray( textArray ); - } - - // Highlight preferred item from listbox - if( aCallType == EPhCltVideo ) - { - dlg->ListBox()->SetCurrentItemIndex( KCallUiVideoCall ); - } - - TBool ok = dlg->RunLD(); - CAUILOGSTRING2("CALLUI: >>>CCaUiDialogs::LaunchCreateListQueryL() ok = %d", ok ); - CAUILOGSTRING2("CALLUI: >>>CCaUiDialogs::LaunchCreateListQueryL() choice = %d", choice ); - if ( ok ) - { - // Check what call type was selected. - - // Dynamic list made because of voip support - // take calltype from mappinglist - aCallType = mappingList->At( choice ).iCallType; - } - - CleanupStack::PopAndDestroy( mappingList ); - - return ok; - } - - -// ----------------------------------------------------------------------------- -// CCaUiDialogs::FillListQueryItemsL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiDialogs::FillListQueryItemsL( - CDesCArray& aTextArray, - CListMappingArray& aMappingList ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::FillListQueryItemsL() Begin"); - - // Pointer for strings to be loaded. - HBufC* bufPtr = NULL; - TInt index = 0; - TListMappingItem item; - - // Voice call option. - bufPtr = StringLoader::LoadLC( R_CALLUI_CREATE_LIST_VOICE ); - aTextArray.AppendL( *bufPtr ); - CleanupStack::PopAndDestroy( bufPtr ); - bufPtr = NULL; - item.iIndex = index; - item.iCallType = EPhCltVoice; - aMappingList.AppendL( item ); - index++; - - // Video call option. - if ( FeatureManager::FeatureSupported( KFeatureIdCsVideoTelephony ) ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::FillListQueryItemsL() Adding video call option"); - bufPtr = StringLoader::LoadLC( R_CALLUI_CREATE_LIST_VIDEO ); - aTextArray.AppendL( *bufPtr ); - CleanupStack::PopAndDestroy( bufPtr ); - bufPtr = NULL; - item.iIndex = index; - item.iCallType = EPhCltVideo; - aMappingList.AppendL( item ); - index++; - } - // Internet call option is shown if dynamic voip is set on - // and there are VoIP profiles defined - if( iCaUiEngine.IsVoIPProfiles() ) - { - // Internet call option. - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::FillListQueryItemsL() Adding internet call option"); - bufPtr = StringLoader::LoadLC( R_CALLUI_CREATE_LIST_INTERNET ); - aTextArray.AppendL( *bufPtr ); - CleanupStack::PopAndDestroy( bufPtr ); - bufPtr = NULL; - item.iIndex = index; - item.iCallType = EPhCltCallVoIP; - aMappingList.AppendL( item ); - index++; - } - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::FillListQueryItemsL() End"); - } - - -/** not tested **/ - -// ----------------------------------------------------------------------------- -// CCaUiDialogs::LaunchNoNetSupNoteL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiDialogs::LaunchNoNetSupNoteL() - { - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::LaunchNoNetSupNoteL() Begin"); - HBufC* string = StringLoader::LoadLC( R_CALLUI_NO_VIDEO_NETWORK ); - - CAknInformationNote* dlg = new ( ELeave ) CAknInformationNote( EFalse ); - dlg->ExecuteLD( *string ); - dlg = NULL; - - CleanupStack::PopAndDestroy( string ); - string = NULL; - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::LaunchNoNetSupNoteL() End"); - } - - - -// ----------------------------------------------------------------------------- -// CCaUiDialogs::LaunchReconConfQueryL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiDialogs::LaunchReconConfQueryL( - MCaUiReconnectQueryObserver& aObserver, - CPhCntMatcher* aPhCntMatcher, - const TPtrC aPhoneNumber, - const TBool aIncludeVideoCallOption, - const TPtrC aAlias ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::LaunchReconConfQueryL() Begin "); - CDesCArray* textArray = new( ELeave ) CDesCArrayFlat( 4 ); - CleanupStack::PushL( textArray ); - - // Delete the old query if exists. - CancelReconConfQuery(); - - // Create new active object to handle query results. - iReconActObject = CCaUiGlnActiveObject::NewL( - aObserver, - aPhCntMatcher, - aPhoneNumber, - aAlias ); - - CCaUiTIntArray* objectArray = iReconActObject->ReconQueryOptionsArray(); - - // Pointer for strings to be loaded. - HBufC* bufPtr = NULL; - - // Voice call option. - bufPtr = StringLoader::LoadLC( R_CALLUI_RECONNECT_LIST_ITEM_VOICE ); - textArray->AppendL( *bufPtr ); - CleanupStack::PopAndDestroy( bufPtr ); - bufPtr = NULL; - objectArray->AppendL( CCaUiGlnActiveObject::ECaUiVoiceCall ); - - // Video call option is included only if it is wanted. - if ( aIncludeVideoCallOption ) - { - bufPtr = StringLoader::LoadLC( R_CALLUI_RECONNECT_LIST_ITEM_VIDEO ); - textArray->AppendL( *bufPtr ); - CleanupStack::PopAndDestroy( bufPtr ); - bufPtr = NULL; - objectArray->AppendL( CCaUiGlnActiveObject::ECaUiVideoCall ); - } - -#ifndef RD_UNIFIED_EDITOR - // MMS option. - if (FeatureManager::FeatureSupported(KFeatureIdMMS)) - { - bufPtr = StringLoader::LoadLC( R_CALLUI_RECONNECT_LIST_ITEM_MMS ); - textArray->AppendL( *bufPtr ); - CleanupStack::PopAndDestroy( bufPtr ); - bufPtr = NULL; - objectArray->AppendL( CCaUiGlnActiveObject::ECaUiMms ); - } - - // SMS option. - bufPtr = StringLoader::LoadLC( R_CALLUI_RECONNECT_LIST_ITEM_SMS ); - textArray->AppendL( *bufPtr ); - CleanupStack::PopAndDestroy( bufPtr ); - bufPtr = NULL; - objectArray->AppendL( CCaUiGlnActiveObject::ECaUiSms ); - -#else - // Send message option. - bufPtr = StringLoader::LoadLC( R_CALLUI_RECONNECT_LIST_ITEM_MESSAGE ); - textArray->AppendL( *bufPtr ); - CleanupStack::PopAndDestroy( bufPtr ); - bufPtr = NULL; - objectArray->AppendL( CCaUiGlnActiveObject::ECaUiMsg ); -#endif // RD_UNIFIED_EDITOR - - // Load query header. - bufPtr = StringLoader::LoadLC( R_CALLUI_RECONNECT_QUERY_HEADER ); - iReconListQuery->SetHeadingL( *bufPtr ); // Set query heading. - CleanupStack::PopAndDestroy( bufPtr ); - bufPtr = NULL; - - // Show query. - iReconActObject->SetActive(); - iReconListQuery->ShowListQueryL( textArray, iReconActObject->iStatus ); - - CleanupStack::PopAndDestroy( textArray ); - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::LaunchReconConfQueryL() End "); - } - - -// ----------------------------------------------------------------------------- -// CCaUiDialogs::CancelReconConfQuery -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiDialogs::CancelReconConfQuery() - { - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::CancelReconConfQuery() Begin "); - // Cancel the earlier query if exists. - if( iReconListQuery ) - { - iReconListQuery->CancelListQuery(); - } - - // Cancel the active object. - if( iReconActObject ) - { - if ( iReconActObject->IsActive() ) - { - iReconActObject->Cancel(); - } - } - iReconfQueryOngoing = EFalse; - delete iReconActObject; - iReconActObject = NULL; - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::CancelReconConfQuery() End "); - } - - -// ----------------------------------------------------------------------------- -// CCaUiDialogs::CancelNoteAndReconConfQuery -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiDialogs::CancelNoteAndReconConfQuery() - { - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::CancelNoteAndReconConfQuery() Begin "); - // Delete reconnection query information. - delete iReConQueryInformation; - iReConQueryInformation = NULL; - - // Cancel Note timer if exists. - if ( iNoteTimer ) - { - // Cancel note timer. - iNoteTimer->Cancel(); - } - - // Cancel the reconnect query if exists. - if( iReconListQuery ) - { - iReconListQuery->CancelListQuery(); - } - - // Cancel the active object. - if( iReconActObject ) - { - if ( iReconActObject->IsActive() ) - { - iReconActObject->Cancel(); - } - } - - delete iReconActObject; - iReconActObject = NULL; - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::CancelNoteAndReconConfQuery() End "); - } - - - -// ----------------------------------------------------------------------------- -// CCaUiDialogs::LaunchNoteAndReconConfQueryL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiDialogs::LaunchNoteAndReconConfQueryL( - MCaUiReconnectQueryObserver& aObserver, - CPhCntMatcher* aPhCntMatcher, - const TPtrC aPhoneNumber, - const TBool aIncludeVideoCallOption, - const TPtrC aNoteText, - const TPtrC aAlias ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::LaunchNoteAndReconConfQueryL() Begin "); - iReconfQueryOngoing = ETrue; - delete iReConQueryInformation; - iReConQueryInformation = NULL; - iReConQueryInformation = new ( ELeave ) CCaUiReConQueryInformation( - aObserver, - aPhCntMatcher, - aPhoneNumber, - aIncludeVideoCallOption, - aAlias ); - - HBufC* string = NULL; - TInt noteTextLength = aNoteText.Length(); - - // Use either given note string or the qtn.tel.no.video.network string. - if ( noteTextLength ) - { - string = HBufC::NewLC( noteTextLength ); - string->Des() = aNoteText; - } - else - { - string = StringLoader::LoadLC( R_CALLUI_NO_VIDEO_NETWORK ); - } - - if ( !iInfoNote ) - { - iInfoNote = new ( ELeave ) CAknInformationNote( EFalse ); - iInfoNote->SetTimeout( CAknNoteDialog::ELongTimeout ); - iInfoNote->ExecuteLD( *string ); - } - - // Start note wait timer. - if ( !iNoteTimer ) - { - iNoteTimer = CPeriodic::NewL( CActive::EPriorityStandard ); - } - iNoteTimer->Cancel(); - iNoteTimer->Start( - KCaUiEngNoteTimeout, - KCaUiEngNoteTimeout, - TCallBack( DoPerformNoteLaunchCallBackL, this ) ); - - CleanupStack::PopAndDestroy( string ); - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::LaunchNoteAndReconConfQueryL() End"); - } - - - -// ----------------------------------------------------------------------------- -// CCaUiDialogs::DoPerformNoteLaunchCallBackL -// -// -// ----------------------------------------------------------------------------- -// -TInt CCaUiDialogs::DoPerformNoteLaunchCallBackL( TAny* aAny ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::DPNoteLaunchCallBackL() Begin"); - - CCaUiDialogs* self = static_cast< CCaUiDialogs* >( aAny ); - - if ( self ) - { - if ( self->iNoteTimer ) - { - // Cancel note timer. - self->iNoteTimer->Cancel(); - } - - if ( self->iInfoNote ) - { - // Information note still displayed - return KErrNone; - } - - if ( self->iReConQueryInformation && self->IsReconfQueryOngoing() ) - { - // Launch reconnect query. - self->LaunchReconConfQueryL( - self->iReConQueryInformation->iObserver, - self->iReConQueryInformation->iPhCntMatcher, - self->iReConQueryInformation->iPhoneNumber, - self->iReConQueryInformation->iIncludeVideoCallOption, - self->iReConQueryInformation->iAlias ); - } - - delete self->iReConQueryInformation; - self->iReConQueryInformation = NULL; - } - CAUILOGSTRING("CALLUI: >>>CCaUiDialogs::DPNoteLaunchCallBackL() end"); - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::IsReconfQueryOngoing -// -// -// ----------------------------------------------------------------------------- -// -TBool CCaUiDialogs::IsReconfQueryOngoing() - { - return iReconfQueryOngoing; - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::IsReconfQueryOngoing -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiDialogs::SetReconfQueryOngoing( const TBool aOngoing ) - { - iReconfQueryOngoing = aOngoing; - } diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiEngine/CaUiEngFactImpl.cpp --- a/phoneclientserver/CallUI/Src/CaUiEngine/CaUiEngFactImpl.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the CaUiEngine factory interface. -* -*/ - - - -// INCLUDE FILES -#include "cauiengfactimpl.h" -#include "cauiengine.h" - - -// ============================ MEMBER FUNCTIONS =============================== - - -// ----------------------------------------------------------------------------- -// CCaUiEngFactImpl::CCaUiEngApiLD -// -// -// ----------------------------------------------------------------------------- -// -CCaUiEngApi* CCaUiEngFactImpl::CCaUiEngApiLD() - { - CleanupStack::PushL( this ); - - CCaUiEngine* caUiEng = CCaUiEngine::NewL(); - CleanupStack::PopAndDestroy( this ); - return caUiEng; - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngFactImpl::~CCaUiEngFactImpl -// -// Destructor. -// ----------------------------------------------------------------------------- -// -CCaUiEngFactImpl::~CCaUiEngFactImpl() - { - } - - - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// CreateCaUiEngFactoryL -// -// Creates CallUIEngineFactory. This is only exported function. -// Returns: CCaUiEngFactory*: CallUIEngine Factory instance. -// ----------------------------------------------------------------------------- -// -EXPORT_C CCaUiEngFactory* CreateCaUiEngFactoryL() - { - return new ( ELeave ) CCaUiEngFactImpl; - } - - -// End of File diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiEngine/CaUiEngine.cpp --- a/phoneclientserver/CallUI/Src/CaUiEngine/CaUiEngine.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1392 +0,0 @@ -/* -* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CallUIEngine. -* -*/ - - -// INCLUDE FILES -#include "cauiengine.h" -#include "cauiquery.h" // CCaUiQuery. -#include // MCaUiReconnectQueryObserver. -#include // Resources. -#include // CPhcltDialer. -#include -#include -#include -#include -#include // CPhCltExtPhoneDialData - -#include "callui.loc" // Localized strings. - -#include // String Loader. -#include // CAknInformationNote. -#include // CAknGloballistQuery. -#include // FeatureManager. - -#include // Confirmation query. - -#include // Character removal. -#include // AIW dialdata. - -#include -#include // Pub&Sub functionality. - -#include "cauivoipextension.h" // VoIP/SCCP profile store - -#include -#include -#include "cauilogger.h" // Call Ui Logger -#include -#include -#include -#include - -#include "cauidialogs.h" - -// CONSTANTS - -// GSM Network. -const TInt KCaUiEngGsmNetwork = ENWNetworkModeGsm; -// WCDMA Network. -const TInt KCaUiEngWcdmaNetwork = ENWNetworkModeWcdma; - - -_LIT( KCallTypeUriParam, "call-type" ); -_LIT( KCallTypeVideo, "video" ); -_LIT( KSemiColon, ";" ); - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CCaUiEngine::CCaUiEngine -// -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CCaUiEngine::CCaUiEngine() -: iResourceLoader( *CCoeEnv::Static() ) - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::ConstructL -// -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::ConstructL() - { - CAUILOGSTRING("CALLUI: >>>CCaUiEngine::ConstructL() Begin"); - // Sets up TLS, must be done before FeatureManager is used. - FeatureManager::InitializeLibL(); - - if ( CCoeEnv::Static() ) - { - // Open CallUI resource file. - TFileName* name = new ( ELeave ) TFileName( KCallUIResFile ); - CleanupStack::PushL( name ); - User::LeaveIfError( iResourceLoader.Open( *name ) ); - CleanupStack::PopAndDestroy( name ); - } - - // Get info is VoIP supported - iVoIPProfileHandler = CCaUiVoIPExtension::NewL(); - iLongPressSet = ECaUiLongPressKeyNotSet; - - iServiceSelector = CConvergedServiceSelector::NewL(); - - iDialogs = CCaUiDialogs::NewL( *this ); - - CAUILOGSTRING("CALLUI: >>>CCaUiEngine::ConstructL() Complete"); - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::NewL -// -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCaUiEngine* CCaUiEngine::NewL() - { - CCaUiEngine* self = new( ELeave ) CCaUiEngine; - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::~CCaUEngine -// -// Destructor. -// ----------------------------------------------------------------------------- -// -CCaUiEngine::~CCaUiEngine() - { - delete iServiceSelector; - - // Delete VoIP extension if VoIP is supported - if ( iVoIPProfileHandler ) - { - delete iVoIPProfileHandler; - } - - delete iEmergencyCall; - delete iContactSelector; - delete iFactory; - delete iVTSettingQuery; - - // Clear dial components. - ClearDialContents(); - - if ( CCoeEnv::Static() ) - { - // Close resource loader. - iResourceLoader.Close(); - } - // Delete the menubuffer. - delete iBuf; - iBuf = NULL; - - delete iVTString; - iVTString = NULL; - - delete iContactStoreLoader; - delete iDialogs; - - // Frees the TLS! Must be done after FeatureManager is used. - FeatureManager::UnInitializeLib(); - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::DialL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::DialL( - MCaUiDialResultObserver& aObserver, - const TDesC8& aDialData, - const TCaUiCallType aCallType ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiEngine::DialL() Begin"); - iDialogs->SetReconfQueryOngoing( EFalse ); - // If iPhCltDialer and iDialData exist, - // destroy them and create new ones. This clears the dial data. - ClearDialContents(); - iPhCltDialer = CPhCltExtPhoneBase::NewL( this ); - iObserver = &aObserver; - iDialData = CPhCltExtPhoneDialData::NewL(); - - CAiwInternalDialData* aiwDialData = CAiwInternalDialData::NewLC( aDialData ); - - TPhCltTelephoneNumber aiwTelNumber( aiwDialData->PhoneNumber() ); - HBufC* uriParams = FindAndRipURIParametersL( aiwTelNumber ); - CleanupStack::PushL( uriParams ); - aiwDialData->SetPhoneNumberL( aiwTelNumber ); - - - // ConvertDialDataL overwrites, if given in aDialData - SetDialDataCallType( aCallType ); - - // Convert AIW dial data to PhoneClient format. - ConvertDialDataL( *aiwDialData ); - - // Check if there has been a long press of Send key - if ( iDialData->InitiateCall() ) - { - HandleLongPressOfSendKeyL(); - } - - iDialData->SetSendKeyPressed( - IsSendKeyPressed( aCallType, aiwDialData->CallType() ) ); - - - // By default call is made, unless user cancels the procedure. - TBool createCall = ETrue; - - TPhCltCallType callType = iDialData->CallType(); - - if ( aCallType == ECaUiCallTypeVoice ) - { - iDialData->SetCallType( EPhCltVoice ); - } - // If not forced video call is wanted, ask user to confirm it. - // ECaUiCallTypeUnknown indicates that the call is not made from options menu. - else if ( iDialData->CallType() == EPhCltVideo - && aCallType == ECaUiCallTypeUnknown ) - { - // Get preferred call-type from URI params, it will be passed to - // list query and selected by default - callType = CallTypeFromUriParams( *uriParams ); - // If query is canceled, then call is not made. - createCall = iDialogs->LaunchCreateListQueryL( callType ); - // Set the call type, video must be forced - if ( EPhCltVideo == callType ) - { - iDialData->SetCallType( EPhCltForcedVideo ); - } - else - { - iDialData->SetCallType( callType ); - } - } - else if ( aCallType == ECaUiCallTypeInternet ) - { - iDialData->SetCallType( EPhCltCallVoIP ); - } - else if ( aCallType == ECaUiCallTypeVideo ) - { - // (Forced) video call must be created. - iDialData->SetCallType( EPhCltForcedVideo ); - } - - CleanupStack::PopAndDestroy( uriParams ); - - - - // If user did not Cancel query or query was not shown, - // perform the dial operation. - if ( createCall ) - { - if ( iDialData->ContactLink() != KNullDesC8() - && !aiwDialData->PhoneNumber().Length() ) - { - - TBool storeLoaded - = LaunchContactStoreLoadingL( iDialData->ContactLink() ); - if ( storeLoaded ) - { - // Launch address select. - // aCallType describes which selector is used. ( VoIP/PhoneNumber ) - LaunchAddressSelectL( iDialData->ContactLink(), aCallType ); - } - } - else - { - PhoneClientDialL( NULL ); - } - } - else - { - HandleDialL( KErrCancel ); - } - - CleanupStack::PopAndDestroy( aiwDialData ); - CAUILOGSTRING("CALLUI: >>>CCaUiEngine::DialL() End"); - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::LaunchNoNetSupNoteL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::LaunchNoNetSupNoteL() - { - - iDialogs->LaunchNoNetSupNoteL(); - - } - - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::LaunchReconConfQueryL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::LaunchReconConfQueryL( - MCaUiReconnectQueryObserver& aObserver, - CPhCntMatcher* aPhCntMatcher, - const TPtrC aPhoneNumber, - const TBool aIncludeVideoCallOption ) - { - // Empty pointer. - TPtrC ptrc; - - iDialogs->LaunchReconConfQueryL( - aObserver, - aPhCntMatcher, - aPhoneNumber, - aIncludeVideoCallOption, - ptrc ); - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::CancelReconConfQuery -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::CancelReconConfQuery() - { - - iDialogs->CancelReconConfQuery(); - - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::LaunchNoteAndReconConfQueryL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::LaunchNoteAndReconConfQueryL( - MCaUiReconnectQueryObserver& aObserver, - CPhCntMatcher* aPhCntMatcher, - const TPtrC aPhoneNumber, - const TBool aIncludeVideoCallOption, - const TPtrC aNoteText ) - { - // Empty pointer. - const TPtrC ptrc; - - iDialogs->LaunchNoteAndReconConfQueryL( - aObserver, - aPhCntMatcher, - aPhoneNumber, - aIncludeVideoCallOption, - aNoteText, - ptrc ); - - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::CancelNoteAndReconConfQuery -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::CancelNoteAndReconConfQuery() - { - - iDialogs->CancelNoteAndReconConfQuery(); - - } - -// ----------------------------------------------------------------------------- -// CCaUiEngine::LaunchAddressSelectL -// -// -// ----------------------------------------------------------------------------- -// -TBool CCaUiEngine::LaunchAddressSelectL( - TDes& aTelNum, - const TInt aContactId, - const TBool aVoIPAddressSelect ) - { - TBool addressSelected( EFalse ); - TCaUiCallType callType( ECaUiCallTypeVoice ); - - if ( aVoIPAddressSelect ) - { - callType = ECaUiCallTypeInternet; - } - - addressSelected = LaunchAddressSelectL( aTelNum, aContactId, callType ); - - return addressSelected; - } - -// ----------------------------------------------------------------------------- -// CCaUiEngine::CancelAddressSelect -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::CancelAddressSelect() - { - } - -// ----------------------------------------------------------------------------- -// From MPhCntStoreLoaderObserver. -// CCaUiEngine::ContactStoreLoadingCompleted -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::ContactStoreLoadingCompleted( - MVPbkContactStore* /*aStore*/, TInt aErrorCode ) - { - TInt result( aErrorCode ); - - if ( KErrNone == result ) - { - TCaUiCallType caUiCallType( ECaUiCallTypeUnknown ); - ConvertPhCltCallType( iDialData->CallType(), caUiCallType ); - - TRAP( result, - LaunchAddressSelectL( iDialData->ContactLink(), caUiCallType ) ); - } - - if ( KErrNone != result ) - { - TRAP_IGNORE( HandleDialL( aErrorCode ) ); - } - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::HandleDialL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::HandleDialL( const TInt aStatus ) - { - if ( iObserver ) - { - iObserver->HandleDialResultL( aStatus ); - } - if ( !iDialogs->IsReconfQueryOngoing() ) - { - ClearDialContents(); - } - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::OptionSelected -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::OptionSelected( TCaUiReconType aReconType ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiEngine::OptionSelected() Begin"); - if ( aReconType == ECallUiReconTypeVoice || - aReconType == ECallUiReconTypeVideo ) - { - // Call is wanted to be made. Do it only if Dial data exists. - if ( iDialData ) - { - - iDialogs->SetReconfQueryOngoing( EFalse ); - - if( aReconType == ECallUiReconTypeVoice ) - { - // Make sure that call type is correct, i.e. voice call. - iDialData->SetCallType( EPhCltVoice ); - } - else - { - // Make sure that call type is correct, i.e. video call. - iDialData->SetCallType( EPhCltVideo ); - } - - TRAPD( err, iPhCltDialer->DialL( *iDialData ) ); - if( err ) - { - CAUILOGSTRING2("CALLUI: >>>CCaUiEngine DialL error = %d", err ); - } - } - } - CAUILOGSTRING("CALLUI: >>>CCaUiEngine::OptionSelected() End"); - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::ConvertDialDataL -// -// -// ----------------------------------------------------------------------------- -// - -void CCaUiEngine::ConvertDialDataL( - const CAiwInternalDialData& aAiwDialData ) - { - // Telephony number. - iDialData->SetTelephoneNumber( aAiwDialData.PhoneNumber().Left( - iDialData->TelephoneNumber().MaxLength() ) ); - - // Call type. - CAiwDialData::TCallType aiwCallType = aAiwDialData.CallType(); - TPhCltCallType phCltCallType = EPhCltVoice; - - // After this the call type should be correct one. - if ( aiwCallType == CAiwDialData::EAIWVideo ) - { - phCltCallType = EPhCltVideo; - iDialData->SetCallType( phCltCallType ); - } - else if ( aiwCallType == CAiwDialData::EAIWForcedVideo ) - { - phCltCallType = EPhCltForcedVideo; - iDialData->SetCallType( phCltCallType ); - } - else if ( aiwCallType == CAiwDialData::EAIWVoiP ) - { - phCltCallType = EPhCltCallVoIP; - iDialData->SetCallType( phCltCallType ); - } - else if ( aiwCallType == CAiwDialData::EAIWForcedCS ) - { - phCltCallType = EPhCltVoice; - iDialData->SetCallType( phCltCallType ); - } - - - // Name. - iDialData->SetNameL( aAiwDialData.Name().Left( - iDialData->Name().MaxLength() ) ); - - // Contact link. - iDialData->SetContactLinkL( aAiwDialData.ContactLink() ); - - // Window group. - iDialData->SetWindowGroup( aAiwDialData.WindowGroup() ); - - // Redial. - iDialData->SetRedial( aAiwDialData.Redial() ); - - // Redial maximum duration. - iDialData->SetRedialMaximumDuration( aAiwDialData.RedialMaximumDuration() ); - - // Show number. - iDialData->SetShowNumber( aAiwDialData.ShowNumber() ); - - // Match. - iDialData->SetAllowMatch( aAiwDialData.AllowMatch() ); - - // End other calls. - iDialData->SetEndOtherCalls( aAiwDialData.EndOtherCalls() ); - - // Subaddress. - iDialData->SetSubAddressL( aAiwDialData.SubAddress().Left( - iDialData->SubAddress().MaxLength() ) ); - - // SAT call. - iDialData->SetSATCall( aAiwDialData.SATCall() ); - - // Bearer. - iDialData->SetBearerL( aAiwDialData.Bearer().Left( - iDialData->Bearer().MaxLength() ) ); - - // Set Long keypress activity. ETrue if client wants to initate - // voice/video call. - iDialData->SetInitiateCall( aAiwDialData.InitiateCall() ); - - if ( aAiwDialData.ServiceId() ) - { - iDialData->SetServiceId( aAiwDialData.ServiceId() ); - } - // Remove invalid chars. - if( iDialData->CallType() != EPhCltCallVoIP ) - - { - TPhCltTelephoneNumber telnum; - telnum.Zero(); - telnum = iDialData->TelephoneNumber(); - PhCltUtils::RemoveInvalidChars( telnum ); - - iDialData->SetTelephoneNumber( telnum ); - } - iDialData->SetUUIL( aAiwDialData.UUI() ); - } - -// ----------------------------------------------------------------------------- -// CCaUiEngine::ClearDialContents -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::ClearDialContents() - { - if ( iPhCltDialer ) - { - delete iPhCltDialer; - iPhCltDialer = NULL; - } - - if ( iDialData ) - { - delete iDialData; - iDialData = NULL; - } - - // Not owned, so just set to NULL. - iObserver = NULL; - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::IsVoIPProfiles() -// -// -// ----------------------------------------------------------------------------- -// -TBool CCaUiEngine::IsVoIPProfiles() - { - TBool isProfiles = EFalse; - - TRAP_IGNORE( isProfiles = iVoIPProfileHandler->IsVoIPProfilesL() ); - - return isProfiles; - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::GetVoIPServiceIdsL() -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::GetVoIPServiceIdsL( RIdArray& aVoipServiceIds ) const - { - if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) ) - { - iVoIPProfileHandler->GetVoIPServiceIdsL( aVoipServiceIds ); - } - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::GetVoipServiceNameL() -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::GetVoipServiceNameL( TServiceId aServiceId, TDes& aServiceName ) const - { - iVoIPProfileHandler->GetVoipServiceNameL( aServiceId, aServiceName ); - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::LaunchAddressSelectL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::LaunchAddressSelectL( - const TDesC8& aContactLink, - const TCaUiCallType aCallType ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiEngine::LaunchAddressSelectL() start"); - if ( !iFactory ) - { - iFactory = CreateCntFactoryL(); - } - if ( !iContactSelector ) - { - iContactSelector = iFactory->CreateContactDataSelectionL(); - } - - CPhCntContactDataSelection::TCallType callType; - - // if aCallType is ECaUiCallTypeUnknown call is not intitated from Call ui menu - // so have to use iDialDataCallType - if ( aCallType != ECaUiCallTypeUnknown ) - { - ConvertCaUiCallType( aCallType, callType ); - } - else - { - ConvertDialDataCallType( callType ); - } - - iContactSelector->Cancel(); - iContactSelector->SelectPhoneNumberForCallL( aContactLink, - callType, *this ); - - CAUILOGSTRING("CALLUI: >>>CCaUiEngine::LaunchAddressSelectL() end"); - } - - -//------------------------------------------------------------------------------ -// CCaUiEngine::FindAndRipURIParametersL() -// -// -// ----------------------------------------------------------------------------- -// -HBufC* CCaUiEngine::FindAndRipURIParametersL( TDes& aNumber ) const - { - HBufC* buf = NULL; - TInt offset = aNumber.Locate( TChar( KSemiColon()[0] ) ); - if( offset > 0 ) // Separator is no allowed to be a first char - { - __ASSERT_ALWAYS( offset <= aNumber.Length(), - User::Leave( KErrGeneral ) ); - buf = aNumber.Mid( offset ).AllocL(); - aNumber.SetLength( offset ); - } - else - { - buf = HBufC::NewL( 0 ); - } - return buf; - } - -//------------------------------------------------------------------------------ -// CBrowserTelService::CallTypeFromUriParams() -// -// -// ----------------------------------------------------------------------------- -// -TPhCltCallType CCaUiEngine::CallTypeFromUriParams( - const TDesC& aUriParams ) const - { - TPhCltCallType type( EPhCltVoice ); // Default type is voice call - - TPtrC value( ParamValue( KCallTypeUriParam, aUriParams ) ); - if( value.CompareF( KCallTypeVideo ) == 0 ) // URIs are case-insensitive. - { - type = EPhCltVideo; - } - // Otherwise return default type - return type; - } - -//------------------------------------------------------------------------------ -// CBrowserTelService::ParamValue() -// -// -// ----------------------------------------------------------------------------- -// -TPtrC CCaUiEngine::ParamValue( const TDesC& aName, const TDesC& aUri ) const - { - TInt startIndex = 0; - TInt offset = 0; - TPtrC pairTmp( KNullDesC() ); - TPtrC ret( KNullDesC() ); - TBool found = EFalse; - - if( aName.Length() > 0 ) - { - while( startIndex < aUri.Length() && !found ) - { - pairTmp.Set( FindNextParamValuePair( aUri, startIndex ) ); - offset = pairTmp.FindF( aName ); // URIs are case-insensitive. - if( offset >= 0 && - ( offset + aName.Length() + 1 < pairTmp.Length() ) ) - { - ret.Set( pairTmp.Mid( offset + aName.Length() + 1 ) ); - found = ETrue; - } - } - } - - return ret; - } - -//------------------------------------------------------------------------------ -// CCaUiEngine::FindNextParamValuePair() -// -// -// ----------------------------------------------------------------------------- -// -TPtrC CCaUiEngine::FindNextParamValuePair( const TDesC& aUri, - TInt& aStartIndex ) const - { - TInt offset = 0; - TPtrC tmp( KNullDesC() ); - TPtrC ret( KNullDesC() ); - - tmp.Set( aUri.Mid( aStartIndex ) ); - // Search start mark for new paramter. - offset = tmp.Find( KSemiColon ); - if( offset >= 0 ) - { - if( aStartIndex + offset + KSemiColon().Length() < aUri.Length() ) - { - // Move start index - aStartIndex += offset + KSemiColon().Length(); - - // Store descriptor after start mark - tmp.Set( aUri.Mid( aStartIndex ) ); - - // Search end mark (semi-colon) - offset = tmp.Find( KSemiColon ); - if ( offset >= 0 ) - { - // If end mark was found store the param/value pair - ret.Set( tmp.Left( offset ) ); - } - else - { - // If end mark is not found, - // the rest of descriptor belong to this parameter - ret.Set( tmp ); - } - } - } - - // Move start offset based on findings - if( ret.Length() ) - { - aStartIndex += ret.Length(); - } - else - { - aStartIndex = aUri.Length(); - } - - return ret; - } - -// --------------------------------------------------------- -// CCaUiEngine::HandleFirstLongPressOfSendKeyL() -// --------------------------------------------------------- -// -TBool CCaUiEngine::HandleFirstLongPressOfSendKeyL() - { - TBool set( EFalse ); - - TInt result = iDialogs->QueryVideoCallDefaultActionL(); - - // Check user decision and set return value accordingly - switch ( result ) - { - case EAknSoftkeyYes: // from avkon.hrh - set = ETrue; - break; - case EAknSoftkeyNo: - set = EFalse; - break; - default: - set = EFalse; - break; - } - return set; - } - -// --------------------------------------------------------- -// CCaUiEngine::HandleLongPressOfSendKeyL() -// --------------------------------------------------------- -// -void CCaUiEngine::HandleLongPressOfSendKeyL() - { - - // Check if the setting is already ON -> make a video call - if ( iLongPressSet == ECaUiLongPressKeyInUse ) - { - // ON -> initiate a video call - // (Forced) video call must be created - iDialData->SetCallType( EPhCltForcedVideo ); - } - // Check if the setting is already OFF -> make a voice call - else if ( iLongPressSet == ECaUiLongPressKeyNotInUse ) - { - // OFF -> initiate a voice call - // Voice call must be created - iDialData->SetCallType( EPhCltVoice ); - } - // If the setting has never been set, check what the user wants to do - else if ( iLongPressSet == ECaUiLongPressKeyNotSet ) - { - // Ask from the user how long press of Send key should be handled - TBool set = HandleFirstLongPressOfSendKeyL(); - - if ( set ) - { - // User answered YES -> initiate a video call - // (Forced) video call must be created - iLongPressSet = ECaUiLongPressKeyInUse; - iDialData->SetCallType( EPhCltForcedVideo ); - } - else - { - // User answered NO -> initiate a voice call - // Voice call must be created - iLongPressSet = ECaUiLongPressKeyNotInUse; - iDialData->SetCallType( EPhCltVoice ); - } - } - } - -// --------------------------------------------------------- -// CCaUiEngine::SelectionDone() -// --------------------------------------------------------- -// -void CCaUiEngine::SelectionDone( CPhCntSelectedData* aContactData, - TInt aErrorCode ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiEngine::SelectionDone() Start"); - CAUILOGSTRING2("CALLUI: >>>SelectionDone() ECode = %d", aErrorCode ); - if ( aErrorCode == KErrNone ) - { - TPhCltTelephoneNumber phoneNumber; - HBufC8* fieldLink = NULL; - - if ( iDialData->TelephoneNumber() == KNullDesC ) - { - phoneNumber = aContactData->Data(); - - // Do not remove illegal chars if call type is VOIP and - // call is made to a voip number - if ( !( EPhCltCallVoIP == iDialData->CallType() && - aContactData->NumberType()==MPhCntMatch::EVoipNumber ) ) - { - PhCltUtils::RemoveInvalidChars( phoneNumber ); - } - iDialData->SetTelephoneNumber( phoneNumber ); - } - if ( aContactData->FieldLink().Length() > 0 ) - { - fieldLink = aContactData->FieldLink().Alloc(); - } - - TRAP( aErrorCode, PhoneClientDialL( fieldLink ) ); - - delete fieldLink; - fieldLink = NULL; - } - - if ( aErrorCode != KErrNone ) - { - TRAP_IGNORE( HandleDialL( aErrorCode ) ); - } - CAUILOGSTRING("CALLUI: >>>CCaUiEngine::SelectionDone() End"); - } -// --------------------------------------------------------- -// CCaUiEngine::PhoneClientDialL() -// --------------------------------------------------------- -// -void CCaUiEngine::PhoneClientDialL( const TDesC8* aFieldLink ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiEngine::DialL()::PhoneClient dial Start"); - - TBool createCall( ETrue ); - TInt error( KErrNone ); - - if ( aFieldLink ) - { - iDialData->SetContactLinkL( *aFieldLink ); - } - - // Check if number is emergency number and if it is - // then call emeregency call - if ( !iEmergencyCall ) - { - iEmergencyCall = CPhCltEmergencyCall::NewL( this ); - } - if ( IsEmergencyNumber() ) - { - createCall = EFalse; - error = KErrNone; - iEmergencyCall->DialEmergencyCallL( iDialData->TelephoneNumber() ); - } - - if ( createCall ) - { - CConvergedServiceSelector::TSsResult results; - - error = iServiceSelector->GetCallingServiceByCallType( - results, - ServiceSelectorCallType(), - iDialData->ServiceId(), - iDialData->SendKeyPressed(), - iDialData->TelephoneNumber() ); - - if ( KErrNone == error ) - { - SetSelectorResults( results ); - } - else - { - createCall = EFalse; - } - } - - // Here note launch + query if this is video call and we - // are not in 3G network. - - if ( createCall ) - { - if ( ( iDialData->CallType() == EPhCltVideo ) || - ( iDialData->CallType() == EPhCltForcedVideo ) ) - { - if ( !IsVideoCallAllowedL() ) - { - createCall = EFalse; - error = KErrCancel; - } - } - } - if ( createCall ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiEngine::DialL(): Call PhoneClientdial"); - iPhCltDialer->DialL( *iDialData ); - } - else - { - //User cancelled. Need to inform client. - if ( error != KErrNone ) // Emergency call does not need to inform client. - { - HandleDialL( error ); - } - } - CAUILOGSTRING("CALLUI: >>>CCaUiEngine::DialL()::PhoneClient dial End"); - } - -// --------------------------------------------------------- -// CCaUiEngine::SetDialDataCallType() -// --------------------------------------------------------- -// -void CCaUiEngine::SetDialDataCallType( const TCaUiCallType aCallType ) - { - if ( aCallType == ECaUiCallTypeVoice ) - { - // Voice call must be created. - iDialData->SetCallType( EPhCltVoice ); - } - else if ( aCallType == ECaUiCallTypeVideo ) - { - // (Forced) video call must be created. - iDialData->SetCallType( EPhCltForcedVideo ); - } - else if ( aCallType == ECaUiCallTypeInternet ) - { - // VoIP call must be created. - iDialData->SetCallType( EPhCltCallVoIP ); - } - else - { - // else Voice call is ok. - iDialData->SetCallType( EPhCltVoice ); - } - } - -// --------------------------------------------------------- -// CCaUiEngine::IsEmergencyNumber() -// --------------------------------------------------------- -// -TBool CCaUiEngine::IsEmergencyNumber() - { - TBool isEmergencyNumber( EFalse ); - - // get phonenumber from iDialData and heck number using phoneclient - // emergencycall api - TInt result = iEmergencyCall->IsEmergencyPhoneNumber( - iDialData->TelephoneNumber(), - isEmergencyNumber ); - - return isEmergencyNumber; - } - -// --------------------------------------------------------- -// CCaUiEngine::IsVideoCallAllowedL() -// --------------------------------------------------------- -// -TBool CCaUiEngine::IsVideoCallAllowedL() - { - TInt err = KErrNone; - TInt createCall( ETrue ); - TInt networkMode = KCaUiEngGsmNetwork; // Default: GSM. - err = RProperty::Get( KPSUidNetworkInfo, - KNWTelephonyNetworkMode, - networkMode ); - - if ( err ) - { - // Information is not ok, so assume that - // we are in GSM network. - networkMode = KCaUiEngGsmNetwork; - } - // check network status - TInt nwStatus = ENWStatusRegistrationUnknown; - RProperty::Get( KPSUidNetworkInfo, KNWRegistrationStatus, nwStatus ); - - // If we are not in WCDMA network, then it is not allowed - // to create a video call. - if ( networkMode != KCaUiEngWcdmaNetwork ) - { - TInt automaticredial = 0; - - GetCenRepValueL( KCRUidTelephonySettings, KSettingsAutomaticRedial, automaticredial ); - - // if no network, fall back to voice call for proper error handling - if ( (FeatureManager::FeatureSupported( KFeatureIdAutoRedialForVideoCall ) && automaticredial) - || nwStatus == ENWStatusRegistrationUnknown - || nwStatus == ENWStatusNotRegisteredNoService - || nwStatus == ENWStatusNotRegisteredEmergencyOnly - || nwStatus == ENWStatusNotRegisteredSearching ) - { - // fallback to voice when no network support to videocall - // handled in Phone. - } - else - { - createCall = EFalse; - // Video call can not be done. - // => Launch Note + Reconnect Query. - - // Empty pointer. - TPtrC ptrc; - - iDialogs->LaunchNoteAndReconConfQueryL( - *this, - NULL, - iDialData->TelephoneNumber(), - EFalse, - ptrc, - iDialData->Name() ); - } - } - return createCall; - } -// --------------------------------------------------------- -// CCaUiEngine::HandleEmergencyDialL() -// --------------------------------------------------------- -// -void CCaUiEngine::HandleEmergencyDialL( const TInt aStatus ) - { - if ( iObserver ) - { - iObserver->HandleDialResultL( aStatus ); - } - } -// --------------------------------------------------------- -// CCaUiEngine::GetCenRepValue() -// --------------------------------------------------------- -// -void CCaUiEngine::GetCenRepValueL( - const TUid& aUid, - const TUint aId, - TInt& aValue ) const - { - CRepository* repository = CRepository::NewL( aUid ); - TInt err = repository->Get( aId, aValue ); - - delete repository; - repository = NULL; - - if ( err != KErrNotFound ) // KErrNotFound acceptable. - { - User::LeaveIfError( err ); - } - } - -// --------------------------------------------------------- -// CCaUiEngine::ConvertCaUiCallType( ) -// --------------------------------------------------------- -// -void CCaUiEngine::ConvertCaUiCallType( const TCaUiCallType aCallType, - CPhCntContactDataSelection::TCallType& aResultCallType ) - { - switch ( aCallType ) - { - case ECaUiCallTypeVoice: - { - aResultCallType = CPhCntContactDataSelection::ECallPhoneNumber; - break; - } - case ECaUiCallTypeVideo: - { - aResultCallType = CPhCntContactDataSelection::ECallVideoNumber; - break; - } - case ECaUiCallTypeInternet: - { - aResultCallType = CPhCntContactDataSelection::ECallVoip; - break; - } - default: - { - aResultCallType = CPhCntContactDataSelection::ECallPhoneNumber; - break; - } - } - } - -// --------------------------------------------------------- -// CCaUiEngine::ConvertDialDataCallType() -// --------------------------------------------------------- -// -void CCaUiEngine::ConvertDialDataCallType( CPhCntContactDataSelection::TCallType& aResultCallType ) - { - switch ( iDialData->CallType() ) - { - case EPhCltVoice: - { - aResultCallType = CPhCntContactDataSelection::ECallPhoneNumber; - break; - } - case EPhCltVideo: - case EPhCltForcedVideo: - { - aResultCallType = CPhCntContactDataSelection::ECallVideoNumber; - break; - } - case EPhCltCallVoIP: - { - aResultCallType = CPhCntContactDataSelection::ECallVoip; - break; - } - default: - { - aResultCallType = CPhCntContactDataSelection::ECallPhoneNumber; - break; - } - } - } - - -// --------------------------------------------------------- -// CCaUiEngine::ConvertPhCltCallType -// --------------------------------------------------------- -// -void CCaUiEngine::ConvertPhCltCallType( const TPhCltCallType aCallType, - TCaUiCallType& aResultCallType ) const - { - switch ( aCallType ) - { - case EPhCltVoice: - { - aResultCallType = ECaUiCallTypeVoice; - break; - } - case EPhCltVideo: - case EPhCltForcedVideo: - { - aResultCallType = ECaUiCallTypeVideo; - break; - } - case EPhCltCallVoIP: - { - aResultCallType = ECaUiCallTypeInternet; - break; - } - default: - { - break; - } - } - } - - -// --------------------------------------------------------- -// CCaUiEngine::ServiceSelectorCallType() -// --------------------------------------------------------- -// -CConvergedServiceSelector::TSsCallType CCaUiEngine::ServiceSelectorCallType() const - { - CConvergedServiceSelector::TSsCallType ret; - - switch ( iDialData->CallType() ) - { - case EPhCltVoice: - { - ret = CConvergedServiceSelector::ESsVoiceCall; - break; - } - case EPhCltVideo: - case EPhCltForcedVideo: - { - ret = CConvergedServiceSelector::ESsVideoCall; - break; - } - case EPhCltCallVoIP: - { - ret = CConvergedServiceSelector::ESsVoipCall; - break; - } - default: - { - ret = CConvergedServiceSelector::ESsVoiceCall; - break; - } - } - - return ret; - } - -// --------------------------------------------------------- -// CCaUiEngine::SetSelectorResults() -// --------------------------------------------------------- -// -void CCaUiEngine::SetSelectorResults( - CConvergedServiceSelector::TSsResult& aResults ) - { - switch ( aResults.iCallType ) - { - case CConvergedServiceSelector::ESsVoipCall: - { - iDialData->SetCallType( EPhCltCallVoIP ); - break; - } - case CConvergedServiceSelector::ESsVideoCall: - { - iDialData->SetCallType( EPhCltForcedVideo ); - break; - } - case CConvergedServiceSelector::ESsVoiceCall: - default: - { - iDialData->SetCallType( EPhCltVoice ); - break; - } - } - - iDialData->SetServiceId( aResults.iServiceId ); - } - - -// --------------------------------------------------------- -// CCaUiEngine::LaunchContactStoreLoadingL -// --------------------------------------------------------- -// -TBool CCaUiEngine::LaunchContactStoreLoadingL( const TDesC8& aContactLink ) - { - if ( !iFactory ) - { - iFactory = CreateCntFactoryL(); - } - - if ( !iContactStoreLoader ) - { - iContactStoreLoader = iFactory->CreateContactStoreLoaderL(); - } - - TBool isStoreLoaded( - iContactStoreLoader->IsContactStoreLoaded( aContactLink ) ); - if ( !isStoreLoaded ) - { - iContactStoreLoader->LoadContactStoreL( aContactLink, *this ); - } - - return isStoreLoaded; - } - -// --------------------------------------------------------- -// CCaUiEngine::IsSendKeyPressed -// --------------------------------------------------------- -// -TBool CCaUiEngine::IsSendKeyPressed( TCaUiCallType aCallType, - CAiwDialData::TCallType aAiwCallType ) const - { - TBool isSendKeyPressed( EFalse ); - if ( CAiwDialData::EAIWForcedCS != aAiwCallType ) - { - if ( ECaUiCallTypeUnknown == aCallType ) - { - isSendKeyPressed = ETrue; - } - } - - return isSendKeyPressed; - } - -// End of file diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiEngine/CaUiEngineMain.cpp --- a/phoneclientserver/CallUI/Src/CaUiEngine/CaUiEngineMain.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Global functions for CaUiEngine. -* -*/ - - - -// INCLUDE FILES -#include - - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - - -// ----------------------------------------------------------------------------- -// E32Dll -// -// Returns always KErrNone. -// ----------------------------------------------------------------------------- -// -GLDEF_C TInt E32Dll( TDllReason ) - { - return KErrNone; - } - -// End of File diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiEngine/CaUiEngineStub.cpp --- a/phoneclientserver/CallUI/Src/CaUiEngine/CaUiEngineStub.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,656 +0,0 @@ -/* -* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CallUIEngine, stub version. -* -*/ - - - -// INCLUDE FILES -#include "cauiengine.h" -#include "cauidialogs.h" - -#include // resources. -#include // cphcltdialer. -#include -#include -#include -#include // cphcltextphonedialdata - -#include "callui.loc" // localized strings. - -#include // string loader. -#include // featuremanager. - -#include // character removal. -#include // aiw dialdata. - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CCaUiEngine::CCaUiEngine -// -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CCaUiEngine::CCaUiEngine() -: iResourceLoader( *CCoeEnv::Static() ) -#ifndef RD_PHONE_NG - ,iResourceLoaderPhoneApE( *CCoeEnv::Static() ) -#endif - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::ConstructL -// -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::ConstructL() - { - // Sets up TLS, must be done before FeatureManager is used. - FeatureManager::InitializeLibL(); - - if( CCoeEnv::Static() ) - { - // Open CallUI resource file. - TFileName* name = new ( ELeave ) TFileName( KCallUIResFile ); - CleanupStack::PushL( name ); - User::LeaveIfError( iResourceLoader.Open( *name ) ); - CleanupStack::PopAndDestroy( name ); - } - } - -// ----------------------------------------------------------------------------- -// CCaUiEngine::NewL -// -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCaUiEngine* CCaUiEngine::NewL() - { - CCaUiEngine* self = new( ELeave ) CCaUiEngine; - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::~CCaUEngine -// -// Destructor. -// ----------------------------------------------------------------------------- -// -CCaUiEngine::~CCaUiEngine() - { - delete iContactSelector; - delete iFactory; - - // Clear dial components. - ClearDialContents(); - - if( CCoeEnv::Static() ) - { - // Close resource loader. - iResourceLoader.Close(); - -#ifndef RD_PHONE_NG - // Release PhoneAppEngine resources. - iResourceLoaderPhoneApE.Close(); -#endif - } - - // Delete the menubuffer. - delete iBuf; - iBuf = NULL; - - // Frees the TLS! Must be done after FeatureManager is used. - FeatureManager::UnInitializeLib(); - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::GetResources -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::GetResources( - const TCaUiEngResource aResource, - TFileName& aResFile, - TInt& aResId ) - { - aResFile = KCallUIResFile; - if ( aResource == ECaUiResOnlyInternet ) - { - aResId = 0; - } - else - { - // Return pure voice menu item. - aResId = R_CALLUI_CALL_MENU; - } - } - -// ----------------------------------------------------------------------------- -// CCaUiEngine::DialL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::DialL( - MCaUiDialResultObserver& aObserver, - const TDesC8& aDialData, - const TCaUiCallType aCallType ) - { - TInt length = aDialData.Length(); - - // If iPhCltDialer and iDialDataContainer exist, - // destroy them and create new ones. This clears the dial data. - ClearDialContents(); - iPhCltDialer = CPhCltExtPhoneBase::NewL( this ); - iObserver = &aObserver; - - iDialData = CPhCltExtPhoneDialData::NewL(); - CAiwInternalDialData* aiwDialData = CAiwInternalDialData::NewLC( aDialData ); - - // Convert AIW dial data to PhoneClient format. - - ConvertDialDataL( *aiwDialData ); - - iDialData->SetCallType( EPhCltVoice ); - - //a call type is still unknown if the dialing is made via phonebook - //send key (doesn't use HandleMenuCmdL, check the call type in - //aiwDialData to make sure if unknown is really unknown - //only do if call type unknown - TCaUiCallType callType = aCallType; - if ( callType == ECaUiCallTypeUnknown ) - { - CAiwDialData::TCallType aiwCalltype = aiwDialData->CallType(); - - switch ( aiwCalltype ) - { - case CAiwDialData::EAIWVoice: - callType = ECaUiCallTypeVoice; - break; - case CAiwDialData::EAIWVideo: - case CAiwDialData::EAIWForcedVideo: - callType = ECaUiCallTypeVideo; - break; - case CAiwDialData::EAIWVoiP: - callType = ECaUiCallTypeInternet; - break; - default: - //already unknown - break; - } - } - - //aiwDialData not needed anymore, remove from stack - CleanupStack::PopAndDestroy( aiwDialData ); - - // If Contact link is provided fetch field link from Phone Book. - if ( iDialData->ContactLink() != KNullDesC8() ) - { - // Launch address select. - // aCallType describes which selector is used. ( VoIP/PhoneNumber ) - LaunchAddressSelectL( - iDialData->ContactLink(), - callType ); - } - - - else - { - iPhCltDialer->DialL( *iDialData ); - } - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::LaunchNoNetSupNoteL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::LaunchNoNetSupNoteL() - { - User::Leave( KErrNotSupported ); - } - - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::LaunchReconConfQueryL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::LaunchReconConfQueryL( - MCaUiReconnectQueryObserver& /*aObserver*/, - CPhCntMatcher* /*aPhCntMatcher*/, - const TPtrC /*aPhoneNumber*/, - const TBool /*aIncludeVideoCallOption*/ ) - { - User::Leave( KErrNotSupported ); - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::CancelReconConfQuery -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::CancelReconConfQuery() - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::LaunchNoteAndReconConfQueryL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::LaunchNoteAndReconConfQueryL( - MCaUiReconnectQueryObserver& /*aObserver*/, - CPhCntMatcher* /*aPhCntMatcher*/, - const TPtrC /*aPhoneNumber*/, - const TBool /*aIncludeVideoCallOption*/, - const TPtrC /*aNoteText*/ ) - { - User::Leave( KErrNotSupported ); - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::CancelNoteAndReconConfQuery -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::CancelNoteAndReconConfQuery() - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::LaunchAddressSelectL -// -// -// ----------------------------------------------------------------------------- -// -TBool CCaUiEngine::LaunchAddressSelectL( - TDes& aTelNum, - const TInt aContactId, - const TBool aVoIPAddressSelect ) - { - if ( aVoIPAddressSelect ) - { - User::Leave( KErrNotSupported ); - } - - TBool addressSelected( EFalse ); - TCaUiCallType callType( ECaUiCallTypeVoice ); - - addressSelected = LaunchAddressSelectL( aTelNum, aContactId, callType ); - - return addressSelected; - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::CancelAddressSelect -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::CancelAddressSelect() - { - } - -// ----------------------------------------------------------------------------- -// From MPhCntStoreLoaderObserver. -// CCaUiEngine::ContactStoreLoadingCompleted -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::ContactStoreLoadingCompleted( - MVPbkContactStore* /*aStore*/, TInt /*aErrorCode*/ ) - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiEngine::HandleDialL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::HandleDialL( const TInt aStatus ) - { - if ( iObserver ) - { - iObserver->HandleDialResultL( aStatus ); - } - - ClearDialContents(); - } - -// ----------------------------------------------------------------------------- -// From base class MCaUiReconnectQueryObserver -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::OptionSelected( - MCaUiReconnectQueryObserver::TCaUiReconType /*aReconType*/ ) - { - } - -// ----------------------------------------------------------------------------- -// CCaUiEngine::ConvertDialData -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::ConvertDialDataL( - const CAiwInternalDialData& aAiwDialData ) - { - // Telephony number. - iDialData->SetTelephoneNumber( aAiwDialData.PhoneNumber().Left( - iDialData->TelephoneNumber().MaxLength() ) ); - - // Call type. - CAiwDialData::TCallType aiwCallType = aAiwDialData.CallType(); - TPhCltCallType phCltCallType = EPhCltVoice; - - // After this the call type should be correct one. - if ( aiwCallType == CAiwDialData::EAIWVideo ) - { - phCltCallType = EPhCltVideo; - iDialData->SetCallType( phCltCallType ); - } - else if ( aiwCallType == CAiwDialData::EAIWForcedVideo ) - { - phCltCallType = EPhCltForcedVideo; - iDialData->SetCallType( phCltCallType ); - } - else if ( aiwCallType == CAiwDialData::EAIWVoiP ) - { - phCltCallType = EPhCltCallVoIP; - iDialData->SetCallType( phCltCallType ); - } - - // Name. - iDialData->SetNameL( aAiwDialData.Name().Left( - iDialData->Name().MaxLength() ) ); - - // Contact link. - iDialData->SetContactLinkL( aAiwDialData.ContactLink() ); - - // Window group. - iDialData->SetWindowGroup( aAiwDialData.WindowGroup() ); - - // Redial. - iDialData->SetRedial( aAiwDialData.Redial() ); - - // Redial maximum duration. - iDialData->SetRedialMaximumDuration( aAiwDialData.RedialMaximumDuration() ); - - // Show number. - iDialData->SetShowNumber( aAiwDialData.ShowNumber() ); - - // Match. - iDialData->SetAllowMatch( aAiwDialData.AllowMatch() ); - - // End other calls. - iDialData->SetEndOtherCalls( aAiwDialData.EndOtherCalls() ); - - // Subaddress. - iDialData->SetSubAddressL( aAiwDialData.SubAddress().Left( - iDialData->SubAddress().MaxLength() ) ); - - // SAT call. - iDialData->SetSATCall( aAiwDialData.SATCall() ); - - // Bearer. - iDialData->SetBearerL( aAiwDialData.Bearer().Left( - iDialData->Bearer().MaxLength() ) ); - - TPhCltTelephoneNumber telnum; - telnum.Zero(); - telnum = iDialData->TelephoneNumber(); - PhCltUtils::RemoveInvalidChars( telnum ); - iDialData->SetTelephoneNumber( telnum ); - - } - -// ----------------------------------------------------------------------------- -// CCaUiEngine::ClearDialContents -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::ClearDialContents() - { - if ( iPhCltDialer ) - { - delete iPhCltDialer; - iPhCltDialer = NULL; - } - - if ( iDialData ) - { - delete iDialData; - iDialData = NULL; - } - - // Not owned, so just set to NULL. - iObserver = NULL; - } - -// ----------------------------------------------------------------------------- -// CCaUiEngine::LaunchAddressSelectL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiEngine::LaunchAddressSelectL( - const TDesC8& aContactLink, - const TCaUiCallType aCallType ) - { - if ( aCallType != ECaUiCallTypeVoice ) - { - HandleDialL( KErrNotSupported ); - } - - else - { - if ( !iFactory ) - { - iFactory = CreateCntFactoryL(); - } - if ( !iContactSelector ) - { - iContactSelector = iFactory->CreateContactDataSelectionL(); - } - - CPhCntContactDataSelection::TCallType callType; - - if ( aCallType == ECaUiCallTypeVoice ) - { - callType = CPhCntContactDataSelection::ECallPhoneNumber; - } - else if ( aCallType == ECaUiCallTypeVideo ) - { - callType = CPhCntContactDataSelection::ECallVideoNumber; - } - else if ( aCallType == ECaUiCallTypeInternet ) - { - callType = CPhCntContactDataSelection::ECallVoip; - } - else - { - callType = CPhCntContactDataSelection::ECallPhoneNumber; - } - - iContactSelector->Cancel(); - iContactSelector->SelectPhoneNumberForCallL( aContactLink, callType, *this ); - - } - - } - -// --------------------------------------------------------- -// CCaUiEngine::HandleEmergencyDialL() -// --------------------------------------------------------- -// -void CCaUiEngine::HandleEmergencyDialL( const TInt /*aStatus*/ ) - { - // Do nothing - } - -// --------------------------------------------------------- -// CCaUiEngine::SelectionDone() -// --------------------------------------------------------- -// -void CCaUiEngine::SelectionDone( CPhCntSelectedData* aContactData, - TInt aErrorCode ) - { - if ( aErrorCode == KErrNone ) - { - TPhCltTelephoneNumber phoneNumber; - HBufC8* fieldLink = NULL; - - if ( iDialData->TelephoneNumber() == KNullDesC ) - { - phoneNumber = aContactData->Data(); - PhCltUtils::RemoveInvalidChars( phoneNumber ); - iDialData->SetTelephoneNumber( phoneNumber ); - } - if ( aContactData->FieldLink().Length() > 0 ) - { - fieldLink = aContactData->FieldLink().Alloc(); - } - - TRAP( aErrorCode, PhoneClientDialL( fieldLink ) ); - - delete fieldLink; - fieldLink = NULL; - } - - if ( aErrorCode != KErrNone ) - { - TRAP_IGNORE( HandleDialL( aErrorCode ) ); - } - } - -// --------------------------------------------------------- -// CCaUiEngine::PhoneClientDialL() -// --------------------------------------------------------- -// -void CCaUiEngine::PhoneClientDialL( const TDesC8* aFieldLink ) - { - - TBool createCall( ETrue ); - TInt error( KErrNone ); - - if ( aFieldLink ) - { - iDialData->SetContactLinkL( *aFieldLink ); - } - - // Check if number is emergency number and if it is - // then call emeregency call - if ( !iEmergencyCall ) - { - iEmergencyCall = CPhCltEmergencyCall::NewL( this ); - } - if ( IsEmergencyNumber() ) - { - createCall = EFalse; - if ( aFieldLink ) - { - error = KErrNone; - iEmergencyCall->DialEmergencyCallL( iDialData->TelephoneNumber() ); - } - else - { - error = KErrNotSupported; - } - } - - // Here note launch + query if this is video call and we - // are not in 3G network. - - if ( createCall ) - { - if ( ( iDialData->CallType() == EPhCltVideo ) || - ( iDialData->CallType() == EPhCltForcedVideo ) || - ( iDialData->CallType() == EPhCltCallVoIP ) ) - { - createCall = EFalse; - error = KErrNotSupported; - } - - } - if ( createCall ) - { - iPhCltDialer->DialL( *iDialData ); - } - else - { - //User cancelled. Need to inform client. - if ( error != KErrNone ) // Emergency call does not need to inform client. - { - HandleDialL( error ); - } - } - } - -// --------------------------------------------------------- -// CCaUiEngine::IsEmergencyNumber() -// --------------------------------------------------------- -// -TBool CCaUiEngine::IsEmergencyNumber() - { - TBool isEmergencyNumber( EFalse ); - - // get phonenumber from iDialData and heck number using phoneclient - // emergencycall api - TInt result = iEmergencyCall->IsEmergencyPhoneNumber( - iDialData->TelephoneNumber(), - isEmergencyNumber ); - - return isEmergencyNumber; - } - -// ----------------------------------------------------------------------------- -// CCaUiEngine::IsVoIPProfiles() -// -// -// ----------------------------------------------------------------------------- -// -TBool CCaUiEngine::IsVoIPProfiles() - { - return EFalse; - } - -// End of file diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiEngine/CaUiMessageSender.cpp --- a/phoneclientserver/CallUI/Src/CaUiEngine/CaUiMessageSender.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,342 +0,0 @@ -/* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Launches Sendui Editor. -* -*/ - - - - -// INCLUDES -#include "cauimessagesender.h" - -#include // CCoeEnv -#include // Resources. - -#include // KUidMsvLocalServiceMtmValue - -#include // CSendAppUi, CSendUi -#include // Message data for CSendUi -#include // Feature manager -#include "cauilogger.h" // Call Ui Logger - -// CONSTANTS -// The reconnect query options granularity. -#ifdef RD_UNIFIED_EDITOR -const TInt KCaUiReConQueryOptionsArrayGranularity = 3; -#else // RD_UNIFIED_EDITOR -const TInt KCaUiReConQueryOptionsArrayGranularity = 4; -#endif // RD_UNIFIED_EDITOR - -const TInt KMtmPop3Uid = 0x10001029; -const TInt KMtmImap4Uid = 0x1000102a; -const TInt KUidEmail = 0x10001028; -const TInt KUidPostCard = 0x10207245; - -// ----------------------------------------------------------------------------- -// CCaUiMessageSender::CCaUiMessageSender -// -// C++ constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CCaUiMessageSender::CCaUiMessageSender() - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiMessageSender::~CCaUiMessageSender -// -// Destructor. -// ----------------------------------------------------------------------------- -// -CCaUiMessageSender::~CCaUiMessageSender() - { - - CAUILOGSTRING("CALLUI: >>> CCaUiMessageSender::~CCaUiMessageSender()"); - - if ( iMsgTypes ) - { - iMsgTypes->Reset(); - delete iMsgTypes; - } - - if( iSession ) - { - iSession->Cancel(); - } - delete iSession; - - if( iSendUi ) - { - delete iSendUi; - } - - CAUILOGSTRING("CALLUI: <<< CCaUiMessageSender::~CCaUiMessageSender()"); - } - - -// ----------------------------------------------------------------------------- -// CCaUiMessageSender::NewL -// -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCaUiMessageSender* CCaUiMessageSender::NewL() - { - - CAUILOGSTRING("CALLUI: >>> CCaUiMessageSender::NewL()"); - - CCaUiMessageSender* self = new( ELeave ) CCaUiMessageSender (); - - CAUILOGSTRING("CALLUI: <<< CCaUiMessageSender::NewL()"); - - return self; - } - -// --------------------------------------------------------- -// CCaUiMessageSender::CreateNewMessageL -// Create a new message of the given type, in the given location -// --------------------------------------------------------- -// -void CCaUiMessageSender::CreateNewMessageL( - TInt aMessageType, - MDesC16Array* aRealAddress, - MDesC16Array* aAliases, - CRichText* aRichText ) - { - - CAUILOGSTRING("CALLUI: >>> CCaUiMessageSender::CreateNewMessageL()"); - - TRAPD( err, CreateSendUiL()); - if ( err != KErrNone ) - User::Leave( KErrGeneral ); - - //Launch message editor standalone - TUid mtmUid = { aMessageType }; - - CMessageData* messageData = CMessageData::NewL(); - CleanupStack::PushL( messageData ); - if ( aRichText ) - { - messageData->SetBodyTextL( aRichText ); - } - - // Set real address and check if aliases exist - if ( aRealAddress ) - { - TBool aAliasesExist = EFalse; - if ( aAliases && - aAliases->MdcaCount() == aRealAddress->MdcaCount() ) - { - aAliasesExist = ETrue; - } - for ( TInt i=0; i < aRealAddress->MdcaCount(); i++ ) - { - if ( aAliasesExist ) - { - messageData->AppendToAddressL( - aRealAddress->MdcaPoint( i ), - aAliases->MdcaPoint( i ) ); - } - else - { - messageData->AppendToAddressL( - aRealAddress->MdcaPoint( i ) ); - } - } - } - - iSendUi->CreateAndSendMessageL( mtmUid, messageData, KNullUid, EFalse ); - CleanupStack::PopAndDestroy(); // messageData - - CAUILOGSTRING("CALLUI: <<< CCaUiMessageSender::CreateNewMessageL()"); - } - -// --------------------------------------------------------- -// CCaUiMessageSender::CreateSendUiL -// --------------------------------------------------------- -// -void CCaUiMessageSender::CreateSendUiL() - { - CAUILOGSTRING("CALLUI: >>> CCaUiMessageSender::CreateSendUiL()"); - - // Create instance of send ui. - if( !iSendUi ) - { - iSendUi = CSendUi::NewL(); - } - - CAUILOGSTRING("CALLUI: <<< CCaUiMessageSender::CreateSendUiL()"); - } - -// --------------------------------------------------------- -// CCaUiMessageSender::MessageTypesArray -// --------------------------------------------------------- -const CUidNameArray& CCaUiMessageSender:: - MessageTypesArrayL() - { - - CAUILOGSTRING("CALLUI: >>> CCaUiMessageSender::MessageTypesArrayL()"); - - delete iMsgTypes; - iMsgTypes = NULL; - - CUidNameArray* msgTypes = new ( ELeave ) - CUidNameArray( KCaUiReConQueryOptionsArrayGranularity ); - CleanupStack::PushL( msgTypes ); - UpdateMessageTypesArrayL( msgTypes ); - CleanupStack::Pop(); - iMsgTypes = msgTypes; - - CAUILOGSTRING("CALLUI: <<< CCaUiMessageSender::MessageTypesArrayL()"); - - return *iMsgTypes; - } - -// --------------------------------------------------------- -// CCaUiMessageSender::UpdateMessageTypesArrayL -// Updates the array of UIDs which defines the MTM types for which the user -// can create new messages. -// --------------------------------------------------------- -void CCaUiMessageSender::UpdateMessageTypesArrayL( - CUidNameArray* aMsgTypes ) - { - - CAUILOGSTRING("CALLUI:>>> CCaUiMessageSender::UpdateMessageTypesArrayL()"); - - aMsgTypes->Reset(); - - FeatureManager::InitializeLibL(); - //Read MTM types from resource file - TResourceReader resReader; - CCoeEnv::Static()->CreateResourceReaderLC( resReader, - NEW_MESSAGE_TYPES_ARRAY ); - - TInt count = resReader.ReadInt16(); - - for ( TInt i = 0; i < count; i++ ) - { - TInt32 id = resReader.ReadInt32(); - HBufC* name = resReader.ReadHBufCL(); - CleanupStack::PushL( name ); - - switch( id ) - { - case KUidEmail: - { - if ( IsMailboxDefinedL() ) - { - aMsgTypes->AppendL( TUidNameInfo( TUid::Uid( id ), *name ) ); - } - break; - } - case KUidPostCard: - { - if ( FeatureManager::FeatureSupported( KFeatureIdMmsPostcard ) ) - { - aMsgTypes->AppendL( TUidNameInfo( TUid::Uid( id ), *name ) ); - } - break; - } - default: - { - aMsgTypes->AppendL( TUidNameInfo( TUid::Uid( id ), *name ) ); - break; - } - } - - CleanupStack::PopAndDestroy( name ); - } - - CleanupStack::PopAndDestroy();//resReader - FeatureManager::UnInitializeLib(); - - CAUILOGSTRING("CALLUI:<<< CCaUiMessageSender::UpdateMessageTypesArrayL() end"); - } - -// --------------------------------------------------------- -// CCaUiMessageSender::CreateMessageServiceConnectionL -// --------------------------------------------------------- -// -void CCaUiMessageSender::CreateMessageServiceConnectionL() - { - CAUILOGSTRING("CALLUI:>>> CCaUiMessageSender::CreateMessageServiceConnectionL()"); - - if ( !iSession ) - { - iSession = CMsvSession::OpenSyncL( *this ); - } - CAUILOGSTRING("CALLUI:<<< CCaUiMessageSender::CreateMessageServiceConnectionL()"); - } - -// --------------------------------------------------------- -// CCaUiMessageSender::IsMailboxDefinedL -// --------------------------------------------------------- -// -TBool CCaUiMessageSender::IsMailboxDefinedL() - { - CAUILOGSTRING("CALLUI:>>> CCaUiMessageSender::IsMailboxDefinedL()"); - - CreateMessageServiceConnectionL(); - - TBool isDefined = EFalse; - CMsvEntry* root = iSession->GetEntryL( KMsvRootIndexEntryId ); - - TInt count = root->Count(); - for ( TInt i = 0; i < count; i++ ) - { - const TMsvEntry& tentry = (*root)[i]; - if ( tentry.iMtm.iUid == KMtmPop3Uid || - tentry.iMtm.iUid == KMtmImap4Uid ) - { - isDefined = ETrue; - break; - } - } - delete root; - - CAUILOGSTRING("CALLUI:<<< CCaUiMessageSender::IsMailboxDefinedL()"); - return isDefined; - } - - -// --------------------------------------------------------- -// CCaUiMessageSender::HandleSessionEventL -// --------------------------------------------------------- -void CCaUiMessageSender::HandleSessionEventL(TMsvSessionEvent aEvent, - TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) - { - CAUILOGSTRING("CALLUI:>>> CCaUiMessageSender::HandleSessionEventL()"); - - CreateMessageServiceConnectionL(); - - switch ( aEvent ) - { - case EMsvCloseSession: - //Server close. - delete iSession; - iSession = NULL; - CAUILOGSTRING("CALLUI:<<< CCaUiMessageSender::HandleSessionEventL(): case: EMsvCloseSession"); - break; - default: - CAUILOGSTRING("CALLUI:<<< CCaUiMessageSender::HandleSessionEventL(): case: default"); - break; - } - - } - - -// End of File diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiEngine/CaUiMessageSenderStub.cpp --- a/phoneclientserver/CallUI/Src/CaUiEngine/CaUiMessageSenderStub.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Message sender stub -* -*/ - - -// INCLUDES -#include "cauimessagesenderstub.h" - -// ----------------------------------------------------------------------------- -// CCaUiMessageSender::CCaUiMessageSender -// -// C++ constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CCaUiMessageSender::CCaUiMessageSender() - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiMessageSender::~CCaUiMessageSender -// -// Destructor. -// ----------------------------------------------------------------------------- -// -CCaUiMessageSender::~CCaUiMessageSender() - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiMessageSender::NewL -// -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCaUiMessageSender* CCaUiMessageSender::NewL() - { - CCaUiMessageSender* self = new( ELeave ) CCaUiMessageSender (); - - return self; - } - -// --------------------------------------------------------- -// CCaUiMessageSender::CreateNewMessageL -// Create a new message of the given type, in the given location -// --------------------------------------------------------- -// -void CCaUiMessageSender::CreateNewMessageL( - TInt /*aMessageType*/, - MDesC16Array* /*aRealAddress*/, - MDesC16Array* /*aAliases*/, - CRichText* /*aRichText*/ ) - { - } - -// --------------------------------------------------------- -// CCaUiMessageSender::CreateSendUiL -// --------------------------------------------------------- -// -void CCaUiMessageSender::CreateSendUiL() - { - } - - -// --------------------------------------------------------- -// CCaUiMessageSender::UpdateMessageTypesArrayL -// Updates the array of UIDs which defines the MTM types for which the user -// can create new messages. -// --------------------------------------------------------- -void CCaUiMessageSender::UpdateMessageTypesArrayL( - CUidNameArray* /*aMsgTypes*/ ) - { - } - -// --------------------------------------------------------- -// CCaUiMessageSender::CreateMessageServiceConnectionL -// --------------------------------------------------------- -// -void CCaUiMessageSender::CreateMessageServiceConnectionL() - { - } - -// --------------------------------------------------------- -// CCaUiMessageSender::IsMailboxDefinedL -// --------------------------------------------------------- -// -TBool CCaUiMessageSender::IsMailboxDefinedL() - { - TBool isDefined( EFalse ); - return isDefined; - } - -// End of File diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiEngine/CaUiQuery.cpp --- a/phoneclientserver/CallUI/Src/CaUiEngine/CaUiQuery.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Query that is used in asking call type (confirmation) -* from user. -* -*/ - - - - -// INCLUDES -#include "cauiquery.h" - - -// ----------------------------------------------------------------------------- -// CCaUiCreateListQuery::CCaUiListQuery -// -// C++ constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CCaUiCreateListQuery::CCaUiCreateListQuery( TInt* aIndex ) -: CAknListQueryDialog( aIndex ) - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiCreateListQuery::~CCaUiCreateListQuery -// -// Destructor. -// ----------------------------------------------------------------------------- -// -CCaUiCreateListQuery::~CCaUiCreateListQuery() - { - } - - -// ----------------------------------------------------------------------------- -// CCaUiCreateListQuery::OfferKeyEventL -// -// -// ----------------------------------------------------------------------------- -// -TKeyResponse CCaUiCreateListQuery::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - TKeyResponse response = EKeyWasConsumed; - - if ( aType == EEventKeyDown ) - { - // The first key event received will be a partial one, and will therefore be ignored. - iValidKeyEvent = ETrue; - } - - if ( iValidKeyEvent && aKeyEvent.iScanCode == EStdKeyYes ) - { - if ( aType == EEventKey ) - { - // The send key is specified to act (in Video Telephony UI specification) so that it - // initiates the call. This means that the event is modified and faked to be a select - // key event, so that the list box can handle it correctly. - TKeyEvent keyEvent = aKeyEvent; - keyEvent.iCode = EKeyOK; - keyEvent.iScanCode = EStdKeyDevice3; - response = CAknListQueryDialog::OfferKeyEventL( keyEvent, EEventKey ); - } - } - else - { - response = CAknListQueryDialog::OfferKeyEventL( aKeyEvent, aType ); - } - - return response; - } - - -// End of File diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiEngine/CaUiVoIPExtension.cpp --- a/phoneclientserver/CallUI/Src/CaUiEngine/CaUiVoIPExtension.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* -* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: VoIP profile handler -* -*/ - - - -// INCLUDE FILES -#include "cauivoipextension.h" -#include -#include -#include -#include -#include // String Loader. - - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CCaUiVoIPExtension::CCaUiVoIPExtension -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CCaUiVoIPExtension::CCaUiVoIPExtension() - { - } - -// ----------------------------------------------------------------------------- -// CCaUiVoIPExtension::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CCaUiVoIPExtension::ConstructL() - { - - } - -// ----------------------------------------------------------------------------- -// CCaUiVoIPExtension::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCaUiVoIPExtension* CCaUiVoIPExtension::NewL() - { - CCaUiVoIPExtension* self = new( ELeave ) CCaUiVoIPExtension; - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - - -// Destructor -CCaUiVoIPExtension::~CCaUiVoIPExtension() - { - - } - -// ----------------------------------------------------------------------------- -// CCaUiVoIPExtension::IsVoIPProfilesL() -// Checks if any service supports internet call -// ----------------------------------------------------------------------------- -// -TBool CCaUiVoIPExtension::IsVoIPProfilesL() - { - TBool isProfiles = EFalse; - - RIdArray voipServiceIds; - CleanupClosePushL( voipServiceIds ); - GetVoIPServiceIdsL( voipServiceIds ); - if ( voipServiceIds.Count() ) - { - isProfiles = ETrue; - } - CleanupStack::PopAndDestroy( &voipServiceIds ); - - return isProfiles; - } - -// ----------------------------------------------------------------------------- -// CCaUiVoIPExtension::GetVoIPServiceIdsL() -// -// ----------------------------------------------------------------------------- -// -void CCaUiVoIPExtension::GetVoIPServiceIdsL( RIdArray& aVoipServiceIds ) const - { - aVoipServiceIds.Reset(); - - // Fetch the settings api. - CSPSettings* settingsApi = CSPSettings::NewLC(); - - // read all service ids to array - RIdArray idArray; - CleanupClosePushL( idArray ); - - if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) ) - { - User::LeaveIfError( settingsApi->FindServiceIdsL( idArray ) ); - - // go throught all the services and check if any - // of them supports internet call - for ( TInt i = 0; idArray.Count() > i; i++) - { - // check if the service supports internet call - CSPProperty* property = CSPProperty::NewLC(); - // get attribute mask of the service - User::LeaveIfError( settingsApi->FindPropertyL( idArray[i], - EPropertyServiceAttributeMask, *property ) ); - - // read the value of mask property - TInt mask = 0; - if ( KErrNone == property->GetValue( mask ) ) - { - if ( ( mask & ESupportsInternetCall ) - && ( mask & EIsVisibleInCallMenu ) ) - { - aVoipServiceIds.Append( idArray[i] ); - } - } - CleanupStack::PopAndDestroy( property ); - } - } - CleanupStack::PopAndDestroy( 2, settingsApi ); - } - - -// ----------------------------------------------------------------------------- -// CCaUiVoIPExtension::GetVoipServiceNameL() -// -// ----------------------------------------------------------------------------- -// -void CCaUiVoIPExtension::GetVoipServiceNameL( TServiceId aServiceId, TDes& aServiceName ) const - { - CSPSettings* settingsApi = CSPSettings::NewLC(); - CSPProperty* property = CSPProperty::NewLC(); - - settingsApi->FindPropertyL( aServiceId, EServiceName, *property ); - User::LeaveIfError( property->GetValue( aServiceName ) ); - - CleanupStack::PopAndDestroy( 2, settingsApi ); - } - -// End of File diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiEngine/ccauireconnectquery.cpp --- a/phoneclientserver/CallUI/Src/CaUiEngine/ccauireconnectquery.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Creates CallUIEngine reconnect query implementation. -* -*/ - - - -// INCLUDE FILES -#include "ccauireconnectquery.h" -#include "ccauireconnectqueryimpl.h" - - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CCaUiReconnectQuery::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CCaUiReconnectQuery* CCaUiReconnectQuery::NewL( - MCaUiReconnectQueryObserver& aObserver ) - { - return CCaUiReconnectQueryImpl::NewL( aObserver ); - } - -CCaUiReconnectQuery::~CCaUiReconnectQuery() - { - // No implementation needed - } -// ----------------------------------------------------------------------------- -// CCaUiReconnectQuery::CCaUiReconnectQuery -// C++ constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CCaUiReconnectQuery::CCaUiReconnectQuery( MCaUiReconnectQueryObserver& aObserver ) - : iObserver( aObserver ) - { - } - - - - -// End of File diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiEngine/ccauireconnectqueryimpl.cpp --- a/phoneclientserver/CallUI/Src/CaUiEngine/ccauireconnectqueryimpl.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CallUIEngine reconnect query. -* -*/ - - - -// INCLUDE FILES -#include "ccauireconnectqueryimpl.h" -#include "cauiengine.h" - -CCaUiReconnectQueryImpl* CCaUiReconnectQueryImpl::NewL( - MCaUiReconnectQueryObserver& aObserver ) - { - CCaUiReconnectQueryImpl* self = - new ( ELeave ) CCaUiReconnectQueryImpl( aObserver); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - -CCaUiReconnectQueryImpl::~CCaUiReconnectQueryImpl( ) - { - if ( iEng ) - { - iEng->CancelReconConfQuery(); - delete iEng; - } - } - -void CCaUiReconnectQueryImpl::ShowL( - const TPtrC aPhoneNumber, - const TBool aIncludeVideoCallOption ) - { - iEng->LaunchReconConfQueryL(iObserver, - NULL, - aPhoneNumber, - aIncludeVideoCallOption ); - } - -void CCaUiReconnectQueryImpl::ConstructL() - { - iEng = CCaUiEngine::NewL(); - } - -CCaUiReconnectQueryImpl::CCaUiReconnectQueryImpl( - MCaUiReconnectQueryObserver& aObserver ): - CCaUiReconnectQuery(aObserver) - { - - } - -// End of file - - diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiPlugin/CaUIMain.cpp --- a/phoneclientserver/CallUI/Src/CaUiPlugin/CaUIMain.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Global functions for CaUiPlugin. -* -*/ - - - -// INCLUDE FILES -#include -#include -#include "caui.hrh" -#include "cauiplugin.h" - - -// CONSTANTS - -// Holds implementation table. -const TImplementationProxy KCallUIImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( - KCallUIImplementationUid, - CCaUiPlugin::NewL ), - IMPLEMENTATION_PROXY_ENTRY( - KCallUIImplementationUid2, - CCaUiPlugin::NewL ) - }; - - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// ImplementationGroupProxy -// -// Returns implementation table and updates aTableCount parameter to hold -// amount of elements in table. -// ----------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( - TInt& aTableCount ) - { - aTableCount = - sizeof( KCallUIImplementationTable ) / - sizeof( TImplementationProxy ); - - return KCallUIImplementationTable; - } - -// End of File diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/CallUI/Src/CaUiPlugin/CaUiPlugin.cpp --- a/phoneclientserver/CallUI/Src/CaUiPlugin/CaUiPlugin.cpp Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,441 +0,0 @@ -/* -* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CallUI plugin. -* -*/ - - - -// INCLUDE FILES -#include "cauiplugin.h" // This class interface. -#include "cauieng.h" // CaUiEngine. -#include // AIW constants. -#include "caui.hrh" // CallUI constants. -#include // AIW Menu pane. - -#include -#include // PhoneClient types. -#include "cauilogger.h" // Call Ui Logger -#include -#include - -// CONSTANTS - -// Empty filename for initialization. -_LIT( KCaUiNullResFile, "" ); - -// The library to be loaded. -_LIT( KCaUiLoadedLib, "cauiengine.dll" ); - - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CCaUiPlugin::CCaUiPlugin -// -// C++ constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CCaUiPlugin::CCaUiPlugin() - { - } - -// ----------------------------------------------------------------------------- -// CCaUiPlugin::ConstructL -// -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CCaUiPlugin::ConstructL() - { - CAUILOGSTRING("CALLUI: >>>CCaUiPlugin::ConstructL() Begin"); - User::LeaveIfError( iLibrary.Load( KCaUiLoadedLib ) ); - - // Call function CreateCaUiEngFactoryL() - TInt res = iLibrary.Lookup( 1 )(); - CCaUiEngFactory* caUiEngFactory = - reinterpret_cast< CCaUiEngFactory* >( res ); - - iCaUiEngine = caUiEngFactory->CCaUiEngApiLD(); - - if( !iCaUiEngine ) - { - // Null returned, so leave. - User::Leave( KErrNotSupported ); - } - CAUILOGSTRING("CALLUI: >>>CCaUiPlugin::ConstructL() End"); - } - - -// ----------------------------------------------------------------------------- -// CCaUiPlugin::NewL -// -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCaUiPlugin* CCaUiPlugin::NewL() - { - CCaUiPlugin* self = new( ELeave ) CCaUiPlugin; - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - } - - -// ----------------------------------------------------------------------------- -// CCaUiPlugin::~CCaUiPlugin -// -// Destructor. -// ----------------------------------------------------------------------------- -// -CCaUiPlugin::~CCaUiPlugin() - { - delete iCaUiEngine; - - iLibrary.Close(); - } - - -// ----------------------------------------------------------------------------- -// CCaUiPlugin::InitialiseL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiPlugin::InitialiseL( - MAiwNotifyCallback& /*aFrameworkCallback*/, - const RCriteriaArray& /*aInterest*/) - { - // Stub. Not used. - } - - -// ----------------------------------------------------------------------------- -// CCaUiPlugin::HandleServiceCmdL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiPlugin::HandleServiceCmdL( - const TInt& aCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, - TUint aCmdOptions, - const MAiwNotifyCallback* aCallback ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiPlugin::HandleServiceCmdL() Begin"); - // Handle only call command. - if ( aCmdId == KAiwCmdCall ) - { - if ( aCmdOptions & KAiwOptCancel ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiPlugin::HandleServiceCmdL() Cancel"); - return; - } - // Check if there is CallUI Dialdata parameter. - TInt index = 0; - const TAiwGenericParam* genericParam = NULL; - - genericParam = aInParamList.FindFirst( - index, - EGenericParamCallDialData, - EVariantTypeDesC8 ); - - if ( index >= 0 && genericParam ) - { - // Get the data. - TPtrC8 ptr = genericParam->Value().AsData(); - - // If this function was called through HandleMenuCmdL, - // iMenuCmdId was set, otherwise it is zero. - TCaUiCallType callType = ECaUiCallTypeUnknown; - - if ( iMenuCmdId == ECallUIVoice ) - { - callType = ECaUiCallTypeVoice; - } - else if ( iMenuCmdId == ECallUIVideo ) - { - callType = ECaUiCallTypeVideo; - } - else if ( iMenuCmdId == ECallUIInternet ) - { - callType = ECaUiCallTypeInternet; - } - - iMenuCmdId = 0; - - // Save the parameters given. - iAiwNotifyCallback = aCallback; - iInParamList = &aInParamList; - iOutParamList = &aOutParamList; - - // Perform the dial operation. - iCaUiEngine->DialL( *this, ptr, callType ); - } - } - CAUILOGSTRING("CALLUI: >>>CCaUiPlugin::HandleServiceCmdL() End"); - } - - - -// ----------------------------------------------------------------------------- -// CCaUiPlugin::InitializeMenuPaneL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiPlugin::InitializeMenuPaneL( - CAiwMenuPane& aMenuPane, - TInt aIndex, - TInt /* aCascadeId */, - const CAiwGenericParamList& aInParamList ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiPlugin::InitializeMenuPaneL() Begin"); - - // By default we want all internet, voice and video call resources - TBool csVoiceMenuItemAvailable( ETrue ); - TBool csVideoMenuItemAvailable( ETrue ); - TBool voipMenuItemAvailable( ETrue ); - - // If there is PhoneNumber parameter given, then only voice call - // resource is wanted. - TInt count = aInParamList.Count(); - if ( count ) - { - TInt index = 0; - aInParamList.FindFirst( - index, - EGenericParamPhoneNumber, - EVariantTypeAny ); - - if ( index >= 0 ) - { - csVideoMenuItemAvailable = EFalse; - voipMenuItemAvailable = EFalse; - } - - if ( index == KErrNotFound ) - { - index = 0; - aInParamList.FindFirst( - index, - EGenericParamSIPAddress, - EVariantTypeAny ); - - if ( index >= 0 ) - { - // Internet number parameter was found, - csVoiceMenuItemAvailable = EFalse; - csVideoMenuItemAvailable = EFalse; - } - } - } - - // Add menu items - - TInt menuIndex = aIndex; - - if ( csVoiceMenuItemAvailable ) - { - AddAiwMenuItemL( aMenuPane, menuIndex, ECSVoice ); - menuIndex++; - } - - if ( csVideoMenuItemAvailable ) - { - AddAiwMenuItemL( aMenuPane, menuIndex, ECSVideo ); - menuIndex++; - } - - if ( voipMenuItemAvailable ) - { - RIdArray voipServiceIds; - CleanupClosePushL( voipServiceIds ); - iCaUiEngine->GetVoIPServiceIdsL( voipServiceIds ); - TInt numberOfVoipServices = voipServiceIds.Count(); - - if ( 1 == numberOfVoipServices ) - { - // Single VoIP service, use service name in menu item - AddAiwMenuItemL( aMenuPane, menuIndex, EInternetWithName, voipServiceIds[0] ); - menuIndex++; - } - else if ( numberOfVoipServices > 1 ) - { - // Regular internet call menu - AddAiwMenuItemL( aMenuPane, menuIndex, EInternet ); - menuIndex++; - } - - CleanupStack::PopAndDestroy( &voipServiceIds ); - } - - // Set submenu title - if ( csVoiceMenuItemAvailable || - csVideoMenuItemAvailable || - voipMenuItemAvailable ) - { - HBufC* menuTitle = StringLoader::LoadLC( R_CALLUI_CALL_SUBMENU_TITLE ); - aMenuPane.AddTitleItemL( *menuTitle, aIndex ); - CleanupStack::PopAndDestroy( menuTitle ); - } - - CAUILOGSTRING("CALLUI: >>>CCaUiPlugin::InitializeMenuPaneL() End"); - } - - -// ----------------------------------------------------------------------------- -// CCaUiPlugin::HandleMenuCmdL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiPlugin::HandleMenuCmdL( - TInt aMenuCmdId, - const CAiwGenericParamList& aInParamList, - CAiwGenericParamList& aOutParamList, - TUint aCmdOptions, - const MAiwNotifyCallback* aCallback ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiPlugin::HandleMenuCmdL() Begin"); - // Handle only call commands. - if ( ( aMenuCmdId == ECallUIVideo ) || - ( aMenuCmdId == ECallUIVoice ) || - ( aMenuCmdId == ECallUIInternet ) ) - { - // Save the menu command. - iMenuCmdId = aMenuCmdId; - - // Menu commands are handled as service commands. - HandleServiceCmdL( - KAiwCmdCall, - aInParamList, - aOutParamList, - aCmdOptions, - aCallback ); - } - CAUILOGSTRING("CALLUI: >>>CCaUiPlugin::HandleMenuCmdL() End"); - } - - -// ----------------------------------------------------------------------------- -// CCaUiPlugin::HandleDialResultL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiPlugin::HandleDialResultL( const TInt aStatus ) - { - CAUILOGSTRING("CALLUI: >>>CCaUiPlugin::HandleDialResultL() Start"); - // If callback exists, inform client of call result. - if ( iAiwNotifyCallback ) - { - // Add the call result to the out parameter list. - TAiwVariant variant( aStatus ); - TAiwGenericParam genericParam( EGenericParamError, variant ); - iOutParamList->AppendL( genericParam); - - // R&D solution: Remove constness. - MAiwNotifyCallback* callback = - const_cast< MAiwNotifyCallback* >( iAiwNotifyCallback ); - - // Notify client. - callback->HandleNotifyL( - KAiwCmdCall, - KAiwEventStarted, - *iOutParamList, - *iInParamList ); - } - - // Callback not active anymore, make clearing. - iAiwNotifyCallback = NULL; - iInParamList = NULL; - iOutParamList = NULL; - CAUILOGSTRING("CALLUI: >>>CCaUiPlugin::HandleDialResultL() End"); - } - -// ----------------------------------------------------------------------------- -// CCaUiPlugin::AddAiwMenuItemL -// -// -// ----------------------------------------------------------------------------- -// -void CCaUiPlugin::AddAiwMenuItemL( CAiwMenuPane& aMenuPane, TInt aIndex, EMenuItemType aType, TServiceId aServiceId ) - { - CEikMenuPaneItem::SData data; - data.iCascadeId = 0; - data.iFlags = 0; - data.iExtraText = KNullDesC(); - - HBufC* menuItemText = NULL; - - switch ( aType ) - { - case ECSVoice: - { - data.iCommandId = ECallUIVoice; - menuItemText = StringLoader::LoadLC( R_CALLUI_CS_VOICE_CALL ); - data.iText.Copy( *menuItemText ); - break; - } - - case ECSVideo: - { - data.iCommandId = ECallUIVideo; - menuItemText = StringLoader::LoadLC( R_CALLUI_CS_VIDEO_CALL ); - data.iText.Copy( *menuItemText ); - break; - } - - case EInternet: - { - data.iCommandId = ECallUIInternet; - menuItemText = StringLoader::LoadLC( R_CALLUI_INTERNET_CALL ); - data.iText.Copy( *menuItemText ); - break; - } - - case EInternetWithName: - { - data.iCommandId = ECallUIInternet; - - // Get the service provider name - TBuf<100> buf; - iCaUiEngine->GetVoipServiceNameL( aServiceId, buf ); - menuItemText = StringLoader::LoadLC( R_CALLUI_XSP_CALL_WITH_SERVICE_NAME, buf ); - data.iText.Copy( *menuItemText ); - break; - } - - default: - break; - } - - if ( NULL != menuItemText ) - { - CleanupStack::PopAndDestroy( menuItemText ); - } - - aMenuPane.AddMenuItemL( - KAiwCmdCall, - data, - aIndex ); - } - -// End of file diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/EnPolicy/Inc/CEmergencyNumberPolicy.h --- a/phoneclientserver/EnPolicy/Inc/CEmergencyNumberPolicy.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phoneclientserver/EnPolicy/Inc/CEmergencyNumberPolicy.h Mon May 03 13:01:45 2010 +0300 @@ -24,7 +24,7 @@ // INCLUDES #include #include -#include +#include // CONSTANTS const TUid KEnPolicyUid={ 0x101F86D1 }; diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/EnPolicy/Src/SosEnPolicy/CSosEnPolicySimStatusMonitor.cpp --- a/phoneclientserver/EnPolicy/Src/SosEnPolicy/CSosEnPolicySimStatusMonitor.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/phoneclientserver/EnPolicy/Src/SosEnPolicy/CSosEnPolicySimStatusMonitor.cpp Mon May 03 13:01:45 2010 +0300 @@ -20,7 +20,7 @@ // INCLUDES #include "csosenpolicysimstatusmonitor.h" #include // Property values -#include +#include diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/dialutils/group/dialutils.mmp --- a/phoneclientserver/dialutils/group/dialutils.mmp Fri Apr 16 15:31:58 2010 +0300 +++ b/phoneclientserver/dialutils/group/dialutils.mmp Mon May 03 13:01:45 2010 +0300 @@ -24,8 +24,8 @@ UID 0x1000008d 0x101F8747 SOURCEPATH ../src -SOURCE DialUtilsImpl.cpp -SOURCE DialUtilsFactImpl.cpp +SOURCE dialutilsimpl.cpp +SOURCE dialutilsfactimpl.cpp USERINCLUDE ../inc diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/Group/PhoneClient.mmp --- a/phoneclientserver/phoneclient/Group/PhoneClient.mmp Fri Apr 16 15:31:58 2010 +0300 +++ b/phoneclientserver/phoneclient/Group/PhoneClient.mmp Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -89,14 +89,13 @@ SOURCEPATH ../src -START RESOURCE ../data/phoneclient.rss -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END // RESOURCE MW_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE ../../../inc +SYSTEMINCLUDE /epoc32/include/mw/hb/hbwidgets +SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore +SYSTEMINCLUDE /epoc32/include/platform/mw/loc +SYSTEMINCLUDE /epoc32/include/platform/mw/loc/sc USERINCLUDE ../inc/extcall/extcall_aiw USERINCLUDE ../inc/notifier/notifier_aiw @@ -117,7 +116,6 @@ LIBRARY euser.lib LIBRARY aknnotify.lib -LIBRARY avkon.lib LIBRARY cone.lib LIBRARY estor.lib LIBRARY commonengine.lib @@ -128,6 +126,9 @@ LIBRARY efsrv.lib LIBRARY charconv.lib LIBRARY fbscli.lib +LIBRARY hbwidgets.lib +LIBRARY flogger.lib +LIBRARY hbcore.lib #ifdef WINSCW diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/Inc/UssdWrapper/CPhCltUssdNoteController.h --- a/phoneclientserver/phoneclient/Inc/UssdWrapper/CPhCltUssdNoteController.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phoneclientserver/phoneclient/Inc/UssdWrapper/CPhCltUssdNoteController.h Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,11 +21,10 @@ // INCLUDES #include +#include #include "mphcltussdnotecontrollercallback.h" +#include "cphcltussdcommonconstant.h" -// FORWARD DECLARATIONS -class CAknGlobalNote; -class RConeResourceLoader; // CLASS DECLARATION @@ -33,12 +32,12 @@ * Encapsulates an active object used in controlling notes. * * @lib phoneclient.lib -* @since 9.1 */ -NONSHARABLE_CLASS( CPhCltUssdNoteController ) : public CActive +NONSHARABLE_CLASS( CPhCltUssdNoteController ) : public CBase, + public MHbDeviceProgressDialogObserver { public: // Constructor and destructor - + /** * Two-phased constructor. * @@ -47,87 +46,81 @@ * @return Pointer to created CPhCltUssdImp instance. */ static CPhCltUssdNoteController* NewL( - MPhCltUssdNoteControllerCallBack& aCallBack, - TInt aPriority ); - + MPhCltUssdNoteControllerCallBack& aCallBack ); + /** * Destructor. */ ~CPhCltUssdNoteController(); - public: - - // Shows information note. - void ShowInformationNoteL( TInt aResourceId ); - - // Shows global information note. - void ShowGlobalInformationNoteL( TInt aResourceId ); - - // Shows global confirmation note. - void ShowGlobalConfirmationNoteL( TInt aResourceId ); - - // Shows global wait note. - void ShowGlobalWaitNoteL( TInt aResourceId, TInt aSoftkeyResourceId = 0 ); - - // Destroys global wait note. + + /** + * Shows global Information note. + */ + void ShowGlobalInformationNoteL( const TPhCltUssdInformationType aInfoType ); + + /** + * Shows global wait note. + */ + void ShowGlobalWaitNoteL(); + + /** + * Destroys global wait note. + */ void DestroyGlobalWaitNote(); - - private: - + + /** + * From base class MHbDeviceProgressDialogObserver + */ + void ProgressDialogCancelled( + const CHbDeviceProgressDialogSymbian* aProgressDialog); + + /** + * From base class MHbDeviceProgressDialogObserver + */ + void ProgressDialogClosed( + const CHbDeviceProgressDialogSymbian* aProgressDialog); + + private: + /** * C++ constructor. */ CPhCltUssdNoteController( - MPhCltUssdNoteControllerCallBack& aCallBack, - TInt aPriority ); - - // Symbian 2nd phase constructor. + MPhCltUssdNoteControllerCallBack& aCallBack ); + + /** + * Symbian 2nd phase constructor. + */ void ConstructL(); - - // The note type enumeration, used inside the class. - enum TPhCltUssdNoteType - { - EPhCltUssdInformationNote, - EPhCltUssdGlobalInformationNote, - EPhCltUssdGlobalConfirmationNote - }; - // Shows the note of given type. - void ShowNoteL( TPhCltUssdNoteType aType, TInt aResourceId ); - - // Loads the resource file. - void LoadResourceFileL(); - - // From base classes - - /* - * From CActive. Called when dialog is dismissed by soft key. + /** + * LoadDefaultString. */ - void RunL(); + HBufC* LoadDefaultStringL( const TDesC& aText ); + + private: // Data /** - * From CActive. + * Own,Global wait note. */ - void DoCancel(); - + CHbDeviceProgressDialogSymbian* iGlobalWaitNote; - private: // Data - - // Buffer for messages. - HBufC* iMessageBuffer; - - // Global wait note. - CAknGlobalNote* iGlobalWaitNote; - - // Id of an active wait note. - TInt iWaitNoteId; - - // The callback to be notified when wait note is dismissed. + /** + * Not own,callback to be notified when wait note is dismissed. + */ MPhCltUssdNoteControllerCallBack& iCallBack; - // Resource loader. - RConeResourceLoader* iResourceLoader; + /** + * Check Load Success .ts file successfully or not + */ + TBool iIsResolverSuccess; + + /** + * Own, resouce of global note. + */ + HBufC* iGlobalResource; }; #endif // CPHCLTUSSDNOTECONTROLLER_H diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/Inc/UssdWrapper/MPhCltUssdNoteControllerCallBack.h --- a/phoneclientserver/phoneclient/Inc/UssdWrapper/MPhCltUssdNoteControllerCallBack.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phoneclientserver/phoneclient/Inc/UssdWrapper/MPhCltUssdNoteControllerCallBack.h Mon May 03 13:01:45 2010 +0300 @@ -27,7 +27,7 @@ /** * Abstract interface for handling the notify events from note controller. -* User derives his class from this and implements GlobalWaitNoteDismissedL(). +* User derives his class from this and implements GlobalWaitNoteHidden(). * * @lib phoneclient.lib * @since 9.1 @@ -39,11 +39,11 @@ public: // New functions /** - * Called when global wait note is dismissed. + * Called when global wait note is hidden, to background. * * @param aError Error code. */ - virtual void GlobalWaitNoteDismissedL( const TInt aError ) = 0; + virtual void GlobalWaitNoteHidden() = 0; }; diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/Inc/UssdWrapper/Ussd_Ext/CPhCltUssdImp.h --- a/phoneclientserver/phoneclient/Inc/UssdWrapper/Ussd_Ext/CPhCltUssdImp.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phoneclientserver/phoneclient/Inc/UssdWrapper/Ussd_Ext/CPhCltUssdImp.h Mon May 03 13:01:45 2010 +0300 @@ -171,8 +171,8 @@ // Called when send completes. void HandleSendEventL( const TInt aError ); - // Called when the user cancel the wait dialog. - void GlobalWaitNoteDismissedL( TInt aButtonId ); + // Hidden when the user cancel the wait dialog. + void GlobalWaitNoteHidden(); diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdImp.cpp --- a/phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdImp.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdImp.cpp Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -27,12 +27,8 @@ #include #include #include -// -#include -#include -#include - -#include +#include +//#include #include #include @@ -40,7 +36,8 @@ #include "mphcltussdnotecontrollercallback.h" #include "cphcltussdnotecontroller.h" - +#include "cphcltussdcommonconstant.h" +#include "tflogger.h" // CONSTANTS const TUint8 KPhCltUssdDcsDefaultAlphabet = 0x0f; // 00001111 @@ -333,10 +330,12 @@ // CPhCltUssdImp* CPhCltUssdImp::NewL( TBool aShowNotes ) { + TFLOGSTRING("CPhCltUssdImp: NewL call") CPhCltUssdImp* self = new( ELeave ) CPhCltUssdImp; CleanupStack::PushL( self ); self->ConstructL( aShowNotes ); CleanupStack::Pop(); // self + TFLOGSTRING("CPhCltUssdImp: NewL exit") return self; } @@ -348,14 +347,14 @@ // void CPhCltUssdImp::ConstructL( TBool aShowNotes ) { + TFLOGSTRING("CPhCltUssdImp: ConstructL call") // The note controller is needed only if the notes are shown. iNoteController = NULL; if ( aShowNotes ) { iNoteController = CPhCltUssdNoteController::NewL( - *this, - CActive::EPriorityStandard ); + *this ); } iDCS = KPhCltUssdDcsDefaultAlphabet; @@ -365,6 +364,7 @@ iRequestHandler = CPhCltUssdRequestHandler::NewL( *this, CActive::EPriorityStandard ); + TFLOGSTRING("CPhCltUssdImp: ConstructL exit") } @@ -376,6 +376,7 @@ // CPhCltUssdImp::CPhCltUssdImp() { + TFLOGSTRING("CPhCltUssdImp: CPhCltUssdImp call_exit") } @@ -386,6 +387,7 @@ // CPhCltUssdImp::~CPhCltUssdImp() { + TFLOGSTRING("CPhCltUssdImp: ~CPhCltUssdImp call") if ( iWait ) { if ( iWait->IsStarted() ) @@ -400,7 +402,8 @@ iRequestHandler = NULL; delete iNoteController; - iNoteController = NULL; + iNoteController = NULL; + TFLOGSTRING("CPhCltUssdImp: ~CPhCltUssdImp exit") } @@ -414,7 +417,8 @@ void CPhCltUssdImp::HandleSendEventL( const TInt aError ) { *iSendError = Min( aError , KErrNone ); - + TFLOGSTRING2("CPhCltUssdImp: HandleSendEventL\ + aError = %d call", aError) // iNoteController is allocated only if notes are shown. if ( iNoteController ) { @@ -428,12 +432,12 @@ { // All Ok. case KErrNone: - iNoteController->ShowGlobalConfirmationNoteL( R_TEXT_DONE ); + iNoteController->ShowGlobalInformationNoteL( EPhCltUssdDone ); break; // Operation cancelled. case KErrCancel: - iNoteController->ShowGlobalInformationNoteL( R_TEXT_UNCONFIRMED ); + iNoteController->ShowGlobalInformationNoteL( EPhCltUssdUnconfirme ); break; // Ongoing Ussd session or the string is barred due SS request @@ -441,17 +445,17 @@ case KErrInUse: case KErrAccessDenied: case KErrGsmSSCallBarred: - iNoteController->ShowGlobalInformationNoteL( R_TEXT_NOT_ALLOWED ); + iNoteController->ShowGlobalInformationNoteL( EPhCltUssdNotallowed ); break; // No network coverage. case KErrGsmSMSNoNetworkService: - iNoteController->ShowGlobalInformationNoteL( R_TEXT_NO_SERVICE ); + iNoteController->ShowGlobalInformationNoteL(EPhCltUssdNoservice ); break; // Offline mode. case KErrGsmOfflineOpNotAllowed: - iNoteController->ShowGlobalInformationNoteL( R_TEXT_OFFLINE ); + iNoteController->ShowGlobalInformationNoteL( EPhCltUssdOffline ); break; case KErrSatControl: @@ -459,7 +463,7 @@ // Unknown error. default: - iNoteController->ShowGlobalInformationNoteL( R_TEXT_NOT_DONE ); + iNoteController->ShowGlobalInformationNoteL( EPhCltUssdNotDone ); break; } } @@ -470,6 +474,7 @@ { iWait->AsyncStop(); } + TFLOGSTRING("CPhCltUssdImp: HandleSendEventL exit") } @@ -531,6 +536,7 @@ const TDesC8& aMsgData, const TUint8 iSendDcs ) { + TFLOGSTRING("CPhCltUssdImp: SendUssd call") __ASSERT_ALWAYS( aMsgData.Length() <= KPhCltUssdMax7BitCharacterOctets, User::Invariant() ); @@ -568,15 +574,16 @@ TInt error = KErrNone; iSendError = &error; - + TFLOGSTRING("CPhCltUssdImp: SendUssd iRequestHandler") iRequestHandler->SendUssd( aMsgData , attributePckg ); // iNoteController is allocated only if notes are shown. + TFLOGSTRING("CPhCltUssdImp: SendUssd ShowGlobalWaitNoteL") if ( iNoteController ) { - TRAP_IGNORE( iNoteController->ShowGlobalWaitNoteL( - R_TEXT_SENDING, - R_AVKON_SOFTKEYS_QUIT ) ); + TRAP_IGNORE( iNoteController->ShowGlobalWaitNoteL(); + ); } + TFLOGSTRING("CPhCltUssdImp: SendUssd iWait") // Set this active object to wait the completion of the send request. iWait->Start(); @@ -586,6 +593,7 @@ { iSendError = NULL; } + TFLOGSTRING("CPhCltUssdImp: SendUssd exit") return error; } @@ -598,7 +606,9 @@ // void CPhCltUssdImp::SendUssdCancel() { + TFLOGSTRING("CPhCltUssdImp: SendUssdCancel call") iRequestHandler->SendUssdCancel(); + TFLOGSTRING("CPhCltUssdImp: SendUssdCancel exit") } @@ -621,7 +631,10 @@ // TInt CPhCltUssdImp::AppStarting() { - return iRequestHandler->UssdClient().AppStarting(); + TFLOGSTRING("CPhCltUssdImp: AppStarting call") + TInt res = iRequestHandler->UssdClient().AppStarting(); + TFLOGSTRING2("CPhCltUssdImp: AppStarting exit res = %d",res) + return res; } // ----------------------------------------------------------------------------- @@ -633,7 +646,10 @@ TInt CPhCltUssdImp::AppTerminating( TPhCltUssdAppExitReason aExitReason ) { - return iRequestHandler->UssdClient().AppTerminating( aExitReason ); + TFLOGSTRING("CPhCltUssdImp: AppTerminating call") + TInt res = iRequestHandler->UssdClient().AppTerminating( aExitReason ); + TFLOGSTRING2("CPhCltUssdImp: AppTerminating exit res = %d",res) + return res; } // ----------------------------------------------------------------------------- @@ -644,7 +660,10 @@ // TBool CPhCltUssdImp::AppToForeground() { - return iRequestHandler->UssdClient().AppToForeground(); + TFLOGSTRING("CPhCltUssdImp: AppToForeground call") + TBool res = iRequestHandler->UssdClient().AppToForeground(); + TFLOGSTRING2("CPhCltUssdImp: AppToForeground exit res = %d",res) + return res; } // ----------------------------------------------------------------------------- @@ -655,7 +674,10 @@ // TInt CPhCltUssdImp::AppToBackground() { - return iRequestHandler->UssdClient().AppToBackground(); + TFLOGSTRING("CPhCltUssdImp: AppToBackground call") + TInt res = iRequestHandler->UssdClient().AppToBackground(); + TFLOGSTRING2("CPhCltUssdImp: AppToBackground exit res = %d",res) + return res; } // ----------------------------------------------------------------------------- @@ -669,7 +691,9 @@ TDes& aReceiveMessage, TPckg< TUint >& aShowNotesAndDcs ) { + TFLOGSTRING("CPhCltUssdImp: StartSAT call") iRequestHandler->UssdClient().StartSAT( aStatus, aReceiveMessage, aShowNotesAndDcs ); + TFLOGSTRING("CPhCltUssdImp: StartSAT exit") } // ----------------------------------------------------------------------------- @@ -680,24 +704,22 @@ // void CPhCltUssdImp::StopSAT() { + TFLOGSTRING("CPhCltUssdImp: StopSAT call") iRequestHandler->UssdClient().StopSAT(); + TFLOGSTRING("CPhCltUssdImp: StopSAT exit") } // ----------------------------------------------------------------------------- -// CPhCltUssdImp::GlobalNoteDismissedL +// CPhCltUssdImp::GlobalWaitNoteHidden // -// Dialog is cancelled by the right softkey. +// Dialog is hidden by the cancel key. // ----------------------------------------------------------------------------- // -void CPhCltUssdImp::GlobalWaitNoteDismissedL( TInt aButtonId ) +void CPhCltUssdImp::GlobalWaitNoteHidden() { - if ( aButtonId == EAknSoftkeyClose || - aButtonId == EAknSoftkeyCancel || - aButtonId == EAknSoftkeyQuit ) - { - SendUssdCancel(); - } + TFLOGSTRING("CPhCltUssdImp: GlobalWaitNoteHidden call") + TFLOGSTRING("CPhCltUssdImp: GlobalWaitNoteHidden exit") } @@ -709,8 +731,8 @@ // void CPhCltUssdImp::EncodeL( const TDesC& aSrc, TDes8& aDes ) { - // - aDes.Zero(); + TFLOGSTRING("CPhCltUssdImp: EncodeL call") + aDes.Zero(); TSmsDataCodingScheme::TSmsAlphabet alphabet = TSmsDataCodingScheme::ESmsAlphabet7Bit; // default @@ -813,6 +835,7 @@ } CleanupStack::PopAndDestroy(3); // fs, packer, charConv + TFLOGSTRING("CPhCltUssdImp: EncodeL exit") } // ----------------------------------------------------------------------------- diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdNoteController.cpp --- a/phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdNoteController.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdNoteController.cpp Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,15 +17,27 @@ // INCLUDE FILES -#include //CAknGlobalNote -#include -#include -#include +#include +#include +#include #include "phcltclientserver.h" #include "cphcltussdnotecontroller.h" +#include "tflogger.h" +_LIT(KFilename, "phcltsrvussd.ts"); +_LIT(KPath, "z://data"); +_LIT(KUssdRequesting, "txt_common_info_requesting"); // Requesting +// Will be replaced by Hidden +_LIT(KUssdRequestingQuit, "txt_ussd_button_exit"); // Quit +_LIT(KUssdDone, "txt_ussd_dpopinfo_done"); // Done +_LIT(KUssdNotDone, "txt_ussd_dpopinfo_not_done"); // NotDone +_LIT(KUssdNotAllowed, "txt_ussd_dpopinfo_not_allowed"); //NotAllowed +_LIT(KUssdUnconfirmed, "txt_ussd_dpopinfo_unconfirmed"); // Unconfirmed +_LIT(KUssdNoService, "txt_ussd_dpopinfo_no_service"); // NoService +_LIT(KUssdOffline, "txt_ussd_dpopinfo_offline_not_possible"); // Offline +const int KPhCltUssdProgressBarMaxLength = 10; // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -34,19 +46,19 @@ // ----------------------------------------------------------------------------- // CPhCltUssdNoteController* CPhCltUssdNoteController::NewL( - MPhCltUssdNoteControllerCallBack& aCallBack, - TInt aPriority ) + MPhCltUssdNoteControllerCallBack& aCallBack ) { + TFLOGSTRING("CPhCltUssdNoteController: NewL call") CPhCltUssdNoteController* self = new( ELeave ) - CPhCltUssdNoteController( aCallBack, aPriority ); - + CPhCltUssdNoteController( aCallBack ); + CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); + TFLOGSTRING("CPhCltUssdNoteController: NewL exit") return self; } - // ----------------------------------------------------------------------------- // CPhCltUssdNoteController::ConstructL // Symbian 2nd phase constructor can leave. @@ -54,26 +66,29 @@ // void CPhCltUssdNoteController::ConstructL() { - LoadResourceFileL(); + TFLOGSTRING( "CPhCltUssdNoteController: ConstructL\ + init in" ) + iIsResolverSuccess = HbTextResolverSymbian::Init(KFilename, KPath); + TFLOGSTRING2("CPhCltUssdNoteController: ConstructL\ + init filename iIsResolverSuccess = %d", iIsResolverSuccess ) } - // ----------------------------------------------------------------------------- // CPhCltUssdNoteController::CPhCltUssdNoteController // C++ constructor can NOT contain any code, that // might leave. // ----------------------------------------------------------------------------- CPhCltUssdNoteController::CPhCltUssdNoteController( - MPhCltUssdNoteControllerCallBack& aCallBack, - TInt aPriority ) - : CActive( aPriority ), - iCallBack( aCallBack ), - iWaitNoteId( KErrNotFound ) + MPhCltUssdNoteControllerCallBack& aCallBack ) + : iGlobalWaitNote( NULL ), + iCallBack( aCallBack ), + iIsResolverSuccess( EFalse ), + iGlobalResource( NULL ) { - CActiveScheduler::Add( this ); + TFLOGSTRING("CPhCltUssdNoteController: CPhCltUssdNoteController call") + TFLOGSTRING("CPhCltUssdNoteController: CPhCltUssdNoteController exit") } - - + // ----------------------------------------------------------------------------- // CPhCltUssdNoteController:~CPhCltUssdNoteController // C++ default constructor can NOT contain any code, that @@ -82,182 +97,163 @@ // CPhCltUssdNoteController::~CPhCltUssdNoteController() { - Cancel(); - + TFLOGSTRING("CPhCltUssdNoteController: ~CPhCltUssdNoteController call") DestroyGlobalWaitNote(); - - delete iMessageBuffer; - iMessageBuffer = NULL; - - if ( iResourceLoader ) - { - iResourceLoader->Close(); - delete iResourceLoader; - iResourceLoader = NULL; - } + TFLOGSTRING("CPhCltUssdNoteController: ~CPhCltUssdNoteController exit") } - -// ----------------------------------------------------------------------------- -// CPhCltUssdNoteController::RunL -// -// Called when dialog is dismissed by pressing a softkey. -// ----------------------------------------------------------------------------- -void CPhCltUssdNoteController::RunL() - { - iCallBack.GlobalWaitNoteDismissedL( iStatus.Int() ); - } - - -// ----------------------------------------------------------------------------- -// CPhCltUssdNoteController::DoCancel -// ----------------------------------------------------------------------------- -void CPhCltUssdNoteController::DoCancel() - { - DestroyGlobalWaitNote(); - } - - -// ----------------------------------------------------------------------------- -// CPhCltUssdNoteController::ShowInformationNoteL -// ----------------------------------------------------------------------------- -void CPhCltUssdNoteController::ShowInformationNoteL( TInt aResourceId ) - { - ShowNoteL( EPhCltUssdInformationNote, aResourceId ); - } - - // ----------------------------------------------------------------------------- // CPhCltUssdNoteController::ShowGlobalInformationNoteL // ----------------------------------------------------------------------------- -void CPhCltUssdNoteController::ShowGlobalInformationNoteL( TInt aResourceId ) +void CPhCltUssdNoteController::ShowGlobalInformationNoteL( + const TPhCltUssdInformationType aInfoType ) { - ShowNoteL( EPhCltUssdGlobalInformationNote, aResourceId ); - } - + TFLOGSTRING2("CPhCltUssdNoteController: ShowGlobalInformationNoteL\ + aInfoType = %d call", aInfoType) -// ----------------------------------------------------------------------------- -// CPhCltUssdNoteController::ShowGlobalConfirmationNoteL -// ----------------------------------------------------------------------------- -void CPhCltUssdNoteController::ShowGlobalConfirmationNoteL( TInt aResourceId ) - { - ShowNoteL( EPhCltUssdGlobalConfirmationNote, aResourceId ); + HBufC* temp(NULL); + switch ( aInfoType ) + { + case EPhCltUssdUnconfirme: + { + temp = LoadDefaultStringL(KUssdUnconfirmed); + break; + } + case EPhCltUssdNotallowed: + { + temp = LoadDefaultStringL(KUssdNotAllowed); + break; + } + case EPhCltUssdNoservice: + { + temp = LoadDefaultStringL(KUssdNoService); + break; + } + case EPhCltUssdOffline: + { + temp = LoadDefaultStringL(KUssdOffline); + break; + } + case EPhCltUssdDone: + { + temp = LoadDefaultStringL(KUssdDone); + break; + } + case EPhCltUssdNotDone: + { + temp = LoadDefaultStringL(KUssdNotDone); + break; + } + default: + { + User::Leave( KErrArgument ); + } + break; + } + CHbDeviceMessageBoxSymbian* dlg = CHbDeviceMessageBoxSymbian::NewL( + CHbDeviceMessageBoxSymbian::EInformation); + CleanupStack::PushL( dlg ); + dlg->SetTextL( temp->Des() ); + dlg->SetButton( CHbDeviceMessageBoxSymbian::EAcceptButton, + ETrue ); + dlg->ExecL(); + CleanupStack::PopAndDestroy( dlg ); + delete temp; + temp = NULL; + TFLOGSTRING("CPhCltUssdNoteController: ShowGlobalInformationNoteL exit") } - // ----------------------------------------------------------------------------- // CPhCltUssdNoteController::ShowGlobalWaitNoteL // ----------------------------------------------------------------------------- -void CPhCltUssdNoteController::ShowGlobalWaitNoteL( - TInt aResourceId, - TInt aSoftkeyResourceId ) +void CPhCltUssdNoteController::ShowGlobalWaitNoteL( ) { - delete iMessageBuffer; - iMessageBuffer = NULL; - iMessageBuffer = StringLoader::LoadL( aResourceId ); - + TFLOGSTRING("CPhCltUssdNoteController: ShowGlobalWaitNoteL call") DestroyGlobalWaitNote(); - - iGlobalWaitNote = CAknGlobalNote::NewL(); - - if ( aSoftkeyResourceId ) - { - iGlobalWaitNote->SetSoftkeys( aSoftkeyResourceId ); - } - - SetActive(); - - iWaitNoteId = iGlobalWaitNote->ShowNoteL( iStatus, - EAknGlobalWaitNote, - *iMessageBuffer ); + //CHbDeviceProgressDialogSymbian + iGlobalWaitNote = CHbDeviceProgressDialogSymbian::NewL( + CHbDeviceProgressDialogSymbian::EProgressDialog ); + CleanupStack::PushL( iGlobalWaitNote ); + iGlobalResource = LoadDefaultStringL( KUssdRequesting ); + iGlobalWaitNote->SetTextL( iGlobalResource->Des() ); + iGlobalWaitNote->SetObserver( this ); + TFLOGSTRING("CPhCltUssdNoteController: ShowGlobalWaitNoteL before setactive") + iGlobalWaitNote->SetRange(0,KPhCltUssdProgressBarMaxLength); + iGlobalWaitNote->SetProgressValue(KPhCltUssdProgressBarMaxLength); + iGlobalWaitNote->SetAutoClose(EFalse); + iGlobalWaitNote->ShowL(); + CleanupStack::Pop( iGlobalWaitNote ); + TFLOGSTRING("CPhCltUssdNoteController: ShowGlobalWaitNoteL after setactive") + TFLOGSTRING("CPhCltUssdNoteController: ShowGlobalWaitNoteL exit") } - // ----------------------------------------------------------------------------- // CPhCltUssdNoteController::DestroyGlobalWaitNote // ----------------------------------------------------------------------------- void CPhCltUssdNoteController::DestroyGlobalWaitNote() { + TFLOGSTRING("CPhCltUssdNoteController: DestroyGlobalWaitNote call") if ( iGlobalWaitNote ) { - if ( iWaitNoteId != KErrNotFound ) - { - TRAP_IGNORE( iGlobalWaitNote->CancelNoteL( iWaitNoteId ) ); - iWaitNoteId = KErrNotFound; - } + iGlobalWaitNote->Cancel(); delete iGlobalWaitNote; iGlobalWaitNote = NULL; + delete iGlobalResource; + iGlobalResource = NULL; } + TFLOGSTRING("CPhCltUssdNoteController: DestroyGlobalWaitNote exit") } - // ----------------------------------------------------------------------------- -// CPhCltUssdNoteController::ShowNoteL +// CPhCltUssdNoteController::ProgressDialogCancelled // -// Launches a corresponding dialog with the given string. +// // ----------------------------------------------------------------------------- // -void CPhCltUssdNoteController::ShowNoteL( TPhCltUssdNoteType aType, TInt aResourceId ) +void CPhCltUssdNoteController::ProgressDialogCancelled( + const CHbDeviceProgressDialogSymbian* /*aProgressDialog*/) { - switch ( aType ) - { - case EPhCltUssdInformationNote: - { - delete iMessageBuffer; - iMessageBuffer = NULL; - iMessageBuffer = StringLoader::LoadL( aResourceId ); - - if ( iMessageBuffer->Length() == 0 ) - { - break; - } - CAknInformationNote* dlg = new ( ELeave ) - CAknInformationNote( ETrue ); - - dlg->ExecuteLD( *iMessageBuffer ); - break; - } - case EPhCltUssdGlobalInformationNote: - case EPhCltUssdGlobalConfirmationNote: - { - CAknGlobalNote* dlg = CAknGlobalNote::NewLC(); - - delete iMessageBuffer; - iMessageBuffer = NULL; - iMessageBuffer = StringLoader::LoadL( aResourceId ); - - if ( aType == EPhCltUssdGlobalInformationNote ) - { - dlg->ShowNoteL( EAknGlobalInformationNote , *iMessageBuffer ); - } - else if ( aType == EPhCltUssdGlobalConfirmationNote ) - { - dlg->ShowNoteL( EAknGlobalConfirmationNote , *iMessageBuffer ); - } - CleanupStack::PopAndDestroy(); // dlg - break; - } - - default: - break; - } + TFLOGSTRING("CPhCltUssdNoteController: ProgressDialogCancelled call") + iCallBack.GlobalWaitNoteHidden(); + delete iGlobalResource; + iGlobalResource = NULL; + TFLOGSTRING("CPhCltUssdNoteController: ProgressDialogCancelled exit") } // ----------------------------------------------------------------------------- -// CPhCltUssdNoteController::LoadResourceFileL +// CPhCltUssdNoteController::ProgressDialogClosed // -// Loads resource file via RConeResourceLoader. +// // ----------------------------------------------------------------------------- // -void CPhCltUssdNoteController::LoadResourceFileL() +void CPhCltUssdNoteController::ProgressDialogClosed( + const CHbDeviceProgressDialogSymbian* /*aProgressDialog*/) { - // load resource file for notes - iResourceLoader = new( ELeave ) RConeResourceLoader( *CCoeEnv::Static() ); - TFileName fileName ( KPhCltServerZDrive ); - fileName.Append( KDC_RESOURCE_FILES_DIR ); - fileName.Append( KPhCltResourceFileNameAndPath ); - fileName.ZeroTerminate(); - iResourceLoader->OpenL( fileName ); + TFLOGSTRING("CPhCltUssdNoteController: ProgressDialogClosed call") + TFLOGSTRING("CPhCltUssdNoteController: ProgressDialogClosed exit") + } + +// ----------------------------------------------------------------------------- +// CPhCltUssdNoteController::LoadDefaultString +// +// +// ----------------------------------------------------------------------------- +// +HBufC* CPhCltUssdNoteController::LoadDefaultStringL( const TDesC& aText ) + { + TFLOGSTRING("CPhCltUssdNoteController: LoadDefaultString call") + HBufC* newText = NULL; + if ( iIsResolverSuccess ) + { + newText = HbTextResolverSymbian::LoadL( aText ); + } + else + { + newText = aText.AllocL(); + TFLOGSTRING("CPhCltUssdNoteController: LoadDefaultString load failed."); + } + TFLOGSTRING("CPhCltUssdNoteController: LoadDefaultString exit") + return newText; } // End of file diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/inc/ussdwrapper/cphcltussdcommonconstant.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/inc/ussdwrapper/cphcltussdcommonconstant.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CPHCLTUSSDCOMMONCONSTANT_H +#define CPHCLTUSSDCOMMONCONSTANT_H + +// CONSTANTS + + +/**num for Ussd information type*/ +enum TPhCltUssdInformationType + { + EPhCltUssdUnconfirme = 1, + EPhCltUssdNotallowed, + EPhCltUssdNoservice, + EPhCltUssdOffline, + EPhCltUssdDone, + EPhCltUssdNotDone + }; + +#endif // CPHCLTUSSDCOMMONCONSTANT_H diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/inc/ussdwrapper/tflogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/inc/ussdwrapper/tflogger.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + +#ifndef __TFLOGGER_H__ +#define __TFLOGGER_H__ + +#include +#include + +_LIT(KTfLogFolder, "phcltussd"); +_LIT(KTfLogFile, "ussd.txt"); + +/** +* ------------------------------------------------------------------------------ +* +* Remove #define LOGGING_ENABLED from comments to enable logging +* +* ------------------------------------------------------------------------------ +*/ + +#ifdef _DEBUG +#define LOGGING_ENABLED +#endif + +/** +* ------------------------------------------------------------------------------ +* +* LOGGING MACROs +* +* USE THESE MACROS IN YOUR CODE +* +* Example: TFLOGTEXT(own_desc) +* Example: TFLOGSTRING("Test") +* Example: TFLOGSTRING("Test %i", aValue) +* Example: TFLOGSTRING("Test %i %i", aValue1, aValue2) +* +* ------------------------------------------------------------------------------ +*/ + +#ifdef LOGGING_ENABLED + + #define TFLOGTEXT(TEXT) \ + { \ + RFileLogger::Write(KTfLogFolder,KTfLogFile, \ + EFileLoggingModeAppend, TEXT); \ + RDebug::Print(TEXT); \ + } + + #define TFLOGSTRING(TEXT) \ + { \ + _LIT(tempLogDes, TEXT); \ + RFileLogger::Write(\ + KTfLogFolder, \ + KTfLogFile, \ + EFileLoggingModeAppend, \ + tempLogDes()); \ + RDebug::Print(_L(TEXT)); \ + } + + #define TFLOGSTRING2(TEXT, VAR1) \ + { \ + _LIT(tempLogDes, TEXT); \ + RFileLogger::WriteFormat(\ + KTfLogFolder, \ + KTfLogFile, \ + EFileLoggingModeAppend, \ + TRefByValue(tempLogDes()), VAR1); \ + RDebug::Print(_L(TEXT), VAR1); \ + } + + #define TFLOGSTRING3(TEXT, VAR1, VAR2) \ + { \ + _LIT(tempLogDes, TEXT); \ + RFileLogger::WriteFormat(\ + KTfLogFolder, \ + KTfLogFile, \ + EFileLoggingModeAppend, \ + TRefByValue(tempLogDes()), VAR1, VAR2); \ + RDebug::Print(_L(TEXT), VAR1, VAR2); \ + } + +#else + + #define TFLOGTEXT(TEXT) + #define TFLOGSTRING(TEXT) + #define TFLOGSTRING2(TEXT, VAR1) + #define TFLOGSTRING3(TEXT, VAR1, VAR2) + +#endif // LOGGING_ENABLED + +#endif // __TFLOGGER_H__ diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/etel_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/etel_mock.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,227 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "ut_testenv.h" +#include +#include +#include +#include + + +// global variables +CPeriodic* messageResponseTimer = 0; + +// ============================================================================== +// RMobileUssdMessaging +// ============================================================================== + +RMobileUssdMessaging::RMobileUssdMessaging() +{ +} + +RMobileUssdMessaging::RMobileUssdMessaging(const RMobileUssdMessaging&) +{ +} + +void RMobileUssdMessaging::ConstructL() +{ + QVERIFY(!messageResponseTimer); + messageResponseTimer = + CPeriodic::NewL(CActive::EPriorityStandard+1); +} + +TInt RMobileUssdMessaging::Open(RMobilePhone& /*aPhone*/) +{ + TRAPD(err,ConstructL()); + return err; +} + +void RMobileUssdMessaging::Close() +{ + delete messageResponseTimer; + messageResponseTimer = 0; +} + +void RMobileUssdMessaging::Destruct() +{ +} + +TInt RMobileUssdMessaging::GetCaps(TDes8& aCaps) const +{ + TMobileUssdCapsV1 caps; + caps.iUssdFormat = KCapsPackedString; + caps.iUssdTypes = KCapsMTUssd | KCapsMOUssd; + TMobileUssdCapsV1Pckg pckgCaps( caps ); + aCaps.Copy( pckgCaps ); + return KErrNone; +} + +void RMobileUssdMessaging::ReceiveMessage( + TRequestStatus& aReqStatus, TDes8& aMsgData, + TDes8& aMsgAttributes) const +{ + EtelMsgLoop& loop = TestEnv::env().etelMsgLoop(); + QVERIFY2(!loop.mReceiveMessageReqStatus, + "etel_mock: ReceiveMessage called twice!"); + aReqStatus = KRequestPending; + loop.mReceiveMessageReqStatus = &aReqStatus; + loop.mReceiveMessageData = &aMsgData; + loop.mReceiveMessageAttributes = &aMsgAttributes; +} + +TInt SendMessageCallback(TAny* /*aPtr*/) + { + messageResponseTimer->Cancel(); + + EtelMsgLoop& loop = TestEnv::env().etelMsgLoop(); + const TestMode& mode = TestEnv::env().testMode(); + if (mode.m_event == TestMode::Normal) + { + User::RequestComplete(loop.mSendMessageReqStatus, mode.m_error); + } + return 0; + } + +void RMobileUssdMessaging::SendMessage( + TRequestStatus& aReqStatus, const TDesC8& /*aMsgData*/, + const TDesC8& /*aMsgAttributes*/) const +{ + EtelMsgLoop& loop = TestEnv::env().etelMsgLoop(); + QVERIFY2(!loop.mSendMessageReqStatus, + "etel_mock: SendMessage called twice!"); + aReqStatus = KRequestPending; + loop.mSendMessageReqStatus = &aReqStatus; + + const TestMode& mode = TestEnv::env().testMode(); + if (mode.m_event != TestMode::NoResp) + { + // start timer to respond + TTimeIntervalMicroSeconds32 delay( + 1000*mode.m_timeout); + messageResponseTimer->Start(delay,delay, + TCallBack(SendMessageCallback,(TAny*)this)); + } +} + +void RMobileUssdMessaging::SendMessageNoFdnCheck( + TRequestStatus& /*aReqStatus*/, const TDesC8& /*aMsgData*/, + const TDesC8& /*aMsgAttributes*/) const +{ + // not used +} + +void RMobileUssdMessaging::SendRelease( + TRequestStatus& /*aReqStatus*/, TDes8& /*aReturnResult*/) const +{ + // not used +} + +void RMobileUssdMessaging::NotifyNetworkRelease( + TRequestStatus& aReqStatus, TDes8& aReturnResult) const +{ + EtelMsgLoop& loop = TestEnv::env().etelMsgLoop(); + QVERIFY2(!loop.mNetworkReleaseReqStatus, + "etel_mock: NotifyNetworkRelease called twice!"); + aReqStatus = KRequestPending; + loop.mNetworkReleaseReqStatus = &aReqStatus; + loop.mNetworkReleaseMessageData = &aReturnResult; + loop.mNetworkReleaseMessageAttributes = 0; +} + +void RMobileUssdMessaging::NotifyNetworkRelease( + TRequestStatus& aReqStatus, TDes8& aMsgData, + TDes8& aMsgAttributes) const +{ + EtelMsgLoop& loop = TestEnv::env().etelMsgLoop(); + QVERIFY2(!loop.mNetworkReleaseReqStatus, + "etel_mock: NotifyNetworkRelease called twice!"); + aReqStatus = KRequestPending; + loop.mNetworkReleaseReqStatus = &aReqStatus; + loop.mNetworkReleaseMessageData = &aMsgData; + loop.mNetworkReleaseMessageAttributes = &aMsgAttributes; +} + + +RMobileUssdMessaging::TMobileUssdAttributesV1::TMobileUssdAttributesV1() +{ + iFlags = 0; + iFormat = EFormatUnspecified; + iType = EUssdUnknown; + iDcs = 0; +} + +RMobileUssdMessaging::TMobileUssdCapsV1::TMobileUssdCapsV1() +{ + iUssdFormat = 0; + iUssdTypes = 0; +} + +// ============================================================================== +// RMobilePhone +// ============================================================================== + +RMobilePhone::TMobilePhoneSendSSRequestV3::TMobilePhoneSendSSRequestV3() +{ + iOpCode = 0; +} + +RMobilePhone::TMultimodeType::TMultimodeType() +{ + iExtensionId = 0; +} + +// ============================================================================== +// RTelSubSessionBase +// ============================================================================== + +RTelSubSessionBase::RTelSubSessionBase() +{ +} + +void RTelSubSessionBase::CancelAsyncRequest(TInt aReqToCancel) const +{ + if ( aReqToCancel == EMobileUssdMessagingSendMessage ) + { + EtelMsgLoop& loop = TestEnv::env().etelMsgLoop(); + if ( loop.mSendMessageReqStatus ) + { + User::RequestComplete( loop.mSendMessageReqStatus, KErrCancel ); + } + } + else if ( aReqToCancel == EMobileUssdMessagingReceiveMessage ) + { + EtelMsgLoop& loop = TestEnv::env().etelMsgLoop(); + if ( loop.mReceiveMessageReqStatus ) + { + User::RequestComplete( loop.mReceiveMessageReqStatus, KErrCancel ); + } + } + else if ( aReqToCancel == EMobileUssdMessagingNotifyNetworkRelease ) + { + EtelMsgLoop& loop = TestEnv::env().etelMsgLoop(); + if ( loop.mNetworkReleaseReqStatus ) + { + User::RequestComplete( loop.mNetworkReleaseReqStatus, KErrCancel ); + } + } + else if ( aReqToCancel == EMobileUssdMessagingSendRelease ) + { + // not used + } +} + diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/main.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description:Unit testing of SatApp +* +* +*/ + + +#include + +#include "ut_ussd.h" +#include "ut_cphcltussdnotecontroller.h" + +// ==================================================================== +// MAIN +// ==================================================================== + +int main(int argc, char *argv[]) +{ + qDebug("Ut_ussd: main() >"); + QApplication app(argc, argv); + + int result(0); + + Ut_Ussd test; +// char *my_argv[3]; +// my_argv[0] = argv[0]; +// my_argv[1] = "-o"; +// my_argv[2] = "c:\\logs\\ussd\\ut_ussd.txt"; + result = QTest::qExec(&test/*, 3, my_argv*/); + qDebug("Ut_ussd: main() test Ut_Ussd<, result=%d", result); + + Ut_CphCltUssdNoteController testNoteController; +// char *note_argv[3]; +// note_argv[0] = argv[0]; +// note_argv[1] = "-o"; +// note_argv[2] = "c:\\logs\\ussd\\ut_ussdNoteController.txt"; + result = QTest::qExec(&testNoteController/*, 3, note_argv*/); + qDebug("Ut_ussd: main() test Ut_CphCltUssdNoteController<, result=%d", + result); + + return result; +} + +//End of file diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/phoneclientserver_stubs.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/phoneclientserver_stubs.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Stubs for phoneclientserver classes +* +*/ + +// INCLUDES +#include "rphcltserver.h" +#include "cphsrvresourcemanager.h" + +// --------------------------------------------------------------------- +// Stub for RPhCltServer +// --------------------------------------------------------------------- + +RPhCltServer::RPhCltServer() +{ +} + +RPhCltServer::RPhCltServer( const RPhCltServer& ) +{ +} + +TVersion RPhCltServer::Version() const +{ + return TVersion(0,0,0); +} + +TInt RPhCltServer::Connect( TInt ) +{ + return KErrNone; +} + +void RPhCltServer::CreateAll( TRequestStatus& ) +{ +} + +void RPhCltServer::Panic( TPhCltPanicTypes /*aPanic*/ ) +{ +} + +TInt RPhCltServer::StartServer() +{ + return KErrNone; +} + + +RPhCltServer& RPhCltServer::operator= ( const RPhCltServer& ) +{ + return *this; +} + +// --------------------------------------------------------------------- +// Stub for CPhSrvResourceManager +// --------------------------------------------------------------------- + +CPhSrvResourceManager::CPhSrvResourceManager( RFs& aFsSession ) + :iFsSession(aFsSession) + { + } + +CPhSrvResourceManager::~CPhSrvResourceManager() + { + } + +void CPhSrvResourceManager::ConstructL() + { + } + +HBufC* CPhSrvResourceManager::ReadResourceLC( TUint /*aResourceId*/ ) + { + HBufC* buffer = HBufC::NewLC(32); + buffer->Des().Copy(_L("Hello!")); + return buffer; + } + diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/readme.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/readme.txt Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,13 @@ + +USSD unit test project - instructions +======================================= + +1. Create a work area (or take a snapshot copy) for phoneclientserver project +2. copy this directory and all its contents to + phoneclientserver\phoneclient\tsrc\public\basic +3. qmake ut_ussd.pro +4. make +5. start emulator +6. run #ut_ussd +7. view c:/logs/ut_ussd.txt + diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/rphcltussd_glue.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/rphcltussd_glue.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Unit test replacement class for RPhCltUssd +* +*/ + + +// +// This implementation glues USSD client directly to +// USSD Manager class so that the client/server mechanism is +// not used. This is practical in unit test environment. +// + +// INCLUDE FILES +#include +#include "mphsrvussdmessagesentobserver.h" +#include "ut_testenv.h" +#include "cphsrvussdmanager.h" +#include "rphcltussd.h" + + +// ======================================================================== +// GLOBALS +// ======================================================================== + +class TUssdGlueAdapter: public MPhSrvUssdMessageSentObserver + { + public: + void writeAttributes( const TDesC8& aAttributes ) + { + RMobileUssdMessaging::TMobileUssdAttributesV1Pckg pAttributes( + iUssdAttributes ); + pAttributes.Copy( aAttributes ); + } + void Listen( TRequestStatus& aReqStatus ) + { + aReqStatus = KRequestPending; + iPendingStatus = &aReqStatus; + } + void UssdMessageSentObserverHandleResult( TInt aError ) + { + // this causes the pending active object to signalled and run + User::RequestComplete( iPendingStatus, aError ); + } + + RMobileUssdMessaging::TMobileUssdAttributesV1 iUssdAttributes; + TRequestStatus* iPendingStatus; + }; + +TUssdGlueAdapter glueAdapter; + + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +RPhCltUssd::RPhCltUssd() + { + } + +// ----------------------------------------------------------------------------- +TInt RPhCltUssd::Open( RPhCltServer& /*aServer*/ ) + { + return KErrNone; + glueAdapter.iPendingStatus = 0; + } + + +// ----------------------------------------------------------------------------- +void RPhCltUssd::Close() + { + } + + +// ----------------------------------------------------------------------------- +TInt RPhCltUssd::StartUssdEditor() const + { + TRAPD( leave, + TestEnv::env().ussdManager().RequestStartEditingL() ); + return leave; + } + + +// ----------------------------------------------------------------------------- +TInt RPhCltUssd::AppStarting() + { + TestEnv::env().ussdManager().InformUssdApplicationStarting(); + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +TInt RPhCltUssd::AppTerminating( + TPhCltUssdAppExitReason aExitReason ) + { + RMessage2& fakeMessage = TestEnv::env().fakeMessage(); + + TRAPD( leave, + TestEnv::env().ussdManager().InformUssdApplicationTerminatingL( fakeMessage ) ); + + return leave; + } + +// ----------------------------------------------------------------------------- +TBool RPhCltUssd::AppToForeground() + { + return TestEnv::env().ussdManager().InformUssdApplicationToForeground(); + } + +// ----------------------------------------------------------------------------- +TInt RPhCltUssd::AppToBackground() + { + TestEnv::env().ussdManager().InformUssdApplicationToBackground(); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +void RPhCltUssd::SendUssd( + TRequestStatus& aReqStatus, + const TDesC8& aMsgData, + const TDesC8& aMsgAttribute ) + { + glueAdapter.Listen( aReqStatus ); + glueAdapter.writeAttributes( aMsgAttribute ); + + TRAPD( leave, TestEnv::env().ussdManager().SendUssdL( + aMsgData, glueAdapter.iUssdAttributes, glueAdapter ) ); + if ( leave != KErrNone ) + { + glueAdapter.UssdMessageSentObserverHandleResult( leave ); + } + } + +// ----------------------------------------------------------------------------- +void RPhCltUssd::CancelSend() + { + TestEnv::env().ussdManager().SendUssdCancel(); + } + + +// ----------------------------------------------------------------------------- +void RPhCltUssd::StartSAT( + TRequestStatus& aStatus , + TDes& /*aReceiveMessage*/, + TPckg< TUint >& /*aShowNotesAndDcs*/ ) + { + RMessage2& fakeMessage = TestEnv::env().fakeMessage(); + + TestEnv::env().ussdManager().InformStartSAT( fakeMessage ); + + TRequestStatus* reqStatus = &aStatus; + User::RequestComplete( reqStatus, KErrNone ); + } + + +// ----------------------------------------------------------------------------- +void RPhCltUssd::StopSAT() + { + TestEnv::env().ussdManager().InformStopSAT(); + } + + +// End of File diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_cphcltussdnotecontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_cphcltussdnotecontroller.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,180 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Unit test for satappmainhandler +* +*/ + +#include // timeout callback +#include + +#include "ut_cphcltussdnotecontroller.h" +#include "cphcltussdcommonconstant.h" +//test class +#include "cphcltussdnotecontroller.h" +//const +const int KExtendTimeoutMseconds = 50000; + +// ----------------------------------------------------------------------------- +// Ut_CphCltUssdNoteController::Ut_CphCltUssdNoteController +// ----------------------------------------------------------------------------- +// +Ut_CphCltUssdNoteController::Ut_CphCltUssdNoteController(QObject *parent): + QObject(parent) +{ + qDebug("Ut_CphCltUssdNoteController::Ut_CphCltUssdNoteController >"); + qDebug("Ut_CphCltUssdNoteController::Ut_CphCltUssdNoteController <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CphCltUssdNoteController::~Ut_CphCltUssdNoteController +// ----------------------------------------------------------------------------- +// +Ut_CphCltUssdNoteController::~Ut_CphCltUssdNoteController() +{ + qDebug("Ut_CphCltUssdNoteController::~Ut_CphCltUssdNoteController >"); + qDebug("Ut_CphCltUssdNoteController::~Ut_CphCltUssdNoteController <"); +} + + +void Ut_CphCltUssdNoteController::GlobalWaitNoteHidden() +{ + qDebug("Ut_CphCltUssdNoteController::GlobalWaitNoteHidden >"); + qDebug("Ut_CphCltUssdNoteController::GlobalWaitNoteHidden <"); +} +// ----------------------------------------------------------------------------- +// Ut_CphCltUssdNoteController::initTestCase +// QTestLib cleanup method, called after the last testfunction . +// ----------------------------------------------------------------------------- +void Ut_CphCltUssdNoteController::initTestCase() +{ + qDebug("Ut_CphCltUssdNoteController::initTestCase >"); + qDebug("Ut_CphCltUssdNoteController::initTestCase <"); +} + + +// ----------------------------------------------------------------------------- +// Ut_CphCltUssdNoteController::cleanupTestCase +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CphCltUssdNoteController::cleanupTestCase() +{ + qDebug("Ut_CphCltUssdNoteController::cleanupTestCase >"); + if (mNoteController) { + qDebug("Ut_CphCltUssdNoteController::cleanupTestCase delete \ + mNoteController"); + delete mNoteController; + mNoteController = 0; + } + qDebug("Ut_CphCltUssdNoteController::cleanupTestCase <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CphCltUssdNoteController::testCreateMainHandler +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CphCltUssdNoteController::testCreateMainHandler() +{ + qDebug("Ut_CphCltUssdNoteController::testProfileState >"); + mNoteController = CPhCltUssdNoteController::NewL(*this); + QVERIFY(mNoteController); + qDebug("Ut_CphCltUssdNoteController::testProfileState <"); +} + + +// ----------------------------------------------------------------------------- +// Ut_CphCltUssdNoteController::testShowGlobalInformationNote_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CphCltUssdNoteController::testShowGlobalInformationNote_data() +{ + qDebug("Ut_CphCltUssdNoteController::testShowGlobalInformationNote_data >"); + QTest::addColumn("noteType"); + QTest::newRow("Unconfirme") << 1; + QTest::newRow("Notallowed") << 2; + QTest::newRow("Noservice") << 3; + QTest::newRow("Offline") << 4; + QTest::newRow("Done") << 5; + QTest::newRow("NotDone") << 6; + qDebug("Ut_CphCltUssdNoteController::testShowGlobalInformationNote_data <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CphCltUssdNoteController::testShowGlobalInformationNote +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CphCltUssdNoteController::testShowGlobalInformationNote() +{ + qDebug("Ut_CphCltUssdNoteController::testShowGlobalInformationNote >"); + QFETCH(int, noteType); + TPhCltUssdInformationType infoType = + static_cast(noteType); + TRAPD(err,mNoteController->ShowGlobalInformationNoteL(infoType) ); + QCOMPARE(KErrNone, err); + qDebug("Ut_CphCltUssdNoteController::testShowGlobalInformationNote <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CphCltUssdNoteController::testProfileState +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CphCltUssdNoteController::testShowGlobalWaitNote() +{ + qDebug("Ut_CphCltUssdNoteController::testShowGlobalWaitNote >"); + QVERIFY(mNoteController); + TRAPD(err, mNoteController->ShowGlobalWaitNoteL() ); + QCOMPARE(KErrNone, err); + qDebug("Ut_CphCltUssdNoteController::testShowGlobalWaitNote <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CphCltUssdNoteController::testDestroyGlobalWaitNote +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CphCltUssdNoteController::testDestroyGlobalWaitNote() +{ + qDebug("Ut_CphCltUssdNoteController::testDestroyGlobalWaitNote >"); + QVERIFY(mNoteController); + mNoteController->DestroyGlobalWaitNote(); + qDebug("Ut_CphCltUssdNoteController::testDestroyGlobalWaitNote <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CphCltUssdNoteController::testCancelGlobalWaitNote +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CphCltUssdNoteController::testCancelGlobalWaitNote() +{ + qDebug("Ut_CphCltUssdNoteController::testCancelGlobalWaitNote >"); + QVERIFY(mNoteController); + TRAPD(err, mNoteController->ShowGlobalWaitNoteL() ); + QTimer *timer = new QTimer(this); + timer->start(KExtendTimeoutMseconds); + bool ret = connect(timer, SIGNAL(timeout()), timer, SLOT(stop())); + + + QEventLoop *loop = new QEventLoop(this); + ret = connect(timer, SIGNAL(timeout()), loop, SLOT(quit())); + loop->exec(QEventLoop::AllEvents); + mNoteController->DestroyGlobalWaitNote(); + qDebug("Ut_CphCltUssdNoteController::testCancelGlobalWaitNote <"); +} + +// End of file diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_cphcltussdnotecontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_cphcltussdnotecontroller.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef UT_CPHCLTUSSDNOTECONTROLLER_H +#define UT_CPHCLTUSSDNOTECONTROLLER_H + + +#include +#include +#include "MPhCltUssdNoteControllerCallBack.h" + + + +// Class forwards +class CPhCltUssdNoteController; + +/** + * Satapp unit test class. + * + * @since S60 + */ +class Ut_CphCltUssdNoteController : public QObject, + public MPhCltUssdNoteControllerCallBack +{ + Q_OBJECT + +public: + + Ut_CphCltUssdNoteController(QObject *parent = 0); + + virtual ~Ut_CphCltUssdNoteController(); + + /** + * From MPhCltUssdNoteControllerCallBack. + * + */ + void GlobalWaitNoteHidden(); + +private slots: + /** + * Called before the first testfunction is executed. + */ + void initTestCase(); + + /** + * Called after the last testfunction has been executed. + * + */ + void cleanupTestCase(); + + /** + * Test CPhCltUssdNoteController's constructor. + * + */ + void testCreateMainHandler(); + + /** + * Test CPhCltUssdNoteController's testShowGlobalInformationNote param list. + * + */ + void testShowGlobalInformationNote_data(); + + /** + * Test CPhCltUssdNoteController's ShowGlobalInformationNoteL. + * + */ + void testShowGlobalInformationNote(); + + /** + * Test CPhCltUssdNoteController's ShowGlobalWaitNoteL. + * + */ + void testShowGlobalWaitNote(); + + /** + * Test CPhCltUssdNoteController's DestroyGlobalWaitNote. + * + */ + void testDestroyGlobalWaitNote(); + + /** + * Test CPhCltUssdNoteController's cancel GlobalWaitNote. + * + */ + void testCancelGlobalWaitNote(); + +private: + + /** + * Own. + */ + CPhCltUssdNoteController *mNoteController; + +}; + +#endif // UT_CPHCLTUSSDNOTECONTROLLER_H diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_testenv.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_testenv.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +// phoneclientengine +#include "cphsrvresourcemanager.h" +#include "cphsrvussdmanager.h" +#include // USSD API + +// qt stuff +#include + +// unit test +#include "ut_testenv.h" + +// globals +TestEnv* TestEnv::m_singleton = 0; + +// ==================================================================== +// EtelMsgLoop +// ==================================================================== +EtelMsgLoop::EtelMsgLoop() +{ + mSendMessageReqStatus = 0; + + mReceiveMessageReqStatus = 0; + mReceiveMessageData = 0; + mReceiveMessageAttributes = 0; + + mNetworkReleaseReqStatus = 0; + mNetworkReleaseMessageData = 0; + mNetworkReleaseMessageAttributes = 0; +} + +void EtelMsgLoop::receive( const TDesC8& msg, const TDesC8& attr ) +{ + QVERIFY2(mReceiveMessageReqStatus, "EtelMsgLoop: unable to receive"); + mReceiveMessageData->Copy( msg ); + mReceiveMessageAttributes->Copy( attr ); + const TestMode& mode = TestEnv::env().testMode(); + User::RequestComplete(mReceiveMessageReqStatus, mode.m_error); +} + +void EtelMsgLoop::networkRelease( const TDesC8& msg, const TDesC8& attr ) +{ + QVERIFY2(mNetworkReleaseReqStatus, "EtelMsgLoop: unable to networkRelease"); + mNetworkReleaseMessageData->Copy( msg ); + if ( mNetworkReleaseMessageAttributes ) + mNetworkReleaseMessageAttributes->Copy( attr ); + const TestMode& mode = TestEnv::env().testMode(); + User::RequestComplete(mNetworkReleaseReqStatus, mode.m_error); +} + +// ==================================================================== +// TestEnv +// ==================================================================== + +void TestEnv::create() +{ + QVERIFY(!m_singleton); + m_singleton = new TestEnv(); + m_singleton->construct(); +} + +void TestEnv::destroy() +{ + QVERIFY(m_singleton); + delete m_singleton; + m_singleton = 0; +} + +TestEnv& TestEnv::env() +{ + return *m_singleton; +} + +TestEnv::TestEnv() +{ +} + +void TestEnv::construct() +{ + int leave; + // create the main USSD resource manager class + m_resourceManager = new CPhSrvResourceManager(m_fs); + TRAP(leave, m_resourceManager->ConstructL()); + QVERIFY(leave==0); + m_ussdManager = new CPhSrvUssdManager(m_fs,*m_resourceManager); + TRAP(leave,m_ussdManager->ConstructL(*this)); + QVERIFY(leave==0); + m_fakeMessage = new RMessage2(); +} + +TestEnv::~TestEnv() +{ + delete m_ussdManager; + m_ussdManager = 0; + delete m_resourceManager; + m_resourceManager = 0; + delete m_fakeMessage; + m_fakeMessage = 0; +} + + +#define NULLREF(clz) *reinterpret_cast((void*)0) + +RTelServer& TestEnv::PhSrvETelServer() + { return NULLREF(RTelServer); } + +RMobilePhone& TestEnv::PhSrvMobilePhone() + { return NULLREF(RMobilePhone); } + +RMmCustomAPI& TestEnv::PhSrvCustomPhone() + { return NULLREF(RMmCustomAPI); } + + + + +//End of file + diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_testenv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_testenv.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,136 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// include files +#include +#include +#include +#include "mphsrvphoneinterface.h" // base class + +// forward declarations +class RTelServer; +class RMobilePhone; +class RMmCustomAPI; +class CPhSrvResourceManager; +class CPhSrvUssdManager; + +/** + * Mode for current test execution + */ +class TestMode +{ +public: + enum {Immediate=50}; + enum Event{Normal,NoResp,NetworkRelease}; + + TestMode(Event event,int error=KErrNone,int timeout=Immediate) + {m_event=event;m_error=error;m_timeout=timeout;} + TestMode(int error,int timeout=Immediate) + {m_event=Normal;m_error=error;m_timeout=timeout;} + TestMode() + {m_event=Normal;m_error=KErrNone;m_timeout=Immediate;} + Event m_event; + int m_error; + int m_timeout; +}; + +/** + * ETEL message loop + */ +class EtelMsgLoop +{ +public: + EtelMsgLoop(); + + // methods + void receive( const TDesC8& msg, const TDesC8& attr ); + void networkRelease( const TDesC8& msg, const TDesC8& attr ); + + //data + TRequestStatus* mSendMessageReqStatus; + + TRequestStatus* mReceiveMessageReqStatus; + TDes8* mReceiveMessageData; + TDes8* mReceiveMessageAttributes; + + TRequestStatus* mNetworkReleaseReqStatus; + TDes8* mNetworkReleaseMessageData; + TDes8* mNetworkReleaseMessageAttributes; + +}; + + + +/** + * test environment + */ +class TestEnv: public MPhSrvPhoneInterface +{ + public: + + static void create(); + static void destroy(); + static TestEnv& env(); // the singleton + + TestEnv(); + void construct(); + ~TestEnv(); + + CPhSrvUssdManager& ussdManager() {return *m_ussdManager;} + + void setTestMode(const TestMode& testMode) {m_testMode = testMode;} + const TestMode& testMode() {return m_testMode;} + + EtelMsgLoop& etelMsgLoop() {return m_etelMsgLoop;} + + RMessage2& fakeMessage() {return *m_fakeMessage;} + + protected: // stubbed MPhSrvPhoneInterface + + RTelServer& PhSrvETelServer(); + RMobilePhone& PhSrvMobilePhone(); + RMmCustomAPI& PhSrvCustomPhone(); + + private: + + // file manager. Never actually connected to + RFs m_fs; + + // resource manager mock + CPhSrvResourceManager* m_resourceManager; + + // ussd manager (server main ussd class) + CPhSrvUssdManager* m_ussdManager; + + // test mode + TestMode m_testMode; + + // etel msg loop + EtelMsgLoop m_etelMsgLoop; + + // temp message + RMessage2* m_fakeMessage; + + static TestEnv* m_singleton; + +}; + + + + + diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_ussd.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_ussd.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,571 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include +#include + +// phoneclientengine +#include // USSD API +#include "cphcltussdimp.h" // USSD INTERNAL API +#include // USSD SAT API +#include + +// qt stuff +#include +#include +#include + +// unit test +#include "ut_testenv.h" +#include "ut_ussd.h" + +// want to use TestMode class inside QVariant (using QFETCH) +Q_DECLARE_METATYPE(TestMode) + + +// ==================================================================== +// Test cases +// ==================================================================== + + +void Ut_Ussd::testTestEnv() +{ + TestEnv::create(); + QTest::qSleep(200); + + TestEnv* env = &TestEnv::env(); + QVERIFY2(env,"TestEnv null"); + + CPhSrvUssdManager* m = &TestEnv::env().ussdManager(); + QVERIFY2(m,"TestEnv::ussdManager null"); + + TestMode tm1(TestMode::NoResp,KErrUnknown,123); + TestEnv::env().setTestMode(tm1); + QCOMPARE( (int)TestEnv::env().testMode().m_event, (int)TestMode::NoResp); + QCOMPARE( TestEnv::env().testMode().m_error, KErrUnknown); + QCOMPARE( TestEnv::env().testMode().m_timeout, 123); + TestMode tm2(KErrNotSupported,456); + TestEnv::env().setTestMode(tm2); + QCOMPARE( (int)TestEnv::env().testMode().m_event, (int)TestMode::Normal); + QCOMPARE( TestEnv::env().testMode().m_error, KErrNotSupported); + QCOMPARE( TestEnv::env().testMode().m_timeout, 456); + TestMode tm3(TestMode::Normal); + TestEnv::env().setTestMode(tm3); + QCOMPARE( (int)TestEnv::env().testMode().m_event, (int)TestMode::Normal); + QCOMPARE( TestEnv::env().testMode().m_error, KErrNone); + QCOMPARE( TestEnv::env().testMode().m_timeout, (int)TestMode::Immediate); + + TestEnv::destroy(); + QTest::qSleep(200); +} + +void Ut_Ussd::openAndCloseApi() +{ + TestEnv::create(); + QTest::qSleep(200); + + createUssdApi(false); + + delete m_ussdApi; + m_ussdApi = 0; + + TestEnv::destroy(); + QTest::qSleep(200); +} + +void Ut_Ussd::sendUssd16bit_data() +{ + QTest::addColumn("ui"); + QTest::addColumn("message"); + QTest::addColumn("testmode"); + + // without ui + QTest::newRow("1.1") << false << "123" << TestMode(KErrNone); + QTest::newRow("1.2") << false << "***" << TestMode(KErrNone,3000); + QTest::newRow("1.3") << false << "qwerty" << TestMode(KErrUnknown); + // show ui + QTest::newRow("2.1") << true << "#*555*" << TestMode(KErrNone,20); + QTest::newRow("2.2") << true << "#*555*" << TestMode(KErrCancel,500); + QTest::newRow("2.3") << true << "#*555*" << TestMode(KErrInUse,1000); + QTest::newRow("2.4") << true << "#*555*" << TestMode(KErrAccessDenied,90); + QTest::newRow("2.5") << true << "#*555*" << TestMode(KErrGsmSSCallBarred,190); + QTest::newRow("2.6") << true << "#*555*" << TestMode(KErrGsmSMSNoNetworkService,700); + QTest::newRow("2.7") << true << "#*555*" << TestMode(KErrGsmOfflineOpNotAllowed,1200); + QTest::newRow("2.8") << true << "#*555*" << TestMode(KErrSatControl,200); + QTest::newRow("2.9") << true << "#*555*" << TestMode(KErrUnknown,920); + +} + +void Ut_Ussd::sendUssd16bit() +{ + TestEnv::create(); + QTest::qSleep(200); + + QFETCH(bool, ui); + QFETCH(QString, message); + QFETCH(TestMode, testmode); + TestEnv::env().setTestMode(testmode); + + // create api + createUssdApi(ui); + + // send USSD + TBuf<100> buf16; + buf16.Copy( (const TUint16*)message.constData(), message.length() ); + int result = m_ussdApi->SendUssd( buf16 ); + QCOMPARE(result, testmode.m_error); + QTest::qSleep(100); + + // close api + delete m_ussdApi; + m_ussdApi = NULL; + QTest::qSleep(100); + + TestEnv::destroy(); + QTest::qSleep(200); +} + +void Ut_Ussd::sendCancel() +{ + TestEnv::create(); + QTest::qSleep(200); + + // create api + createUssdApi(false); + + // send USSD + _LIT( KMsg, "#12345*" ); + TestEnv::env().setTestMode(TestMode(KErrNone)); + int result = m_ussdApi->SendUssd( KMsg ); + QCOMPARE(result, KErrNone); + m_ussdApi->SendUssdCancel(); + + // close api + delete m_ussdApi; + m_ussdApi = NULL; + QTest::qSleep(100); + + TestEnv::destroy(); + QTest::qSleep(200); +} + + +void Ut_Ussd::sendUssd8bit_data() +{ + QTest::addColumn("ui"); + QTest::addColumn("message"); + QTest::addColumn("testmode"); + + // without ui + QTest::newRow("1.1") << false << "8" << TestMode(KErrNone); + QTest::newRow("1.2") << false << "#*888*" << TestMode(KErrUnknown,600); + QTest::newRow("1.3") << false << "illegal" << TestMode(KErrNotSupported); + // show ui + QTest::newRow("2.1") << true << "#*555*" << TestMode(KErrNone,20); + QTest::newRow("2.2") << true << "#*555*" << TestMode(KErrCancel,500); + QTest::newRow("2.3") << true << "#*555*" << TestMode(KErrInUse,1000); + QTest::newRow("2.4") << true << "#*555*" << TestMode(KErrAccessDenied,90); + QTest::newRow("2.5") << true << "#*555*" << TestMode(KErrGsmSSCallBarred,190); + QTest::newRow("2.6") << true << "#*555*" << TestMode(KErrGsmSMSNoNetworkService,700); + QTest::newRow("2.7") << true << "#*555*" << TestMode(KErrGsmOfflineOpNotAllowed,1200); + QTest::newRow("2.8") << true << "#*555*" << TestMode(KErrSatControl,200); + QTest::newRow("2.9") << true << "#*555*" << TestMode(KErrUnknown,920); +} + +void Ut_Ussd::sendUssd8bit() +{ + TestEnv::create(); + QTest::qSleep(200); + + QFETCH(bool, ui); + QFETCH(QString, message); + QFETCH(TestMode, testmode); + TestEnv::env().setTestMode(testmode); + + // create api + createUssdApi(ui); + + // send USSD + TBuf<100> buf16; + buf16.Copy( (const TUint16*)message.constData(), message.length() ); + TBuf8<100> buf8; + buf8.Copy( buf16 ); + int result = m_ussdApi->SendUssd( buf8 ); + QCOMPARE(result, testmode.m_error); + QTest::qSleep(100); + + // close api + delete m_ussdApi; + m_ussdApi = 0; + QTest::qSleep(100); + + TestEnv::destroy(); + QTest::qSleep(200); +} + +void Ut_Ussd::openAndCloseSatApi() +{ + TestEnv::create(); + QTest::qSleep(200); + + m_ussdSatApi = NULL; + createUssdSatApi(m_ussdSatApi); + + delete m_ussdSatApi; + m_ussdSatApi = 0; + + TestEnv::destroy(); + QTest::qSleep(200); +} + +void Ut_Ussd::sendSatMessage_data() +{ + QTest::addColumn("ui"); + QTest::addColumn("message"); + QTest::addColumn("testmode"); + + // without ui + QTest::newRow("1.1") << false << "123456" << TestMode(KErrNone); + QTest::newRow("1.2") << false << "*100#" << TestMode(KErrNone,1000); + QTest::newRow("1.3") << false << "8" << TestMode(KErrNone,400); + //QTest::newRow("1.4") << false << "illegal" << TestMode(KErrNotSupported); + +} + +void Ut_Ussd::sendSatMessage() +{ + TestEnv::create(); + QTest::qSleep(200); + + QFETCH(bool, ui); + QFETCH(QString, message); + QFETCH(TestMode, testmode); + TestEnv::env().setTestMode(testmode); + + // create api + createUssdSatApi(ui); + + TBuf receiveMessage; + TBool sendCompletedFirst( EFalse ); + TUint8 receiveDcs = 0; + TBuf<100> sendMessage; + sendMessage.Copy( (const TUint16*)message.constData(), + message.length() ); + + TInt ret = m_ussdSatApi->SendSatMessage( + sendMessage, + CPhCltUssdSatClient::EPhCltDcsUnknown, + receiveMessage, + sendCompletedFirst, + receiveDcs ); + + qDebug("receive error=%d", ret); + qDebug("receive receive msg=%s", &receiveMessage); + qDebug("receive isCompleteFirst=%d", &sendCompletedFirst); + qDebug("receive receive Dcs=%d", &receiveDcs); + + QVERIFY2(ret == testmode.m_error , "testSendSatMessage failed "); + + // close api + delete m_ussdSatApi; + m_ussdSatApi = NULL; + QTest::qSleep(100); + + TestEnv::destroy(); + QTest::qSleep(200); +} + +void Ut_Ussd::sendReceive_data() +{ + QTest::addColumn("ui"); + QTest::addColumn("msg1"); + QTest::addColumn("msg2"); + QTest::addColumn("testmode"); + + // without ui, empty resp + QTest::newRow("1.1") << false << "*100#" << "" << TestMode(KErrNone,1000); + QTest::newRow("1.2") << false << "*100#" << "" << TestMode(KErrNotSupported,400); + // without ui, text resp + QTest::newRow("2.1") << false << "*100#" << "12345" << TestMode(KErrNone,100); + QTest::newRow("2.2") << false << "*100#" << "12345" << TestMode(KErrUnknown,800); + + // show ui, empty resp + QTest::newRow("3.1") << true << "*100#" << "" << TestMode(KErrNone,700); + QTest::newRow("3.2") << true << "*100#" << "" << TestMode(KErrNotFound,400); + // show ui, text resp + QTest::newRow("4.1") << true << "*100#" << "12345" << TestMode(KErrNone,2000); + QTest::newRow("4.2") << true << "*100#" << "12345" << TestMode(-800,800); + +} + + +void Ut_Ussd::sendReceive() +{ + TestEnv::create(); + QTest::qSleep(200); + + QFETCH(bool, ui); + QFETCH(QString, msg1); + QFETCH(QString, msg2); + QFETCH(TestMode, testmode); + + createUssdApi(ui); + + TestEnv::env().setTestMode(TestMode(KErrNone)); + send(msg1); + TestEnv::env().setTestMode(testmode); + receive(msg2, RMobileUssdMessaging::EUssdMTReply); + activeSleep(500); + networkRelease( KErrNone ); + activeSleep(500); + + // close api + delete m_ussdApi; + m_ussdApi = NULL; + QTest::qSleep(100); + + TestEnv::destroy(); + QTest::qSleep(200); +} + +void Ut_Ussd::testMultipleIncomingMessages() +{ + TestEnv::create(); + QTest::qSleep(200); + + QString msg1 = "your favorite color?\n1=red\n2=blue"; + QString msg2 = "your favorite food?\n1=rice\n2=potatoes"; + QString msg3 = "thank you"; + receive(msg1,RMobileUssdMessaging::EUssdMTRequest); + activeSleep(1000); + receive(msg2,RMobileUssdMessaging::EUssdMTRequest); + //activeSleep(1000); + receive(msg3,RMobileUssdMessaging::EUssdMTNotify); + //activeSleep(1000); + + TestEnv::destroy(); + QTest::qSleep(200); +} + +void Ut_Ussd::testUssdInternalApi_data() +{ + QTest::addColumn("ui"); + QTest::addColumn("msg1"); + QTest::addColumn("msg2"); + QTest::addColumn("testmode"); + + // without ui + QTest::newRow("1.1") << false << "1" << "" << TestMode(KErrNone,100); + QTest::newRow("1.2") << false << "1" << "23" << TestMode(KErrNone,200); + QTest::newRow("1.3") << false << "1" << "" << TestMode(KErrUnknown,300); + QTest::newRow("1.4") << false << "1" << "23" << TestMode(KErrNotFound,400); + // show ui + QTest::newRow("1.1") << true << "1" << "" << TestMode(KErrNone,100); + QTest::newRow("1.2") << true << "1" << "23" << TestMode(KErrNone,200); + QTest::newRow("1.3") << true << "1" << "" << TestMode(KErrUnknown,300); + QTest::newRow("1.4") << true << "1" << "23" << TestMode(KErrNotFound,400); +} + +void Ut_Ussd::testUssdInternalApi() +{ + TestEnv::create(); + QTest::qSleep(200); + + QFETCH(bool, ui); + QFETCH(QString, msg1); // send + QFETCH(QString, msg2); // receive1 + QFETCH(TestMode, testmode); + + createUssdInternalApi(ui); + + int err = m_ussdInternalApi->AppStarting(); + QCOMPARE(err,KErrNone); + QTest::qSleep(100); + + err = m_ussdInternalApi->AppToBackground(); + QCOMPARE(err,KErrNone); + QTest::qSleep(100); + + err = m_ussdInternalApi->AppToForeground(); + QTest::qSleep(100); + + err = m_ussdInternalApi->AppTerminating(EPhCltUserExit); + QCOMPARE(err,KErrNone); + QTest::qSleep(100); + + err = m_ussdInternalApi->AppStarting(); + QCOMPARE(err,KErrNone); + QTest::qSleep(100); + + TBuf<200> reply_buf16; + reply_buf16.Copy( (const TUint16*)msg1.constData(), msg1.length() ); + int result = m_ussdInternalApi->SendUssd( reply_buf16 ); + QCOMPARE(result, TestEnv::env().testMode().m_error); + QTest::qSleep(100); + + receive(msg2, RMobileUssdMessaging::EUssdMTNotify); + activeSleep(100); + + err = m_ussdInternalApi->AppTerminating(EPhCltSendCompleted); + QCOMPARE(err,KErrNone); + QTest::qSleep(100); + + // close internal api + delete m_ussdInternalApi; + m_ussdInternalApi = NULL; + QTest::qSleep(100); + + TestEnv::destroy(); + QTest::qSleep(200); +} + +void Ut_Ussd::createUssdApi(bool ui) +{ + TRAPD(leave, m_ussdApi = CPhCltUssd::NewL(ui)); + QTest::qSleep(200); + if (leave != KErrNone) + QFAIL("CPhCltUssd::NewL Leave"); + if (NULL == m_ussdApi) + QFAIL("CPhCltUssd pointer null"); + qDebug("m_ussdApi=%d", m_ussdApi); +} + +void Ut_Ussd::createUssdInternalApi(bool ui) +{ + TRAPD(leave, m_ussdInternalApi = CPhCltUssdImp::NewL(ui)); + QTest::qSleep(200); + if (leave != KErrNone) + QFAIL("CPhCltUssdInt::NewL Leave"); + if (NULL == m_ussdInternalApi) + QFAIL("CPhCltUssdInt pointer null"); + qDebug("m_ussdInternalApi=%d", m_ussdInternalApi); +} + +void Ut_Ussd::createUssdSatApi(bool ui) +{ + TRAPD(leave, m_ussdSatApi = CPhCltUssdSatClient::NewL(ui)); + QTest::qSleep(200); + if (leave != KErrNone) + QFAIL("CPhCltUssdSatClient::NewL Leave"); + if (NULL == m_ussdSatApi) + QFAIL("CPhCltUssdSatClient pointer null"); + qDebug("m_ussdSatApi=%d", m_ussdSatApi); +} + +void Ut_Ussd::send(const QString& msg) +{ + qDebug("Ut_Ussd::send SendUssd in"); + QVERIFY(m_ussdApi); + TBuf<200> send_buf16; + send_buf16.Copy( (const TUint16*)msg.constData(), msg.length() ); + qDebug("Ut_Ussd::send SendUssd before"); + int result = m_ussdApi->SendUssd( send_buf16 ); + qDebug("Ut_Ussd::send SendUssd after"); + QCOMPARE(result, TestEnv::env().testMode().m_error); + qDebug("Ut_Ussd::send SendUssd out"); +} + +// type = { +// RMobileUssdMessaging::EUssdMTRequest +// RMobileUssdMessaging::EUssdMTReply +// RMobileUssdMessaging::EUssdMTNotify +// } + +void Ut_Ussd::receive(const QString& msg, int type) +{ + qDebug("Ut_Ussd::send receive in"); + QTest::qSleep(TestEnv::env().testMode().m_timeout); + TBuf<200> rcv_buf16; + rcv_buf16.Copy( (const TUint16*)msg.constData(), msg.length() ); + TBuf8<200> rcv_buf8; + rcv_buf8.Copy( rcv_buf16 ); + // prepare attributes + RMobileUssdMessaging::TMobileUssdAttributesV1 attr; + attr.iFlags = RMobileUssdMessaging::KUssdMessageType; + attr.iType = (RMobileUssdMessaging::TMobileUssdMessageType)type; + RMobileUssdMessaging::TMobileUssdAttributesV1Pckg attrpkg(attr); + + TestEnv::env().etelMsgLoop().receive( rcv_buf8, attrpkg ); + qDebug("Ut_Ussd::send receive out"); +} + +void Ut_Ussd::networkRelease(int error) +{ + qDebug("Ut_Ussd::send networkRelease in"); + RMobilePhone::TMobilePhoneSendSSRequestV3 attr; + attr.iOpCode = error; + RMobilePhone::TMobilePhoneSendSSRequestV3Pckg attrpkg(attr); + + TestEnv::env().etelMsgLoop().networkRelease( _L8(""), attrpkg ); + qDebug("Ut_Ussd::send networkRelease out"); +} + + +// global variables +CPeriodic* activeSleepTimer = 0; + +TInt ActiveSleepTimerCallback(TAny* aPtr) +{ + if ( activeSleepTimer ) { + qDebug("Ut_Ussd::ActiveSleepTimerCallback Cancel"); + activeSleepTimer->Cancel(); + } + CActiveSchedulerWait* wait = (CActiveSchedulerWait*) aPtr; + if (wait) { + qDebug("Ut_Ussd::ActiveSleepTimerCallback AsyncStop"); + wait->AsyncStop(); + } + return 0; +} + +// This is a special SLEEP method that allows active objects to run meanwhile. +// Note: because of its active nature, this sleep method is very inaccurate. +void Ut_Ussd::activeSleep(int ms) +{ + qDebug("Ut_Ussd::activeSleep in"); + + CActiveSchedulerWait* wait = new CActiveSchedulerWait; + activeSleepTimer = CPeriodic::NewL(CActive::EPriorityStandard+1); + TTimeIntervalMicroSeconds32 delay(1000*ms); + activeSleepTimer->Start(delay,delay, + TCallBack(ActiveSleepTimerCallback,(TAny*)wait)); + if ( wait && wait->IsStarted() ) { + wait->AsyncStop(); + delete activeSleepTimer; + activeSleepTimer = 0; + delete wait; + wait = NULL; + qDebug("Ut_Ussd::activeSleep out unnormal"); + return; + } + + if (wait) { + qDebug("Ut_Ussd::activeSleep start snyc before"); + wait->Start(); + qDebug("Ut_Ussd::activeSleep start snyc after"); + } + delete activeSleepTimer; + activeSleepTimer = 0; + delete wait; + wait = NULL; + qDebug("Ut_Ussd::activeSleep out"); +} + +//End of file + diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_ussd.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_ussd.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// include files +#include // base class + +// forward declarations +class CPhCltUssd; +class CPhCltUssdImp; +class CPhCltUssdSatClient; + +// class declaration +class Ut_Ussd: public QObject +{ + Q_OBJECT + +private slots: // test cases + + // Test for CPhCltUssd + void testTestEnv(); + void openAndCloseApi(); + void sendUssd16bit_data(); + void sendUssd16bit(); + void sendUssd8bit_data(); + void sendUssd8bit(); + void sendCancel(); + + // Test for CPhCltUssdSatClient + void openAndCloseSatApi(); + void sendSatMessage_data(); + void sendSatMessage(); + + // receiving messages + void sendReceive_data(); + void sendReceive(); + void testMultipleIncomingMessages(); + + // cases for internal api + void testUssdInternalApi_data(); + void testUssdInternalApi(); + +private: // tet blocks + + void createUssdApi(bool ui); + void createUssdInternalApi(bool ui); + void createUssdSatApi(bool ui); + void send(const QString& msg); + void receive(const QString& msg, int type); + void networkRelease(int error); + void activeSleep(int ms); + + +private: // test-related members + + // phone client + CPhCltUssd *m_ussdApi; + CPhCltUssdImp *m_ussdInternalApi; + CPhCltUssdSatClient *m_ussdSatApi; + +}; + diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_ussd.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/phoneclient/tsrc/public/basic/ut_ussd/ut_ussd.pro Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,119 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: USSD unit test project file. +# this project combines phone server client and server classes, +# glues them in one single package with the test module and test +# the class functionality all together. +# + +TEMPLATE = app +TARGET = ut_ussd +DEPENDPATH += . +INCLUDEPATH += . +CONFIG += hb +CONFIG += qtestlib +HEADERS += $$PUBLIC_HEADERS + +symbian { + TARGET.CAPABILITY = CAP_APPLICATION + } + +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + +# ===================================================================== +# CODE SUBJECT TO TEST +# Note that both ussd client and server code is compiled! +# ===================================================================== + +# server +HEADERS += ../../../../../phoneserver/inc/ussd/cphsrvussdmanager.h +HEADERS += ../../../../../phoneserver/inc/ussd/cphsrvussdnotifynwrelease.h +HEADERS += ../../../../../phoneserver/inc/ussd/cphsrvussdreceivehandler.h +HEADERS += ../../../../../phoneserver/inc/ussd/cphsrvussdreplytimer.h +HEADERS += ../../../../../phoneserver/inc/ussd/cphsrvussdsendhandler.h +HEADERS += ../../../../../phoneserver/inc/ussd/cphsrvussdsessioncancelwaiter.h +HEADERS += ../../../../../phoneserver/inc/ussd/mphsrvussdmessagesentobserver.h +HEADERS += ../../../../../phoneserver/inc/ussd/mphsrvussdnetworkobserver.h +HEADERS += ../../../../../phoneserver/inc/ussd/mphsrvussdreplytimerobserver.h +HEADERS += ../../../../../phoneserver/inc/Standard/mphsrvphoneinterface.h +HEADERS += ../../../../../phoneserver/inc/Standard/cphsrvresourcemanager.h +HEADERS += ../../../../../phoneserver/inc/Standard/phsrvutils.h +HEADERS += ../../../../../phoneserver/inc/Standard/phsrvdebuginfo.h +HEADERS += ../../../../../phoneserver/inc/Standard/phsrvconfigure.h + +SOURCES += ../../../../../phoneserver/src/ussd/cphsrvussdmanager.cpp +SOURCES += ../../../../../phoneserver/src/ussd/cphsrvussdnotifynwrelease.cpp +SOURCES += ../../../../../phoneserver/src/ussd/cphsrvussdreceivehandler.cpp +SOURCES += ../../../../../phoneserver/src/ussd/cphsrvussdreplytimer.cpp +SOURCES += ../../../../../phoneserver/src/ussd/cphsrvussdsendhandler.cpp +SOURCES += ../../../../../phoneserver/src/standard/phsrvutils.cpp +SOURCES += ../../../../../phoneserver/src/standard/phsrvdebuginfo.cpp + +# client/ussdwrapper +HEADERS += ../../../../../phoneclient/inc/ussd/ussd_ext/rphcltussd.h +HEADERS += ../../../../../phoneclient/inc/ussdwrapper/ussd_ext/cphcltussdimp.h +HEADERS += ../../../../../phoneclient/inc/ussdwrapper/cphcltussdnotecontroller.h +HEADERS += ../../../../../phoneclient/inc/ussdwrapper/cphcltussdrequesthandler.h +HEADERS += ../../../../../phoneclient/inc/ussdwrapper/mphcltussdnotecontrollercallback.h +HEADERS += ../../../../../phoneclient/inc/ussdwrapper/mphcltussdrequesthandler.h +HEADERS += ../../../../../phoneclient/inc/SharedClientServer/phcltclientserver.h +HEADERS += ../../../../../phoneclient/inc/ussdwrapper/cphcltussdcommonconstant.h + +SOURCES += ../../../../../phoneclient/src/ussdwrapper/cphcltussdext.cpp +SOURCES += ../../../../../phoneclient/src/ussdwrapper/cphcltussdimp.cpp +SOURCES += ../../../../../phoneclient/src/ussdwrapper/cphcltussdint.cpp +SOURCES += ../../../../../phoneclient/src/ussdwrapper/cphcltussdnotecontroller.cpp +SOURCES += ../../../../../phoneclient/src/ussdwrapper/cphcltussdrequesthandler.cpp +SOURCES += ../../../../../phoneclient/src/ussdwrapper/cphcltussdsatclient.cpp + + +# ===================================================================== +# TEST CODE +# Explanation of the test/mock classes +# * ut_ussd: +# QTestLib test cases +# * ut_testenv: +# keep-up of the test environment, stubs and mocks etc. +# * rphcltussd_glue: +# replaces RPhCltUssd implementation. Instead of connecting to +# phone server, directs commands directly to USSD manager and +# receives callbacks. +# * etel_mock: +# Mocks ETEL, fakes different USSD send responses. +# * phoneclientserver_stubs: +# Replaces the phoneserver resource reader with a dummy +# Replaces phoneserver client with a dummy +# ===================================================================== + +HEADERS += ut_ussd.h +HEADERS += ut_testenv.h +HEADERS += ut_cphcltussdnotecontroller.h + +SOURCES += main.cpp +SOURCES += ut_ussd.cpp +SOURCES += ut_testenv.cpp +SOURCES += rphcltussd_glue.cpp +SOURCES += etel_mock.cpp +SOURCES += phoneclientserver_stubs.cpp +SOURCES += ut_cphcltussdnotecontroller.cpp + + +LIBS += -lefsrv +LIBS += -lgsmu +LIBS += -lflogger +LIBS += -lCommonEngine +LIBS += -laknnotify +LIBS += -leiksrv +LIBS += -lbafl + diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneserver/Group/PhoneServer.mmp --- a/phoneclientserver/phoneserver/Group/PhoneServer.mmp Fri Apr 16 15:31:58 2010 +0300 +++ b/phoneclientserver/phoneserver/Group/PhoneServer.mmp Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -123,6 +123,10 @@ // TEMPORARY DEFINITION FOR TELEPHONY VARIATION HEADERS SYSTEMINCLUDE ../../../../../app/phone/inc +// TEMPORARY DEFINITION FOR Orbit Device Dialog +SYSTEMINCLUDE /epoc32/include/mw/hb/hbwidgets +SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore + LIBRARY efsrv.lib LIBRARY apgrfx.lib LIBRARY charconv.lib @@ -130,9 +134,7 @@ LIBRARY ws32.lib LIBRARY etel.lib LIBRARY bafl.lib -LIBRARY aknnotify.lib LIBRARY gsmu.lib -LIBRARY avkon.lib LIBRARY apparc.lib LIBRARY customapi.lib LIBRARY etelmm.lib @@ -143,5 +145,7 @@ LIBRARY centralrepository.lib LIBRARY imageconversion.lib LIBRARY bitmaptransforms.lib +LIBRARY hbwidgets.lib +LIBRARY hbcore.lib // End of File diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneserver/Inc/Ussd/CPhSrvUssdManager.h --- a/phoneclientserver/phoneserver/Inc/Ussd/CPhSrvUssdManager.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phoneclientserver/phoneserver/Inc/Ussd/CPhSrvUssdManager.h Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -25,7 +25,7 @@ #include "mphsrvussdnetworkobserver.h" #include "mphsrvussdreplytimerobserver.h" #include - +#include // FORWARD DECLARATIONS class RFs; @@ -35,7 +35,6 @@ class CPhSrvUssdReplyTimer; class MPhSrvPhoneInterface; class MPhSrvUssdMessageSentObserver; -class CAknGlobalMsgQuery; class CPhSrvUssdSessionCancelWaiter; class CPhSrvUssdNotifyNWRelease; @@ -49,7 +48,8 @@ class CPhSrvUssdManager : public CActive, public MPhSrvUssdNetworkObserver, - public MPhSrvUssdReplyTimerObserver + public MPhSrvUssdReplyTimerObserver, + public MHbDeviceMessageBoxObserver { public: // Constructors and destructor @@ -161,6 +161,12 @@ */ void UssdReplyTimerObserverHandleExpiredL( TInt aError ); + /** + * @see MHbDeviceMessageBoxObserver + */ + void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox, + CHbDeviceMessageBoxSymbian::TButtonId aButton); + /* * @see CActive */ @@ -175,8 +181,6 @@ * @see CActive */ TInt RunError( TInt aError ); - - private: // New functions @@ -303,7 +307,7 @@ * * @since 3.1 */ - void UpdateNotifyMessage(); + void UpdateNotifyMessageL(); /** * Turn lights on @@ -311,9 +315,15 @@ * @since 3.1 */ void TurnLightsOn(); + + /** + * Load default string by QT style localization + * @param aText default string id defined by _LIT + */ + const TPtrC LoadDefaultString( const TDesC& aText ); private: // Data - + // The file session reference. RFs& iFsSession; @@ -342,8 +352,8 @@ TBuf< KPhCltUssdMax8BitCharacters > iReceivedMessage; // The message query for showing USSD operation queries. - CAknGlobalMsgQuery* iGlobalMsgQuery; - + CHbDeviceMessageBoxSymbian* iDeviceDialog; + // Is editor emptied. TBool iEmptyEditor; @@ -374,9 +384,6 @@ // Local Telephony variant read-only data. TInt iVariantReadOnlyValues; - // The message query header text. - HBufC* iMeQuHeaderText; - // The buffer for received decoded message. TBuf< KPhCltUssdMax8BitCharacters > iDecodedMessage; @@ -418,6 +425,11 @@ // An asynchronous callback for sending MO ACK messages CAsyncCallBack* iMoAckCallback; + + TBool iTextResolver; + + HBufC* iTextBuffer; + }; #endif // CPHSRVUSSDMANAGER_H diff -r e32024264ebb -r d7fc66ccd6fb phoneclientserver/phoneserver/Src/Ussd/CPhSrvUssdManager.cpp --- a/phoneclientserver/phoneserver/Src/Ussd/CPhSrvUssdManager.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/phoneclientserver/phoneserver/Src/Ussd/CPhSrvUssdManager.cpp Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -27,15 +27,9 @@ #include "mphsrvphoneinterface.h" #include "cphsrvussdsessioncancelwaiter.h" -#include -#include -#include -#include #include #include #include -#include -#include #include #include #include @@ -45,7 +39,7 @@ #include #include #include -#include +#include #include #include "phsrvdebuginfo.h" #include @@ -61,7 +55,7 @@ const TInt KPhSrvUssdAppUID = 0x10005955; const TInt KPhSrvUssdMessageQueryInterval = 500000; // 0.5 sec -const TInt KPhSrvUssdNoteExitPeriod = 500000; // 0.5 sec +//const TInt KPhSrvUssdNoteExitPeriod = 500000; // 0.5 sec // const TUint KPhSrvUssdDefaultDCS = 0x0f; // 00001111 @@ -86,6 +80,23 @@ const TUint KPhSrvUssdDcsMessageHandlingAlphabet8Bit = 0xf4; // 1111x1xx const TInt KPhrUssdNotifyArraySize = 1; +// Refers to HbPopup::NoDismiss = 0 +const TInt KPhSrvUssdPopupDismissPolicy = 0; +// The time out only for testing, from CPhSrvUssdReplyTimer.cpp +const TUint KPhSrvUssdTimeout = 300000000; + +// Use QT style localization +_LIT(KUssdLocFilename, "phcltsrvussd.ts"); +_LIT(KUssdLocPath, "z://data"); +_LIT(KUssdReply, "txt_ussd_button_reply"); // Reply +_LIT(KUssdExit, "txt_ussd_button_exit"); // Exit +_LIT(KUssdNext, "txt_ussd_button_next"); //Next +_LIT(KUssdYes, "txt_common_button_yes"); // Yes +_LIT(KUssdNo, "txt_common_button_no"); // No +_LIT(KUssdTitle, "txt_ussd_title_message"); // Message +_LIT(KUssdDone, "txt_ussd_dpopinfo_done"); // Done +_LIT(KUssdConfirm, "txt_ussd_info_there_are_still_unread_notifications"); + // MACROS #define _DPRINT_FLAGS() \ @@ -373,9 +384,11 @@ :CActive( EPriorityLow ), iFsSession( aFsSession ), iResourceManager( aResourceManager ), + iDeviceDialog( NULL ), iDCS ( KPhCltDcsUnknown ), - iReturnResultPckg ( iReturnResult ) - + iReturnResultPckg ( iReturnResult ), + iTextResolver ( EFalse ), + iTextBuffer ( NULL ) { CActiveScheduler::Add( this ); } @@ -390,7 +403,7 @@ // CPhSrvUssdManager::~CPhSrvUssdManager() { - _DPRINT( 4, "PhSrv.~CPhSrvUssdManager.start" ); // debug print + _DPRINT( 4, "PhSrv.~CPhSrvUssdManager.start" ); delete iUssdSendHandler; @@ -405,9 +418,12 @@ Cancel(); iTimer.Close(); - - delete iGlobalMsgQuery; - iGlobalMsgQuery = NULL; + + delete iTextBuffer; + iTextBuffer = NULL; + + delete iDeviceDialog; + iDeviceDialog = NULL; if ( iNotifyArray ) { @@ -424,13 +440,10 @@ iFsSession.Close(); iMobileUssdMessaging.Close(); - - delete iMeQuHeaderText; - iMeQuHeaderText = NULL; delete iMoAckCallback; - _DPRINT( 4, "PhSrv.~CPhSrvUssdManager.end" ); // debug print + _DPRINT( 4, "PhSrv.~CPhSrvUssdManager.end" ); } @@ -443,7 +456,10 @@ // void CPhSrvUssdManager::ConstructL( MPhSrvPhoneInterface& aPhoneInterface ) { - _DPRINT( 4, "PhSrv.ConstructL.Start" ); // debug print + _DPRINT( 4, "PhSrv.ConstructL.Start" ); + iTextResolver = HbTextResolverSymbian::Init( + KUssdLocFilename, KUssdLocPath ); + _DDPRINT( 4, "PhSrv.ConstructL.loc:", iTextResolver ); User::LeaveIfError( iTimer.CreateLocal() ); User::LeaveIfError( iMobileUssdMessaging.Open( aPhoneInterface.PhSrvMobilePhone() ) ); @@ -479,14 +495,10 @@ User::LeaveIfError( GetTelephonyVariantData() ); - iMeQuHeaderText = iResourceManager.ReadResourceLC( - R_PHSRV_USSD_MESQUERY_MESSAGE); - CleanupStack::Pop( iMeQuHeaderText ); - _DDPRINT( 4, "PhSrv.ConstructL.iSatCanceled ", iSatCanceled ); _DDPRINT( 4, "PhSrv.ConstructL.iShowDone ", iShowDone ); iNotifyArray = new( ELeave ) CDesCArrayFlat( KPhrUssdNotifyArraySize ); - _DPRINT( 4, "PhSrv.ConstructL.End" ); // debug print + _DPRINT( 4, "PhSrv.ConstructL.End" ); } @@ -501,20 +513,20 @@ { // If SendHandler is not created, first check that MO Ussd // is supported by the TSY. - _DPRINT( 4, "PhSrv.SendHandlerL.Start" ); // debug print + _DPRINT( 4, "PhSrv.SendHandlerL.Start" ); if ( iUssdSendHandler == NULL ) { - _DPRINT( 4, "PhSrv.SendHandlerL.iUssdSendHandler.NULL" ); // debug print + _DPRINT( 4, "PhSrv.SendHandlerL.iUssdSendHandler.NULL" ); RMobileUssdMessaging::TMobileUssdCapsV1 caps; RMobileUssdMessaging::TMobileUssdCapsV1Pckg pckgCaps( caps ); User::LeaveIfError( iMobileUssdMessaging.GetCaps( pckgCaps ) ); - _DPRINT( 4, "PhSrv.SendHandlerL.iMobileUssdMessaging.GetCaps" ); // debug print + _DPRINT( 4, "PhSrv.SendHandlerL.iMobileUssdMessaging.GetCaps" ); if ( ( caps.iUssdTypes & RMobileUssdMessaging::KCapsMOUssd ) == 0 || ( caps.iUssdFormat & RMobileUssdMessaging::KCapsPackedString ) == 0 ) { - _DPRINT( 4, "PhSrv.SendHandlerL.KErrNotSupported" ); // debug print + _DPRINT( 4, "PhSrv.SendHandlerL.KErrNotSupported" ); User::Leave( KErrNotSupported ); } @@ -524,7 +536,7 @@ iMobileUssdMessaging, *iPhoneInterface ); } - _DPRINT( 4, "PhSrv.SendHandlerL.End" ); // debug print + _DPRINT( 4, "PhSrv.SendHandlerL.End" ); return *iUssdSendHandler; } @@ -541,7 +553,7 @@ RMobileUssdMessaging::TMobileUssdAttributesV1& aMsgAttribute, MPhSrvUssdMessageSentObserver& aObserver ) { - _DPRINT( 4, "PhSrv.SendUssdL.Start ######" ); // debug print + _DPRINT( 4, "PhSrv.SendUssdL.Start ######" ); _DPRINT_FLAGS(); if ( iObserver && iNetworkReleased ) @@ -549,7 +561,7 @@ // Network has been released but the previous send request is still alive. // Cancel the pervious send operation, complete the old request with error // and clean up the pointer. - _DPRINT( 4, "PhSrv.SendUssdL.Error.Complete.Existing" ); // debug print + _DPRINT( 4, "PhSrv.SendUssdL.Error.Complete.Existing" ); if ( iUssdSendHandler ) { iUssdSendHandler->Cancel(); @@ -560,7 +572,7 @@ if ( iObserver || iSendingAck ) { - _DPRINT( 4, "PhSrv.SendUssdL.KErrInUse" ); // debug print + _DPRINT( 4, "PhSrv.SendUssdL.KErrInUse" ); // Other client is using the service. User::Leave( KErrInUse ); } @@ -568,7 +580,7 @@ // Check that message type is set if( ( aMsgAttribute.iFlags & RMobileUssdMessaging::KUssdMessageType ) == 0 ) - _DPRINT( 4, "PhSrv.SendUssdL.KUssdMessageType.0" ); // debug print + _DPRINT( 4, "PhSrv.SendUssdL.KUssdMessageType.0" ); { // Mesasge type not set -> Set it. aMsgAttribute.iFlags |= RMobileUssdMessaging::KUssdMessageType; @@ -588,7 +600,7 @@ RMobileUssdMessaging::TMobileUssdAttributesV1Pckg attribs( aMsgAttribute ); iShowDone = ETrue; _DPRINT( 4, "PhSrv.SendUssdL.iShowDone.ETrue" ); - _DPRINT( 4, "PhSrv.SendUssdL.Send" ); // debug print + _DPRINT( 4, "PhSrv.SendUssdL.Send" ); SendHandlerL().SendUssdL( aMsgData , attribs ); iObserver = &aObserver; // Not closing nor closed anymore @@ -603,7 +615,7 @@ _DPRINT( 4, "PhSrv.SendUssdCancel.TimerStop" ); // debug print iUssdReplyTimer->Stop(); } - _DPRINT( 4, "PhSrv.SendUssdL.End" ); // debug print + _DPRINT( 4, "PhSrv.SendUssdL.End" ); } // ----------------------------------------------------------------------------- @@ -623,7 +635,7 @@ // void CPhSrvUssdManager::SendUssdCancel() { - _DPRINT( 4, "PhSrv.SendUssdCancel.Start #######" ); // debug print + _DPRINT( 4, "PhSrv.SendUssdCancel.Start #######" ); // Ack sending should not be canceled unless it's about terminating // the whole session @@ -642,7 +654,7 @@ iObserver = NULL; SetActiveIfPendingNotificationsExist(); - _DPRINT( 4, "PhSrv.SendUssdCancel.End" ); // debug print + _DPRINT( 4, "PhSrv.SendUssdCancel.End" ); } // ----------------------------------------------------------------------------- @@ -681,14 +693,14 @@ // complete SAT if needed if ( aError < KErrNone ) { - // debug print + _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleSendEventL.CompleteSat" ); CompleteSatL( NULL, aError ); } if ( iObserver ) { - // debug print + _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleSendEventL.Observer" ); iObserver->UssdMessageSentObserverHandleResult( aError ); @@ -746,7 +758,7 @@ if ( aError != KErrNone ) { TurnLightsOn(); //Ensure lights on - // debug print + _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleReceivedEventL.ShErNote" ); ShowErrorNoteL( aError ); } @@ -763,9 +775,6 @@ // ----------------------------------------------------------------------------- // CPhSrvUssdManager::UssdHandleReceivedEventL -// -// -// // ----------------------------------------------------------------------------- // void CPhSrvUssdManager::UssdHandleReceivedEventL( @@ -779,7 +788,7 @@ // 2. Complete Send with some positive value. if ( iObserver ) { - // debug print + _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.Observer" ); UssdNetworkObserverHandleSendEventL( 1 ); // some positive value } @@ -813,7 +822,7 @@ { if ( !ShowNotesL() ) { - // debug print + _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.SAtReturn" ); return; @@ -824,13 +833,13 @@ if ( !iDecodedMessage.Length() ) { TurnLightsOn(); //Ensure lights on - // debug print + _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.EmptyString" ); ShowDoneNoteL(); - // debug print + _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.EmptyString.OK" ); } @@ -849,6 +858,25 @@ iAcksToBeSent ++; } + if ( !iDeviceDialog ){ + iDeviceDialog = CHbDeviceMessageBoxSymbian::NewL( + CHbDeviceMessageBoxSymbian::EInformation ); + iDeviceDialog->SetObserver( this ); + iDeviceDialog->SetTimeout( KPhSrvUssdTimeout ); + iDeviceDialog->SetDismissPolicy ( KPhSrvUssdPopupDismissPolicy ); + + // Show left key with empty string accoring to ui concept + iDeviceDialog->SetButton( + CHbDeviceMessageBoxSymbian::EAcceptButton, EFalse ); + // Show Exit Key always + iDeviceDialog->SetButton( + CHbDeviceMessageBoxSymbian::ERejectButton, ETrue ); + iDeviceDialog->SetButtonTextL( + CHbDeviceMessageBoxSymbian::ERejectButton, + LoadDefaultString( KUssdExit ) ); + _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.Exit" ); + } + if ( iNotifyMessage || iMsgTypeReply ) { //This is for reply message in notifyarray @@ -858,12 +886,12 @@ //Notify added to array iNotifyArray->AppendL( iReceivedMessage ); - _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.AppendL" ); // debug print - UpdateNotifyMessage(); + _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.AppendL" ); + UpdateNotifyMessageL(); if ( !iSendRelease && NotifyCount() <= 1 ) { - _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.!SendRelease.Cancel" ); // debug print + _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.!SendRelease.Cancel" ); Cancel(); } } @@ -871,35 +899,44 @@ { // New message deletes old message, i.e. Cancel existing query. Cancel(); - _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.NewAnswerable" ); // debug print + _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.NewAnswerable" ); } - if ( !iGlobalMsgQuery ) - { - iGlobalMsgQuery = CAknGlobalMsgQuery::NewL(); - } - - // Delay after message query so that application execution order will - // be correct. - iGlobalMsgQuery->SetExitDelay( KPhSrvUssdNoteExitPeriod ); - - TInt softkeys = R_AVKON_SOFTKEYS_USSD_ANSWER_EXIT__ANSWER; + // Remove Reply key if( !( aMsgAttributes.iFlags & RMobileUssdMessaging::KUssdMessageType ) || aMsgAttributes.iType != RMobileUssdMessaging::EUssdMTRequest ) { - softkeys = R_AVKON_SOFTKEYS_EXIT; + // Remove Answer key + iDeviceDialog->SetButton( + CHbDeviceMessageBoxSymbian::EAcceptButton, EFalse ); + _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.NoAnswer" ); + } + // Show Reply key + else + { + iDeviceDialog->SetButton( + CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue ); + iDeviceDialog->SetButtonTextL( + CHbDeviceMessageBoxSymbian::EAcceptButton, + LoadDefaultString( KUssdReply ) ); + _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.WithAnswer" ); } - // Set timer that lauches Global MessageQuery after time interval. - iSoftkeys = softkeys; - - // debug print + _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.String.Middle" ); // Play the USSD tone if needed. Logically should be in RunL, but here // to give better balancing with voice and visible message. - + // <-- QT PHONE START--> + /* + if ( IsTelephonyFeatureSupported( KTelephonyLVFlagUssdTone ) ) + { + _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.PlayTone" ); + PlayUssdTone(); + } + */ + // <-- QT PHONE END--> // Launch the new message query if ( !IsActive() ) { @@ -967,7 +1004,7 @@ if ( !iSatCanceled ) { CompleteSatL(&iReceivedMessage, aError ); - _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleNotifyNWReleaseL.CompleteSat" ); // debug print + _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleNotifyNWReleaseL.CompleteSat" ); } } if ( iUssdReplyTimer && iUssdReplyTimer->IsTimerActive() ) @@ -1004,11 +1041,8 @@ { _DDPRINT( 4, "PhSrv.ShowDoneNoteL.iShowDone", iShowDone ); // Show global confirmation note "Done" - HBufC* noteText = iResourceManager.ReadResourceLC( R_PHSRV_TEXT_DONE ); - CAknGlobalNote* note = CAknGlobalNote::NewLC(); - note->ShowNoteL( EAknGlobalConfirmationNote, *noteText ); - CleanupStack::PopAndDestroy( note ); - CleanupStack::PopAndDestroy( noteText ); + CHbDeviceMessageBoxSymbian::InformationL( + LoadDefaultString( KUssdDone ) ); iShowDone = EFalse; } @@ -1026,14 +1060,16 @@ return; } + // Show specific error message CTextResolver* textResolver = CTextResolver::NewLC(); - HBufC* buffer = textResolver->ResolveErrorString( aError ).AllocLC(); - CAknGlobalNote* note = CAknGlobalNote::NewLC(); - note->ShowNoteL( EAknGlobalErrorNote, *buffer ); + CHbDeviceMessageBoxSymbian::InformationL( buffer ->Des() ); - CleanupStack::PopAndDestroy( 3 ); // note, buffer, textResolver + CleanupStack::PopAndDestroy( buffer ); + CleanupStack::PopAndDestroy( textResolver ); + + _DPRINT( 4, "PhSrv.ShowErrorNoteL.End" ); return; } @@ -1226,7 +1262,7 @@ if ( aError == KErrNone && IsActive() && - iGlobalMsgQuery ) + iDeviceDialog ) { Cancel(); // Terminates USSD session. @@ -1242,12 +1278,88 @@ // ----------------------------------------------------------------------------- +// CPhSrvUssdManager::MessageBoxClosed +// ----------------------------------------------------------------------------- +// +void CPhSrvUssdManager::MessageBoxClosed( + const CHbDeviceMessageBoxSymbian* aMessageBox, + CHbDeviceMessageBoxSymbian::TButtonId aButton) + { + _DPRINT( 4, "PhSrv.MsgClose.Start" ); + // ussd device dialog observer callback function + TPtrC leftBtn = aMessageBox->ButtonText( + CHbDeviceMessageBoxSymbian::EAcceptButton ); + TPtrC rightBtn = aMessageBox->ButtonText( + CHbDeviceMessageBoxSymbian::ERejectButton ); + + TInt err = KErrNone; + // Click Yes on Confirmation note (Yes, No) + if ( !leftBtn.Compare( + LoadDefaultString( KUssdYes ) ) && + ( CHbDeviceMessageBoxSymbian::EAcceptButton == aButton ) ) + { + _DPRINT( 4, "PhSrv.MsgClose.SK.Yes" ); + iClearArray = EFalse; + iNotifyArray->Reset(); + TryCloseSession(); + } + // Click "No" on Confirmation note (Yes, No) + else if ( !rightBtn.Compare( + LoadDefaultString( KUssdNo ) ) && + ( CHbDeviceMessageBoxSymbian::ERejectButton == aButton ) ) + { + _DPRINT( 4, "PhSrv.MsgClose.SK.No" ); + iClearArray = EFalse; + iNotifyMessage = ETrue; // for removing the yes/no query + CheckArray(); + TryCloseSession(); + } + // Click "Next" on Notification note (Next, Exit) + else if ( !leftBtn.Compare( + LoadDefaultString( KUssdNext ) ) && + ( CHbDeviceMessageBoxSymbian::EAcceptButton == aButton ) ) + { + _DPRINT( 4, "PhSrv.MsgClose.SK.Next" ); + CheckArray(); + TryCloseSession(); + } + // Click "Exit" on Notification note (Next, Exit or only Exit) + else if ( !rightBtn.Compare( + LoadDefaultString( KUssdExit ) ) && + ( CHbDeviceMessageBoxSymbian::ERejectButton == aButton ) ) + { + TRAP( err, ClearArrayL() ); + _DDPRINT( 4, "PhSrv.MsgClose.SK.Clear.%d", err ); + TryCloseSession(); + _DPRINT( 4, "PhSrv.MsgClose.SK.Exit" ); + } + // Click "Reply" on Message note (Reply, Exit) + else if ( !leftBtn.Compare( + LoadDefaultString( KUssdReply ) ) && + ( CHbDeviceMessageBoxSymbian::EAcceptButton == aButton ) ) + { + // Answer + iStartEditor = ETrue; + iShowDone = EFalse; + // Start the USSD editor now. + TRAP( err, RequestStartEditingL() ); + _DDPRINT( 4, "PhSrv.MsgClose.RequestStartEditingL.%d", err ); + } + else + { + _DPRINT( 4, "PhSrv.MsgClose.SK.Default" ); + } + + _DPRINT( 4, "PhSrv.MsgClose.End" ); + } + +// ----------------------------------------------------------------------------- // CPhSrvUssdManager::RunL // ----------------------------------------------------------------------------- // void CPhSrvUssdManager::RunL() { - _DPRINT( 4, "PhSrv.RunL.Start" ); // debug print + _DPRINT( 4, "PhSrv.RunL.Start" ); ProcessMoAcksL(); @@ -1261,73 +1373,7 @@ else { iStartEditor = EFalse; - - TInt key = iStatus.Int(); - if ( key == EEikBidOk ) // OK key - { - if ( NetworkWaitingForAnAnswer() ) - { - key = EAknSoftkeyShow; - } - else - { - key = EAknSoftkeyExit; - } - } - - switch( key ) - { - case EAknSoftkeyShow: - { - // Answer - iStartEditor = ETrue; - iShowDone = EFalse; - // Start the USSD editor now. - _DPRINT( 4, "PhSrv.RunL.RequestStartEditingL" ); // debug print - RequestStartEditingL(); - break; - } - case EAknSoftkeyYes: - { - _DPRINT( 4, "PhSrv.RunL.SK.Yes" ); - iClearArray = EFalse; - iNotifyArray->Reset(); - TryCloseSession(); - break; - } - case EAknSoftkeyCancel: - _DPRINT( 4, "PhSrv.RunL.SK.Cancel" ); - if ( iHavePendingSatMessagePointer ) - { - iSatCanceled = ETrue; - CompleteSatL( &iReceivedMessage, KErrCancel ); - _DPRINT( 4, "PhSrv.RunL.CompleteSatL" ); - } - // fall through. - case EAknSoftkeyExit: - _DPRINT( 4, "PhSrv.RunL.SK.Exit" ); - ClearArrayL(); - TryCloseSession(); - break; - case EAknSoftkeyBack: - _DPRINT( 4, "PhSrv.RunL.SK.Back" ); - ClearArrayL(); - TryCloseSession(); - break; - case EAknSoftkeyNo: - _DPRINT( 4, "PhSrv.RunL.SK.No" ); - iClearArray = EFalse; - iNotifyMessage = ETrue; // for removing the yes/no query - // fall through. - case EAknSoftkeyNext: - _DPRINT( 4, "PhSrv.RunL.SK.Next" ); - CheckArray(); - TryCloseSession(); - break; - default: - _DPRINT( 4, "PhSrv.RunL.SK.Default" ); - break; - } + // update device dialog _DPRINT( 4, "PhSrv.RunL.End" ); // debug print } } @@ -1340,22 +1386,54 @@ { _DPRINT( 4, "PhSrv.LGMQ.start" ); _DPRINT_FLAGS(); + if ( iNotifyMessage ) { _DDPRINT( 4, "PhSrv.LGMQ.NotifyMessage", iNotifyMessage ); iNotifyMessage = ETrue; TInt count = NotifyCount(); + //check softkey in avkon.rss if ( count > 1 ) { - iSoftkeys = R_AVKON_SOFTKEYS_NEXT_EXIT__NEXT; + // Next, Exit + iDeviceDialog->SetButton( + CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue ); + iDeviceDialog->SetButtonTextL( + CHbDeviceMessageBoxSymbian::EAcceptButton, + LoadDefaultString( KUssdNext ) ); + iDeviceDialog->SetButton( + CHbDeviceMessageBoxSymbian::ERejectButton, ETrue ); + iDeviceDialog->SetButtonTextL( + CHbDeviceMessageBoxSymbian::ERejectButton, + LoadDefaultString( KUssdExit ) ); + _DPRINT( 4, "PhSrv.LGMQ.Next&Exit" ); } else { - iSoftkeys = R_AVKON_SOFTKEYS_EXIT; + // Only Exit + iDeviceDialog->SetButton( + CHbDeviceMessageBoxSymbian::EAcceptButton, EFalse ); + iDeviceDialog->SetButton( + CHbDeviceMessageBoxSymbian::ERejectButton, ETrue ); + iDeviceDialog->SetButtonTextL( + CHbDeviceMessageBoxSymbian::ERejectButton, + LoadDefaultString( KUssdExit ) ); + _DPRINT( 4, "PhSrv.LGMQ.onlyExit" ); } if ( iClearArray ) { - iSoftkeys = R_AVKON_SOFTKEYS_YES_NO; + // Yes, No + iDeviceDialog->SetButton( + CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue ); + iDeviceDialog->SetButtonTextL( + CHbDeviceMessageBoxSymbian::EAcceptButton, + LoadDefaultString( KUssdYes ) ); + iDeviceDialog->SetButton( + CHbDeviceMessageBoxSymbian::ERejectButton, ETrue ); + iDeviceDialog->SetButtonTextL( + CHbDeviceMessageBoxSymbian::ERejectButton, + LoadDefaultString( KUssdNo ) ); + _DPRINT( 4, "PhSrv.LGMQ.Yes&No" ); } iReceivedMessage.Zero(); iReceivedMessage = (*iNotifyArray)[0]; @@ -1364,11 +1442,27 @@ _DPRINT( 4, "PhSrv.LGMQ.ShMsgQuery" ); // debug print // Launch Global MessageQuery as requested. - iGlobalMsgQuery->ShowMsgQueryL(iStatus, iReceivedMessage, iSoftkeys, - *iMeQuHeaderText, KNullDesC); - _DPRINT( 4, "PhSrv.LGMQ.SetActive" ); - SetActive(); + // Dialog not support header text, this code is only + // for testing, not final solution. + TInt receiveLength = iReceivedMessage.Length(); + _DDPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.MsgLength", receiveLength ); + + TInt titleLength = LoadDefaultString( KUssdTitle ).Length(); + _DDPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.TilteLength", titleLength ); + + TInt length = receiveLength + titleLength; + _DDPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.TotalLength", length ); + + HBufC* titleAndText = HBufC::NewLC( length ); + titleAndText->Des().Append( LoadDefaultString( KUssdTitle ) ); + titleAndText->Des().Append( iReceivedMessage ); + iDeviceDialog->SetTextL( titleAndText->Des() ); + CleanupStack::Pop( titleAndText ); + + iDeviceDialog->Close(); + iDeviceDialog->ShowL(); iShowDone = EFalse; + // Do nothing else in RunL this time. _DPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.ret" ); // debug print } @@ -1523,11 +1617,9 @@ else { iReceivedMessage.Zero(); - HBufC* unreadText = iResourceManager.ReadResourceLC( R_PHSRV_TEXT_UNREAD ); - TPtr pMessage( unreadText->Des() ); - iReceivedMessage.Append( pMessage ); + iReceivedMessage.Append( + LoadDefaultString( KUssdConfirm ) ); iNotifyArray->InsertL( 0, iReceivedMessage ); - CleanupStack::PopAndDestroy( unreadText ); iLaunchGMQ = ETrue; iNotifyMessage = ETrue; _DPRINT( 4, "PhSrv.ClearArrayL.iNotifyMessage.ETrue" ); @@ -1545,24 +1637,40 @@ // CPhSrvUssdManager::NotifyCount() // ----------------------------------------------------------------------------- // - TInt CPhSrvUssdManager:: NotifyCount() - { - return iNotifyArray->Count(); - } +TInt CPhSrvUssdManager:: NotifyCount() +{ + TInt count = iNotifyArray->Count(); + _DDPRINT( 4, "PhSrv.NotifyCount:", count ); // debug print + return count; +} - // ----------------------------------------------------------------------------- -// CPhSrvUssdManager::UpdateNotifyMessage() +// ----------------------------------------------------------------------------- +// CPhSrvUssdManager::UpdateNotifyMessageL() // ----------------------------------------------------------------------------- // - void CPhSrvUssdManager:: UpdateNotifyMessage() + void CPhSrvUssdManager:: UpdateNotifyMessageL() { - _DDPRINT( 4, "PhSrv.UpdateNotifyMessage.Start, clear: ", iClearArray ); // debug print + _DDPRINT( 4, "PhSrv.UpdateNotifyMessageL.Start, clear: ", iClearArray ); // debug print + + // Show left softkey - "Next" if (NotifyCount() > 1 && !iClearArray ) { - _DPRINT( 4, "PhSrv.UpdateNotifyMessage" ); // debug print - iGlobalMsgQuery->UpdateMsgQuery( R_AVKON_SOFTKEYS_NEXT_EXIT__NEXT ); + _DPRINT( 4, "PhSrv.UpdateNotifyMessageL" ); // debug print + iDeviceDialog->SetButton( + CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue ); + iDeviceDialog->SetButtonTextL( + CHbDeviceMessageBoxSymbian::EAcceptButton, + LoadDefaultString( KUssdNext ) ); } - _DPRINT( 4, "PhSrv.UpdateNotifyMessage.End" ); // debug print + // Remove left softkey + else + { + iDeviceDialog->SetButton( + CHbDeviceMessageBoxSymbian::EAcceptButton, EFalse ); + } + iDeviceDialog->UpdateL(); + + _DPRINT( 4, "PhSrv.UpdateNotifyMessageL.End" ); // debug print } // ----------------------------------------------------------------------------- @@ -1574,11 +1682,12 @@ _DPRINT( 4, "PhSrv.DoCancel.Start" ); // debug print iTimer.Cancel(); iLaunchGMQ = EFalse; - - if ( iGlobalMsgQuery ) + if ( iDeviceDialog ) { _DPRINT( 4, "PhSrv.DoCancel" ); // debug print - iGlobalMsgQuery->CancelMsgQuery(); + iDeviceDialog->Close(); + delete iDeviceDialog; + iDeviceDialog = NULL; } _DPRINT( 4, "PhSrv.DoCancel.End" ); // debug print } @@ -1647,6 +1756,16 @@ CleanupStack::PopAndDestroy( apaCommandLine ); } CleanupStack::PopAndDestroy(); // apaLsSession + + // bring the ussd editor to foreground, only for testing + TApaTaskList tasklist( wsSession ); + TApaTask task = tasklist.FindApp( TUid::Uid( KPhSrvUssdAppUID ) ); + if ( task.Exists() ) + { + _DPRINT( 4, "PhSrv.UssdM.RequestStartEditingL.task.BringToForeground" ); + task.BringToForeground(); + } + // bring the ussd editor to foreground, only for testing } CleanupStack::PopAndDestroy(); // wsSession @@ -1685,7 +1804,7 @@ { if ( iUssdReplyTimer->IsTimerActive() ) { - // debug print + _DPRINT( 4, "PhSrv.UssdM.InfUssdAppTerminatingL.timer" ); // Read the information what is the reason @@ -1696,14 +1815,14 @@ 0, exitReasonPckg ); - // debug print + _DPRINT( 4, "PhSrv.UssdM.InfUssdAppTerminatingL.timer2" ); // If reason was the completion of send operation, the USSD // session is not canceled, otherwise it is canceled. if ( exitReason != EPhCltSendCompleted ) { - // debug print + _DPRINT( 4, "PhSrv.UssdM.InfUssdAppTerminatingL.SendRelease" ); CloseSession(); } @@ -1771,7 +1890,7 @@ } else { - _DPRINT( 4, "PhSrv.InformStartSAT.Set" ); // debug print + _DPRINT( 4, "PhSrv.InformStartSAT.Set" ); // There was not pending SAT message iHavePendingSatMessagePointer = ETrue; @@ -1789,7 +1908,7 @@ // void CPhSrvUssdManager::InformStopSAT() { - _DPRINT( 4, "PhSrv.InformStopSAT.Start" ); // debug print + _DPRINT( 4, "PhSrv.InformStopSAT.Start" ); // Do the actions only if there is pending SAT message. if ( iHavePendingSatMessagePointer ) @@ -1802,7 +1921,7 @@ } iHavePendingSatMessagePointer = EFalse; } - _DPRINT( 4, "PhSrv.InformStopSAT.End" ); // debug print + _DPRINT( 4, "PhSrv.InformStopSAT.End" ); } // ----------------------------------------------------------------------------- @@ -1854,7 +1973,7 @@ TDesC* aReceiveString, TInt aError ) { - _DPRINT( 4, "PhSrv.CompleteSatL.Start" ); // debug print + _DPRINT( 4, "PhSrv.CompleteSatL.Start" ); if ( aReceiveString ) { if ( aReceiveString->Length() ) @@ -1863,7 +1982,7 @@ // copy the received string to client side. if ( iPendingSatMessagePointer.Int1() < aReceiveString->Length() ) { - // debug print + _DPRINT( 4, "PhSrv.CompleteSatL.recString.LengthError" ); if ( !iPendingSatMessagePointer.IsNull() ) { @@ -1887,7 +2006,7 @@ } } } - _DPRINT( 4, "PhSrv.CompleteSatL.Middle" ); // debug print + _DPRINT( 4, "PhSrv.CompleteSatL.Middle" ); if ( !iPendingSatMessagePointer.IsNull() ) { if ( aReceiveString && !iSatCanceled ) @@ -1904,7 +2023,7 @@ iHavePendingSatMessagePointer = EFalse; - _DPRINT( 4, "PhSrv.CompleteSatL.End" ); // debug print + _DPRINT( 4, "PhSrv.CompleteSatL.End" ); } @@ -1927,7 +2046,7 @@ // TInt CPhSrvUssdManager::PlayUssdTone() { - _DPRINT( 4, "PhSrv.UssdM.PlayTone.start" ); // debug print + _DPRINT( 4, "PhSrv.UssdM.PlayTone.start" ); TInt err = KErrNone; // <-- QT PHONE START--> @@ -1952,6 +2071,28 @@ { _DPRINT( 4, "PhSrv.UssdM.GetTelephonyVariantData.Start" ); TInt err = KErrNone; +// <-- QT PHONE START--> +/* + // Variation data should be unchangable during run-time, + // therefore, if once succesfully read, later reads are + // not allowed. + if ( iVariantReadOnlyValues == KPhSrvDefaultValue ) + { + CRepository* cenRepSession = NULL; + TRAP ( err , + cenRepSession = CRepository::NewL( KCRUidTelVariation ) ); + if ( err == KErrNone ) + { + err = cenRepSession->Get( KTelVariationFlags, + iVariantReadOnlyValues ); + } + delete cenRepSession; + } + + _DDPRINT( 4, "PhSrv.UssdM.variant", iVariantReadOnlyValues ); // debug print + _DPRINT( 4, "PhSrv.UssdM.GetTelephonyVariantData.End" ); + */ +// <-- QT PHONE END--> return err; } @@ -1963,7 +2104,7 @@ // void CPhSrvUssdManager::SendMoAcknowledgementL() { - _DPRINT( 4, "PhSrv.SendMoAckL.Start" ); // debug print + _DPRINT( 4, "PhSrv.SendMoAckL.Start" ); // Acknowledge MT USSD message. RMobileUssdMessaging::TMobileUssdAttributesV1 msgAttribs; @@ -1981,7 +2122,7 @@ RMobileUssdMessaging::TMobileUssdAttributesV1Pckg attribs = msgAttribs; SendHandlerL().SendUssdL( KNullDesC8() , attribs ); - _DPRINT( 4, "PhSrv.SendMoAckL.End" ); // debug print + _DPRINT( 4, "PhSrv.SendMoAckL.End" ); } // ----------------------------------------------------------------------------- @@ -1991,20 +2132,51 @@ // void CPhSrvUssdManager::TurnLightsOn() { - _DPRINT( 4, "PhSrv.TurnLightsOn Start" ); // debug print + _DPRINT( 4, "PhSrv.TurnLightsOn.Start" ); - // Change the bit on and off. SysAp will detect that + // Change the bit on and off. SysAp will detect that // the lights should be switched on for the specified time. // - RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOn); - TInt err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOff); + RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOn); + TInt err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOff); + + if ( err != KErrNone ) + { + _DDPRINT( 4,"PhSrv.TurnLightsOn.Error: ",err );// debug print + } + + _DPRINT( 4, "PhSrv.TurnLightsOn.End" ); + } - if ( err != KErrNone ) - { - _DDPRINT( 4,"PhSrv.TurnLightsOn.Error: ",err );// debug print - } +// ----------------------------------------------------------------------------- +// CPhSrvUssdManager::LoadDefaultString +// ----------------------------------------------------------------------------- +// +const TPtrC CPhSrvUssdManager::LoadDefaultString( const TDesC& aText ) + { + _DPRINT( 4, "PhSrv.LoadDefaultString.Start" ); + + if ( iTextBuffer ) + { + delete iTextBuffer; + iTextBuffer = NULL; + _DPRINT( 4, "PhSrv.LoadDefaultString.Clear" ); + } + TInt err = KErrNone; + TPtrC ptr( aText ); + if ( iTextResolver && ptr.Length() ) + { + TRAP( err, iTextBuffer = HbTextResolverSymbian::LoadL( ptr ) ); + _DDPRINT( 4, "PhSrv.LoadDefaultString.LoadL.%d", err ); + if ( iTextBuffer ) + { + ptr.Set( iTextBuffer->Des() ); + _DPRINT( 4, "PhSrv.LoadDefaultString.Set" ); + } + } + _DPRINT( 4, "PhSrv.LoadDefaultString.End" ); + return ptr; + } - _DPRINT( 4, "PhSrv.TurnLightsOn.End" ); // debug print - } // End of File diff -r e32024264ebb -r d7fc66ccd6fb phonecmdhandler/phonecmdhnlr/group/PhoneCmdHandler.mmp --- a/phonecmdhandler/phonecmdhnlr/group/PhoneCmdHandler.mmp Fri Apr 16 15:31:58 2010 +0300 +++ b/phonecmdhandler/phonecmdhnlr/group/PhoneCmdHandler.mmp Mon May 03 13:01:45 2010 +0300 @@ -27,19 +27,19 @@ SOURCEPATH ../src -SOURCE PhoneHandler.cpp -SOURCE PhoneHandlerControl.cpp -SOURCE PhoneHandlerActive.cpp -SOURCE PhoneHandlerCallBase.cpp -SOURCE PhoneHandlerAnswerCall.cpp -SOURCE PhoneHandlerEndCall.cpp -SOURCE PhoneHandlerDialCall.cpp -SOURCE PhoneHandlerVoiceDial.cpp -SOURCE PhoneHandlerRedial.cpp -SOURCE PhoneHandlerMultipartyCall.cpp -SOURCE PhoneHandlerDTMF.cpp -SOURCE PhoneHandlerResponse.cpp -SOURCE PhoneHandlerCallState.cpp +SOURCE phonehandler.cpp +SOURCE phonehandlercontrol.cpp +SOURCE phonehandleractive.cpp +SOURCE phonehandlercallbase.cpp +SOURCE phonehandleranswercall.cpp +SOURCE phonehandlerendcall.cpp +SOURCE phonehandlerdialcall.cpp +SOURCE phonehandlervoicedial.cpp +SOURCE phonehandlerredial.cpp +SOURCE phonehandlermultipartycall.cpp +SOURCE phonehandlerdtmf.cpp +SOURCE phonehandlerresponse.cpp +SOURCE phonehandlercallstate.cpp USERINCLUDE ../inc diff -r e32024264ebb -r d7fc66ccd6fb phonecmdhandler/phonecmdhnlr/group/bld.inf --- a/phonecmdhandler/phonecmdhnlr/group/bld.inf Fri Apr 16 15:31:58 2010 +0300 +++ b/phonecmdhandler/phonecmdhnlr/group/bld.inf Mon May 03 13:01:45 2010 +0300 @@ -26,7 +26,7 @@ ../rom/phonecmdhandler.iby CORE_MW_LAYER_IBY_EXPORT_PATH(phonecmdhandler.iby) PRJ_MMPFILES -PhoneCmdHandler.mmp +phonecmdhandler.mmp // End of File diff -r e32024264ebb -r d7fc66ccd6fb phonecmdhandler/phonecmdhnlr/inc/PhoneHandlerControl.h --- a/phonecmdhandler/phonecmdhnlr/inc/PhoneHandlerControl.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phonecmdhandler/phonecmdhnlr/inc/PhoneHandlerControl.h Mon May 03 13:01:45 2010 +0300 @@ -21,8 +21,8 @@ // INCLUDES #include "phonehandlerservice.h" -#include -#include +#include +#include #include #include #include diff -r e32024264ebb -r d7fc66ccd6fb phonesrv.pro --- a/phonesrv.pro Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv.pro Mon May 03 13:01:45 2010 +0300 @@ -24,7 +24,7 @@ SUBDIRS += telutils/dialpad SUBDIRS += vmbx/vmbxcpplugin SUBDIRS += vmbx/vmbxengine -SUBDIRS += cellular/SSSettings/xqbindings/sssettingswrapper +SUBDIRS += cellular/sssettings/xqbindings/sssettingswrapper SUBDIRS += cellular/telephonysettings/xqbindings/psetwrapper #SUBDIRS += cbs/cbsui SUBDIRS += satui/satapp diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/call_information_api/tsrc/run_auto_tests.bat --- a/phonesrv_plat/call_information_api/tsrc/run_auto_tests.bat Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/call_information_api/tsrc/run_auto_tests.bat Mon May 03 13:01:45 2010 +0300 @@ -54,7 +54,7 @@ set INSTRUMENT=TRUE set REMOVEINSTRUMENT=TRUE set DOMODULESTESTS=TRUE -set ABLD_CALL=abld test build winscw udeb -keepgoing +set SBS_CALL=sbs --config winscw_udeb.test --keepgoing BUILD set PATH_TO_DLL=\epoc32\release\winscw\udeb set PATH_TO_MOVE_DLL=\epoc32\release\winscw\udeb\z\sys\bin set PATH_TO_COVERAGE_DATA=\coverage_data @@ -145,12 +145,11 @@ pushd . call cd %1\group -call bldmake bldfiles -call abld test clean winscw udeb +call sbs --config winscw_udeb.test --keepgoing CLEAN if [%INSTRUMENT%] EQU [TRUE] ( -call ctcwrap -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" %ABLD_CALL% +call ctcwrap -2comp -n %PATH_TO_COVERAGE_DATA%\%1 -i d -C "EXCLUDE=*" -C "NO_EXCLUDE=%TESTED_SRC%" "%SBS_CALL%" ) else ( -call %ABLD_CALL% +call %SBS_CALL% ) popd diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/network_handling_engine_api/inc/CNWSession.h --- a/phonesrv_plat/network_handling_engine_api/inc/CNWSession.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/network_handling_engine_api/inc/CNWSession.h Mon May 03 13:01:45 2010 +0300 @@ -20,7 +20,7 @@ #define CNWSESSION_H // INCLUDES -#include "NWHandlingEngine.h" +#include "nwhandlingengine.h" // CLASS DECLARATION diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/network_handling_engine_api/inc/NWHandlingEngine.h --- a/phonesrv_plat/network_handling_engine_api/inc/NWHandlingEngine.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/network_handling_engine_api/inc/NWHandlingEngine.h Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,7 +22,8 @@ // INCLUDES #include -#include +#include +#include // for RPacketService::TDynamicCapsFlags // CONSTANTS @@ -187,6 +188,8 @@ #ifdef RD_PHONE_NG TNWNetworkSelectionSetting iSelectionSetting; // Contains a network selection setting manual/automatic etc. #endif // RD_PHONE_NG + RPacketService::TDynamicCapsFlags iDynamicCapsFlags; // Dynamic packet data capabilities + // (used to hide alpha tag when CS registration is unsuccessful) }; // CLASS DECLARATION @@ -243,6 +246,9 @@ ENWMessageCurrentHomeZoneMessage, // Message will be sent when cell info display changed ENWMessageNetworkIndicatorChange, + // Message will be sent when dynamic packet data capabilities change + // (Used to hide alpha tag when CS registration is unsuccessful) + ENWMessageDynamicCapsChange, // CDMA SPECIFIC MESSAGES 200 - 299 @@ -263,7 +269,9 @@ // Fetching Network Provider Name ENWGetNetworkProviderName, // Fetching Programmable Operator Name - ENWGetProgrammableOperatorName + ENWGetProgrammableOperatorName, + // Notifying network registration status change + ENWNotifyNetworkRegistrationStatusChange }; /** diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/network_handling_engine_api/inc/NetworkHandlingProxy.h --- a/phonesrv_plat/network_handling_engine_api/inc/NetworkHandlingProxy.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/network_handling_engine_api/inc/NetworkHandlingProxy.h Mon May 03 13:01:45 2010 +0300 @@ -20,7 +20,7 @@ #define NETWORKHANDLINGPROXY_H // INCLUDES -#include "NWHandlingEngine.h" +#include "nwhandlingengine.h" // FORWARD DECLARATIONS diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/phone_client_ussd_api/tsrc/mt_ussd.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesrv_plat/phone_client_ussd_api/tsrc/mt_ussd.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the Mt_Ussd class +* +*/ + +#include +#include "mt_ussd.h" + +/*------------------------------------------------------------------------------ +This module testing project links to phoneclient.dll. +------------------------------------------------------------------------------*/ + +// ----------------------------------------------------------------------------- +// Mt_Ussd::Mt_Ussd +// Default constructor, remember to null new members here. +// ----------------------------------------------------------------------------- +// +Mt_Ussd::Mt_Ussd():mUssd(NULL) +{ + qDebug("Mt_Ussd in-out"); +} + +// ----------------------------------------------------------------------------- +// Mt_Ussd::~Mt_Ussd +// ----------------------------------------------------------------------------- +Mt_Ussd::~Mt_Ussd() +{ + qDebug("~Mt_Ussd in-out"); +} + + +// ----------------------------------------------------------------------------- +// Mt_Ussd::initTestCase +// QTestLib initialization method, called for each test case. +// ----------------------------------------------------------------------------- +void Mt_Ussd::initTestCase() +{ + qDebug("initTestCase in"); + mUssd = CPhCltUssd::NewL( EFalse ); + qDebug("initTestCase out"); +} + + +// ----------------------------------------------------------------------------- +// Mt_Ussd::cleanupTestCase +// QTestLib cleanup method, called for each test case. +// ----------------------------------------------------------------------------- +void Mt_Ussd::cleanupTestCase() +{ + qDebug("cleanupTestCase in"); + delete mUssd; + qDebug("cleanupTestCase out"); +} + +// ----------------------------------------------------------------------------- +// Mt_Ussd::testSendUssd +// ----------------------------------------------------------------------------- +void Mt_Ussd::testSendUssdUnicode() +{ + qDebug("testSendUssdUnicode in"); + + mUssd->SetDCS( KPhCltDcsUnknown ); + + _LIT( KUnicodeUSSD, "Ussd msg"); + TInt ret = mUssd->SendUssd( KUnicodeUSSD ); + qDebug("ussd str=%S, ret=%d", KUnicodeUSSD, ret); + + QVERIFY2(KErrNone == ret , "testSendUssdUnicode failed "); + qDebug("testSendUssdUnicode out"); +} + +// ----------------------------------------------------------------------------- +// Mt_Ussd::testSendUssd +// ----------------------------------------------------------------------------- +void Mt_Ussd::testSendUssd() +{ + qDebug("testSendUssd in"); + + mUssd->SetDCS( KPhCltDcsUnknown ); + _LIT8( KMsg, "*#123#" ); + TInt ret = mUssd->SendUssd( KMsg ); + qDebug("ussd str=%S, ret=%d", KMsg, ret); + + QVERIFY2(KErrNone == ret , "testSendUssd failed "); + qDebug("testSendUssd out"); +} + +// ----------------------------------------------------------------------------- +// Mt_Ussd::testSendUssd +// ----------------------------------------------------------------------------- +void Mt_Ussd::testSendUssdWithDCS() +{ + qDebug("testSendUssdWithDCS in"); + + _LIT8( KMsg, "*#123#" ); + TInt ret = mUssd->SendUssd( KMsg, KPhCltDcsUnknown ); + qDebug("ussd str=%S, ret=%d", KMsg, ret); + + QVERIFY2(KErrNone == ret , "testSendUssdWithDCS failed "); + qDebug("testSendUssdWithDCS out"); +} + +void Mt_Ussd::testSendUssdBtn() +{ + qDebug("testSendUssdBtn in"); + + _LIT8( KMsg, "*100#" ); + TInt ret = mUssd->SendUssd( KMsg, KPhCltDcsUnknown ); + qDebug("ussd str=%S, ret=%d", KMsg, ret); + + QVERIFY2(KErrNone == ret , "testSendUssdBtn failed "); + qDebug("testSendUssdBtn out"); +} + +void Mt_Ussd::testSendUssdCmcc() +{ + qDebug("testSendUssdCmcc in"); + + _LIT8( KMsg, "*188#" ); + TInt ret = mUssd->SendUssd( KMsg, KPhCltDcsUnknown ); + qDebug("ussd str=%S, ret=%d", KMsg, ret); + + QVERIFY2(KErrNone == ret , "testSendUssdCmcc failed "); + qDebug("testSendUssdCmcc out"); +} + +// ----------------------------------------------------------------------------- +// main() +// Main method implemented for directing test output to a file. +// ----------------------------------------------------------------------------- +int main(int argc, char *argv[]) + { + qDebug("main() in"); + QApplication app(argc, argv); + + qDebug("Start testing..."); + Mt_Ussd tc; + char *pass[3]; + pass[0] = argv[0]; + pass[1] = "-o"; + pass[2] = "c:\\logs\\ussd\\mt_ussdclient.txt"; + const int result = QTest::qExec(&tc, 3, pass); + qDebug("End testing..."); + + qDebug("main() out, result=%d", result); + return result; + } + +//End file diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/phone_client_ussd_api/tsrc/mt_ussd.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesrv_plat/phone_client_ussd_api/tsrc/mt_ussd.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the Mt_Ussd class +* +*/ + + +#ifndef _MT_USSD_H +#define _MT_USSD_H + +#include +#include +#include +#include +#include +#include + + +// Class forwards +class CPhCltUssd; + +/** + * Mt_Ussd module test class. + * + * Tests Mt_Ussd interface. + * See cpp file for more information. + * + * @lib phoneclient.lib + * @since S60 + */ +class Mt_Ussd : public QObject +{ + Q_OBJECT + +public: + Mt_Ussd(); + + virtual ~Mt_Ussd(); + +private slots: + + /** + * Called before the first testfunction is executed. + */ + void initTestCase(); + + /** + * Called after the last testfunction has been executed. + */ + void cleanupTestCase(); + + /** + * Test SendUssd with Unicode string + */ + void testSendUssdUnicode(); + + /** + * Test sendUssd + */ + void testSendUssd(); + + /** + * Test sendUssd with given DCS + */ + void testSendUssdWithDCS(); + + /** + * Test sendUssd by BTN string + */ + void testSendUssdBtn(); + + /** + * Test sendUssd by CMCC string + */ + void testSendUssdCmcc(); + + +private: //data + + CPhCltUssd* mUssd; +}; + +#endif // _MT_VMBXENGINE_H diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/phone_client_ussd_api/tsrc/mt_ussd.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesrv_plat/phone_client_ussd_api/tsrc/mt_ussd.pro Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,38 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . +CONFIG += hb +CONFIG += qtestlib + +symbian: { + TARGET.CAPABILITY = CAP_GENERAL_DLL +} + +symbian { + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ + /epoc32/include/mw/QtTest \ + ../inc + + LIBS += -lphoneclient.dll +} + +# Input +HEADERS += mt_ussd.h +SOURCES += mt_ussd.cpp diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/phone_client_ussd_internal_api/tsrc/mt_ussdinternal.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesrv_plat/phone_client_ussd_internal_api/tsrc/mt_ussdinternal.pro Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,38 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . +CONFIG += hb +CONFIG += qtestlib + +symbian: { + TARGET.CAPABILITY = CAP_GENERAL_DLL +} + +symbian { + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ + /epoc32/include/mw/QtTest \ + ../inc + + LIBS += -lphoneclient.dll +} + +# Input +HEADERS += mt_ussdsat.h +SOURCES += mt_ussdsat.cpp diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/phone_client_ussd_internal_api/tsrc/mt_ussdsat.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesrv_plat/phone_client_ussd_internal_api/tsrc/mt_ussdsat.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the Mt_UssdSat class +* +*/ + +#include +#include +#include "mt_ussdsat.h" + +/*------------------------------------------------------------------------------ +This module testing project links to phoneclient.dll. +------------------------------------------------------------------------------*/ + +// ----------------------------------------------------------------------------- +// Mt_UssdSat::Mt_UssdSat +// Default constructor, remember to null new members here. +// ----------------------------------------------------------------------------- +// +Mt_UssdSat::Mt_UssdSat():mUssdSat(NULL) +{ + qDebug("Mt_UssdSat in-out"); +} + +// ----------------------------------------------------------------------------- +// Mt_UssdSat::~Mt_UssdSat +// ----------------------------------------------------------------------------- +Mt_UssdSat::~Mt_UssdSat() +{ + qDebug("~Mt_UssdSat in-out"); +} + + +// ----------------------------------------------------------------------------- +// Mt_UssdSat::initTestCase +// QTestLib initialization method, called for each test case. +// ----------------------------------------------------------------------------- +void Mt_UssdSat::initTestCase() +{ + qDebug("initTestCase in"); + mUssdSat = CPhCltUssdSatClient::NewL( EFalse ); + qDebug("initTestCase out"); +} + + +// ----------------------------------------------------------------------------- +// Mt_UssdSat::cleanupTestCase +// QTestLib cleanup method, called for each test case. +// ----------------------------------------------------------------------------- +void Mt_UssdSat::cleanupTestCase() +{ + qDebug("cleanupTestCase in"); + delete mUssdSat; + qDebug("cleanupTestCase out"); +} + +// ----------------------------------------------------------------------------- +// Mt_UssdSat::testSendSatMessage +// ----------------------------------------------------------------------------- +void Mt_UssdSat::testSendSatMessage() +{ + qDebug("testSendSatMessage in"); + + _LIT( KUssdSat, "*100#"); // valid for BTN + + TBuf receiveMessage; + TBool sendCompletedFirst( EFalse ); + TUint8 receiveDcs = 0; + + TInt ret = mUssdSat->SendSatMessage( + KUssdSat, + CPhCltUssdSatClient::EPhCltDcsUnknown, + receiveMessage, + sendCompletedFirst, + receiveDcs ); + + qDebug("receive error=%d", ret); + qDebug("receive receive msg=%s", &receiveMessage); + qDebug("receive isCompleteFirst=%d", &sendCompletedFirst); + qDebug("receive receive Dcs=%d", &receiveDcs); + + QVERIFY2(KErrNone == ret , "testSendSatMessage failed "); + qDebug("testSendSatMessage out"); +} + +// ----------------------------------------------------------------------------- +// Mt_UssdSat::testSendSatMessageCancel +// ----------------------------------------------------------------------------- +void Mt_UssdSat::testSendSatMessageCancel() +{ + qDebug("testSendSatMessageCancel in"); + + mUssdSat->SendSatMessageCancel(); + + qDebug("testSendSatMessageCancel out"); +} + +// ----------------------------------------------------------------------------- +// main() +// Main method implemented for directing test output to a file. +// ----------------------------------------------------------------------------- +int main(int argc, char *argv[]) + { + qDebug("main() in"); + QApplication app(argc, argv); + + qDebug("Start testing..."); + Mt_UssdSat tc; + char *pass[3]; + pass[0] = argv[0]; + pass[1] = "-o"; + pass[2] = "c:\\logs\\mt_ussdsat.txt"; + const int result = QTest::qExec(&tc, 3, pass); + qDebug("End testing..."); + + qDebug("main() out, result=%d", result); + return result; + } + +//End file diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/phone_client_ussd_internal_api/tsrc/mt_ussdsat.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonesrv_plat/phone_client_ussd_internal_api/tsrc/mt_ussdsat.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the Mt_UssdSat class +* +*/ + + +#ifndef _MT_USSDSAT_H +#define _MT_USSDSAT_H + +#include +#include +#include +#include +#include +#include + + +// Class forwards +class CPhCltUssdSatClient; + +/** + * Mt_UssdSat module test class. + * + * Tests Mt_UssdSat interface. + * See cpp file for more information. + * + * @lib phoneclient.lib + * @since S60 + */ +class Mt_UssdSat : public QObject +{ + Q_OBJECT + +public: + Mt_UssdSat(); + + virtual ~Mt_UssdSat(); + +private slots: + + /** + * Called before the first testfunction is executed. + */ + void initTestCase(); + + /** + * Called after the last testfunction has been executed. + */ + void cleanupTestCase(); + + /** + * Test send sat message + */ + void testSendSatMessage(); + + /** + * Test cancel send sat message + */ + void testSendSatMessageCancel(); + +private: //data + + CPhCltUssdSatClient* mUssdSat; +}; + +#endif // _MT_USSDSAT_H diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/phone_settings_api/inc/psetcallbarringwrapper.h --- a/phonesrv_plat/phone_settings_api/inc/psetcallbarringwrapper.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/phone_settings_api/inc/psetcallbarringwrapper.h Mon May 03 13:01:45 2010 +0300 @@ -112,6 +112,18 @@ BarringType barringType, QString barringPassword); + /** + * Changes barring password. Maximum password length is 10. + * + * @param oldPassword Old barring password. + * @param newPassword New barring password. + * @param verifiedPassword New password verified. + */ + void changeBarringPassword( + const QString &oldPassword, + const QString &newPassword, + const QString &verifiedPassword); + signals: /** @@ -161,6 +173,14 @@ PSetCallBarringWrapper::BarringStatus barringStatus, bool plural); + /** + * This signal is emitted when barring password change request is completed. + * + * @param result 0 if request was completed successfully + * or error code defined either in gsmerror.h or exterror.h. + */ + void barringPasswordChangeRequestCompleted(int result); + private: // data /** Own. Private implementation. */ diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/phone_settings_api/inc/psetcalldivertingwrapper.h --- a/phonesrv_plat/phone_settings_api/inc/psetcalldivertingwrapper.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/phone_settings_api/inc/psetcalldivertingwrapper.h Mon May 03 13:01:45 2010 +0300 @@ -57,9 +57,8 @@ //member data //Divert condition PsCallDivertingCondition iCondition; - // (RMobileCall::TMobileService) - // RMobileCall::EServiceUnspecified if not available - int iServiceGroup; + //Divert service group + PsServiceGroup iServiceGroup; //Divert status PsCallDivertingStatus iStatus; //Diverted-to number diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/sat_client_api/group/bld.inf --- a/phonesrv_plat/sat_client_api/group/bld.inf Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/sat_client_api/group/bld.inf Mon May 03 13:01:45 2010 +0300 @@ -24,4 +24,4 @@ PRJ_EXPORTS -../inc/RSatSession.h MW_LAYER_PLATFORM_EXPORT_PATH( RSatSession.h ) +../inc/rsatsession.h MW_LAYER_PLATFORM_EXPORT_PATH( rsatsession.h ) diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/sat_client_api/tsrc/group/satclientapitest.mmp --- a/phonesrv_plat/sat_client_api/tsrc/group/satclientapitest.mmp Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/sat_client_api/tsrc/group/satclientapitest.mmp Mon May 03 13:01:45 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: Test class for SAT Client API / RSatSession.h +* Description: Test class for SAT Client API / rsatsession.h * */ diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/sat_client_api/tsrc/inc/satclientapitest.h --- a/phonesrv_plat/sat_client_api/tsrc/inc/satclientapitest.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/sat_client_api/tsrc/inc/satclientapitest.h Mon May 03 13:01:45 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: Test class for SAT Client API / RSatSession.h +* Description: Test class for SAT Client API / rsatsession.h * */ @@ -22,7 +22,7 @@ #include #include // API under testing: -#include +#include // Logging path _LIT( KSatClientAPILogPath, "\\logs\\testframework\\SATClientAPITest\\" ); @@ -31,7 +31,7 @@ /** -* Test class for SAT Client API / RSatSession.h +* Test class for SAT Client API / rsatsession.h * * @lib satclientapitest.dll * @since S60 5.0 diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/sat_client_api/tsrc/src/satclientapitest.cpp --- a/phonesrv_plat/sat_client_api/tsrc/src/satclientapitest.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/sat_client_api/tsrc/src/satclientapitest.cpp Mon May 03 13:01:45 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: Test class for SAT Client API / RSatSession.h +* Description: Test class for SAT Client API / rsatsession.h * */ diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/sat_configuration_api/group/bld.inf --- a/phonesrv_plat/sat_configuration_api/group/bld.inf Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/sat_configuration_api/group/bld.inf Mon May 03 13:01:45 2010 +0300 @@ -24,4 +24,4 @@ PRJ_EXPORTS -../inc/SATDomainPSKeys.h MW_LAYER_PLATFORM_EXPORT_PATH(SATDomainPSKeys.h) +../inc/satdomainpskeys.h MW_LAYER_PLATFORM_EXPORT_PATH(satdomainpskeys.h) diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/sat_refresh_api/group/bld.inf --- a/phonesrv_plat/sat_refresh_api/group/bld.inf Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/sat_refresh_api/group/bld.inf Mon May 03 13:01:45 2010 +0300 @@ -24,5 +24,5 @@ PRJ_EXPORTS -../inc/RSatRefresh.h MW_LAYER_PLATFORM_EXPORT_PATH(RSatRefresh.h) -../inc/MSatRefreshObserver.h MW_LAYER_PLATFORM_EXPORT_PATH(msatrefreshobserver.h) +../inc/rsatrefresh.h MW_LAYER_PLATFORM_EXPORT_PATH(rsatrefresh.h) +../inc/msatrefreshobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(msatrefreshobserver.h) diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/sat_refresh_api/inc/RSatRefresh.h --- a/phonesrv_plat/sat_refresh_api/inc/RSatRefresh.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/sat_refresh_api/inc/RSatRefresh.h Mon May 03 13:01:45 2010 +0300 @@ -23,7 +23,7 @@ // INCLUDES #include #include -#include +#include // FORWARD DECLARATIONS class RSatSession; diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/sat_refresh_api/tsrc/group/satrefreshapitest.mmp --- a/phonesrv_plat/sat_refresh_api/tsrc/group/satrefreshapitest.mmp Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/sat_refresh_api/tsrc/group/satrefreshapitest.mmp Mon May 03 13:01:45 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: Test class for SAT Refresh API / -* RSatRefresh.h, MSatRefreshObserver.h +* rsatrefresh.h, msatrefreshobserver.h * */ diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/sat_refresh_api/tsrc/inc/satrefreshapitest.h --- a/phonesrv_plat/sat_refresh_api/tsrc/inc/satrefreshapitest.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/sat_refresh_api/tsrc/inc/satrefreshapitest.h Mon May 03 13:01:45 2010 +0300 @@ -24,10 +24,10 @@ #include #include "satrefreshobserver.h" // API under testing: -#include -#include +#include +#include // This is needed for Refresh API -#include +#include // Logging path _LIT( KSatRefreshAPILogPath, "\\logs\\testframework\\SATRefreshAPITest\\" ); diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/sat_refresh_api/tsrc/inc/satrefreshobserver.h --- a/phonesrv_plat/sat_refresh_api/tsrc/inc/satrefreshobserver.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/sat_refresh_api/tsrc/inc/satrefreshobserver.h Mon May 03 13:01:45 2010 +0300 @@ -23,10 +23,10 @@ #include #include // API under testing: -#include -#include +#include +#include // This is needed for Refresh API -#include +#include /** * Refresh event observer diff -r e32024264ebb -r d7fc66ccd6fb phonesrv_plat/ss_settings_api/inc/MSSSettingsObserver.h --- a/phonesrv_plat/ss_settings_api/inc/MSSSettingsObserver.h Fri Apr 16 15:31:58 2010 +0300 +++ b/phonesrv_plat/ss_settings_api/inc/MSSSettingsObserver.h Mon May 03 13:01:45 2010 +0300 @@ -20,7 +20,7 @@ #define MSSSETTINGSOBSERVER_H // INCLUDES -#include +#include // CLASS DECLARATION diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/Commands/LaunchBrowserCmd/src/CLaunchBrowserHandler.cpp --- a/satengine/SatServer/Commands/LaunchBrowserCmd/src/CLaunchBrowserHandler.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/Commands/LaunchBrowserCmd/src/CLaunchBrowserHandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -1527,7 +1527,7 @@ TInt ipvType( KSatInvalidPdpType ); TInt length( aAddress.Length() ); - if ( &aAddress && length ) + if ( length ) { // The maximum length of a IP address is less than 39. if ( KSatMaxIPv4AddressLength >= length && diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/Commands/OpenChannelCmd/src/COpenChannelHandler.cpp --- a/satengine/SatServer/Commands/OpenChannelCmd/src/COpenChannelHandler.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/Commands/OpenChannelCmd/src/COpenChannelHandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -65,6 +65,8 @@ Cancel(); iDataChannel = NULL; + delete iConnectionInfo.iOverrideSet; + LOG( SIMPLE, "OPENCHANNEL: COpenChannelHandler::~CCloseChannelHandler exiting" ) } @@ -633,6 +635,8 @@ "OPENCHANNEL: COpenChannelHandler::SetConnectionSettingsL calling,\ aBearerType: %d", aBearerType ) + RPacketContext::TProtocolType pdpType = RPacketContext::EPdpTypeIPv4; + TUint32 defaultId( 0 ); switch ( aBearerType ) { case MSatBIPUtils::ESatGPRS: @@ -648,9 +652,8 @@ TUint32 nwId( 0 ); TBool apnCreated( EFalse ); - RPacketContext::TProtocolType pdpType = - RPacketContext::EPdpTypeIPv6; - + pdpType = RPacketContext::EPdpTypeIPv6; + if ( RSat::EIPv4Address == iOpenChannelData.iDestinationAddress.iType ) { @@ -684,10 +687,14 @@ } else { - LOG( NORMAL, "OPENCHANNEL: COpenChannelHandler::SetConnectionSettingsL \ + LOG( NORMAL, "OPENCHANNEL: SetConnectionSettingsL \ No APN, using defaults" ) // No APN, use default settings - SetOverrideSettingsL( 0 ); + TRAPD( err, defaultId = + iUtils->BipUtils().ApnHandler().FindDefaultApL( pdpType ) ); + LOG2( NORMAL, "OPENCHANNEL: SetConnectionSettingsL \ + No APN, using defaults err = %i", err ) + SetOverrideSettingsL( defaultId ); } break; } @@ -703,7 +710,11 @@ #ifdef SAT_USE_DUMMY_TSY // No APN, use default settings - SetOverrideSettingsL( 0 ); + TRAPD( err, + defaultId = iUtils->BipUtils().ApnHandler().FindDefaultApL( pdpType ) ); + LOG2( NORMAL, "OPENCHANNEL: COpenChannelHandler::SetConnectionSettingsL \ + No APN, using defaults err = %i", err ) + SetOverrideSettingsL( defaultId ); #endif // SAT_USE_DUMMY_TSY LOG( SIMPLE, @@ -721,6 +732,9 @@ "OPENCHANNEL: COpenChannelHandler::SetOverrideSettingsL aIapId: %i", aIapId ) + delete iConnectionInfo.iOverrideSet; + iConnectionInfo.iOverrideSet = NULL; + // Override connection preferences TExtendedConnPref* overrideSettings = new( ELeave ) TExtendedConnPref; overrideSettings->SetIapId( aIapId ); diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/Commands/SendSSCmd/src/CSendSsHandler.cpp --- a/satengine/SatServer/Commands/SendSSCmd/src/CSendSsHandler.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/Commands/SendSSCmd/src/CSendSsHandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -53,7 +53,7 @@ const TInt KSsOperationShowFDNLIst = 0x05; const TInt KSsOperationPasswordRegistration = 0x06; // Ss error -const TInt KSsSimAtkCcRejected = 0x0D; +const TInt KSsSimAtkCcRejected = 0x13; const TInt KTwo = 2; // ======== MEMBER FUNCTIONS ======== diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/Commands/SendSmCmd/src/CSendSmHandler.cpp --- a/satengine/SatServer/Commands/SendSmCmd/src/CSendSmHandler.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/Commands/SendSmCmd/src/CSendSmHandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -136,7 +136,9 @@ void CSendSmHandler::Event( TInt aEvent ) { LOG( SIMPLE, "SENDSM: CSendSmHandler::Event calling" ) - LOG2( SIMPLE, "SENDSM: Event %i", aEvent ) + LOG2( SIMPLE, "SENDSM: CSendSmHandler::Event iWaitingUiLaunch=%d", + iWaitingUiLaunch ) + LOG2( SIMPLE, "SENDSM: CSendSmHandler::Event IsActive=%d", IsActive() ) if ( MSatUtils::EMoSmControlExecuting == aEvent ) { LOG( NORMAL, "SENDSM: Event EMoSmControlExecuting" ) @@ -147,7 +149,9 @@ LOG( NORMAL, "SENDSM: Event EMoSmControlDone" ) iMoSmControlActive = EFalse; // Check if Sendsm is waiting. - if ( !IsActive() ) + // Completing call control should not trigger this command handler + // if it is still waiting for UI to be launched. + if ( !IsActive() && !iWaitingUiLaunch ) { LOG( SIMPLE, "SENDSM: CSendSmHandler::Event sendsm" ) // Do the Sendsm. @@ -513,6 +517,11 @@ // and sends the command then. if ( !iMoSmControlActive ) { + LOG2( SIMPLE, + "SENDSM: CSendSmHandler::HandleCommand: !iMoSmControlActive, \ + iNeedUiSession=%d", + iNeedUiSession ) + iUtils->NotifyEvent( MSatUtils::ESendSmExecuting ); if ( !iNeedUiSession ) @@ -614,6 +623,8 @@ ESatSProactiveNotificationResponse, this ) ) + LOG( SIMPLE, + "SENDSM: CSendSmHandler::HandleCommand send ui notification" ) iUtils->SatUiHandler().UiSession()->SendCommand( &iNotificationDataPckg, &iNotificationRspPckg, @@ -623,6 +634,8 @@ } else { + LOG( SIMPLE, + "SENDSM: CSendSmHandler::HandleCommand user confirmation needed" ) // Register service request handler for SendSm command, // If there is already service request for query, registering // updates command handler, so client responses comes to this @@ -634,6 +647,9 @@ iNotificationSent = EFalse; + LOG( SIMPLE, + "SENDSM: CSendSmHandler::HandleCommand send user confirmation request" ) + // Ask the user permission to send sms. Reply will come // to ClientResponse method. iUtils->SatUiHandler().UiSession()->SendCommand( diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/Commands/SendUSSDCmd/src/CSendUssdHandler.cpp --- a/satengine/SatServer/Commands/SendUSSDCmd/src/CSendUssdHandler.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/Commands/SendUSSDCmd/src/CSendUssdHandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -739,6 +739,16 @@ iSendUssdRsp.iAdditionalInfo.SetLength( 1 ); iSendUssdRsp.iAdditionalInfo[0] = RSat::KNoSpecificMeProblem; } + else if ( KErrSatBusy == aError ) + { + LOG( SIMPLE, + "SENDUSSD: CSendUssdHandler::HandleSendUssdResult \ + KInteractionWithCCTemporaryError" ) + iSendUssdRsp.iGeneralResult = RSat::KInteractionWithCCTemporaryError; + iSendUssdRsp.iInfoType = RSat::KNoAdditionalInfo; + iSendUssdRsp.iAdditionalInfo.SetLength( 0 ); + iSendUssdRsp.iAdditionalInfo.Zero(); + } else if ( KErrNone == aError ) // Success case { LOG( SIMPLE, diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/Engine/inc/CSatApnHandler.h --- a/satengine/SatServer/Engine/inc/CSatApnHandler.h Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/Engine/inc/CSatApnHandler.h Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -80,6 +80,13 @@ */ void DeleteApnL( TUint32 aApnId ); + /** + * Find the default APN Id + * @param aPdpType, indicates the address type is IPv4 or IPv6 + * @return a default iap id + */ + TUint32 FindDefaultApL( + const RPacketContext::TProtocolType& aPdpType ); private: /** diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/Engine/src/CSatApnHandler.cpp --- a/satengine/SatServer/Engine/src/CSatApnHandler.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/Engine/src/CSatApnHandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include "MSatUtils.h" #include "CSatApnHandler.h" @@ -386,4 +388,74 @@ return formatApnName; } +// ----------------------------------------------------------------------------- +// CSatApnHandler::FindDefaultApL +// ----------------------------------------------------------------------------- +// +TUint32 CSatApnHandler::FindDefaultApL( + const RPacketContext::TProtocolType& aPdpType ) + { + LOG( SIMPLE, "SATENGINE: CSatApnHandler::FindDefaultApL calling" ); + TUint32 defaultIap( 0 ); + TInt pdpType; + TBool isFound( EFalse ); + + // create a network destination + RCmDestination des; + RCmConnectionMethod cm; + + // Create CMManager Session + RCmManager cmManager; + cmManager.OpenL(); + CleanupClosePushL( cmManager ); + + // Get the Connection Method list from the open CMManager session + RArray array( KSatCMGranularity ); + CleanupClosePushL( array ); + + // list all available destinations' id + cmManager.AllDestinationsL( array ); + for( TInt i = 0; ( i < array.Count() ) && !isFound; ++i ) + { + des = cmManager.DestinationL( array[i] ); + CleanupClosePushL( des ); + + if ( CMManager::ESnapPurposeInternet == + des.MetadataL( CMManager::ESnapMetadataPurpose ) ) + { + LOG( SIMPLE, "SATENGINE: CSatApnHandler::FindDefaultApL \ + the fixed destination is identified as 'Internet'" ); + for( TInt j = 0; ( j < des.ConnectionMethodCount() ) && + !isFound; ++j ) + { + cm = des.ConnectionMethodL( j ); + CleanupClosePushL( cm ); + pdpType = cm.GetIntAttributeL( + CMManager::EPacketDataPDPType ); + LOG2( SIMPLE, "SATENGINE: CSatApnHandler::FindDefaultApL \ + current protocol type is %d", pdpType ) + if ( pdpType == aPdpType ) + { + defaultIap = cm.GetIntAttributeL( CMManager::ECmIapId ); + isFound = ETrue; + LOG2( SIMPLE, "SATENGINE: CSatApnHandler::FindDefaultApL \ + default iap had been found %d", defaultIap ) + } + CleanupStack::PopAndDestroy( &cm ); + } + } + CleanupStack::PopAndDestroy( &des ); + } + CleanupStack::PopAndDestroy( &array ); + CleanupStack::PopAndDestroy( &cmManager ); + + if ( !isFound ) + { + LOG( SIMPLE, "SATENGINE: CSatApnHandler: default AP not found" ); + User::Leave( KErrNotFound ); + } + + LOG( SIMPLE, "SATENGINE: CSatApnHandler::FindDefaultApL exit" ) + return defaultIap; + } // End of File diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/Engine/src/CSatCommandContainer.cpp --- a/satengine/SatServer/Engine/src/CSatCommandContainer.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/Engine/src/CSatCommandContainer.cpp Mon May 03 13:01:45 2010 +0300 @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include "MSatSystemState.h" #include "TSatSystemStateFactory.h" @@ -318,7 +318,10 @@ // to handle client responses. If SAT UI / Proactive command is executing // while Bluetooth SAP is enabled, SAT UI sends ClientResponse and that must // be preveted - iServiceReqs->Reset(); + if ( iServiceReqs ) + { + iServiceReqs->Reset(); + } // Close all reserved BIP Data channels if ( iBipUtils ) @@ -338,7 +341,10 @@ #ifdef SAT_USE_DUMMY_TSY // Close ATSY. This is needed when testin BT SAP in emulator - iUSatAPI->Close(); + if ( iUSatAPI ) + { + iUSatAPI->Close(); + } #endif LOG( NORMAL, diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/Engine/src/CSatCommandHandler.cpp --- a/satengine/SatServer/Engine/src/CSatCommandHandler.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/Engine/src/CSatCommandHandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -158,6 +158,12 @@ // Notify derived class that ui launch failed. UiLaunchFailed(); } + else + { + LOG( SIMPLE, + "SATENGINE: CSatCommandHandler::DoHandleCommand iWaitingUiLaunch") + iWaitingUiLaunch = ETrue; + } } else { diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/Engine/src/CSatSIconSubSession.cpp --- a/satengine/SatServer/Engine/src/CSatSIconSubSession.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/Engine/src/CSatSIconSubSession.cpp Mon May 03 13:01:45 2010 +0300 @@ -312,17 +312,11 @@ CleanupStack::PopAndDestroy( converter ); - if ( iClut ) - { delete iClut; iClut = NULL; - } - - if ( iIconData ) - { + delete iIconData; iIconData = NULL; - } iMessage.Complete( KErrNone ); LOG( SIMPLE, "SATENGINE: CSatSIconSubSession::NotifyGetClutL exiting" ) diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/Engine/src/CSatSUiSubSession.cpp --- a/satengine/SatServer/Engine/src/CSatSUiSubSession.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/Engine/src/CSatSUiSubSession.cpp Mon May 03 13:01:45 2010 +0300 @@ -19,7 +19,7 @@ // INCLUDE FILES #include -#include +#include #include "CSatSUiSubSession.h" #include "CSatSSession.h" diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/SatClient/src/CSatAllowRefreshMonitor.cpp --- a/satengine/SatServer/SatClient/src/CSatAllowRefreshMonitor.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/SatClient/src/CSatAllowRefreshMonitor.cpp Mon May 03 13:01:45 2010 +0300 @@ -20,7 +20,7 @@ // INCLUDE FILES #include "CSatAllowRefreshMonitor.h" #include "msatrefreshobserver.h" -#include "RSatRefresh.h" +#include "rsatrefresh.h" #include "SatLog.h" // ============================ MEMBER FUNCTIONS =============================== diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/SatClient/src/CSatRefreshMonitor.cpp --- a/satengine/SatServer/SatClient/src/CSatRefreshMonitor.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/SatClient/src/CSatRefreshMonitor.cpp Mon May 03 13:01:45 2010 +0300 @@ -18,8 +18,8 @@ // INCLUDE FILES -#include -#include +#include +#include #include "CSatRefreshMonitor.h" #include "SatLog.h" diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/SatClient/src/RSatRefresh.cpp --- a/satengine/SatServer/SatClient/src/RSatRefresh.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/SatClient/src/RSatRefresh.cpp Mon May 03 13:01:45 2010 +0300 @@ -18,8 +18,8 @@ // INCLUDE FILES -#include -#include +#include +#include #include "SatSOpcodes.h" #include "CSatAllowRefreshMonitor.h" #include "CSatRefreshMonitor.h" diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/SatClient/src/RSatSession.cpp --- a/satengine/SatServer/SatClient/src/RSatSession.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/SatClient/src/RSatSession.cpp Mon May 03 13:01:45 2010 +0300 @@ -16,7 +16,7 @@ */ -#include +#include #include "SatSOpcodes.h" #include "SatServerFactory.h" #include "SatLog.h" diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/SatClient/src/rsatservice.cpp --- a/satengine/SatServer/SatClient/src/rsatservice.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/SatClient/src/rsatservice.cpp Mon May 03 13:01:45 2010 +0300 @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include "tsatinternaliconinfo.h" diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/SatInternalClient/src/RSatUiSession.cpp --- a/satengine/SatServer/SatInternalClient/src/RSatUiSession.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/SatInternalClient/src/RSatUiSession.cpp Mon May 03 13:01:45 2010 +0300 @@ -19,7 +19,7 @@ // INCLUDE FILES #include -#include +#include #include #include "RSatUiSession.h" diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/SystemState/src/CSatSystemState.cpp --- a/satengine/SatServer/SystemState/src/CSatSystemState.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/SystemState/src/CSatSystemState.cpp Mon May 03 13:01:45 2010 +0300 @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include // ****************************************************************** // TODO: ScreensaverInternalPSKeys.h does no longer exist. @@ -34,7 +34,6 @@ #include #include #include -#include #include "SATInternalPSKeys.h" #include "CSatSystemState.h" diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/inc/CSatCommandHandler.h --- a/satengine/SatServer/inc/CSatCommandHandler.h Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/inc/CSatCommandHandler.h Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -183,6 +183,9 @@ // Utils interface MSatUtils* iUtils; + // Indicates that command is pending for UI to launch + TBool iWaitingUiLaunch; + private: // Data // Requiered attribute for the ECOM framework. @@ -195,8 +198,6 @@ // starting to handle pending proactive command. RTimer iDelayTimer; - // Indicates that command is pending for UI to launch - TBool iWaitingUiLaunch; }; #endif // CSATCOMMANDHANDLER_H diff -r e32024264ebb -r d7fc66ccd6fb satengine/SatServer/inc/MSatApnHandler.h --- a/satengine/SatServer/inc/MSatApnHandler.h Fri Apr 16 15:31:58 2010 +0300 +++ b/satengine/SatServer/inc/MSatApnHandler.h Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -76,6 +76,13 @@ */ virtual void DeleteApnL( TUint32 aApnId ) = 0; + /** + * Find the default APN Id + * @param aPdpType, indicates the address type is IPv4 or IPv6 + * @return a default iap id + */ + virtual TUint32 FindDefaultApL( + const RPacketContext::TProtocolType& aPdpType ) = 0; private: // Prohibit copy constructor if not deriving from CBase. diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/inc/csatuiobserver.h --- a/satui/satapp/inc/csatuiobserver.h Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/inc/csatuiobserver.h Mon May 03 13:01:45 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-20010 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -23,7 +23,8 @@ // INCLUDES #include #include -#include +#include +#include #include "satappcommonconstant.h" // CONSTANTS //256 max length-header information fields @@ -76,7 +77,7 @@ * Sets the UI. * @param aImplementer Pointer to be set. */ - void SetImplementer(MSatUiActionImplementer* aImplementer); + void SetImplementer( MSatUiActionImplementer* aImplementer ); /** * Returns the adapter provided by SatCli. @@ -90,6 +91,18 @@ */ TInt ProfileState(); + /** + * ConnectRSatSession. + * + */ + void ConnectRSatSessionL(); + + /** + * DisconnectRSatSession + * + */ + void DisconnectRSatSession(); + public: // Functions from base classes /** @@ -299,9 +312,10 @@ * @param aControl Used only for MoSm and Call Control * @return Resource id for the default text */ - TInt DefaultAlphaIdL( + void DefaultAlphaId( const TSatSNotifyCommand aCommandId, - const TSatControlResult aControlResult) const; + const TSatControlResult aControlResult, + QString &resource) const; /** * Get size for the icon in popup window. @@ -351,7 +365,6 @@ // play tone sequence TBuf8 iSequence; - //Ref: Interface to the UI-part MSatUiActionImplementer* iActionImplementer; @@ -370,12 +383,6 @@ //Own: Current Iconididentifier TInt iIconIdIdentifier; - //Own: SetupMenu and SelectItem items icon - //CAknIconArray* iItemIcons; - - //Own: Icon fetching handler - //CSatUiIconHandler* iIconHandler; - // own: used to signal that icons are supported TBool iIconSupport; diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/inc/satappcommandhandler.h --- a/satui/satapp/inc/satappcommandhandler.h Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/inc/satappcommandhandler.h Mon May 03 13:01:45 2010 +0300 @@ -175,7 +175,25 @@ //const QPixmap* /*aIconBitmapGetInput*/, const bool aSelfExplanatory, unsigned int &aDuration); - + + /** + * Notification of the SAT Call Control command. + * @param aText The text string to be displayed. + * @param aAlphaIdStatus alpha ID's status + */ + void callControl( + const QString &aText, + const TSatAlphaIdStatus aAlphaIdStatus); + + /** + * Notification of the SAT Mo Sms Control command. + * @param aText The text string to be displayed. + * @param aAlphaIdStatus alpha ID's status + */ + void moSmControl( + const QString &aText, + const TSatAlphaIdStatus aAlphaIdStatus); + /** * Shows the confirmation note about the SAT Send SMS, Send SS or * Send USSD command. @@ -230,10 +248,34 @@ bool &aActionAccepted//, //const CFbsBitmap* aIconBitmap, //const TBool aSelfExplanatory - ); + ); + + /** + * Shows the wait note about the Send Ss or Ussd command. + * @param aText The text to be displayed. + * @param aIconBitmapSendSM Sending dialog icon. + * @param aSelfExplanatoryIcon A flag indicating if only icon is shown. + */ + void showSsWaitNote( + const QString &aText, + //const CFbsBitmap* aIconBitmapSendSM, + const bool aSelfExplanatoryIcon + ); + + /** + * Shows the wait note about BIP + * @param aCommand command type. + * @param aText The text to be displayed. + */ + void showBIPWaitNote(int aCommand, const QString &aText); + private: - SatAppUiProvider &mUi; + /** + * Not own. + */ + SatAppUiProvider &mUi; + }; #endif /* SATAPPCOMMANDHANDLER_H */ diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/inc/satappcommonconstant.h --- a/satui/satapp/inc/satappcommonconstant.h Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/inc/satappcommonconstant.h Mon May 03 13:01:45 2010 +0300 @@ -28,6 +28,9 @@ const int KExtendTimeoutMseconds(3000); const int KDefaultSelectionTimeoutMseconds(60000); +const int KSymbianTimeConvertQtTime(100); +const int KMoSmControlTimeOut(3000); +const int KPlayToneSymbianConvertQtTime(1000); //enum for SendSms /**Sat send sms user response*/ @@ -70,7 +73,8 @@ ESatDialogGetYesNo, // Yes No ESatDialogGetDigitalRsp, // Cancel ESatDialogSetUpCall, // Call Cancel - ESatDialogConfirmSend // Yes No + ESatDialogConfirmSend, // Yes No + ESatDialogConfirmBip // Ok Cancel }; #endif diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/inc/satappeventprovider.h --- a/satui/satapp/inc/satappeventprovider.h Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/inc/satappeventprovider.h Mon May 03 13:01:45 2010 +0300 @@ -14,6 +14,7 @@ * Description: * */ + #ifndef SATAPPEVENTPROVIDER_H #define SATAPPEVENTPROVIDER_H @@ -22,7 +23,8 @@ #include "msatuiactionimplementer.h" class CSatUiObserver; -//class QPixmap; // For future icon support +class SatAppPlayToneProvider; + class SatAppEventProvider: public QObject, public MSatUiActionImplementer @@ -59,7 +61,6 @@ TSatUiResponse &aRes, const QString &aText, const QString &aSimApplicationName, - //const HbIcon &aIcon, bool &aRequestedIconDisplayed, const bool aSustainedText, const int aDuration, @@ -86,9 +87,8 @@ const int aMinLength, const int aMaxLength, const bool aHideInput, - //const QPixmap* /*aIconBitmapGetInput*/, const bool aSelfExplanatory, - unsigned int &aDuration ); + unsigned int &aDuration); /** * Notification of the SAT Get Inkey command. @@ -105,9 +105,8 @@ const QString &aTitleText, const TSatCharacterSet aCharacterSet, QString &aInputText, - //const QPixmap* /*aIconBitmapGetInput*/, const bool aSelfExplanatory, - unsigned int &aDuration ); + unsigned int &aDuration); /** * Notification of the SAT Get YesNo command. @@ -130,7 +129,29 @@ //const TSatIconId &aIconId, const bool &aSelfExplanatory, unsigned int &aDuration, - const bool aImmediateDigitResponse ); + const bool aImmediateDigitResponse); + + /** + * Notification of the SAT Call Control command. + * @param aRes The response. + * @param aText The heading. + * @param aAlphaIdStatus The alpha ID status. + * + */ + void callControlEvent( + const QString &aText, + const TSatAlphaIdStatus aAlphaIdStatus); + + /** + * Notification of the SAT Call Control command. + * @param aRes The response. + * @param aText The heading. + * @param aAlphaIdStatus The alpha ID status. + * + */ + void moSmControlEvent( + const QString &aText, + const TSatAlphaIdStatus aAlphaIdStatus); /** * Handles the SetUpMenu command. @@ -148,9 +169,6 @@ TSatUiResponse &aRes, const QString &aText, const QStringList &aMenuItems, - //const CArrayFixFlat* aMenuItemNextActions, - //const HbIcon &aIcon, - //const CAknIconArray* aItemIconsArray, const bool aSelfExplanatoryItems, const bool aHelpIsAvailable); @@ -172,11 +190,8 @@ TSatUiResponse &aRes, const QString &aText, const QStringList &aMenuItems, - //const CArrayFixFlat* aMenuItemNextActions, const int aDefaultItem, unsigned char &aSelection, - //const HbIcon &aIcon, - //const CAknIconArray* aItemsIconArray, const bool aSelfExplanatoryItems, const bool aHelpIsAvailable); @@ -202,9 +217,7 @@ */ void showSmsWaitNoteEvent( const QString &aText, - //const CFbsBitmap* aIconBitmapSendSM, - const bool aSelfExplanatoryIcon - ); + const bool aSelfExplanatoryIcon); /** * Shows the confirmation not about SetUpCall. @@ -215,10 +228,7 @@ void showSetUpCallConfirmEvent( const QString &aText, const QString &aSimAppName, - bool &aActionAccepted//, - //const CFbsBitmap* aIconBitmap, - //const TBool aSelfExplanatory - ); + bool &aActionAccepted); /** * Shows the wait note about the Send DTMF command. @@ -229,74 +239,26 @@ TSatUiResponse &aRes, const QString &aText); - /** - * Notification of the SAT Play Tone command. + + /** + * Shows the wait note about the Send Ss or Ussd command. * @param aText The text to be displayed. - * @param aTone The tone to be played. - * @param aDuration The duration of the tone to be played. - * @param aIconId The id of icon. - * @param aRequestedIconDisplayed Informs if icon is not used. - * @return The response of the UI to this command. - */ -// virtual TSatUiResponse PlayTone( -// const TDesC &aText, -// const TSatTone aTone, -// const TTimeIntervalMicroSeconds aDuration, -// const TSatIconId &aIconId, -// TBool &aRequestedIconDisplayed ) = 0; - - /** - * General confirmation request - * @param aCommandId ID of the quering command - * @param aAlphaIdStatus Alpha Identifier status - * @param aText The text to be displayed. - * @param aAdditionalText Additional text to be used in queries. - * @param aActionAccepted Indicates whether the command was accepted. - * @param aIconId The id of icon. - * @param aRequestedIconDisplayed Informs if icon is not used. - * @param aTerminatedByUser Informs if end key is used. + * @param aIconBitmapSendSM Sending dialog icon. + * @param aSelfExplanatoryIcon A flag indicating if only icon is shown. */ -// virtual void ConfirmCommand( -// const TSatSQueryCommand aCommandId, -// const TSatAlphaIdStatus aAlphaIdStatus, -// const TDesC &aText, -// const TDesC &aAdditionalText, -// TBool &aActionAccepted, -// const TSatIconId &aIconId, -// TBool &aRequestedIconDisplayed, -// TBool &aTerminatedByUser ) = 0; + void showSsWaitNoteEvent( + const QString &aText, + const bool aSelfExplanatoryIcon); - /** - * General notification - * @param aCommandId ID of the notifying command - * @param aAlphaIdStatus Alpha Identifier status - * @param aText Alpha Identifier - * @param aIconId The id of icon. - * @param aRequestedIconDisplayed Informs if icon is not used. - * @param aControlResult Control result of the MoSm and CallControl - * @return The response of the UI to this command. + /** + * Shows the wait note about Open Channel + * @param aText The text to be displayed. + * @param aActionAccepted Indicates whether the command was accepted. */ -// virtual TSatUiResponse Notification( -// const TSatSNotifyCommand aCommandId, -// const TSatAlphaIdStatus aAlphaIdStatus, -// const TDesC &aText, -// const TSatIconId &aIconId, -// TBool &aRequestedIconDisplayed, -// const TSatControlResult aControlResult ) = 0; + void showOpenChannelConfirmEvent( + const QString &aText, + bool &aActionAccepted); - /** - * General event notification. Used for example to tell UI that command - * has completed its execution. - * @param aEventId, identifies the event - * @param aEventStatus, status of the event, used as additional info for - * the event - * @param aError, possible error code that may affect on event handling. - * This is also used as additional info - */ -// virtual void EventNotification( -// const TSatSEvent aEventId, -// const TSatSEventStatus aEventStatus, -// const TInt aError ) = 0; /*! Removes Display Text Dialog from the screen. @@ -313,12 +275,26 @@ */ void stopShowWaitNoteEvent(); + /*! + *Show SsWaitNote without Delay + */ + void showWaitNoteWithoutDelayEvent(); + + /*! + *ShowSsErrorNoteEvent + */ + void showSsErrorNoteEvent(); + + /*! + * Show BIP related Note + */ + void showBIPNoteEvent(int aCommand, const QString &aText); public slots: /*! - *User cancel Dtmf response + *User cancel response, Send DTMF, Send Data, Receive Data */ - void userCancelDtmfResponse(); + void userCancelResponse(); public: // from MSatUiActionImplementer and impletment by QT @@ -330,7 +306,7 @@ /** * Shows the wait note without delay */ - virtual void ShowWaitNoteWithoutDelayL() {}; + virtual void ShowWaitNoteWithoutDelayL(); /** * Removes the wait note from the screen. @@ -353,8 +329,7 @@ const TDesC &aText, const MDesCArray &aMenuItems, const CArrayFixFlat* aMenuItemNextActions, - const CFbsBitmap* aIconBitmap, - //const CAknIconArray* aItemIconsArray, + const CFbsBitmap *aIconBitmap, const TBool aSelfExplanatoryItems, const TBool aHelpIsAvailable); @@ -371,17 +346,14 @@ * @param aHelpIsAvailable A flag indicating if SAT help is available. * @return Information of the operation result. */ - virtual TSatUiResponse SelectItemL( const TDesC &aText, + virtual TSatUiResponse SelectItemL(const TDesC &aText, const MDesCArray &aMenuItems, const CArrayFixFlat* aMenuItemNextActions, const TInt aDefaultItem, TUint8 &aSelection, - const CFbsBitmap* aIconBitmap, - //const CAknIconArray* aItemsIconArray, + const CFbsBitmap *aIconBitmap, const TBool aSelfExplanatoryItems, - const TBool aHelpIsAvailable ); - -public: // from MSatUiActionImplementer and impletment by Symbian + const TBool aHelpIsAvailable); /** * Returns CoeEnv. @@ -403,7 +375,7 @@ virtual TSatUiResponse DisplayTextL( const TDesC &aText, const TDesC &aSimApplicationName, - CFbsBitmap* aIconBitmapDisplayText, + CFbsBitmap *aIconBitmapDisplayText, const TBool aSelfExplanatoryIcon, const TBool aSustainedText, const TTimeIntervalSeconds aDuration, @@ -430,7 +402,7 @@ const TDesC &aText, const TSatCharacterSet aCharacterSet, TChar &aInkey, - const CFbsBitmap* /*aIconBitmap*/, + const CFbsBitmap */*aIconBitmap*/, const TBool aSelfExplanatory, TUint &aDuration, const TBool aImmediateDigitResponse); @@ -457,9 +429,9 @@ const TInt aMaxLength, const TBool aHideInput, const TBool aGetInkey, - const CFbsBitmap* aIconBitmapGetInput, + const CFbsBitmap *aIconBitmapGetInput, const TBool aSelfExplanatory, - TUint &aDuration ); + TUint &aDuration); /** @@ -472,14 +444,11 @@ * @return Information of the operation result. */ virtual TSatUiResponse PlayStandardToneL( - const TDesC &/*aText*/, - const TDesC8 &/*aSequence*/, - TTimeIntervalMicroSeconds /*aDuration*/, - const CFbsBitmap* /*aIconBitmap*/, - const TBool /*aSelfExplanatory*/ ) - { - return ESatSuccess; - }; + const TDesC &aText, + const TDesC8 &aSequence, + TTimeIntervalMicroSeconds aDuration, + const CFbsBitmap *aIconBitmap, + const TBool aSelfExplanatory); /** * Shows the confirmation note about the SAT Send SMS, Send SS or @@ -502,7 +471,7 @@ */ virtual void ShowSmsWaitNoteL( const TDesC &aText, - const CFbsBitmap* aIconBitmapSendSM, + const CFbsBitmap *aIconBitmapSendSM, const TBool aSelfExplanatoryIcon); /** @@ -512,9 +481,9 @@ * @param aSelfExplanatoryIcon A flag indicating if only icon is shown. */ virtual void ShowSsWaitNoteL( - const TDesC &/*aText*/, - const CFbsBitmap* /*aIconBitmap*/, - const TBool /*aSelfExplanatoryIcon*/ ) {}; + const TDesC &aText, + const CFbsBitmap */*aIconBitmap*/, + const TBool aSelfExplanatoryIcon); /** * Shows the confirmation note about the SAT Refresh command. @@ -535,11 +504,8 @@ * @return The response from the UI */ virtual TSatUiResponse CallControlL( - const TDesC &/*aText*/, - const TSatAlphaIdStatus /*aAlphaIdStatus*/ ) - { - return ESatSuccess; - }; + const TDesC &aText, + const TSatAlphaIdStatus aAlphaIdStatus); /** * Notification of the SAT Launch browser confirmation request @@ -551,7 +517,7 @@ virtual void ConfirmLaunchBrowserL( const TDesC &/*aText*/, TBool &/*aActionAccepted*/, - const CFbsBitmap* /*aIconBitmap*/, + const CFbsBitmap */*aIconBitmap*/, const TBool /*aSelfExplanatory*/) {}; /** @@ -562,11 +528,8 @@ * @return The response from the UI */ virtual TSatUiResponse MoSmControlL( - const TDesC &/*aText*/, - const TSatAlphaIdStatus /*aAlphaIdStatus*/ ) - { - return ESatSuccess; - }; + const TDesC &aText, + const TSatAlphaIdStatus aAlphaIdStatus); /** * Shows the wait note while DTMF are being sent. @@ -577,8 +540,8 @@ */ virtual TSatUiResponse ShowDtmfWaitNoteL( const TDesC &aText, - const CFbsBitmap* aIconBitmap, - const TBool aSelfExplanatoryIcon ); + const CFbsBitmap *aIconBitmap, + const TBool aSelfExplanatoryIcon); /** * Dispatch iWait to action implementer. @@ -589,11 +552,9 @@ /** * Get flag which is indicating if end key is pressed. * @return A Boolean flag which is indicating if end key is pressed. + * EndKey not support, Open issue */ - virtual TBool GetEndKey() - { - return EFalse; - }; + virtual TBool GetEndKey(){return EFalse;}; /** * Set a flag which is indicating if end key is pressed. @@ -617,14 +578,11 @@ * @return Information on the operation result. */ virtual TSatUiResponse PlayUserSelectedToneL( - const TDesC &/*aText*/, - TTimeIntervalMicroSeconds /*aDuration*/, - TSatTone /*aTone*/, - const CFbsBitmap* /*aIconBitmap*/, - const TBool /*aSelfExplanatory*/ ) - { - return ESatSuccess; - }; + const TDesC &aText, + TTimeIntervalMicroSeconds aDuration, + TSatTone aTone, + const CFbsBitmap *aIconBitmap, + const TBool aSelfExplanatory); /** * Confirm user permission for Open Channel. @@ -635,13 +593,10 @@ * @return Operation result */ virtual TSatUiResponse ConfirmOpenChannelL( - const TDesC &/*aText*/, - TBool &/*aActionAccepted*/, - const CFbsBitmap* /*aIconBitmapOpenChannel*/, - const TBool /*aSelfExplanatory*/ ) - { - return ESatSuccess; - }; + const TDesC &aText, + TBool &aActionAccepted, + const CFbsBitmap */*aIconBitmapOpenChannel*/, + const TBool aSelfExplanatory); /** * Shows the wait note while BIP packets are sent. @@ -651,10 +606,10 @@ * @param aSelfExplanatory A flag indicating if icon is self-explanatory */ virtual void ShowBIPNoteL( - TInt /*aCommand*/, - const TDesC &/*aText*/, - const CFbsBitmap* /*aIconBitmap*/, - const TBool /*aSelfExplanatory*/) {}; + TInt aCommand, + const TDesC &aText, + const CFbsBitmap */*aIconBitmap*/, + const TBool /*aSelfExplanatory*/); /** * Confirm user permission for SetUpCall @@ -668,7 +623,7 @@ const TDesC &aText, const TDesC &aSimAppName, TBool &aActionAccepted, - const CFbsBitmap* aIconBitmap, + const CFbsBitmap *aIconBitmap, const TBool aSelfExplanatory); /** @@ -679,10 +634,10 @@ /** * Show the Ss error note. */ - virtual void ShowSsErrorNoteL() {}; + virtual void ShowSsErrorNoteL(); /** - * Start SatUi closing process. + * Close SatUi process. */ virtual void CloseSatUI(); @@ -699,10 +654,7 @@ * @param aMenuItem The selected menu item. * @param aHelpRequested Indicates whether help was requested. */ - void menuSelection( int aMenuItem, bool aHelpRequested ); - -protected: - //Q_DISABLE_COPY( SatAppEventProvider ); + void menuSelection(int aMenuItem, bool aHelpRequested); private: // Data @@ -712,6 +664,12 @@ * own */ CSatUiObserver *mObs; + + /** + * Own, PlayTone + */ + SatAppPlayToneProvider *mPlayTone; + }; #endif diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/inc/satappgetinkeynote.h --- a/satui/satapp/inc/satappgetinkeynote.h Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/inc/satappgetinkeynote.h Mon May 03 13:01:45 2010 +0300 @@ -19,7 +19,6 @@ #ifndef SATAPPGETINKEYNOTE_H #define SATAPPGETINKEYNOTE_H -#include #include #include diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/inc/satappplaytoneprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/inc/satappplaytoneprovider.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef SATAPPPLAYTONEPROVIDER_H +#define SATAPPPLAYTONEPROVIDER_H + +#include +#include //PlayStandardTone +#include //PlayUserSelectedTone +#include +#include + + +class CMdaAudioToneUtility; +class CMdaAudioPlayerUtility; +class QTimer; +class HbMessageBox; + +class SatAppPlayToneProvider: public QObject, + public MMdaAudioToneObserver,//PlayStandardTone + public MMdaAudioPlayerCallback//PlayUserSelectedTone +{ + Q_OBJECT + +public: + + /** + * Constructor + */ + SatAppPlayToneProvider(QObject *parent = 0); + + /** + * Distructor + */ + virtual ~SatAppPlayToneProvider(); + +public: // from MSatUiActionImplementer and impletment by Symbian + + /** + * Handles Standard Tone playing. + * @param aText The text to be displayed. + * @param aFileName The name of the file corresponding to the tone. + * @param aDuration The duration of the tone to be played. + * @param aIconBitmap The tone playing note icon + * @param aSelfExplanatory Flag indicating if icon is self-explanatory. + * @return Information of the operation result. + */ + virtual TSatUiResponse PlayStandardToneL( + const TDesC &aText, + const TDesC8 &aSequence, + TTimeIntervalMicroSeconds aDuration, + const CFbsBitmap *aIconBitmap, + const TBool aSelfExplanatory ); + + /** + * Plays user selected tone. + * @param aText The text to be displayed. + * @param aDuration Play duration. + * @param aTone Tone to be played. + * @param aIconBitmap The tone playing note icon + * @param aSelfExplanatory Flag indicating if icon is self-explanatory. + * @return Information on the operation result. + */ + virtual TSatUiResponse PlayUserSelectedToneL( + const TDesC &aText, + TTimeIntervalMicroSeconds aDuration, + TSatTone aTone, + const CFbsBitmap *aIconBitmap, + const TBool aSelfExplanatory ); + + /** + * ClearScreen + */ + void clearScreen(); + + /** + * CloseSatUI + */ + void closeSatUI(); + +public:// from MMdaAudioToneObserver + + /** + * From MMdaAudioToneObserver Called by the player object when + * it has been initialised. + * @param aError Error type. + */ + void MatoPrepareComplete( TInt aError ); + + /** + * From MMdaAudioToneObserver Called by the player object when + * the playback has been terminated. + * @param aError Error type. + */ + void MatoPlayComplete( TInt aError ); + +public://from MMdaAudioPlayerCallback + /** + * Initialisation of an audio sample has completed. + * @param aError The status of the audio sample after initialisation. + * @param aDuration The duration of the audio sample. + */ + void MapcInitComplete( + TInt aError, + const TTimeIntervalMicroSeconds& /*aDuration*/ ); + + /** + * Play of an audio sample has completed. + * @param aError The status of playback. + */ + void MapcPlayComplete( TInt aError ); + +private:// for playTone + + /** + * Get settings from current profile like volume, warning tones on/off etc. + * @param aTone, optional specifies the type of needed tone if necessary + * @param aToneName, optional buffer to get a soundfile name from + * the active profile if necessary + */ + void GetProfileParamsL( TSatTone aTone = ESatToneNotSet, + TDes *aToneName = NULL ); + + /** + * showWaitNote + */ + void showWaitNote(); + +private slots: + + void stopPlayTone(); + +private: // Data + + /** + * Warning And Play Tones + */ + bool mWarningAndPlayTones; + + /** + * Play tone volume + */ + int mVolume; + + /** + * Own, Media server interface to play rtf file + */ + CMdaAudioToneUtility *mPlayer; + + /** + * Response of Play tone + */ + TSatUiResponse mPlayToneError; + + /* + * Own. PlayTone + */ + QTimer *mTimer; + + /* + * Own. PlayTone + */ + QEventLoop *mLoop; + + /* + * Own. PlayTone note + */ + HbMessageBox *mPermanentNote; + + /* + * Own. Player for user selected tones. + */ + CMdaAudioPlayerUtility *mAudioPlayer; + +}; + +#endif //SATAPPPLAYTONEPROVIDER_H diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/inc/satappuiprovider.h --- a/satui/satapp/inc/satappuiprovider.h Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/inc/satappuiprovider.h Mon May 03 13:01:45 2010 +0300 @@ -28,11 +28,11 @@ class SatAppEventProvider; // Call back from SatServer class SatAppView; // SetupMenu and SelectItem class HbMessageBox; // DisplayText +class HbDeviceMessageBox; // CallControl class SatAppGetInkeyNote; // GetInKey class HbInputDialog; // GetInKey -class HbDialog; // GetInput -class HbProgressDialog; // For wait note class QTimer; // For SMS/DTMF +class HbProgressDialog; // Here we create custom document loader to be able to use own classes in XML. class SatAppDocumentLoader : public HbDocumentLoader @@ -206,11 +206,47 @@ const QString &aText, const QString &aSimAppName, bool &aActionAccepted); + + /* + * Show Ss wait note + * @param aText The string shown in heading widget + */ + void showSsWaitNote(const QString &aText, const bool aSelfExplanatoryIcon); + + /* + * Show call control device info note, with cancel key + * @param aText The string shown in heading widget + */ + void showCallControlNote(const QString &aText); + + /* + * Show receive data and send data wait note, with cancel key + * @param aText The string shown in heading widget + */ + void showBIPWaitNote(const QString &aText); + + /* + * Show Mo sms info note, with cancel key + * @param aText The string shown in heading widget + */ + void showMoSmControlNote(const QString &aText); + /* + * Show Close Channel wait note without cancel key + * @param aText The string shown in heading widget + */ + void showCloseChannelWaitNote(const QString &aText); + + /* + * Show sat info note + * @param aText The string shown in heading widget + */ + void showSatInfoNote(const QString &aText); + signals: /* - * User cancel Dtmf response + * User cancel response, Send DTMF, Send Data, Receive Data */ - void userCancelDtmfResponse(); + void userCancelResponse(); public slots: /* @@ -245,9 +281,28 @@ void updateQueryAction(QString text); /* - * User cancel Dtmf response + * User cancel response, Send DTMF, Send Data, Receive Data */ - void cancelDtmfResponse(); + void cancelResponse(); + + /* + * Show WaitNoteWithoutDelay + */ + void showWaitNoteWithoutDelay(); + + /* + * Show SsErrorNote + */ + void showSsErrorNote(); + + /* + * Comfirm OpenChannel + * @param aText + * @param aActionAccepted + */ + void showConfirmOpenChannelQuery( + const QString &aText, + bool &aActionAccepted); private: /* @@ -322,18 +377,19 @@ HbMessageBox *mConfirmSendQuery; /* - * Own. SmsWaitNote - */ - HbProgressDialog *mSmsWaitNote; - /* - * Own. DtmfWaitNote - */ - HbProgressDialog *mDtmfWaitNote; - - /* * Own. SetUpCall Query */ HbMessageBox *mSetUpCallQuery; + + /* + * Own. CallControl Query + */ + HbDeviceMessageBox *mCallControlMsg; + + /* + * Own. Confirm Bip Query + */ + HbMessageBox *mConfirmBipQuery; /* * General user response @@ -359,6 +415,12 @@ * Own. */ QEventLoop *mLoop; + + /* + * Own. SsWaitNote + */ + HbProgressDialog *mWaitNote; + }; #endif// SATAPPUIPROVIDER_H diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/resource/qgn_menu_sat.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/resource/qgn_menu_sat.svg Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/resource/sat_text_map.xls Binary file satui/satapp/resource/sat_text_map.xls has changed diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/resource/satapp.qrc --- a/satui/satapp/resource/satapp.qrc Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/resource/satapp.qrc Mon May 03 13:01:45 2010 +0300 @@ -6,5 +6,7 @@ satapp_en.qm - + + qgn_menu_sat.svg + diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/resource/satapp_en.qm Binary file satui/satapp/resource/satapp_en.qm has changed diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/resource/satapp_en.ts --- a/satui/satapp/resource/satapp_en.ts Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/resource/satapp_en.ts Mon May 03 13:01:45 2010 +0300 @@ -1,7 +1,97 @@ - + + + + about to call + about to call + + + + + False + + + + Enter character + Enter character + + + + + False + + + + Call + Call + + + + + False + + + + Connection closed + Connection closed + + + + + False + + + + Request modified + Request modified + + + + + False + + + + Sending… + Sending… + + + + + False + + + + Request not allowed + Request not allowed + + + + + False + + + + Cancel + Cancel + + + + + False + + + + Request modified + Request modified + + + + + False + Sending Text message @@ -12,10 +102,50 @@ False - + + + SAT MESSAGE HEADER + SAT MESSAGE HEADER + + + + + False + + + + Back + Back + + + + + False + + - Enter:\n(1 digit 0-9) - Enter:\n(1 digit 0-9) + No + No + + + + + False + + + + Sending… + Sending… + + + + + False + + + + Yes + Yes @@ -32,6 +162,26 @@ False + + + Send + Send + + + + + False + + + + Not done + Not done + + + + + False + SIM Services @@ -42,5 +192,155 @@ False + + + Enter:\n(1 digit 0-9) + Enter:\n(1 digit 0-9) + + + + + False + + + + Enternumber (1 digit 0-9) + Enternumber (1 digit 0-9) + + + + + False + + + + Requesting… + Requesting… + + + + + False + + + + Open connection? + Open connection? + + + + + False + + + + Sending data + Sending data + + + + + False + + + + Allow SIM card to send message? + Allow SIM card to send message? + + + + + False + + + + Connection closed + Connection closed + + + + + False + + + + OK + OK + + + + + False + + + + Allow SIM card to send a request to the network? + Allow SIM card to send a request to the network? + + + + + False + + + + Receiving data + Receiving data + + + + + False + + + + Enter: + Enter: + + + + + False + + + + Sending DTMF + Sending DTMF + + + + + False + + + + Sending\n%U + Sending\n%U + + + + + False + + + + Processing + Processing + + + + + False + + + + Request not allowed + Request not allowed + + + + + False + diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/rom/satapp.iby --- a/satui/satapp/rom/satapp.iby Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/rom/satapp.iby Mon May 03 13:01:45 2010 +0300 @@ -24,6 +24,7 @@ file=ABI_DIR\BUILD_DIR\satapp.exe SHARED_LIB_DIR\satapp.exe data=DATAZ_\resource\apps\satapp.rsc resource\apps\satapp.rsc +data=DATAZ_\resource\apps\satapp.mif resource\apps\satapp.mif data=ZSYSTEM\install\satapp_stub.sis system\install\satapp_stub.sis data=ZPRIVATE\10003a3f\import\apps\satapp_reg.rsc private\10003a3f\import\apps\satapp_reg.rsc diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/rom/satapp.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/rom/satapp.pkg Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,47 @@ +; +; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: For packing sat application update. +; + +; Language +&EN + +; Header +#{"satapp"}, (0x101f4ce0), 10, 1, 0, TYPE=PU + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Localised Vendor name +;%{"Nokia, Qt Software"} + +; Unique Vendor name +;:"Nokia, Qt Software" + +; Dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} +(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"} + +; Executable and default resource files +"\epoc32\release\armv5\urel\satapp.exe" - "!:\sys\bin\satapp.exe" +"\epoc32\release\armv5\urel\satshellcntrl.dll" - "!:\sys\bin\satshellcntrl.dll" +"\epoc32\data\z\private\10003a3f\import\apps\satapp_reg.rsc" - "!:\private\10003a3f\import\apps\satapp_reg.rsc" +"\epoc32\data\z\resource\apps\satapp.mif" - "!:\resource\apps\satapp.mif" + diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/rom/satapp_stub.pkg --- a/satui/satapp/rom/satapp_stub.pkg Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/rom/satapp_stub.pkg Mon May 03 13:01:45 2010 +0300 @@ -30,3 +30,4 @@ ""-"z:\sys\bin\satapp.exe" ""-"z:\resource\apps\satapp.rsc" ""-"z:\private\10003a3f\import\apps\satapp_reg.rsc" +""-"z:\resource\apps\satapp.mif" diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/rom/satapp_stub.sis Binary file satui/satapp/rom/satapp_stub.sis has changed diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/satapp.pro --- a/satui/satapp/satapp.pro Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/satapp.pro Mon May 03 13:01:45 2010 +0300 @@ -20,13 +20,17 @@ TARGET = satapp DEPENDPATH += . HEADERS += $$PUBLIC_HEADERS +MOC_DIR = moc CONFIG += hb +ICON = resource/qgn_menu_sat.svg symbian: { TARGET.CAPABILITY = CAP_GENERAL_DLL TARGET.UID3=0x101f4ce0 INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ + .inc\ + MOC_DIR \ ../../inc LIBS += -lSatClient.dll \ -lSatInternalClient.dll \ @@ -35,7 +39,8 @@ -lcentralrepository.dll \ -lCenRepNotifHandler.dll \ -lCdlEngine.dll \ - -lFlogger.dll + -lFlogger.dll \ + -lprofileeng.dll HEADERS += inc/msatuiactionimplementer.h \ inc/satappcommonconstant.h \ @@ -48,7 +53,7 @@ inc/satappgetinkeynote.h \ inc/csatuiobserver.h \ inc/csatuiiconhandler.h \ - + inc/satappplaytoneprovider.h SOURCES += src/main.cpp \ src/satappmainhandler.cpp \ @@ -58,10 +63,13 @@ src/satappview.cpp \ src/satappgetinkeynote.cpp \ src/csatuiobserver.cpp \ - src/csatuiiconhandler.cpp + src/csatuiiconhandler.cpp \ + src/satappplaytoneprovider.cpp BLD_INF_RULES.prj_exports += "rom/satapp.iby CORE_MW_LAYER_IBY_EXPORT_PATH(satapp.iby)" \ - "rom/satapp_stub.sis /epoc32/data/z/system/install/satapp_stub.sis" + "rom/satapp_stub.sis /epoc32/data/z/system/install/satapp_stub.sis" \ + "resource/satapp_en.ts /epoc32/include/platform/qt/translations/satapp_en.ts" + } RESOURCES += resource/satapp.qrc diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/sis/satapp.pkg --- a/satui/satapp/sis/satapp.pkg Fri Apr 16 15:31:58 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -; -; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -; All rights reserved. -; This component and the accompanying materials are made available -; under the terms of "Eclipse Public License v1.0" -; which accompanies this distribution, and is available -; at the URL "http://www.eclipse.org/legal/epl-v10.html". -; -; Initial Contributors: -; Nokia Corporation - initial contribution. -; -; Contributors: -; -; Description: For packing sat application update. -; - -; Language -&EN - -; Header -#{"satapp"}, (0x101f4ce0), 10, 1, 0, TYPE=PU - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -; Localised Vendor name -;%{"Nokia, Qt Software"} - -; Unique Vendor name -;:"Nokia, Qt Software" - -; Dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} -(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"} - -; Executable and default resource files -"\epoc32\release\armv5\urel\satapp.exe" - "!:\sys\bin\satapp.exe" -"\epoc32\release\armv5\urel\satshellcntrl.dll" - "!:\sys\bin\satshellcntrl.dll" -"\epoc32\data\z\private\10003a3f\import\apps\satapp_reg.rsc" - "!:\private\10003a3f\import\apps\satapp_reg.rsc" - diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/src/csatuiobserver.cpp --- a/satui/satapp/src/csatuiobserver.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/src/csatuiobserver.cpp Mon May 03 13:01:45 2010 +0300 @@ -25,6 +25,7 @@ #include #include //for itemsicon #include +#include #include "csatuiobserver.h" #include "msatuiactionimplementer.h" @@ -85,24 +86,6 @@ void CSatUiObserver::ConstructL() { TFLOGSTRING("SATAPP: CSatUiObserver::ConstructL called") - - //Register to Server as subsession - //If Server is not up, this function call may take time - iSatSession.ConnectL(); - - iSat.RegisterL(iSatSession, this); - iAdapter = iSat.Adapter(); - if (!iAdapter) - { - User::Leave(KErrNotFound); - } - - // create icon handler - //iIconHandler = CSatUiIconHandler::NewL(); - - //Item icons - //iItemIcons = new (ELeave) CAknIconArray(1); - TFLOGSTRING("SATAPP: CSatUiObserver::ConstructL exit") } @@ -131,23 +114,8 @@ CSatUiObserver::~CSatUiObserver() { TFLOGSTRING("SATAPP: CSatUiObserver::~CSatUiObserver() called") - - iSat.Close(); - iSatSession.Close(); - -// if (iItemIcons) -// { -// iItemIcons->ResetAndDestroy(); -// delete iItemIcons; -// } - - // delete icon handler -// delete iIconHandler; -// iIconHandler = NULL; - iActionImplementer = NULL; iAdapter = NULL; - TFLOGSTRING("SATAPP: CSatUiObserver::~CSatUiObserver() exit") } @@ -242,19 +210,19 @@ aSustainedText, aDuration, aWaitUserToClear); ); - if (err != KErrNone) + if ( KErrNone != err ) { response = ESatFailure; aRequestedIconDisplayed = EFalse; } - if (iActionImplementer->GetEndKey()) + if ( iActionImplementer->GetEndKey() ) { response = ESatSessionTerminatedByUser; - iActionImplementer->SetEndKey(EFalse); + iActionImplementer->SetEndKey( EFalse ); } - iActionImplementer->SetCommandPending(EFalse); + iActionImplementer->SetCommandPending( EFalse ); TFLOGSTRING2("SATAPP: CSatUiObserver::DisplayText exit, return: %d", \ response) @@ -289,7 +257,7 @@ input.Fill(aInput, 1); } - if ((aCharacterSet == ESatYesNo) && (aText.Length() == 0)) + if ( ( ESatYesNo == aCharacterSet ) && (aText.Length() == 0) ) { TFLOGSTRING("SATAPP: CSatUiObserver::GetInkey return ESatFailure") return ESatFailure; @@ -343,17 +311,14 @@ aText, aCharacterSet, input, 1, 1, EFalse, ETrue, iconBitmapGetInkey, selfExplanatory, aDuration); - if (ESatSuccess == response) + if ( ESatSuccess == response && input.Length() ) { - if (input.Length()) - { - aInput = input[0]; - } + aInput = input[0]; } } ); - if (err != KErrNone) + if ( KErrNone != err ) { response = ESatFailure; } @@ -431,7 +396,7 @@ duration); ); - if (err != KErrNone) + if ( KErrNone != err ) { TFLOGSTRING2("SATAPP: CSatUiObserver::GetInput err:%d", err) response = ESatFailure; @@ -499,7 +464,6 @@ GetScalableBitmap(iconTitleBitmap, EIconSetUpMenuContext); } -// iItemIcons->ResetAndDestroy(); TInt iconCount(0); if (aMenuIcons) @@ -532,18 +496,17 @@ iconItemBitmap = FetchIcon(itemIconId, EIconSetUpMenuItems); if (!iconItemBitmap && - (aIconListQualifier == ESatSelfExplanatory)) + (ESatSelfExplanatory == aIconListQualifier)) { TFLOGSTRING("SATAPP: CSatUiObserver::SetUpMenu \ SelfExplanatory ") CleanupStack::PopAndDestroy(gulIcon); // gulIcon -// iItemIcons->ResetAndDestroy(); continueLoop = EFalse; } else { if (!iconItemBitmap && - (aIconListQualifier == ESatNotSelfExplanatory)) + (ESatNotSelfExplanatory == aIconListQualifier)) { TFLOGSTRING("SATAPP: CSatUiObserver::SetUpMenu \ not SelfExplanatory ") @@ -557,7 +520,6 @@ } gulIcon->SetBitmap(iconItemBitmap); -// iItemIcons->AppendL(gulIcon); CleanupStack::Pop(gulIcon); } } @@ -629,8 +591,6 @@ aRequestedIconDisplayed); } - //iItemIcons->ResetAndDestroy(); - TInt iconCount(0); if (aMenuIcons) @@ -642,14 +602,14 @@ //if icons are available for item list if ((aMenuItems.MdcaCount() == iconCount) && - ((aIconListQualifier == ESatSelfExplanatory) || - (aIconListQualifier == ESatNotSelfExplanatory)) && + ((ESatSelfExplanatory == aIconListQualifier) || + (ESatNotSelfExplanatory == aIconListQualifier)) && (iIconSupport)) { TFLOGSTRING( "SATAPP: CSatUiObserver::SelectItem icon available for item list") - if (aIconListQualifier == ESatSelfExplanatory) + if (ESatSelfExplanatory == aIconListQualifier) { selfExplanatoryItems = ETrue; } @@ -671,8 +631,6 @@ { TFLOGSTRING("SATAPP: CSatUiObserver::SelectItem \ SelfExplanatory ") - CleanupStack::PopAndDestroy(gulIcon); // gulIcon - //iItemIcons->ResetAndDestroy(); continueLoop = EFalse; aRequestedIconDisplayed = EFalse; } @@ -681,7 +639,7 @@ // when icon can't be received and is set to not self // explanatory, we replace it with empty icon if (!iconItemBitmap && - (aIconListQualifier == ESatNotSelfExplanatory)) + (ESatNotSelfExplanatory == aIconListQualifier)) { TFLOGSTRING("SATAPP: CSatUiObserver::SelectItem \ not SelfExplanatory ") @@ -708,7 +666,6 @@ } gulIcon->SetBitmap(iconItemBitmap); - //iItemIcons->AppendL(gulIcon); CleanupStack::Pop(gulIcon); } } @@ -721,7 +678,7 @@ /*iItemIcons,*/ selfExplanatoryItems, aHelpIsAvailable); ); - if (err != KErrNone) + if (KErrNone != err) { response = ESatFailure; aRequestedIconDisplayed = EFalse; @@ -1049,32 +1006,32 @@ { case ESatOpenChannelQuery: { - TFLOGSTRING(" Quering OpenChannel") - //TRAP(error, iActionImplementer->ConfirmOpenChannelL( - // aText, aActionAccepted, iconBitmap, selfExplanatory)); + TFLOGSTRING("Quering OpenChannel") + TRAP(error, iActionImplementer->ConfirmOpenChannelL( + aText, aActionAccepted, iconBitmap, selfExplanatory)); break; } case ESatSRefreshQuery: { - TFLOGSTRING(" Quering Refresh") + TFLOGSTRING("Quering Refresh") //TRAP(error, iActionImplementer->ConfirmRefreshL(aActionAccepted)); break; } case ESatSLaunchBrowserQuery: { - TFLOGSTRING(" Quering LaunchBrowser") + TFLOGSTRING("Quering LaunchBrowser") HBufC* textHolder = NULL; TRAP(error, if (ESatAlphaIdNull != aAlphaIdStatus) { - TFLOGSTRING(" CSatUiObserver::ConfirmCommand AlphaId \ + TFLOGSTRING("CSatUiObserver::ConfirmCommand AlphaId \ isn't null") if (ESatAlphaIdNotProvided == aAlphaIdStatus) { - TFLOGSTRING(" CSatUiObserver::ConfirmCommand \ + TFLOGSTRING("CSatUiObserver::ConfirmCommand \ AlphaId not provided") // ToDo: replace the resouce with qt. //textHolder = StringLoader::LoadLC( @@ -1083,7 +1040,7 @@ } else { - TFLOGSTRING(" CSatUiObserver::ConfirmCommand \ + TFLOGSTRING("CSatUiObserver::ConfirmCommand \ AlphaId provided") textHolder = HBufC::NewLC(aText.Length()); TPtr ptr = textHolder->Des(); @@ -1103,7 +1060,7 @@ case ESatSSendSmQuery: { - TFLOGSTRING( " Quering SendSm" ) + TFLOGSTRING( "Quering SendSm" ) TRAP( error, iActionImplementer->ConfirmSendL( aText, aActionAccepted, ESatUiConfirmSendSms ) ); break; @@ -1112,16 +1069,16 @@ case ESatSSendSsQuery: { TFLOGSTRING(" Quering SendSs") - //TRAP(error, iActionImplementer->ConfirmSendL(aText, - // aActionAccepted, ESatUiConfirmSendSs)); + TRAP(error, iActionImplementer->ConfirmSendL(aText, + aActionAccepted, ESatUiConfirmSendSs)); break; } case ESatSSendUssdQuery: { TFLOGSTRING(" Quering SendUssd") - //TRAP(error, iActionImplementer->ConfirmSendL(aText, - // aActionAccepted, ESatUiConfirmSendUssd)); + TRAP(error, iActionImplementer->ConfirmSendL(aText, + aActionAccepted, ESatUiConfirmSendUssd)); break; } @@ -1153,10 +1110,6 @@ aActionAccepted = EFalse; iActionImplementer->SetEndKey(EFalse); } - else - { - // Meaningless else - } iActionImplementer->SetCommandPending(EFalse); TFLOGSTRING("SATAPP: CSatUiObserver::ConfirmCommand exiting") @@ -1176,39 +1129,47 @@ const TSatControlResult aControlResult) { TFLOGSTRING("SATAPP: CSatUiObserver::Notification calling") + TFLOGSTRING2("SATAPP: CSatUiObserver::Notification str=%S", &aText) TSatUiResponse response = ESatSuccess; TInt error(KErrNone); aRequestedIconDisplayed = EFalse; iActionImplementer->SetCommandPending(ETrue); HBufC* textHolder = NULL; - + QString resource; // In case where command id is SendDtmf and alphaID is not provided, // DTMF string to be sent is shown in dialog along with default text. if ((ESatSSendDtmfNotify == aCommandId) && - (ESatAlphaIdNotProvided == aAlphaIdStatus)) - { + (ESatAlphaIdNotProvided == aAlphaIdStatus)) { TFLOGSTRING("SATAPP: CSatUiObserver::Notification SendDtmf") - TRAP(error, - TInt resource = DefaultAlphaIdL(aCommandId, aControlResult); - - // Todo: - // Now that resource is defined, get default text - //textHolder = StringLoader::LoadL( - // resource, aText) - ); + DefaultAlphaId(aCommandId, aControlResult,resource); + if ( resource.length()>0) + { + TFLOGSTRING("SATAPP: CSatUiObserver::Notification SendDtmf resource") + TRAP(error, textHolder = HBufC::NewL(resource.length())); + if (KErrNone == error) + { + textHolder->Des().Copy(reinterpret_cast + (resource.utf16())); + } + } } // Get default text, if alpha not provided or it is NULL else if (aText.Length() == 0 && ESatAlphaIdNotNull != aAlphaIdStatus) { TFLOGSTRING("SATAPP: CSatUiObserver::Notification alpha is null") - TRAP(error, - TInt resource = DefaultAlphaIdL(aCommandId, aControlResult); - // Todo: - // Now that resource is defined, get default text - //textHolder = StringLoader::LoadL( - // resource, iActionImplementer->CoeEnv()) - ); + DefaultAlphaId(aCommandId, aControlResult,resource); + if ( resource.length()>0) + { + TFLOGSTRING("SATAPP: CSatUiObserver::Notification alpha null resource") + TRAP( error, textHolder = HBufC::NewL(resource.length()) ); + if (KErrNone == error) + { + textHolder->Des().Copy(reinterpret_cast + (resource.utf16())); + } + } + TFLOGSTRING("SATAPP: CSatUiObserver::Notification alpha is null out") } // else use given text else @@ -1220,16 +1181,16 @@ ptr.Copy(aText); ); } - if (!textHolder) { + TFLOGSTRING("SATAPP: CSatUiObserver::Notification textHolder 0") TRAP(error, textHolder = HBufC::NewL(0)); } // No need to add textHolder into CleanupStack, since this is // not a leaving function - if ((KErrNone == error || KErrArgument == error) && textHolder) + if ((KErrNone == error) && textHolder) { TFLOGSTRING("SATAPP: CSatUiObserver::Notification none error ") CFbsBitmap* iconBitmap = NULL; @@ -1244,8 +1205,6 @@ { iconBitmap = FetchIcon(aIconId.iIdentifier, EIconNotification); - //GetScalableBitmap(iconBitmap, EIconNotification, - // aRequestedIconDisplayed); } if (ESatSelfExplanatory == aIconId.iIconQualifier) @@ -1302,9 +1261,9 @@ TFLOGSTRING(" Notifying CallControl") iActionImplementer->DispatchTimer(iWait); TRAP(error, - iActionImplementer->CallControlL( - *textHolder, aAlphaIdStatus) - ); + iActionImplementer->CallControlL( + *textHolder, aAlphaIdStatus) + ); iActionImplementer->SetCommandPending(EFalse); break; } @@ -1347,7 +1306,6 @@ iActionImplementer->ShowSmsWaitNoteL(*textHolder, iconBitmap, selfExplanatoryIcon)); } - break; } default: @@ -1379,7 +1337,6 @@ response = ESatSuccess; } - TFLOGSTRING2("SATAPP: CSatUiObserver::Notification exiting, return: %d", \ response) return response; @@ -1460,104 +1417,94 @@ } // ---------------------------------------------------------------------------- -// CSatUiObserver::DefaultAlphaIdL +// CSatUiObserver::DefaultAlphaId // (other items were commented in a header). // ---------------------------------------------------------------------------- // -TInt CSatUiObserver::DefaultAlphaIdL( +void CSatUiObserver::DefaultAlphaId( const TSatSNotifyCommand aCommandId, - const TSatControlResult aControlResult) const + const TSatControlResult aControlResult, QString &resource) const { - TFLOGSTRING("SATAPP: CSatUiObserver::DefaultAlphaIdL calling") - TInt resource(0); - + TFLOGSTRING("SATAPP: CSatUiObserver::DefaultAlphaId calling") switch (aCommandId) { case ESatSSendDataNotify: // SendData { - TFLOGSTRING(" SendData default") - //resource = R_QTN_SAT_CONF_SEND_DATA_BIP; + TFLOGSTRING("SendData default") + resource = hbTrId("txt_sat_conf_send_data_bip"); break; } - case ESatSReceiveDataNotify: // ReceiveData { - TFLOGSTRING(" ReceiveData default") - //resource = R_QTN_SAT_CONF_RECEIVE_DATA_BIP; + TFLOGSTRING("ReceiveData default") + resource = hbTrId("txt_sat_conf_receive_data_bip"); break; } - case ESatSCloseChannelNotify: // CloseChannel { - TFLOGSTRING(" CloseChannel default") - //resource = R_QTN_SAT_CONF_CLOSE_CHANNEL_BIP; + TFLOGSTRING("CloseChannel default") + resource = hbTrId("txt_sat_conf_close_channel_bip"); break; } - case ESatSMoSmControlNotify: // MoSmControl { if (ESatNotAllowed == aControlResult) { TFLOGSTRING(" MoSmcontrol Not allowed default") - //resource = R_QTN_SAT_MOSM_NOT_ALLOWED; + resource = hbTrId("txt_sat_mosm_not_allowed"); } else if (ESatAllowedWithModifications == aControlResult) { TFLOGSTRING(" MoSmcontrol Modified default") - //resource = R_QTN_SAT_MOSM_MODIFIED; + resource = hbTrId("txt_sat_request_modified"); } else { TFLOGSTRING(" MoSmcontrol No default") - resource = 0; // Allowed, default alpha -> no info + resource = hbTrId(""); // Allowed, default alpha -> no info } break; } - case ESatSCallControlNotify: // CallControl { if (ESatNotAllowed == aControlResult) { - TFLOGSTRING(" CallControl Not allowed default") - //resource = R_QTN_SAT_CC_NOT_ALLOWED; + TFLOGSTRING("CallControl Not allowed default") + resource = hbTrId("txt_sat_cc_not_allowed"); } else if (ESatAllowedWithModifications == aControlResult) { - TFLOGSTRING(" CallControl Modified default") - //resource = R_QTN_SAT_CC_MODIFIED; + TFLOGSTRING("CallControl Modified default") + resource = hbTrId("txt_sat_cc_modified"); } else { - TFLOGSTRING(" CallControl No default") - resource = 0; // Allowed, default alpha -> no info + TFLOGSTRING("CallControl No default") + resource = hbTrId(""); // Allowed, default alpha -> no info } break; } - case ESatSSendSmsNotify: // SendSm { TFLOGSTRING(" SendSms default") - //resource = R_QTN_SAT_SENDING_SMS; + resource = hbTrId("txt_sat_sending_sms"); break; } case ESatSSendDtmfNotify: // SendDtmf { TFLOGSTRING(" SendDTMF default") - //resource = R_QTN_SAT_NOTE_SENDING_DTMF_TEMPLATE; + resource = hbTrId("txt_sat_note_sending_dtmf_template"); break; } - default: { TFLOGSTRING2(" Unknown command id: %i", aCommandId) - User::Leave(KErrArgument); + break; } } - TFLOGSTRING2("SATAPP: CSatUiObserver::DefaultAlphaIdL exiting, resource: \ - %d", resource) - return resource; + TFLOGSTRING("SATAPP: CSatUiObserver::DefaultAlphaId exiting") } // ---------------------------------------------------------------------------- @@ -1572,30 +1519,6 @@ TFLOGSTRING("SATAPP: CSatUiObserver::FetchIcon called") CFbsBitmap* iconBitmap = NULL; -/* - TSize layoutSize(0, 0); - - // Set icon max size according the command - if (GetPopUpWindowIconSize(layoutSize, aIconCommand)) - { - TFLOGSTRING("SATAPP: CSatUiObserver::FetchIcon max size") - // Comment out icon related code, add qt icon support future - TRAPD(err, iconBitmap = iIconHandler->FetchIconL(iSatSession, - aIconId, layoutSize.iWidth, layoutSize.iHeight, iIconSupport)); - - if (err != KErrNone) - { - #if defined _DEBUG - _LIT(KFetchIcon, "SATAPP: CSatUiObserver::FetchIcon"); - User::Panic(KFetchIcon, err); - #endif - } - } - else - { - TFLOGSTRING("SATAPP: CSatUiObserver::FetchIcon not supported") - } -*/ TFLOGSTRING("SATAPP: CSatUiObserver::FetchIcon exit") return iconBitmap; } @@ -1606,82 +1529,11 @@ // (other items were commented in a header). // ---------------------------------------------------------------------------- // -TBool CSatUiObserver::GetPopUpWindowIconSize(TSize& aSize, +TBool CSatUiObserver::GetPopUpWindowIconSize(TSize& /*aSize*/, const TIconCommand /*aIconCommand*/) { TFLOGSTRING("SATAPP: CSatUiObserver::GetPopUpWindowIconSize called") - - TRect rect(TSize(0, 0)); - TBool supported(ETrue); - // Comment out this code for no icon support in current qt satapp -/* TAknLayoutRect opLogoLayout; - - TFLOGSTRING2("SATAPP: CSatUiObserver::GetPopUpWindowIconSize, \ - aIconCommand: %i", aIconCommand) - // depending on the command, get correct layout and - // Calculate rectangle based on LAF specification. - switch (aIconCommand) - { - case EIconSetUpMenuContext: - { - opLogoLayout.LayoutRect(rect, - AknLayoutScalable_Avkon::context_pane_g1().LayoutLine()); - break; - } - case EIconSetUpMenuItems: - { - opLogoLayout.LayoutRect(rect, - AknLayout::List_pane_elements__single_graphic__Line_1()); - break; - } - case EIconDisplayText: - { - // layout borrowed from video - opLogoLayout.LayoutRect(rect, AknLayoutScalable_Avkon:: - popup_query_sat_info_window(0).LayoutLine()); - break; - } - case EIconPlayTone: - { - opLogoLayout.LayoutRect(rect, AknLayoutScalable_Avkon:: - popup_note_window_g1(0).LayoutLine()); - break; - } - case EIconConfirmCommand: // fall through - case EIconGetInput: // fall through - case EIconGetYesNo: // fall through - case EIconGetInkey: - { - opLogoLayout.LayoutRect(rect, AknLayout::Icon(0)); - break; - } - case EIconNotification: - { - opLogoLayout.LayoutRect(rect, AknLayout:: - Wait_or_progress_note_pop_up_window_elements_Line_1()); - break; - } - default: - { - TFLOGSTRING( - "SATAPP: CSatUiObserver::GetPopUpWindowIconSize not supported") - supported = EFalse; - break; - } - } - - aSize = opLogoLayout.Rect().Size(); - - // Layout for title icon gives incorrect width - // but since it is square height can be set to width - if (EIconSetUpMenuContext == aIconCommand) - { - aSize.iWidth = aSize.iHeight; - } -*/ - TFLOGSTRING3("SATAPP: CSatUiObserver::GetPopUpWindowIconSize %dx%d exit", - aSize.iWidth, aSize.iHeight) - return supported; + return ETrue; } // ---------------------------------------------------------------------------- @@ -1695,77 +1547,6 @@ const TIconCommand /*aIconCommand*/) { TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap called") -/* - TSize layoutSize(0, 0); - CFbsBitmap* bitmap = NULL; - - // If scalable icon is supported in current layout then - // makes the scalable icon. - if (GetPopUpWindowIconSize(layoutSize, aIconCommand)) - { - bitmap = new (ELeave) CFbsBitmap; - CleanupStack::PushL(bitmap); - // CAknIcon takes ownership of bitmaps. - CFbsBitmap* dupMain = new (ELeave) CFbsBitmap; - CleanupStack::PushL(dupMain); - TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap duplicate original") - User::LeaveIfError( - dupMain->Duplicate(aBitMapToConvert->Handle())); - - //CAknIcon* bitmapIcon = CAknIcon::NewL(); - // Mask is not set because skins are not used. - // Ownership is transferred. - bitmapIcon->SetBitmap(dupMain); - CleanupStack::Pop(dupMain); - CleanupStack::PushL(bitmapIcon); - CAknIcon* scalableIcon = AknIconUtils::CreateIconL(bitmapIcon); - CleanupStack::Pop(bitmapIcon); - CleanupStack::PushL(scalableIcon); - - // fetch the size of icon - TSize iconSize = dupMain->SizeInPixels(); - - // At first we assume that width is scaled to layout maximum and - // thus height is set so that the ratio of the image remains correct - - TInt newHeight = - (layoutSize.iWidth * iconSize.iHeight) / iconSize.iWidth; - - // If the new height is larger than the height of the layout - // we scale height to maximum and set the width so that the ratio of - // the image remains correct - if (newHeight > layoutSize.iHeight) - { - TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap \ - larger than layout height") - layoutSize.iWidth = - (layoutSize.iHeight * iconSize.iWidth) / iconSize.iHeight; - } - // If the new height is smaller or the same as the height of the - // layout, the image is scaled according to it - else - { - TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap \ - smaller than layout height") - layoutSize.iHeight = newHeight; - } - - TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap resize scaled icon") - AknIconUtils::SetSize(scalableIcon->Bitmap(), layoutSize); - - TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap duplicate scaled") - User::LeaveIfError(bitmap->Duplicate( - scalableIcon->Bitmap()->Handle())); - - CleanupStack::PopAndDestroy(scalableIcon); - - // Uses scaled icon if scalable bitmap is supported. - TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap Show Scaled") - delete aBitMapToConvert; - aBitMapToConvert = bitmap; - CleanupStack::Pop(bitmap); - } -*/ TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap exit") } @@ -1781,37 +1562,6 @@ TBool& /*aRequestedIconDisplayed*/) { TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap called") -/* - if (aBitMapToConvert) - { - TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap bitmap \ - to convert") - // Scale icon - TRAPD(err, GetScalableBitmapL(aBitMapToConvert, aIconCommand);); - - if (KErrNoMemory == err) - { - TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap memory \ - low") - // Memory low, command is done without icon - delete aBitMapToConvert; - aBitMapToConvert = NULL; - aRequestedIconDisplayed = EFalse; - } - else - { - TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap have \ - memory") - aRequestedIconDisplayed = ETrue; - } - } - else - { - TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap no bitmap") - // Icon not received - aRequestedIconDisplayed = EFalse; - } -*/ TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap exit") } @@ -1826,24 +1576,6 @@ const TIconCommand /*aIconCommand*/) { TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap called") -/* - if (aBitMapToConvert) - { - TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap bitmap \ - to convert") - // Scale icon - TRAPD(err, GetScalableBitmapL(aBitMapToConvert, aIconCommand);); - - if (KErrNoMemory == err) - { - TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap memory \ - low") - // Memory low, command is done without icon - delete aBitMapToConvert; - aBitMapToConvert = NULL; - } - } -*/ TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap exit") } @@ -1878,4 +1610,39 @@ return profileId; } +// ---------------------------------------------------------------------------- +// CSatUiObserver::ConnectRSatSessionL +// +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void CSatUiObserver::ConnectRSatSessionL() + { + TFLOGSTRING("SATAPP: CSatUiObserver::ConnectRSatSessionL called") + //Register to Server as subsession + //If Server is not up, this function call may take time + iSatSession.ConnectL(); + iSat.RegisterL(iSatSession, this); + iAdapter = iSat.Adapter(); + if (!iAdapter) + { + User::Leave(KErrNotFound); + } + TFLOGSTRING("SATAPP: CSatUiObserver::ConnectRSatSessionL exit") + } + +// ---------------------------------------------------------------------------- +// CSatUiObserver::DisconnectRSatSession +// Get the profile status +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void CSatUiObserver::DisconnectRSatSession() + { + TFLOGSTRING("SATAPP: CSatUiObserver::DisconnectRSatSession called") + iSat.Close(); + iSatSession.Close(); + TFLOGSTRING("SATAPP: CSatUiObserver::DisconnectRSatSession exit") + } + // End of File diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/src/main.cpp --- a/satui/satapp/src/main.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/src/main.cpp Mon May 03 13:01:45 2010 +0300 @@ -17,12 +17,11 @@ */ #include - +#include #include #include -#include + #include "satappmainhandler.h" - #include "tflogger.h" int main(int argc, char *argv[]) @@ -39,12 +38,6 @@ HbMainWindow window; TFLOGSTRING("SATAPP: main window created") - - // the code is only for test, currently, dphone79 only support - // lanscape, remove it before official release - #ifndef __WINSCW - //window.setOrientation(Qt::Horizontal); - #endif SatAppMainHandler *mainHandler = new SatAppMainHandler(window); diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/src/satappcommandhandler.cpp --- a/satui/satapp/src/satappcommandhandler.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/src/satappcommandhandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -107,7 +107,7 @@ if (!aSimApplicationName.isEmpty()) { heading.append(aSimApplicationName); } else { - heading.append(QObject::tr("SAT MESSAGE HEADER")); + heading.append(hbTrId("txt_sat_application_name")); } // set time @@ -190,11 +190,11 @@ if (aTitleText.isEmpty()) { if (ESatDigitOnly == aCharacterSet) { TFLOGSTRING("SATAPP:SatAppCommandHandler::getInkey: ESatDigitOnly") - heading = tr("Enternumber (1 digit 0-9) "); + heading = hbTrId("txt_sat_getinkey_nbr"); } else { // ESatCharSmsDefaultAlphabet or ESatCharUcs2Alphabet TFLOGSTRING("SatAppCommandHandler::getInkey others") - heading = tr("Enter character "); + heading = hbTrId("txt_sat_getinkey_char"); } } else { heading = aTitleText; @@ -205,7 +205,7 @@ rsp = mUi.showGetInkeyQuery(heading, aInputText, aCharacterSet, aDuration); if (aDuration) { - aDuration = time.elapsed() / 100; + aDuration = time.elapsed() / KSymbianTimeConvertQtTime; TFLOGSTRING2("SATAPP: SatAppCommandHandler::getInkey\ return for server aDuration: %d", aDuration) } @@ -309,12 +309,12 @@ if (aTitleText.isEmpty()) { if (ESatDigitOnly == aCharacterSet) { TFLOGSTRING("SATAPP::getInput ESatDigitOnly") - heading = tr("Enter:\n(1 digit 0-9)"); + heading = hbTrId("txt_sat_getinput_nbr"); } else { // ESatCharSmsDefaultAlphabet or ESatCharUcs2Alphabet TFLOGSTRING("SatAppCommandHandler::getInput ESatCharSmsDefaultAlphabet \ or ESatCharUcs2Alphabet") - heading = tr("Enter:"); + heading = hbTrId("txt_sat_getinput_char"); } } else { heading.append(aTitleText); @@ -365,6 +365,42 @@ } // ---------------------------------------------------------------------------- +// SatAppCommandHandler::callControl +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void SatAppCommandHandler::callControl( + const QString &aText, + const TSatAlphaIdStatus /*aAlphaIdStatus*/) +{ + TFLOGSTRING("SATAPP: SatAppCommandHandler::showCallControlNote call") + //if (ESatAlphaIdNotNull == aAlphaIdStatus) { + //TODO The note will be disabled by the phone UI when the call is + // in connecting status. But call control case is an exception, So we + // use RAknKeyLock to enable soft notifications. + mUi.showCallControlNote(aText); + TFLOGSTRING("SATAPP: SatAppCommandHandler::showCallControlNote exit") +} + +// ---------------------------------------------------------------------------- +// SatAppCommandHandler::moSmControl +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void SatAppCommandHandler::moSmControl( + const QString &aText, + const TSatAlphaIdStatus aAlphaIdStatus) +{ + TFLOGSTRING("SATAPP: SatAppCommandHandler::moSmControl call") + if (ESatAlphaIdNotNull == aAlphaIdStatus) { + mUi.showMoSmControlNote(aText); + } else { + mUi.showSatInfoNote(aText); + } + TFLOGSTRING("SATAPP: SatAppCommandHandler::moSmControl exit") +} + +// ---------------------------------------------------------------------------- // SatAppCommandHandler::confirmSend // (other items were commented in a header). // ---------------------------------------------------------------------------- @@ -381,12 +417,16 @@ switch (aType) { case ESatUiConfirmSendSms: { - title.append(tr("Allow SIM card to send message?")); + title.append(hbTrId("txt_sat_sim_notification_sendsms")); + TFLOGSTRING( "SATAPP: SatAppCommandHandler::confirmSend sms" ) + } break; - } case ESatUiConfirmSendSs: case ESatUiConfirmSendUssd: //the same string for SS and USSD - //title.append(tr("xxxxx")); + { + title.append(hbTrId("txt_sat_sim_notification_sendss_ussd")); + TFLOGSTRING( "SATAPP: SatAppCommandHandler::confirmSend ussd or ss" ) + } break; default: aRes = ESatFailure; @@ -454,9 +494,47 @@ //const TBool aSelfExplanatory ) { - TFLOGSTRING("SatAppCommandHandler::showSetUpCallConfirm") + TFLOGSTRING("SATAPP: SatAppCommandHandler::showSetUpCallConfirm call") mUi.showConfirmSetUpCallQuery(aText, aSimAppName, aActionAccepted); - TFLOGSTRING("SatAppCommandHandler::showSetUpCallConfirm exit") + TFLOGSTRING("SATAPP: SatAppCommandHandler::showSetUpCallConfirm exit") +} + +// ---------------------------------------------------------------------------- +// SatAppCommandHandler::showSsWaitNote +// (other items were commented in a header). +// Displays a wait note to indicate SS sending. +// ---------------------------------------------------------------------------- +// +void SatAppCommandHandler::showSsWaitNote( + const QString &aText, + //const CFbsBitmap* aIconBitmapSendSM, + const bool aSelfExplanatoryIcon) +{ + TFLOGSTRING("SATAPP: SatAppCommandHandler::showSsWaitNote call") + mUi.showSsWaitNote(aText, aSelfExplanatoryIcon); + TFLOGSTRING("SATAPP: SatAppCommandHandler::showSsWaitNote exit") } +// ---------------------------------------------------------------------------- +// SatAppCommandHandler::showBIPWaitNote +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void SatAppCommandHandler::showBIPWaitNote(int aCommand, const QString &aText) +{ + TFLOGSTRING("SATAPP: SatAppCommandHandler::showBIPWaitNote call") + QString title = aText; + if (ECloseChannelIdentifier == aCommand ){ + if (aText.isEmpty()){ + title= hbTrId("txt_sat_closechannel_wait_note"); + } + // No cancel key support, close channel + mUi.showCloseChannelWaitNote(title); + } else { + // Cancel key support, Send Data, Receive Data + mUi.showBIPWaitNote(title); + } + + TFLOGSTRING("SATAPP: SatAppCommandHandler::showBIPWaitNote exit") +} //End of file diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/src/satappeventprovider.cpp --- a/satui/satapp/src/satappeventprovider.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/src/satappeventprovider.cpp Mon May 03 13:01:45 2010 +0300 @@ -17,7 +17,9 @@ #include #include + #include "satappeventprovider.h" +#include "satappplaytoneprovider.h" #include "csatuiobserver.h" #include "tflogger.h" @@ -27,33 +29,44 @@ // ---------------------------------------------------------------------------- // SatAppEventProvider::SatAppEventProvider(QObject *parent) : - QObject(parent), mObs(NULL) + QObject(parent), mObs(NULL), mPlayTone(NULL) { TFLOGSTRING("SATAPP: SatAppEventProvider::SatAppEventProvider call") - TRAPD(err, mObs = CSatUiObserver::NewL()) - TFLOGSTRING2("SATAPP: SatAppEventProvider::SatAppEventProvider \ - new CSatUiObserver err=%d", err) - - if (KErrNone != err) { + TRAPD(err, mObs = CSatUiObserver::NewL(); + mObs->ConnectRSatSessionL(); + ); + if ( KErrNone != err ) { CloseSatUI(); } else { mObs->SetImplementer(this); - TFLOGSTRING("SATAPP: SatAppEventProvider::SatAppEventProvider") - } + TFLOGSTRING("SATAPP: SatAppEventProvider::SatAppEventProvider \ + SetImplementer") + mPlayTone = new SatAppPlayToneProvider(this); + } + TFLOGSTRING("SATAPP: SatAppEventProvider::SatAppEventProvider exit") } // ---------------------------------------------------------------------------- // SatAppEventProvider::~SatAppEventProvider -// Sets a pointer to CSatUiViewAppUi object. +// Sets a pointer to SATAPP: SatAppEventProvider object. // (other items were commented in a header). // ---------------------------------------------------------------------------- // SatAppEventProvider::~SatAppEventProvider() { TFLOGSTRING("SATAPP: SatAppEventProvider::~SatAppEventProvider call") - delete mObs; - mObs = NULL; + if (mObs){ + mObs->DisconnectRSatSession(); + delete mObs; + mObs = NULL; + } + if (mPlayTone) { + delete mPlayTone; + mPlayTone = NULL; + TFLOGSTRING("SATAPP: SatAppEventProvider::~SatAppEventProvider delete\ + mPlayTone") + } TFLOGSTRING("SATAPP: SatAppEventProvider::~SatAppEventProvider exit") } @@ -67,19 +80,18 @@ const MDesCArray &aMenuItems, const CArrayFixFlat */*aMenuItemNextActions*/, const CFbsBitmap */*aIconBitmap*/, - //const CAknIconArray */*aItemIconsArray*/, const TBool aSelfExplanatoryItems, const TBool aHelpIsAvailable) - { +{ TFLOGSTRING("SATAPP: SatAppEventProvider::SetUpMenuL call") TSatUiResponse response(ESatSuccess); QString title; if (aText.Length() > 0) { title = QString::fromUtf16 (aText.Ptr(), aText.Length()); - TFLOGSTRING2("SATAPP: SatAppEventProvider::SetUpMenuL Title=%s", - title.utf16()) - } + TFLOGSTRING2("SATAPP: SatAppEventProvider::SetUpMenuL Title=%S", + &aText) + } QStringList *menuList = new QStringList(); TFLOGSTRING("SATAPP: SatAppEventProvider::SetUpMenuL List") @@ -90,7 +102,7 @@ QString item=QString::fromUtf16(aMenuItems.MdcaPoint(i).Ptr(), aMenuItems.MdcaPoint(i).Length()); menuList->append(item); - } + } TFLOGSTRING("SATAPP: SatAppEventProvider::SetUpMenuL add item") @@ -98,9 +110,6 @@ response, title, *menuList, - //const CArrayFixFlat *aMenuItemNextActions, - //const HbIcon &aIcon, - //const CArrayFixFlat *aMenuIcons, aSelfExplanatoryItems, aHelpIsAvailable); @@ -109,7 +118,7 @@ TFLOGSTRING("SATAPP: SatAppEventProvider::SetUpMenuL exit") return response; - } +} // ---------------------------------------------------------------------------- // SatAppEventProvider::SetUpMenuL @@ -123,7 +132,6 @@ const TInt aDefaultItem, TUint8 &aSelection, const CFbsBitmap */*aIconBitmap*/, - //const CAknIconArray */*aItemsIconArray*/, const TBool aSelfExplanatoryItems, const TBool aHelpIsAvailable) { @@ -134,9 +142,9 @@ QString title; if (aText.Length() > 0) { title=QString::fromUtf16(aText.Ptr(), aText.Length()); - TFLOGSTRING2("SATAPP: SatAppEventProvider::SelectItemL Title=%s", - title.utf16()) - } + TFLOGSTRING2("SATAPP: SatAppEventProvider::SelectItemL Title=%S", + &aText) + } QStringList *menuList = new QStringList(); //Add Item @@ -145,7 +153,7 @@ QString item=QString::fromUtf16(aMenuItems.MdcaPoint(i).Ptr(), aMenuItems.MdcaPoint(i).Length()); menuList->append(item); - } + } TFLOGSTRING("SATAPP: SatAppEventProvider::SelectItemL add item") emit selectItemEvent( @@ -154,9 +162,6 @@ *menuList, aDefaultItem, aSelection, - //const CArrayFixFlat *aMenuItemNextActions, - //const HbIcon &aIcon, - //const CArrayFixFlat *aMenuIcons, aSelfExplanatoryItems, aHelpIsAvailable); @@ -189,15 +194,15 @@ // ---------------------------------------------------------------------------- // void SatAppEventProvider::menuSelection(int aMenuItem, bool aHelpRequested) - { +{ TFLOGSTRING2("SATAPP: SatAppEventProvider::MenuSelection call\ aMenuItem=%d", aMenuItem) if(mObs && mObs->Adapter()) { mObs->Adapter()->MenuSelection(aMenuItem, aHelpRequested); - } + } TFLOGSTRING("SATAPP: SatAppEventProvider::MenuSelection exit") - } +} // ---------------------------------------------------------------------------- // SatAppEventProvider::DisplayTextL @@ -220,16 +225,16 @@ if (aText.Length() > 0) { title=QString::fromUtf16(aText.Ptr(), aText.Length()); TFLOGSTRING2("SATAPP: SatAppEventProvider::DisplayTextL \ - Title=%s", title.utf16()) - } + Title=%S", &aText) + } QString appName; if (aSimApplicationName.Length() > 0) { appName=QString::fromUtf16(aSimApplicationName.Ptr(), aSimApplicationName.Length()); TFLOGSTRING2("SATAPP: SatAppEventProvider::DisplayTextL \ - appName=%s", appName.utf16()) - } + appName=%S", &aSimApplicationName) + } int timeInterval = aDuration.Int(); TFLOGSTRING2("SATAPP: SatAppEventProvider::DisplayTextL: \ @@ -276,26 +281,25 @@ if (aText.Length() > 0) { title=QString::fromUtf16(aText.Ptr(), aText.Length()); TFLOGSTRING2("SATAPP: SatAppEventProvider::GetInputL \ - Title=%s", title.utf16()) - } + Title=%S", &aText) + } QString inputText; if (aInput.Length() > 0) { inputText = QString::fromUtf16(aInput.Ptr(), aInput.Length()); TFLOGSTRING2("SATAPP: SatAppEventProvider::GetInputL \ - inputText=%s", inputText.utf16()) - } + inputText=%S", &aInput) + } bool isSelfExplanatory = aSelfExplanatory; unsigned int duration = aDuration; - //QPixmap *iconBitmapGetInput = QPixmap::fromSymbianCFbsBitmap(CFbsBitmap *aIconBitmapGetInput); - if (aGetInkey) { + + if (aGetInkey) { //Get Inkey emit getInkeyEvent( response, title, aCharacterSet, inputText, - //iconBitmapGetInput, isSelfExplanatory, duration); TFLOGSTRING("SATAPP: SatAppEventProvider::GetInputL: GetInkey") @@ -313,24 +317,62 @@ minLength, maxLength, hideInput, - //iconBitmapGetInput, isSelfExplanatory, duration); int length = inputText.length(); if (length > maxLength) { length = maxLength; } - TFLOGSTRING("SATAPP: SatAppEventProvider::GetInputL: GetInput") - TFLOGSTRING2( "SATAPP: SatAppEventProvider::GetInputL:GetInput \ - text=%s", inputText.utf16() ) aInput.Copy(reinterpret_cast(inputText.utf16()), length); TFLOGSTRING2("SATAPP: SatAppEventProvider::GetInputL aInput=%S", &aInput) } TFLOGSTRING("SATAPP: SatAppEventProvider::GetInputL exit") return response; +} + +// ---------------------------------------------------------------------------- +// SatAppEventProvider::CallControlL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse SatAppEventProvider::CallControlL( + const TDesC &aText, + const TSatAlphaIdStatus aAlphaIdStatus) +{ + TFLOGSTRING("SATAPP: SatAppEventProvider::CallControlL call") + QString text; + if (aText.Length() > 0) { + text=QString::fromUtf16(aText.Ptr(), aText.Length()); + TFLOGSTRING2("SATAPP: SatAppEventProvider::CallControlL \ + aText=%S", &aText) } + emit callControlEvent(text, aAlphaIdStatus); + TFLOGSTRING("SATAPP: SatAppEventProvider::CallControlL exit") + return ESatSuccess; +} - // ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// SatAppEventProvider::MoSmControlL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse SatAppEventProvider::MoSmControlL( + const TDesC &aText, + const TSatAlphaIdStatus aAlphaIdStatus) +{ + TFLOGSTRING("SATAPP: SatAppEventProvider::MoSmControlL call") + QString text; + if (aText.Length() > 0) { + text=QString::fromUtf16(aText.Ptr(), aText.Length()); + TFLOGSTRING2("SATAPP: SatAppEventProvider::MoSmControlL \ + aText=%S", &aText) + } + emit moSmControlEvent(text, aAlphaIdStatus); + TFLOGSTRING("SATAPP: SatAppEventProvider::MoSmControlL exit") + return ESatSuccess; +} + +// ---------------------------------------------------------------------------- // SatAppEventProvider::GetYesNoL // (other items were commented in a header). // ---------------------------------------------------------------------------- @@ -350,7 +392,7 @@ if (aText.Length() > 0) { text=QString::fromUtf16(aText.Ptr(), aText.Length()); TFLOGSTRING2("SATAPP: SatAppEventProvider::GetYesNoL \ - aText=%s", text.utf16()) + aText=%S", &aText) } unsigned int inKey = static_cast < TUint >(aInkey); @@ -366,7 +408,6 @@ text, aCharacterSet, inKey, - //const TSatIconId &aIconId, selfExplanatory, duration, immediateDigitResponse); @@ -393,7 +434,7 @@ if (aText.Length() > 0) { text=QString::fromUtf16(aText.Ptr(), aText.Length()); TFLOGSTRING2("SATAPP: SatAppEventProvider::GetYesNoL \ - aText=%s", text.utf16()) + aText=%S", &aText) } bool actionAccepted = aActionAccepted; int type = aType; @@ -402,6 +443,7 @@ text, actionAccepted, type); + aActionAccepted = actionAccepted; TFLOGSTRING("SATAPP: SatAppEventProvider::ConfirmSendL exit") return response; } @@ -421,7 +463,7 @@ if (aText.Length() > 0) { title = QString::fromUtf16 (aText.Ptr(), aText.Length()); TFLOGSTRING2("SATAPP: SatAppEventProvider::ShowSmsWaitNoteL \ - Title=%s", title.utf16()) + Title=%S", &aText) } bool selfExplanatoryIcon = aSelfExplanatoryIcon; @@ -448,14 +490,14 @@ if (aText.Length() > 0) { text = QString::fromUtf16 (aText.Ptr(), aText.Length()); TFLOGSTRING2("SATAPP: SatAppEventProvider::ConfirmSetUpCallL \ - text=%s", text.utf16()) + text=%S", &aText) } QString title; - if (aText.Length() > 0) { + if (aSimAppName.Length() > 0) { title = QString::fromUtf16 (aSimAppName.Ptr(), aSimAppName.Length()); TFLOGSTRING2("SATAPP: SatAppEventProvider::ConfirmSetUpCallL \ - Title=%s", title.utf16()) + Title=%S", &aSimAppName) } bool actionAccepted = aActionAccepted; @@ -463,7 +505,9 @@ text, title, actionAccepted); - TFLOGSTRING("SATAPP: SatAppEventProvider::ConfirmSetUpCallL exit") + aActionAccepted = actionAccepted; + TFLOGSTRING2("SATAPP: SatAppEventProvider::ConfirmSetUpCallL aActionAccepted %d \ + exit", aActionAccepted) } // ---------------------------------------------------------------------------- @@ -482,7 +526,7 @@ if (aText.Length() > 0) { title = QString::fromUtf16 (aText.Ptr(), aText.Length()); TFLOGSTRING2("SATAPP: SatAppEventProvider::ShowDtmfWaitNoteL \ - Title=%s", title.utf16()) + Title=%S", &aText) } emit showDtmfWaitNoteEvent( response, @@ -499,6 +543,9 @@ void SatAppEventProvider::ClearScreen() { TFLOGSTRING("SATAPP: SatAppEventProvider::ClearScreen call") + if (mPlayTone) { + mPlayTone->clearScreen(); + } emit clearScreenEvent(); TFLOGSTRING("SATAPP: SatAppEventProvider::ClearScreen exit") } @@ -511,6 +558,10 @@ void SatAppEventProvider::CloseSatUI() { TFLOGSTRING("SATAPP: SatAppEventProvider::CloseSatUI call") + if (mPlayTone) { + mPlayTone->closeSatUI(); + } + emit closeUiEvent(); TFLOGSTRING("SATAPP: SatAppEventProvider::CloseSatUI exit") } @@ -528,15 +579,151 @@ } //----------------------------------------------------------------------------- -// SatAppEventProvider::userCancelDtmfResponse +// SatAppEventProvider::userCancelResponse +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void SatAppEventProvider::userCancelResponse() +{ + TFLOGSTRING("SATAPP: SatAppEventProvider::userCancelResponse call") + mObs->Adapter()->SessionTerminated( ESessionCancel ); + TFLOGSTRING("SATAPP: SatAppEventProvider::userCancelResponse exit") +} + +//----------------------------------------------------------------------------- +// SatAppEventProvider::ShowSsWaitNoteL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void SatAppEventProvider::ShowSsWaitNoteL( + const TDesC &aText, + const CFbsBitmap* /*aIconBitmap*/, + const TBool aSelfExplanatoryIcon ) +{ + TFLOGSTRING("SATAPP: SatAppEventProvider::ShowSsWaitNoteL call") + QString title; + if (aText.Length() > 0) { + title = QString::fromUtf16 (aText.Ptr(), aText.Length()); + TFLOGSTRING2("SATAPP: SatAppEventProvider::ShowSsWaitNoteL \ + Title=%S", &aText) + } + bool selfExplanatoryIcon = aSelfExplanatoryIcon; + + emit showSsWaitNoteEvent( + title, + selfExplanatoryIcon); + TFLOGSTRING("SATAPP: SatAppEventProvider::ShowSsWaitNoteL exit") +} + +//----------------------------------------------------------------------------- +// SatAppEventProvider::ShowWaitNoteWithoutDelayL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void SatAppEventProvider::ShowWaitNoteWithoutDelayL() +{ + TFLOGSTRING("SATAPP: SatAppEventProvider::ShowWaitNoteWithoutDelayL call") + emit showWaitNoteWithoutDelayEvent(); + TFLOGSTRING("SATAPP: SatAppEventProvider::ShowWaitNoteWithoutDelayL exit") +} + +//----------------------------------------------------------------------------- +// SatAppEventProvider::showSsErrorNoteEvent +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void SatAppEventProvider::ShowSsErrorNoteL() +{ + TFLOGSTRING("SATAPP: SatAppEventProvider::showSsErrorNoteEvent call") + emit showSsErrorNoteEvent(); + TFLOGSTRING("SATAPP: SatAppEventProvider::showSsErrorNoteEvent exit") +} + +//----------------------------------------------------------------------------- +// SatAppEventProvider::ShowBIPNoteL // (other items were commented in a header). // ---------------------------------------------------------------------------- // -void SatAppEventProvider::userCancelDtmfResponse() +void SatAppEventProvider::ShowBIPNoteL( TInt aCommand, const TDesC &aText, + const CFbsBitmap* /*aIconBitmap*/, const TBool /*aSelfExplanatory*/) { - TFLOGSTRING("SATAPP: SatAppEventProvider::userCancelDtmfResponse call") - mObs->Adapter()->SessionTerminated( ESessionCancel ); - TFLOGSTRING("SATAPP: SatAppEventProvider::userCancelDtmfResponse exit") + TFLOGSTRING("SATAPP: SatAppEventProvider::ShowBIPNoteL call") + int cmdType = aCommand; + QString title; + if (aText.Length() > 0) { + title=QString::fromUtf16(aText.Ptr(), aText.Length()); + TFLOGSTRING2("SATAPP: SatAppEventProvider::ShowBIPNoteL \ + Title=%S", &aText) + } + emit showBIPNoteEvent(cmdType, title); + TFLOGSTRING("SATAPP: SatAppEventProvider::ShowBIPNoteL exit") } - //End of file +//----------------------------------------------------------------------------- +// SatAppEventProvider::ConfirmOpenChannelL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse SatAppEventProvider::ConfirmOpenChannelL( + const TDesC &aText, + TBool &aActionAccepted, + const CFbsBitmap* /*aIconBitmapOpenChannel*/, + const TBool /*aSelfExplanatory*/ ) +{ + TFLOGSTRING("SATAPP: SatAppEventProvider::ConfirmOpenChannelL call") + TSatUiResponse response( ESatSuccess ); + + QString title; + if (aText.Length() > 0) { + title=QString::fromUtf16(aText.Ptr(), aText.Length()); + TFLOGSTRING2("SATAPP: SatAppEventProvider::ConfirmOpenChannelL \ + Title=%S", &aText) + } + bool actionAccepted = aActionAccepted; + emit showOpenChannelConfirmEvent(title, actionAccepted); + aActionAccepted = actionAccepted; + TFLOGSTRING2( "SATAPP: SatAppEventProvider::ConfirmOpenChannelL exit\ + response: %d", response) + return response; +} + +//----------------------------------------------------------------------------- +// SatAppEventProvider::PlayStandardToneL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse SatAppEventProvider::PlayStandardToneL( const TDesC& aText, + const TDesC8& aSequence, + TTimeIntervalMicroSeconds aDuration, + const CFbsBitmap* aIconBitmap, + const TBool aSelfExplanatory ) +{ + TFLOGSTRING("SATAPP: SatAppEventProvider::PlayStandardToneL call") + TSatUiResponse response = mPlayTone->PlayStandardToneL( + aText, aSequence, aDuration, aIconBitmap, aSelfExplanatory); + TFLOGSTRING2("SATAPP: SatAppEventProvider::PlayStandardToneL \ + response= %d exit", response) + return response; +} + +//----------------------------------------------------------------------------- +// SatAppEventProvider::PlayUserSelectedToneL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse SatAppEventProvider::PlayUserSelectedToneL( + const TDesC &aText, + TTimeIntervalMicroSeconds aDuration, + TSatTone aTone, + const CFbsBitmap* aIconBitmap, + const TBool aSelfExplanatory ) +{ + TFLOGSTRING("SatAppEventProvider::PlayUserSelectedToneL calling") + TSatUiResponse response = mPlayTone->PlayUserSelectedToneL( + aText, aDuration, aTone, aIconBitmap, aSelfExplanatory); + TFLOGSTRING2( "SatAppEventProvider::PlayUserSelectedToneL response= %d \ + exit", response) + return response; +} + +//End of file diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/src/satappgetinkeynote.cpp --- a/satui/satapp/src/satappgetinkeynote.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/src/satappgetinkeynote.cpp Mon May 03 13:01:45 2010 +0300 @@ -15,7 +15,6 @@ * * */ -#include #include "tflogger.h" #include "satappgetinkeynote.h" diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/src/satappmainhandler.cpp --- a/satui/satapp/src/satappmainhandler.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/src/satappmainhandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -15,6 +15,7 @@ * * */ + #include "satappmainhandler.h" #include "satappuiprovider.h" #include "satappeventprovider.h" @@ -30,17 +31,17 @@ // ---------------------------------------------------------------------------- // SatAppMainHandler::SatAppMainHandler(HbMainWindow &window, - QObject */*parent*/):mEvent(0), mUi(0), mCommand(0) + QObject */*parent*/):mEvent(NULL), mUi(NULL), mCommand(NULL) { TFLOGSTRING("SATAPP: SatAppMainHandler::SatAppMainHandler call") - + mEvent = new SatAppEventProvider(this); mUi = new SatAppUiProvider(window, *mEvent, this); mCommand = new SatAppCommandHandler(*mUi, this); - + initConnections(); TFLOGSTRING("SATAPP: SatAppMainHandler::SatAppMainHandler exit") - } +} // ---------------------------------------------------------------------------- // SatAppMainHandler::~SatAppMainHandler @@ -52,26 +53,29 @@ TFLOGSTRING("SATAPP: SatAppMainHandler::~SatAppMainHandler call-exit") } - +// ---------------------------------------------------------------------------- +// SatAppMainHandler::initConnections +// +// ---------------------------------------------------------------------------- +// void SatAppMainHandler::initConnections() { TFLOGSTRING("SATAPP: SatAppMainHandler::initConnections call") - bool ret = false; // For SetUpMenu - ret = connect(mEvent, SIGNAL(setUpMenuEvent(TSatUiResponse &, - QString, QStringList, /*const HbIcon& ,*/ bool, bool)), + bool ret = connect(mEvent, SIGNAL(setUpMenuEvent(TSatUiResponse &, + QString, QStringList, bool, bool)), mCommand, SLOT(setUpMenu(TSatUiResponse &, - QString, QStringList, /*const HbIcon& ,*/ bool, bool)), + QString, QStringList, bool, bool)), Qt::DirectConnection); TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ SetUpMenu=%d", ret) // For SelectItem ret = connect(mEvent, SIGNAL(selectItemEvent(TSatUiResponse&, - QString, QStringList, /*const HbIcon& ,*/ + QString, QStringList, int, unsigned char&, bool, bool)), mCommand, SLOT(selectItem(TSatUiResponse&, - QString,QStringList, /*const HbIcon& ,*/ + QString,QStringList, int, unsigned char&, bool, bool)), Qt::DirectConnection); TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ @@ -79,9 +83,9 @@ // for display text ret = connect(mEvent, SIGNAL(displayTextEvent(TSatUiResponse &, - QString, QString, /*const HbIcon & ,*/ bool &, bool, int, bool)), + QString, QString, bool &, bool, int, bool)), mCommand, SLOT(displayText(TSatUiResponse&, - QString, QString, /*const HbIcon & ,*/ bool &, bool, int, bool)), + QString, QString, bool &, bool, int, bool)), Qt::DirectConnection); TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ @@ -104,11 +108,9 @@ // For GetInkey ret = connect(mEvent, SIGNAL(getInkeyEvent(TSatUiResponse &, QString, TSatCharacterSet, QString &, - //const QPixmap* aIconBitmapGetInput, bool,unsigned int &)), mCommand, SLOT(getInkey(TSatUiResponse &, QString, TSatCharacterSet, QString &, - //const QPixmap* aIconBitmapGetInput, bool, unsigned int &)), Qt::DirectConnection); TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ @@ -130,36 +132,49 @@ mCommand, SLOT(getInput(TSatUiResponse &, QString, TSatCharacterSet, QString &, int, int, bool, bool, unsigned int &)), Qt::DirectConnection); - TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: GetInput=%d", ret) + TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ + GetInput=%d", ret) - // For send confirm - ret = connect(mEvent, SIGNAL(confirmSendEvent(TSatUiResponse &, QString, - bool &, int)), - mCommand, SLOT(confirmSend(TSatUiResponse&, QString, bool &, int)), + // For CallControl + ret = connect(mEvent, SIGNAL(callControlEvent(QString, + TSatAlphaIdStatus)), + mCommand, SLOT(callControl(QString, TSatAlphaIdStatus)), Qt::DirectConnection); - TFLOGSTRING2("SATAPP: SatAppSendSms::initConnections: confirmSend=%d", ret) + TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ + CallControl=%d", ret) + // For MoSmControl + ret = connect(mEvent, SIGNAL(moSmControlEvent(QString, + TSatAlphaIdStatus)), + mCommand, SLOT(moSmControl(QString, TSatAlphaIdStatus)), + Qt::DirectConnection); + TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ + MoSmControl=%d", ret) + + // For send confirm ret = connect(mEvent, SIGNAL(showSmsWaitNoteEvent(QString, - /*const CFbsBitmap* aIconBitmapSendSM,*/ bool)), - mCommand, SLOT(showSmsWaitNote(QString, - /*const CFbsBitmap* aIconBitmapSendSM,*/bool)), - Qt::DirectConnection); - + bool)), + mCommand, SLOT(showSmsWaitNote(QString, + bool)), + Qt::DirectConnection); TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ showSmsWaitNote=%d", ret) + //For Send DTMF ret = connect(mEvent, SIGNAL(showDtmfWaitNoteEvent( - TSatUiResponse &, QString/*, - const CFbsBitmap* aIconBitmapSendDTMF, bool*/)), - mCommand, SLOT(showDtmfWaitNote(TSatUiResponse &, QString - /*const CFbsBitmap* aIconBitmapSendDTMF,bool*/)), + TSatUiResponse &, QString)), + mCommand, SLOT(showDtmfWaitNote( + TSatUiResponse &, QString)), Qt::DirectConnection); - TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: showDtmfsWaitNote=%d", ret) - //For DTMF cancel - ret = connect(mUi, SIGNAL(userCancelDtmfResponse()), - mEvent, SLOT(userCancelDtmfResponse()), + TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ + showDtmfsWaitNote=%d", ret) + + //For DTMF, BIP cancel + ret = connect(mUi, SIGNAL(userCancelResponse()), + mEvent, SLOT(userCancelResponse()), Qt::DirectConnection); - TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: userCancelDtmfResponse=%d", ret) + TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ + userCancelResponse=%d", ret) //Stop wait note ret = connect(mEvent, SIGNAL(stopShowWaitNoteEvent()), @@ -167,6 +182,7 @@ Qt::DirectConnection); TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ stopShowWaitNote=%d", ret) + // For SetUpCall ret = connect(mEvent, SIGNAL(showSetUpCallConfirmEvent( QString, QString, bool &)), @@ -175,7 +191,49 @@ Qt::DirectConnection); TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ showSetUpCallConfirm=%d", ret) + + ret = connect(mEvent, SIGNAL(showSsWaitNoteEvent(QString, + bool)), + mCommand, SLOT(showSsWaitNote(QString, + bool)), + Qt::DirectConnection); + // For Send SS or USSD + TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ + showSsWaitNote=%d", ret) + + //For showWaitNoteWithoutDelay + ret = connect(mEvent, SIGNAL(showWaitNoteWithoutDelayEvent()), + mUi, SLOT(showWaitNoteWithoutDelay()), + Qt::DirectConnection); + TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ + showWaitNoteWithoutDelayEvent=%d", ret) + + //For showSsErrorNote + ret = connect(mEvent, SIGNAL(showSsErrorNoteEvent()), + mUi, SLOT(showSsErrorNote()), + Qt::DirectConnection); + TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ + showSsErrorNoteEvent=%d", ret) + + // For Open Channel + ret = connect(mEvent, SIGNAL(showOpenChannelConfirmEvent( + QString, bool &)), + mUi, SLOT(showConfirmOpenChannelQuery( + QString, bool &)), + Qt::DirectConnection); + TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ + showOpenChannelConfirm=%d", ret) + + // For BIP wait note + ret = connect(mEvent, SIGNAL(showBIPNoteEvent( + int, QString)), + mCommand, SLOT(showBIPWaitNote( + int, QString)), + Qt::DirectConnection); + TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \ + showBIPNote=%d", ret) + TFLOGSTRING("SATAPP: SatAppMainHandler::initConnections exit") } diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/src/satappplaytoneprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/src/satappplaytoneprovider.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,531 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// PlayStandardTone +#include +#include +#include +#include +#include //KAudioPriorityLowLevel +#include //KMdaRepeatForever +#include // timeout callback +#include //playtone note +#include // for CMdaAudioToneUtility&CMdaAudioPlayerUtility +#include //TTimeIntervalMicroSeconds + +#include "satappplaytoneprovider.h" +#include "satappcommonconstant.h" +#include "tflogger.h" + +//const +// Maximum length for sound file. +const TInt KMaxSoundFileLength = 256; +// Used when dividing some values. Used only for preventing the use of magic +// numbers +// Audio sample is repeated indefinitely. +const TInt KSoundPlayerRepeatForever = KMdaRepeatForever; + +// ---------------------------------------------------------------------------- +// SatAppPlayToneProvider::SatAppPlayToneProvider +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +SatAppPlayToneProvider::SatAppPlayToneProvider(QObject *parent) : + QObject(parent), mWarningAndPlayTones(false),mVolume(0), + mPlayer(0),mPlayToneError(ESatSuccess), mTimer(0),mLoop(0), + mPermanentNote(0), mAudioPlayer(0) +{ + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::SatAppPlayToneProvider call") + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::SatAppPlayToneProvider exit") +} + +// ---------------------------------------------------------------------------- +// SatAppPlayToneProvider::~SatAppPlayToneProvider +// Sets a pointer to CSatUiViewAppUi object. +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +SatAppPlayToneProvider::~SatAppPlayToneProvider() +{ + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::~SatAppPlayToneProvider call") + stopPlayTone(); + if (mPermanentNote) { + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::~SatAppPlayToneProvider note 0") + delete mPermanentNote; + mPermanentNote = 0; + } + if (mTimer) { + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::~SatAppPlayToneProvider timer 0") + delete mTimer; + mTimer = 0; + } + if (mLoop) { + TFLOGSTRING("SatAppPlayToneProvider::~SatAppPlayToneProvider loop 0") + delete mLoop; + mLoop = 0; + } + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::~SatAppPlayToneProvider exit") +} + +//----------------------------------------------------------------------------- +// SatAppPlayToneProvider::PlayStandardToneL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse SatAppPlayToneProvider::PlayStandardToneL( const TDesC& aText, + const TDesC8& aSequence, + TTimeIntervalMicroSeconds aDuration, + const CFbsBitmap* /*aIconBitmap*/, + const TBool aSelfExplanatory ) +{ + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::PlayStandardToneL call") + if (mTimer) { + if (mTimer->isActive()) { + mTimer->stop(); + } + delete mTimer; + mTimer = 0; + TFLOGSTRING("SatAppPlayToneProvider::PlayStandardToneL delete timer") + } + if (mLoop) { + TFLOGSTRING("SatAppPlayToneProvider::PlayStandardToneL delete loop") + if (mLoop->isRunning()) { + mLoop->exit(); + } + delete mLoop; + mLoop = 0; + } + + TSatUiResponse response(ESatSuccess); + unsigned int duration(0); + if (aDuration > 0) { + duration = aDuration.Int64() / 1000; + } + TFLOGSTRING2("SATAPP: SatAppPlayToneProvider::PlayStandardToneL \ + duration microseconds %d", duration) + QString text; + mLoop = new QEventLoop(this); + if (aText.Length() > 0) { + text = QString::fromUtf16(aText.Ptr(), aText.Length()); + TFLOGSTRING2("SATAPP: SatAppPlayToneProvider::PlayStandardToneL \ + text=%S", &aText) + mPermanentNote = new HbMessageBox(HbMessageBox::MessageTypeInformation); + bool ret = connect(mPermanentNote, SIGNAL(aboutToClose()), + this, SLOT(stopPlayTone())); + TFLOGSTRING2("SATAPP: SatAppPlayToneProvider::PlayStandardToneL connect \ + note close to timer stop: %d", ret) + + bool selfExplanatory = aSelfExplanatory; + if (!selfExplanatory) { + mPermanentNote->setText(text); + if (duration > 0 ) { + mPermanentNote->setTimeout(duration); + } + mPermanentNote->setDismissPolicy(HbPopup::TapAnywhere); + TFLOGSTRING("SatAppPlayToneProvider::PlayStandardToneL show before") + mPermanentNote->show(); + TFLOGSTRING("SatAppPlayToneProvider::PlayStandardToneL show after") + } + } + + if (mPlayer) { + delete mPlayer; + mPlayer = 0; + } + mPlayer = CMdaAudioToneUtility::NewL(*this); + TInt volume(mPlayer->MaxVolume()); + mPlayer->SetVolume(volume); + mPlayer->PrepareToPlayDesSequence(aSequence); + + if (duration > 0) { + mTimer = new QTimer(this); + bool ret = connect(mTimer, SIGNAL(timeout()), + this, SLOT(stopPlayTone())); + TFLOGSTRING2("SATAPP: SatAppPlayToneProvider::PlayStandardToneL \ + connect mTimer stop: %d", ret) + mTimer->start(duration); + } + + if (mLoop) { + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::PlayStandardToneL loop") + mLoop->exec(QEventLoop::AllEvents); + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::PlayStandardToneL quit loop") + delete mLoop; + mLoop = 0; + } + if (mPermanentNote) { + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::PlayStandardToneL note 0") + delete mPermanentNote; + mPermanentNote = 0; + } + if (mTimer) { + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::PlayStandardToneL timer 0") + delete mTimer; + mTimer = 0; + } + + + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::PlayStandardToneL before play cancel") + mPlayer->CancelPlay(); + delete mPlayer; + mPlayer = NULL; + + //get warning and game tones setting from active profile + GetProfileParamsL(); + if((EFalse == mWarningAndPlayTones) && + (ESatSuccess == mPlayToneError)) { + mPlayToneError = ESatSuccessToneNotPlayed; + } + response = mPlayToneError; + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::PlayStandardToneL exit") + return response; +} + + +// --------------------------------------------------------- +// SatAppCommandHandler::GetProfileParamsL +// Get and store settings from current profile +// (other items were commented in a header). +// --------------------------------------------------------- +// +void SatAppPlayToneProvider::GetProfileParamsL( TSatTone aTone /*= ESatToneNotSet*/, + TDes* aToneName /*= NULL*/ ) +{ + TFLOGSTRING( "SatAppCommandHandler::GetProfileParamsL calling" ) + MProfile* profile = NULL; + MProfileEngine* engine = NULL; + engine = CreateProfileEngineL(); + CleanupReleasePushL( *engine ); + + profile = engine->ActiveProfileLC(); + + const MProfileTones& tones = profile->ProfileTones(); + + // Takes a current warning and gametones setting. + const TProfileToneSettings& ts = tones.ToneSettings(); + mWarningAndPlayTones = ts.iWarningAndGameTones; + mVolume = ts.iRingingVolume; + if ( ( ESatUserSelectedToneIncomingSms == aTone ) && ( aToneName ) ) + { + TFLOGSTRING("SatAppCommandHandler::GetProfileParamsL message tone") + aToneName->Copy( tones.MessageAlertTone() ); + } else if( aToneName ) { + TFLOGSTRING("SatAppCommandHandler::GetProfileParamsL ring tone") + aToneName->Copy( tones.RingingTone1() ); + } + + CleanupStack::PopAndDestroy(2); // engine, profile + TFLOGSTRING("SatAppCommandHandler::GetProfileParamsL exits") +} + +// --------------------------------------------------------- +// SatAppPlayToneProvider::MatoPrepareComplete +// Indicates success or failure. +// (other items were commented in a header). +// --------------------------------------------------------- +// +void SatAppPlayToneProvider::MatoPrepareComplete(TInt aError) +{ + TFLOGSTRING2("SatAppPlayToneProvider::MatoPrepareComplete called\ + aError = %d", aError) + if (KErrNone == aError && mPlayer) { + mPlayToneError = ESatSuccess; + TTimeIntervalMicroSeconds zero(static_cast( 0 )); + mPlayer->SetPriority(KAudioPriorityLowLevel, + STATIC_CAST(TMdaPriorityPreference, KAudioPrefConfirmation)); + mPlayer->SetRepeats( KMdaAudioToneRepeatForever, zero ); + mPlayer->Play(); + } else { + mPlayToneError = ESatFailure; + } + TFLOGSTRING( "SatAppPlayToneProvider::MatoPrepareComplete exit" ) +} + +//----------------------------------------------------------------------------- +// SatAppPlayToneProvider::MatoPlayComplete +// Indicates success or failure. +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void SatAppPlayToneProvider::MatoPlayComplete( TInt aError ) +{ + TFLOGSTRING("SatAppPlayToneProvider::MatoPlayComplete calling") + if (KErrNone == aError && mPlayer) { + TFLOGSTRING("SatAppPlayToneProvider::MatoPlayComplete play") + mPlayer->Play(); + } else { + TFLOGSTRING( "SatAppPlayToneProvider::MatoPlayComplete stop playing") + // Stops playing if error. + stopPlayTone(); + } + TFLOGSTRING2("SatAppPlayToneProvider::MatoPlayComplete exit error %d", aError) +} + +//----------------------------------------------------------------------------- +// SatAppPlayToneProvider::PlayUserSelectedToneL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse SatAppPlayToneProvider::PlayUserSelectedToneL( + const TDesC &aText, + TTimeIntervalMicroSeconds aDuration, + TSatTone aTone, + const CFbsBitmap* /*aIconBitmap*/, + const TBool aSelfExplanatory ) +{ + TFLOGSTRING("SatAppPlayToneProvider::PlayUserSelectedToneL calling") + if (mTimer) { + delete mTimer; + mTimer = 0; + TFLOGSTRING("SatAppPlayToneProvider::PlayUserSelectedToneL delete timer") + } + if (mLoop) { + delete mLoop; + mLoop = 0; + TFLOGSTRING("SatAppPlayToneProvider::PlayUserSelectedToneL delete loop") + } + unsigned int duration(0); + if (aDuration > 0) { + duration = aDuration.Int64() / KPlayToneSymbianConvertQtTime; + TFLOGSTRING2("SatAppPlayToneProvider::PlayUserSelectedToneL duration %d", + duration) + } + + QString text; + if (aText.Length() > 0) { + text = QString::fromUtf16(aText.Ptr(), aText.Length()); + TFLOGSTRING2("SATAPP: SatAppPlayToneProvider::PlayUserSelectedToneL \ + text=%S", &aText) + mPermanentNote = new HbMessageBox(HbMessageBox::MessageTypeInformation); + bool selfExplanatory = aSelfExplanatory; + if (!selfExplanatory) { + mPermanentNote->setText(text); + if (duration) { + mPermanentNote->setTimeout(duration); + } + mPermanentNote->setDismissPolicy(HbPopup::TapAnywhere); + TFLOGSTRING("SatAppPlayToneProvider::PlayUserSelectedToneL show before") + mPermanentNote->show(); + TFLOGSTRING("SatAppPlayToneProvider::PlayUserSelectedToneL show after") + } + } + + // If several messages/calls arrive during a small amount of time and if the + // message received or incoming call tone is already being played we do not + // restart it. + if (mAudioPlayer) { + TFLOGSTRING( "SatAppPlayToneProvider::\ + PlayUserSelectedToneL Error - already played" ) + return ESatFailure; + } + + TSatUiResponse response(ESatSuccess); + // This defines name for the current message alert or incoming call tone. + TBuf soundFileName; + GetProfileParamsL( aTone, &soundFileName ); + // This defines the behaviour to be adopted by an + // audio client if a higher priority client takes over the device. + TInt mdaPriority( KAudioPrefIncomingCall ); + // This is used to resolve conflicts when more than one client tries to + // access the same sound output device simultaneously. + TInt audioPriority( KAudioPriorityPhoneCall ); + + TFLOGSTRING2( "SATAPP: SatAppPlayToneProvider::PlayUserSelectedToneL\ + Volume is %d ", mVolume ) + + // Creates the audio player. + mAudioPlayer = CMdaAudioPlayerUtility::NewFilePlayerL( + soundFileName, + *this, + audioPriority, + ( TMdaPriorityPreference ) mdaPriority ); + + if (aDuration > 0) { + TFLOGSTRING( "SATAPP: SatAppPlayToneProvider::PlayUserSelectedToneL\ + duration not 0" ) + mAudioPlayer->SetRepeats( KSoundPlayerRepeatForever, + TTimeIntervalMicroSeconds( + static_cast( 0 ) ) ); + mTimer = new QTimer(this); + mTimer->start(duration); + mLoop = new QEventLoop(this); + bool ret = connect(mTimer, SIGNAL(timeout()), this, SLOT(stopPlayTone())); + TFLOGSTRING2("SATAPP: SatAppPlayToneProvider::PlayUserSelectedToneL\ + connect mTimer stop: %d", ret) + + if (mPermanentNote) { + ret = connect(mPermanentNote, SIGNAL(aboutToClose()), + this, SLOT(stopPlayTone())); + TFLOGSTRING2("SATAPP: SatAppPlayToneProvider::PlayUserSelectedToneL \ + connect note close to timer stop: %d", ret) + } + if (mLoop) { + mLoop->exec(QEventLoop::AllEvents); + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::PlayUserSelectedToneL quit loop") + delete mLoop; + mLoop = 0; + } + if (mPermanentNote) { + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::PlayUserSelectedToneL note 0") + delete mPermanentNote; + mPermanentNote = 0; + } + if (mTimer) { + TFLOGSTRING("SATAPP: SatAppPlayToneProvider::PlayUserSelectedToneL timer 0") + delete mTimer; + mTimer = 0; + } + // Sample is played in forever loop for the duration. + // After duration call back timers are destroyed + // If player exists, stop playing and delete player. MapcPlayComplete + // is not called because CallBackTimer stops the playing. + if (mAudioPlayer) { + mAudioPlayer->Stop(); + delete mAudioPlayer; + mAudioPlayer = 0; + TFLOGSTRING( "SatAppPlayToneProvider::PlayUserSelectedToneL\ + mAudioPlayer deleted" ) + } + } else { + // If duration is zero then tone is played only once. + // Playing duration is same as duration of the sample. + mAudioPlayer->SetRepeats( + 0, TTimeIntervalMicroSeconds( static_cast( 0 ) ) ); + TFLOGSTRING( "SatAppPlayToneProvider::PlayUserSelectedToneL SetRepeats 0" ) + } + + TFLOGSTRING( "SatAppPlayToneProvider::PlayUserSelectedToneL exit" ) + if( EFalse == mWarningAndPlayTones ) { + response = ESatSuccessToneNotPlayed; + } + + TFLOGSTRING( "SatAppPlayToneProvider::PlayUserSelectedToneL exit" ) + return response; +} + +//----------------------------------------------------------------------------- +// SatAppPlayToneProvider::MapcInitComplete +// Plays the tone. +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +void SatAppPlayToneProvider::MapcInitComplete( TInt aError, + const TTimeIntervalMicroSeconds& /*aDuration*/ ) +{ + TFLOGSTRING( "SatAppPlayToneProvider::MapcInitComplete called" ) + // Audio player is initialised, so if there is no error, we can start + // playing the tone. + if (KErrNone == aError && mAudioPlayer) { + const TInt volume( Max(0, Min(mVolume, + mAudioPlayer->MaxVolume()))); + TFLOGSTRING2("CSatUiViewAppUi::\ + MapcInitComplete SetVolume %d", volume ) + // Set volume according Settings. + mAudioPlayer->SetVolume( volume ); + mAudioPlayer->Play(); + TFLOGSTRING( "SatAppPlayToneProvider::MapcInitComplete Play" ) + } else { + // Otherwise, we delete the initialised audio player. + if ( mAudioPlayer ) { + TFLOGSTRING( "SatAppPlayToneProvider::MapcInitComplete mAudioPlayer \ + true" ) + delete mAudioPlayer; + mAudioPlayer = 0; + } + + // Remove also the note for play tone + // If there was a duration for play tone, stop waiting + stopPlayTone(); + + TFLOGSTRING2( "SatAppPlayToneProvider::MapcInitComplete Error %d", aError ) + } + TFLOGSTRING( "SatAppPlayToneProvider::MapcInitComplete exit" ) +} + +//----------------------------------------------------------------------------- +// SatAppPlayToneProvider::MapcPlayComplete +// Deletes audio player after playing is completed. +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +void SatAppPlayToneProvider::MapcPlayComplete( TInt /*aError*/ ) +{ + TFLOGSTRING( "SatAppPlayToneProvider::MapcPlayComplete called" ) + + // When playing is completed, deleting the audio player. + if ( mAudioPlayer ) { + TFLOGSTRING("SatAppPlayToneProvider::MapcPlayComplete delete mAudioPlayer") + delete mAudioPlayer; + mAudioPlayer = 0; + } + // Remove note after play has completed. + stopPlayTone(); + TFLOGSTRING("SatAppPlayToneProvider::MapcPlayComplete exit") +} + +// ---------------------------------------------------------------------------- +// SatAppPlayToneProvider::clearScreen +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void SatAppPlayToneProvider::clearScreen() +{ + TFLOGSTRING("SATAPP: SatAppEventProvider::ClearScreen call") + stopPlayTone(); + TFLOGSTRING("SATAPP: SatAppEventProvider::ClearScreen exit") +} + +// ---------------------------------------------------------------------------- +// SatAppPlayToneProvider::clearScreen +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void SatAppPlayToneProvider::closeSatUI() +{ + TFLOGSTRING("SATAPP: SatAppEventProvider::closeSatUI call") + clearScreen(); + TFLOGSTRING("SATAPP: SatAppEventProvider::closeSatUI exit") +} + +// ---------------------------------------------------------------------------- +// SatAppPlayToneProvider::stopPlayTone +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void SatAppPlayToneProvider::stopPlayTone() +{ + TFLOGSTRING("SATAPP: SatAppEventProvider::stopPlayTone call") + if (mPermanentNote) { + TFLOGSTRING("SatAppPlayToneProvider::stopPlayTone delete mPermanentNote") + disconnect(mPermanentNote,SIGNAL(aboutToClose()), + this, SLOT(stopPlayTone())); + mPermanentNote->close(); + } + if (mTimer) { + TFLOGSTRING("SatAppPlayToneProvider::stopPlayTone delete timer") + disconnect(mTimer,SIGNAL(timeout()), this, SLOT(stopPlayTone())); + if (mTimer->isActive()) { + mTimer->stop(); + } + } + if (mLoop && mLoop->isRunning()) { + TFLOGSTRING("SatAppPlayToneProvider::stopPlayTone exit loop") + mLoop->exit(); + } + TFLOGSTRING("SATAPP: SatAppEventProvider::stopPlayTone exit") +} + + //End of file diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/src/satappuiprovider.cpp --- a/satui/satapp/src/satappuiprovider.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/src/satappuiprovider.cpp Mon May 03 13:01:45 2010 +0300 @@ -21,7 +21,8 @@ #include // application xml #include // action user response #include -#include // DisplayText, ConfirmSend, SetUpCall +#include // DisplayText, ConfirmSend, +#include // CallControl, SetUpCall #include // DisplayText, GetInput, SetUpCall #include // GetInkey #include // SendSms wait note @@ -29,7 +30,6 @@ #include // GetInput #include "satappview.h" // SetUpMenu, SelectItem #include "satappgetinkeynote.h" // GetYesNo immediate digit response - #include "satappuiprovider.h" #include "tflogger.h" @@ -50,8 +50,9 @@ QObject(parent), mMainWindow(window), mLoader(0), mSetupMenuView(0), mSelectItemView(0), mDisplayPopup(0), mGetInkeyQuery(0), mYesNoPopup(0), mGetInputQuery(0), - mConfirmSendQuery(0), mSmsWaitNote(0),mDtmfWaitNote(0), mSetUpCallQuery(0), - mUserRsp(EUserNoResponse), mDigitalRsp(0), mMinLength(0),mTimer(0),mLoop(0) + mConfirmSendQuery(0), mSetUpCallQuery(0), mCallControlMsg(0), + mConfirmBipQuery(0), mUserRsp(EUserNoResponse), mDigitalRsp(0), + mMinLength(0), mTimer(0), mLoop(0),mWaitNote(0) { TFLOGSTRING("SATAPP: SatAppUiProvider::SatAppUiProvider call"); @@ -76,12 +77,10 @@ mSelectItemView->setMainWindow(mMainWindow); mSelectItemView->initSelectItem(event, *this); } - - } else { + } else { TFLOGSTRING( "SATAPP: SatAppUiProvider::SatAppUiProvider DOCML failure!"); - } - + } TFLOGSTRING("SATAPP: SatAppUiProvider::SatAppUiProvider eixt"); } @@ -113,14 +112,14 @@ SatAppUiProvider::~SatAppUiProvider() { TFLOGSTRING("SATAPP: SatAppUiProvider::~SatAppUiProvider call"); - //delete mTopicMonitor; not in use at the moment + stopShowWaitNote(); delete mLoader; // delete all objects created from DOCML. while (!mObjects.isEmpty()) { TFLOGSTRING( "SATAPP: SatAppUiProvider::~SatAppUiProvider object tree"); delete mObjects.takeFirst(); - } + } if (mDisplayPopup) { delete mDisplayPopup; mDisplayPopup = 0; @@ -141,17 +140,20 @@ delete mConfirmSendQuery; mConfirmSendQuery = 0; } - if (mSmsWaitNote) { - delete mSmsWaitNote; - mSmsWaitNote = 0; - } + if (mSetUpCallQuery) { delete mSetUpCallQuery; mSetUpCallQuery = 0; } - if (mDtmfWaitNote) { - delete mDtmfWaitNote; - mDtmfWaitNote = 0; + + if (mConfirmBipQuery ) { + delete mConfirmBipQuery ; + mConfirmBipQuery = 0; + } + + if (mWaitNote) { + delete mWaitNote; + mWaitNote = 0; } if (mLoop && mLoop->isRunning()) { @@ -161,6 +163,10 @@ TFLOGSTRING("SatAppUiProvider::~SatAppUiProvider exit loop") } + if (mCallControlMsg) { + delete mCallControlMsg; + mCallControlMsg = 0; + } TFLOGSTRING("SATAPP: SatAppUiProvider::~SatAppUiProvider exit"); } @@ -199,6 +205,7 @@ const bool aHelpIsAvailable) { TFLOGSTRING("SATAPP: SatAppUiProvider::showSetUpMenuView call") + stopShowWaitNote(); activeView("setupmenu_view"); // The text is the application name @@ -234,6 +241,7 @@ const bool aHelpIsAvailable) { TFLOGSTRING("SATAPP: SatAppUiProvider::showSelectItemView call") + stopShowWaitNote(); activeView("selectitem_view"); mSelectItemView->showSelectItemContent(aRes, aText, aMenuItems, aDefaultItem, aSelection, @@ -253,6 +261,7 @@ { TFLOGSTRING("SATAPP: SatAppUiProvider::showDisplayTextPopup call") resetUserResponse(); + stopShowWaitNote(); // Create a note mDisplayPopup = new HbMessageBox(HbMessageBox::MessageTypeInformation); @@ -290,12 +299,9 @@ unsigned int &aDuration) { TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInkeyQuery call") - TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetInkeyQuery \ - aHeading=%s", aHeading.utf16()) - TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetInkeyQuery \ - aContent=%s", aContent.utf16()) resetUserResponse(); + stopShowWaitNote(); // Create a query mGetInkeyQuery = new HbInputDialog(); if (mGetInkeyQuery) { @@ -310,7 +316,7 @@ HbValidator *val =new HbValidator; if (ESatDigitOnly == aCharacterSet) { - // digit mode, digits only (0 9, *, #, and +); + // digit mode, digits only (0 9, *, #, and +) mGetInkeyQuery->setInputMode(HbInputDialog::IntInput); // Define what digits can be entered QRegExp r("[0123456789*#+]{1,1}"); // from 1 to 1 digits @@ -321,9 +327,9 @@ mGetInkeyQuery->setInputMode(HbInputDialog::TextInput); } - unsigned int duration = 60000; + unsigned int duration = KDefaultSelectionTimeoutMseconds; if (aDuration) { - duration = aDuration * 100; + duration = aDuration * KSymbianTimeConvertQtTime; } composeDialog(mGetInkeyQuery, duration, ESatDialogGetInkey); mGetInkeyQuery->lineEdit()->setMaxLength(1); @@ -334,12 +340,8 @@ TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInkeyQuery end pop") QString inputString = (mGetInkeyQuery->value()).toString(); - TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetInkeyQuery \ - inputString=%s", inputString.utf16()) aContent = inputString; delete val; - TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetInkeyQuery \ - aContent=%s", aContent.utf16()) delete mGetInkeyQuery; mGetInkeyQuery = 0; } @@ -359,11 +361,12 @@ { TFLOGSTRING("SATAPP: SatAppUiProvider::showGetYesNoQuery call") resetUserResponse(); + stopShowWaitNote(); TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetYesNoQuery duration in=%d", aDuration) - unsigned int duration = 60000; + unsigned int duration = KDefaultSelectionTimeoutMseconds; if (aDuration) { - duration = aDuration * 100; + duration = aDuration * KSymbianTimeConvertQtTime; } TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetYesNoQuery duration=%d", duration) @@ -393,7 +396,7 @@ TFLOGSTRING("SATAPP: SatAppUiProvider::showGetYesNoQuery befor pop") mYesNoPopup->exec(); TFLOGSTRING("SATAPP: SatAppUiProvider::showGetYesNoQuery end pop") - aDuration = time.elapsed() / 100; + aDuration = time.elapsed() / KSymbianTimeConvertQtTime; TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetYesNoQuery duration out=%d", aDuration) delete mYesNoPopup; @@ -422,9 +425,8 @@ TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInputQuery call") TFLOGSTRING3("SATAPP: SatAppUiProvider::showGetInputQuery \ min %d max %d length", minLength, maxLength) - TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetInputQuery in content=%s", - content.utf16()) resetUserResponse(); + stopShowWaitNote(); mMinLength = minLength; // Create a query mGetInputQuery = new HbInputDialog(); @@ -438,7 +440,7 @@ HbValidator *val =new HbValidator; QRegExp r; if (ESatDigitOnly == characterSet) { - // digit mode, digits only (0 9, *, #, and +); + // digit mode, digits only (0 9, *, #, and +) mGetInputQuery->setInputMode(HbInputDialog::IntInput); // Define what digits can be entered r.setPattern("[0123456789*#+]{0,255}"); // define what characters can be entered @@ -453,10 +455,11 @@ this, SLOT(updateQueryAction(QString))); mGetInputQuery->lineEdit()->setMaxLength(maxLength); - composeDialog(mGetInputQuery, 60000, ESatDialogGetInput); + composeDialog(mGetInputQuery, KDefaultSelectionTimeoutMseconds, ESatDialogGetInput); // Sets the "OK"-action/button if (0 == minLength || content.length() >= minLength) { - HbAction* okAction = new HbAction(tr("OK"), mGetInputQuery); + HbAction* okAction = new HbAction(hbTrId("txt_sat_general_ok"), + mGetInputQuery); bool ret = connect(okAction, SIGNAL(triggered()), this, SLOT(userPrimaryResponse())); TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetInputQuery \ @@ -477,16 +480,14 @@ TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInputQuery end pop") content = (mGetInputQuery->value()).toString(); - TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetInputQuery out content=%s", - content.utf16()) delete val; delete mGetInputQuery; mGetInputQuery = 0; - TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInputQuery exit") + TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetInputQuery mUserRsp =%d exit", + mUserRsp) return mUserRsp; - } // ---------------------------------------------------------------------------- @@ -496,13 +497,12 @@ void SatAppUiProvider::updateQueryAction(QString text) { TFLOGSTRING("SATAPP: SatAppUiProvider::updateQueryAction call") - TFLOGSTRING2("SATAPP: SatAppUiProvider::updateQueryAction text=%s", \ - text.utf16()) // Get Input if (mGetInputQuery) { if (text.length() >= mMinLength) { if (!mGetInputQuery->primaryAction()) { - HbAction *okAction = new HbAction(tr("OK"), mGetInputQuery); + HbAction *okAction = new HbAction(hbTrId("txt_sat_general_ok"), + mGetInputQuery); bool ret = connect( okAction, SIGNAL(triggered()), this, SLOT(userPrimaryResponse())); @@ -514,7 +514,7 @@ get input OK") } else { if (mGetInputQuery->primaryAction()) { - mGetInputQuery->removeAction(mGetInputQuery->primaryAction()); + mGetInputQuery->removeAction(mGetInputQuery->primaryAction()); } TFLOGSTRING("SATAPP: SatAppUiProvider::updateQueryAction \ get input no OK Action") @@ -523,7 +523,8 @@ // Get InKey if (mGetInkeyQuery) { if (!mGetInkeyQuery->primaryAction() && (text.length() == 1)) { - HbAction *okAction = new HbAction(tr("OK"), mGetInkeyQuery); + HbAction *okAction = new HbAction(hbTrId("txt_sat_general_ok"), + mGetInkeyQuery); bool ret = connect(okAction, SIGNAL(triggered()), this, SLOT(userPrimaryResponse())); TFLOGSTRING2("SATAPP: SatAppUiProvider::updateQueryAction \ @@ -548,15 +549,14 @@ // ---------------------------------------------------------------------------- // void SatAppUiProvider::showConfirmSendQuery( - const QString &/*aText*/, + const QString &aText, bool &aActionAccepted) { TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmSendQuery call") resetUserResponse(); mConfirmSendQuery = new HbMessageBox(); if(mConfirmSendQuery) { - // Sets the "Yes"-action/button - mConfirmSendQuery->setText(tr("Allow SIM card to send message?")); + mConfirmSendQuery->setText(aText); composeDialog(mConfirmSendQuery, 0, ESatDialogConfirmSend); TFLOGSTRING("SATAPP: SatAppUiProvider::confirmSend before exec") @@ -577,16 +577,19 @@ void SatAppUiProvider::showSmsWaitNote(const QString &aText) { TFLOGSTRING("SATAPP: SatAppUiProvider::showSmsWaitNote") - - mSmsWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog); + if (mWaitNote) { + delete mWaitNote; + mWaitNote = 0; + } + mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog); //remove the default cancel softkey - mSmsWaitNote->removeAction(mSmsWaitNote->primaryAction()); + mWaitNote->removeAction(mWaitNote->primaryAction()); if(aText.isEmpty()) { - mSmsWaitNote->setText(hbTrId("txt_sat_sendingtextmessage")); + mWaitNote->setText(hbTrId("txt_sat_sendingtextmessage")); } else { - mSmsWaitNote->setText(aText); + mWaitNote->setText(aText); } - mSmsWaitNote->show(); + mWaitNote->show(); // Extend showing sms wait note timer for test extendNoteShowtime(); TFLOGSTRING("SATAPP: SatAppUiProvider::showSmsWaitNote exit") @@ -603,23 +606,23 @@ TFLOGSTRING("SATAPP: SatAppUiProvider::showDtmfWaitNote call") aRes = ESatSuccess; - if (mDtmfWaitNote) { - delete mDtmfWaitNote; - mDtmfWaitNote = 0; + if (mWaitNote) { + delete mWaitNote; + mWaitNote = 0; } - mDtmfWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog); + mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog); //remove the default cancel softkey - bool ret = connect(mDtmfWaitNote->primaryAction(), SIGNAL(triggered()), - this, SLOT(cancelDtmfResponse())); + bool ret = connect(mWaitNote->primaryAction(), SIGNAL(triggered()), + this, SLOT(cancelResponse())); TFLOGSTRING2("SATAPP: SatAppUiProvider::showDtmfWaitNote \ primaryAction=%d", ret) if(aText.isEmpty()) { - mDtmfWaitNote->setText(tr("Sending DTMF")); + mWaitNote->setText(hbTrId("txt_sat_senddtmf_wait_note")); } else { - mDtmfWaitNote->setText(aText); + mWaitNote->setText(aText); } - mDtmfWaitNote->show(); + mWaitNote->show(); // Extend showing sms wait note timer for test extendNoteShowtime(); TFLOGSTRING("SATAPP: SatAppUiProvider::showDtmfWaitNote exit") @@ -632,17 +635,20 @@ void SatAppUiProvider::stopShowWaitNote() { TFLOGSTRING("SATAPP: SatAppUiProvider::stopShowWaitNote call") - if(mSmsWaitNote) { - TFLOGSTRING("SATAPP: SatAppUiProvider::stopShowWaitNote SMS") - mSmsWaitNote->cancel(); - } - if(mDtmfWaitNote) { - TFLOGSTRING("SATAPP: SatAppUiProvider::mDtmfWaitNote DTMF") - mDtmfWaitNote->close(); - delete mDtmfWaitNote; - mDtmfWaitNote = 0; + + if (mWaitNote) { + TFLOGSTRING("SATAPP: SatAppUiProvider::mWaitNote close") + mWaitNote->close(); + delete mWaitNote; + mWaitNote = 0; } + if (mCallControlMsg) { + TFLOGSTRING("SATAPP: SatAppUiProvider::mCallControlMsg close") + mCallControlMsg->close(); + delete mCallControlMsg; + mCallControlMsg = 0; + } TFLOGSTRING("SATAPP: SatAppUiProvider::stopShowWaitNote exit") } @@ -663,9 +669,13 @@ if (aSimAppName.length() > 0){ alphaId.append(aSimAppName); } else { - alphaId.append(tr("SIM services")); + alphaId.append(hbTrId("txt_sat_title")); } - alphaId.append(tr(" about to call")); + alphaId.append(hbTrId("txt_sat_setupcall_confirm_note")); + TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmSetUpCallQUery length 0") + } else { + alphaId.append(aText); + TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmSetUpCallQUery exit") } mSetUpCallQuery = new HbMessageBox(HbMessageBox::MessageTypeInformation); @@ -692,27 +702,49 @@ { TFLOGSTRING("SATAPP: SatAppUiProvider::clearScreen called") if (mDisplayPopup) { + mDisplayPopup->close(); + mDisplayPopup = NULL; TFLOGSTRING("SATAPP: SatAppUiProvider::clearScreen DisplayText") - mDisplayPopup->close(); } if (mGetInkeyQuery) { + mGetInkeyQuery->close(); + mGetInkeyQuery = NULL; TFLOGSTRING("SATAPP: SatAppUiProvider::clearScreen GetInkey") - mGetInkeyQuery->close(); } if (mYesNoPopup) { + mYesNoPopup->close(); + mYesNoPopup = NULL; TFLOGSTRING("SATAPP: SatAppUiProvider::clearScreen GetYesNo") - mYesNoPopup->close(); } if (mGetInputQuery) { + mGetInputQuery->close(); + mGetInputQuery = NULL; TFLOGSTRING("SATAPP: SatAppUiProvider::clearScreen GetInput") - mGetInputQuery->close(); - } + } if(mConfirmSendQuery) { mConfirmSendQuery->close(); + mConfirmSendQuery = NULL; TFLOGSTRING("SATAPP: SatAppUiProvider::clearScreen ConfirmSend") } if (mSetUpCallQuery) { - mConfirmSendQuery->close(); + mSetUpCallQuery->close(); + mSetUpCallQuery = NULL; + TFLOGSTRING("SATAPP: SatAppUiProvider::clearScreen SetUpCall") + } + if (mCallControlMsg){ + mCallControlMsg->close(); + mCallControlMsg = NULL; + TFLOGSTRING("SATAPP: SatAppUiProvider::clearScreen CallControlMsg") + } + if (mConfirmBipQuery){ + mConfirmBipQuery->close(); + mConfirmBipQuery = NULL; + TFLOGSTRING("SATAPP: SatAppUiProvider::clearScreen ConfirmBip") + } + if (mWaitNote){ + mWaitNote->close(); + mWaitNote = NULL; + TFLOGSTRING("SATAPP: SatAppUiProvider::clearScreen WaitNote") } mUserRsp = EUserClearResponse; TFLOGSTRING("SATAPP: SatAppUiProvider::clearScreen exit") @@ -784,37 +816,42 @@ HbAction *secondaryAction = 0; if (ESatDialogDisplayText == type){ - primaryAction = new HbAction(tr("Ok"), dlg); - secondaryAction = new HbAction(tr("Back"), dlg); + primaryAction = new HbAction(hbTrId("txt_sat_general_ok"), dlg); + secondaryAction = new HbAction(hbTrId("txt_sat_general_back"), dlg); TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \ ESatDialogDisplayText") } else if (ESatDialogGetInput == type){ - secondaryAction = new HbAction(tr("Cancel"), dlg); + secondaryAction = new HbAction(hbTrId("txt_sat_general_cancel"), dlg); TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \ ESatDialogGetInput") } else if (ESatDialogGetInkey == type){ - secondaryAction = new HbAction(tr("Cancel"), dlg); + secondaryAction = new HbAction(hbTrId("txt_sat_general_cancel"), dlg); TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \ ESatDialogGetInkey") } else if (ESatDialogGetYesNo == type){ - primaryAction = new HbAction(tr("Yes"), dlg); - secondaryAction = new HbAction(tr("No"), dlg); + primaryAction = new HbAction(hbTrId("txt_sat_general_yes"), dlg); + secondaryAction = new HbAction(hbTrId("txt_sat_general_no"), dlg); TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \ ESatDialogGetYesNo") } else if (ESatDialogGetDigitalRsp == type){ - secondaryAction = new HbAction(tr("Cancel"), dlg); + secondaryAction = new HbAction(hbTrId("txt_sat_general_cancel"), dlg); TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \ ESatDialogGetDigitalRsp") } else if (ESatDialogSetUpCall == type){ - primaryAction = new HbAction(tr("Call"), dlg); - secondaryAction = new HbAction(tr("Cancel"), dlg); + primaryAction = new HbAction(hbTrId("txt_sat_general_call"), dlg); + secondaryAction = new HbAction(hbTrId("txt_sat_general_cancel"), dlg); TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \ ESatDialogSetUpCall") } else if (ESatDialogConfirmSend == type){ - primaryAction = new HbAction(tr("Yes"), dlg); - secondaryAction = new HbAction(tr("No"), dlg); + primaryAction = new HbAction(hbTrId("txt_sat_general_send"), dlg); + secondaryAction = new HbAction(hbTrId("txt_sat_general_cancel"), dlg); TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \ ESatDialogConfirmSend") + }else if (ESatDialogConfirmBip == type){ + primaryAction = new HbAction(hbTrId("txt_sat_general_ok"), dlg); + secondaryAction = new HbAction(hbTrId("txt_sat_general_cancel"), dlg); + TFLOGSTRING("SATAPP: SatAppUiProvider::composeDialog \ + ESatDialogConfirmBip") } if (primaryAction) { @@ -860,7 +897,7 @@ if (type == SatAppView::staticMetaObject.className()) { QObject *object = new SatAppView(); TFLOGSTRING2( - "SATAPP: SatAppDocumentLoader::createObject %s", name.utf16()) + "SATAPP: SatAppDocumentLoader::createObject %S", name.utf16()) object->setObjectName(name); TFLOGSTRING("SATAPP: SatAppDocumentLoader::createObject sat view exit") return object; @@ -886,7 +923,7 @@ mLoop = 0; TFLOGSTRING("SatAppUiProvider::extendNoteShowtime delete loop") } - QTimer *mTimer = new QTimer(this); + mTimer = new QTimer(this); mTimer->start(KExtendTimeoutMseconds); bool ret = connect(mTimer, SIGNAL(timeout()), mTimer, SLOT(stop())); TFLOGSTRING2("SATAPP: SatAppUiProvider::extendNoteShowtime connect\ @@ -901,27 +938,223 @@ } // ---------------------------------------------------------------------------- -//cancelDtmfResponse +//cancelResponse // ---------------------------------------------------------------------------- // -void SatAppUiProvider::cancelDtmfResponse() +void SatAppUiProvider::cancelResponse() { - TFLOGSTRING("SatAppUiProvider::cancelDtmfResponse") - if (mDtmfWaitNote) { - TFLOGSTRING("SatAppUiProvider::cancelDtmfResponse user cancel") + TFLOGSTRING("SatAppUiProvider::cancelResponse") + if (mWaitNote) { + TFLOGSTRING("SatAppUiProvider::cancelResponse user cancel") if (mTimer) { mTimer->stop(); - TFLOGSTRING("SatAppUiProvider::cancelDtmfResponse time out") + TFLOGSTRING("SatAppUiProvider::cancelResponse time out") } if (mLoop && mLoop->isRunning()) { mLoop->exit(); - TFLOGSTRING("SatAppUiProvider::cancelDtmfResponse exit loop") + TFLOGSTRING("SatAppUiProvider::cancelResponse exit loop") } - mDtmfWaitNote->setEnabled(false); - mDtmfWaitNote->close(); - emit userCancelDtmfResponse(); + mWaitNote->setEnabled(false); + mWaitNote->close(); + emit userCancelResponse(); + } + TFLOGSTRING("SatAppUiProvider::cancelResponse exit") +} + +// ---------------------------------------------------------------------------- +//showSsWaitNote +// Displays a wait note to indicate SS sending. +// ---------------------------------------------------------------------------- +// +void SatAppUiProvider::showSsWaitNote(const QString &aText, + const bool aSelfExplanatoryIcon) +{ + TFLOGSTRING("SATAPP: SatAppUiProvider::showSsWaitNote") + if (mWaitNote) { + delete mWaitNote; + mWaitNote = 0; + } + mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog); + mWaitNote->removeAction(mWaitNote->primaryAction()); + if (aText.length()) { + if (!aSelfExplanatoryIcon) { + TFLOGSTRING("SATAPP: SatAppUiProvider::showSsWaitNote !Icon") + mWaitNote->setText(aText); + } else { + TFLOGSTRING("SATAPP: SatAppUiProvider::showSsWaitNote send") + mWaitNote->setText(hbTrId("txt_sat_sendss_wait_note_send")); + } + } else { + mWaitNote->setText(hbTrId("txt_sat_sendss_wait_note_request")); + } + TFLOGSTRING("SATAPP: SatAppUiProvider::showSsWaitNote show before") + mWaitNote->show(); + TFLOGSTRING("SATAPP: SatAppUiProvider::showSsWaitNote exit") +} + +// ---------------------------------------------------------------------------- +//showWaitNoteWithoutDelay +// +// ---------------------------------------------------------------------------- +// +void SatAppUiProvider::showWaitNoteWithoutDelay() +{ + TFLOGSTRING("SATAPP: SatAppUiProvider::showWaitNoteWithoutDelay") + if (mWaitNote) { + delete mWaitNote; + mWaitNote = 0; + } + mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog); + mWaitNote->removeAction(mWaitNote->primaryAction()); + mWaitNote->setText(hbTrId("txt_sat_wait_note_without_delay")); + mWaitNote->show(); + TFLOGSTRING("SATAPP: SatAppUiProvider::showWaitNoteWithoutDelay exit") +} + +// ---------------------------------------------------------------------------- +//showSsErrorNote +// +// ---------------------------------------------------------------------------- +// +void SatAppUiProvider::showSsErrorNote() +{ + TFLOGSTRING("SATAPP: SatAppUiProvider::showSsErrorNote") + HbMessageBox *msgBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); + msgBox->setText(hbTrId("txt_sat_sendss_error_note")); + msgBox->exec(); + delete msgBox; + msgBox = NULL; + TFLOGSTRING("SATAPP: SatAppUiProvider::showSsErrorNote exit") +} + +// ---------------------------------------------------------------------------- +// showConfirmOpenChannelQuery +// ---------------------------------------------------------------------------- +// +void SatAppUiProvider::showConfirmOpenChannelQuery( + const QString &aText, + bool &aActionAccepted) +{ + TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmOpenChannelQuery call") + QString title = aText; + if (!aText.length()){ + title = hbTrId("txt_sat_openchannel_confirm_note"); + } + + mConfirmBipQuery = new HbMessageBox(); + if(mConfirmBipQuery) { + // Sets the "Yes"-action/button + mConfirmBipQuery->setText(title); + composeDialog(mConfirmBipQuery, 0, ESatDialogConfirmBip); + + TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmOpenChannelQuery before exec") + mConfirmBipQuery->exec(); + TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmOpenChannelQuery after exec") + + delete mConfirmBipQuery; + mConfirmBipQuery = 0; } - TFLOGSTRING("SatAppUiProvider::cancelDtmfResponse exit") + + aActionAccepted = (EUserPrimaryResponse == mUserRsp) ? true : false; + + TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmOpenChannelQuery exit") +} + +// ---------------------------------------------------------------------------- +//showCallControlNote +// +// ---------------------------------------------------------------------------- +// +void SatAppUiProvider::showCallControlNote(const QString &aText) +{ + TFLOGSTRING("SATAPP: SatAppUiProvider::showCallControlNote") + if (mCallControlMsg) { + delete mCallControlMsg; + mCallControlMsg = 0; + } + mCallControlMsg = new HbDeviceMessageBox(HbMessageBox::MessageTypeInformation); + mCallControlMsg->setText(aText); + mCallControlMsg->show(); + // Extend showing sms wait note timer for test + extendNoteShowtime(); + TFLOGSTRING("SATAPP: SatAppUiProvider::showCallControlNote exit") + +} + +// ---------------------------------------------------------------------------- +// showBIPWaitNote +// ---------------------------------------------------------------------------- +// +void SatAppUiProvider::showBIPWaitNote(const QString &aText) +{ + TFLOGSTRING("SATAPP: SatAppUiProvider::showBIPWaitNote call") + if (!mWaitNote) { + mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog); + mWaitNote->setText(aText); + + //remove the default cancel softkey + bool ret = connect(mWaitNote->primaryAction(), SIGNAL(triggered()), + this, SLOT(cancelResponse())); + TFLOGSTRING2("SATAPP: SatAppUiProvider::showDtmfWaitNote \ + primaryAction=%d", ret) + + mWaitNote->show(); + } else { + mWaitNote->setText(aText); + TFLOGSTRING("SATAPP: SatAppUiProvider::showBIPWaitNote Update Text") + } + TFLOGSTRING("SATAPP: SatAppUiProvider::showBIPWaitNote exit") +} + +// ---------------------------------------------------------------------------- +//showMoSmControlNote +// +// ---------------------------------------------------------------------------- +// +void SatAppUiProvider::showMoSmControlNote(const QString &aText) +{ + TFLOGSTRING("SATAPP: SatAppUiProvider::showMoSmControlNote") + HbMessageBox *msgBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); + msgBox->setText(aText); + msgBox->setTimeout(KMoSmControlTimeOut); + msgBox->exec(); + delete msgBox; + TFLOGSTRING("SATAPP: SatAppUiProvider::showMoSmControlNote exit") + +} + +// ---------------------------------------------------------------------------- +// showCloseChannelWaitNote +// ---------------------------------------------------------------------------- +// +void SatAppUiProvider::showCloseChannelWaitNote(const QString &aText) +{ + TFLOGSTRING("SATAPP: SatAppUiProvider::showCloseChannelWaitNote call") + if (mWaitNote) { + delete mWaitNote; + mWaitNote = 0; + } + mWaitNote = new HbProgressDialog(HbProgressDialog::WaitDialog); + mWaitNote->removeAction(mWaitNote->primaryAction()); + mWaitNote->setText(aText); + mWaitNote->show(); + TFLOGSTRING("SATAPP: SatAppUiProvider::showCloseChannelWaitNote exit") +} + +// ---------------------------------------------------------------------------- +//showSatInfoNote +// +// ---------------------------------------------------------------------------- +// +void SatAppUiProvider::showSatInfoNote(const QString &aText) +{ + TFLOGSTRING("SATAPP: SatAppUiProvider::showSatInfoNote") + HbMessageBox *msgBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); + msgBox->setText(aText); + msgBox->exec(); + delete msgBox; + msgBox = 0; + TFLOGSTRING("SATAPP: SatAppUiProvider::showSatInfoNote exit") } // End of file diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/src/satappview.cpp --- a/satui/satapp/src/satappview.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/satui/satapp/src/satappview.cpp Mon May 03 13:01:45 2010 +0300 @@ -72,9 +72,9 @@ TFLOGSTRING("SATAPP: SatAppView::~SatAppView") // The objects are outside the object tree, Delete them manually if (mTimer) { - delete mTimer; - mTimer = 0; - TFLOGSTRING("SATAPP: SatAppView::~SatAppView delete subtitle") + delete mTimer; + mTimer = 0; + TFLOGSTRING("SATAPP: SatAppView::~SatAppView delete subtitle") } if (mLoop) { @@ -104,11 +104,9 @@ // Listwidget mListWidget = qobject_cast ( mUi->docmlLoader()->findWidget(SATAPP_MENUITEM )); - //mMenu = new HbMenu(); if (mListWidget && mWindow) { mSoftKeyQuitAction = new HbAction(Hb::QuitAction,this); - HbMenu *addMenu = menu(); - HbAction *menuAction = addMenu->addAction("Exit"); + HbAction *menuAction = menu()->addAction("Exit"); bool ret = connect(menuAction, SIGNAL(triggered()), mSoftKeyQuitAction, SIGNAL(triggered())); TFLOGSTRING2("SATAPP: SatAppView::initSetupMenu: \ @@ -117,8 +115,8 @@ mWindow, SLOT(close())); TFLOGSTRING2("SATAPP: SatAppView::initSetupMenu: \ quit connected %d", ret) + } - } TFLOGSTRING("SATAPP: SatAppView::initSetupMenu exit") } @@ -144,13 +142,12 @@ if (mSelectListWidget && mWindow) { mSoftKeyBackAction = new HbAction(Hb::BackAction,this); - HbMenu *addMenu = menu(); - HbAction *menuBack = addMenu->addAction("Back"); + HbAction *menuBack = menu()->addAction("Back"); bool ret = connect(menuBack, SIGNAL(triggered()), mSoftKeyBackAction, SIGNAL(triggered())); TFLOGSTRING2("SATAPP: SatAppView::initSelectItem: \ menu connected %d", ret) - HbAction *menuQuit = addMenu->addAction("Exit"); + HbAction *menuQuit = menu()->addAction("Exit"); ret = connect(menuQuit, SIGNAL(triggered()), mWindow, SLOT(close())); TFLOGSTRING2("SATAPP: SatAppView::initSelectItem: \ @@ -198,6 +195,7 @@ } // connect setup menu item connectItem(); + setNavigationAction(mSoftKeyQuitAction); } TFLOGSTRING("SATAPP: SatAppView::SetUpMenu exit") } @@ -229,10 +227,9 @@ if (mWindow){ mWindow->setCurrentViewIndex(aDefaultItem); } - + // Set sub title if (!aText.isEmpty()) { - TFLOGSTRING2("SATAPP: aText=%s", aText.utf16()) mSubTitle->setPlainText(aText); } else { TFLOGSTRING("SATAPP: txt_sat_selectitem_title") @@ -246,6 +243,12 @@ mSelectListWidget->addItem(aMenuItems.at( i )); } } + // Set Back key + //setSoftkeyBack(); + if (mSoftKeyBackAction) { + setNavigationAction(mSoftKeyBackAction); + TFLOGSTRING("SATAPP: SatAppView::selectItem set softkey back") + } // connect selectitem connectItem(); @@ -275,14 +278,13 @@ } else { TFLOGSTRING2("SATAPP: SatAppView::selectItem selected %d", mItemIndex) - //TODO: fix this below. //For Demo. We will not return user select item to SIM. aSelection = mItemIndex; } // disconnet select item disconnectItem(); TFLOGSTRING2("SATAPP: SatAppView::selectItem aRes:%d", aRes) - mTimeout=false; + mTimeout = false; TFLOGSTRING("SATAPP: SatAppView::selectItem exit") } @@ -336,10 +338,15 @@ void SatAppView::backButtonClicked() { TFLOGSTRING("SATAPP: SatAppView::backButtonClicked") - if (mSelectItem && mLoop->isRunning() ) { + if (mSelectItem) { mClickBackSoftkey = true; TFLOGSTRING("SATAPP: SatAppView::backButtonClicked back selected") - mLoop->exit(); + if (mLoop) { + TFLOGSTRING("SATAPP: SatAppView::backButtonClicked quit loop") + if (mLoop->isRunning()) { + mLoop->exit(); + } + } } TFLOGSTRING("SATAPP: SatAppView::backButtonClicked exit") } @@ -369,9 +376,9 @@ if(mSelectItem && mSelectListWidget) { mItemIndex = mSelectListWidget->row(item); if (mLoop && mLoop->isRunning()) { - TFLOGSTRING( "SATAPP: SatAppView::menuItemSelected sel item") - mLoop->quit(); - TFLOGSTRING( "SATAPP: SatAppView::menuItemSelected exit loop") + TFLOGSTRING( "SATAPP: SatAppView::menuItemSelected sel item") + mLoop->quit(); + TFLOGSTRING( "SATAPP: SatAppView::menuItemSelected exit loop") } } if (!mSelectItem && mListWidget) { diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/inc/dummyeventprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/inc/dummyeventprovider.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,687 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: dummyeventprovider.h +* +*/ + +#ifndef DUMMYEVENTPROVIDER_H +#define DUMMYEVENTPROVIDER_H + +#include +#include + + +#include "msatuiactionimplementer.h" + +class CSatUiObserver; +//class QPixmap; // For future icon support +class DummyPlayToneProvider; + +class DummyEventProvider: public QObject, + public MSatUiActionImplementer +{ + Q_OBJECT + +public: + + /** + * Constructor + */ + DummyEventProvider(QObject *parent = 0); + + /** + * Distructor + */ + virtual ~DummyEventProvider(); + +signals: + /** + * Notification of the SAT Display Text command. + * @param aRes, the User's response. + * @param aText The text string to be displayed. + * @param aSimApplicationName Sim Application name + * @param aIcon the icon to show. + * @param aRequestedIconDisplayed Informs if icon is not used. + * @param aSustainedText Indicates is this text sustained ie. no timers + * used if true. + * @param aDuration Duration for showing the text + * @param aWaitUserToClear Indication if user is needed to clear + * message + */ + void displayTextEvent( + TSatUiResponse &aRes, + const QString &aText, + const QString &aSimApplicationName, + //const HbIcon &aIcon, + bool &aRequestedIconDisplayed, + const bool aSustainedText, + const int aDuration, + const bool aWaitUserToClear); + + /** + * Notification of the SAT Get Input command. + * @param aText The query text. + * @param aCharacterSet The character range allowed. + * @param aInput The input string. + * @param aMaxLength The maximum length of the input allowed. + * @param aMinLength The minimum length of the input allowed. + * @param aHideInput A flag indicating if the input should be hidden. + * @param aHelpIsAvailable indicates if help can be requested. + * @param aIconId The id of icon. + * @param aRequestedIconDisplayed Informs if icon is not used. + * @return The response of the UI to this command. + */ + void getInputEvent( + TSatUiResponse &aRes, + const QString &aTitleText, + const TSatCharacterSet aCharacterSet, + QString &aInputText, + const int aMinLength, + const int aMaxLength, + const bool aHideInput, + //const QPixmap* /*aIconBitmapGetInput*/, + const bool aSelfExplanatory, + unsigned int &aDuration ); + + /** + * Notification of the SAT Get Inkey command. + * @param aText The query text. + * @param aCharacterSet The character range allowed. + * @param aInput The input string. + * @param aHideInput A flag indicating if the input should be hidden. + * @param aHelpIsAvailable indicates if help can be requested. + * @param aIconId The id of icon. + * @param aRequestedIconDisplayed Informs if icon is not used. + */ + void getInkeyEvent( + TSatUiResponse &aRes, + const QString &aTitleText, + const TSatCharacterSet aCharacterSet, + QString &aInputText, + //const QPixmap* /*aIconBitmapGetInput*/, + const bool aSelfExplanatory, + unsigned int &aDuration ); + + /** + * Notification of the SAT Get YesNo command. + * @param aText The query text. + * @param aCharacterSet The character range allowed. + * @param aInput The input character. + * @param aHelpIsAvailable indicates if help can be requested. + * @param aIconId The id of icon. + * @param aRequestedIconDisplayed Informs if icon is not used. + * @param aDuration Duration for showing the dialog. + * @param aImmediateDigitResponse Indication if Immediate digit response + * is needed. + * @return The response of the UI to this command. + */ + void getYesNoEvent( + TSatUiResponse &aRes, + const QString &aText, + const TSatCharacterSet aCharacterSet, + unsigned int &aInkey, + //const TSatIconId &aIconId, + const bool &aSelfExplanatory, + unsigned int &aDuration, + const bool aImmediateDigitResponse ); + + /** + * Handles the SetUpMenu command. + * @param aRes the out parameter. the result of the command. + * @param aText The title text. + * @param aMenuItems The array of menu item captions. + * @param aMenuItemNextActions The array of menu item next action + * indicator captions. + * @param aIconBitmap The Context pane icon. + * @param aItemsIconArray Array of item icons + * @param aSelfExplanatoryItems A flag indicating if only icons are shown. + * @param aHelpIsAvailable A flag indicating if SAT help is available. + */ + void setUpMenuEvent( + TSatUiResponse &aRes, + const QString &aText, + const QStringList &aMenuItems, + //const CArrayFixFlat* aMenuItemNextActions, + //const HbIcon &aIcon, + //const CAknIconArray* aItemIconsArray, + const bool aSelfExplanatoryItems, + const bool aHelpIsAvailable); + + /** + * Handles the SelectItem view. + * @param aRes the out parameter. the result of the command. + * @param aText The title text. + * @param aMenuItems The array of menu items. + * @param aMenuItemNextActions The array of next action indicators. + * @param aDefaultItem The item in focus. + * @param aSelection The item index selected by the user. + * @param aIconBitmap The Context Pane icon. + * @param aItemsIconArray Array of item icons + * @param aSelfExplanatoryItems Flag indicating if only icons are shown. + * @param aHelpIsAvailable A flag indicating if SAT help is available. + * @return Information of the operation result. + */ + void selectItemEvent( + TSatUiResponse &aRes, + const QString &aText, + const QStringList &aMenuItems, + //const CArrayFixFlat* aMenuItemNextActions, + const int aDefaultItem, + unsigned char &aSelection, + //const HbIcon &aIcon, + //const CAknIconArray* aItemsIconArray, + const bool aSelfExplanatoryItems, + const bool aHelpIsAvailable); + + /** + * Shows the confirmation note about the SAT Send SMS, Send SS or + * Send USSD command. + * @param aText The text to be displayed. + * @param aActionAccepted Indicates whether the command was accepted. + * @param aType Type of the request (SMS, SS, USSD). + * @return Information of the operation result. + */ + void confirmSendEvent( + TSatUiResponse &aRes, + const QString &aText, + bool &aActionAccepted, + int aType); + + /** + * Shows the wait note about the Send SMS command. + * @param aText The text to be displayed. + * @param aIconBitmapSendSM Sending dialog icon. + * @param aSelfExplanatoryIcon A flag indicating if only icon is shown. + */ + void showSmsWaitNoteEvent( + const QString &aText, + //const CFbsBitmap* aIconBitmapSendSM, + const bool aSelfExplanatoryIcon + ); + + /** + * Shows the confirmation not about SetUpCall. + * @param aText The text to be displayed. + * @param aSimAppName The header to be displayed. + * @param aActionAccepted Indicates whether the command was accepted. + */ + void showSetUpCallConfirmEvent( + const QString &aText, + const QString &aSimAppName, + bool &aActionAccepted//, + //const CFbsBitmap* aIconBitmap, + //const TBool aSelfExplanatory + ); + + /** + * Shows the wait note about the Send DTMF command. + * @param aText The text to be displayed. + * @param aIconBitmapSendSM Sending dialog icon. + */ + void showDtmfWaitNoteEvent( + TSatUiResponse &aRes, + const QString &aText); + + + /** + * Shows the wait note about the Send Ss or Ussd command. + * @param aText The text to be displayed. + * @param aIconBitmapSendSM Sending dialog icon. + * @param aSelfExplanatoryIcon A flag indicating if only icon is shown. + */ + void showSsWaitNoteEvent( + const QString &aText, + //const CFbsBitmap* aIconBitmapSendSM, + const bool aSelfExplanatoryIcon + ); + + /** + * Shows the wait note about Open Channel + * @param aText The text to be displayed. + * @param aActionAccepted Indicates whether the command was accepted. + */ + void showOpenChannelConfirmEvent( + const QString &aText, + bool &aActionAccepted); + + + /*! + Removes Display Text Dialog from the screen. + */ + void clearScreenEvent(); + + /*! + Close the sat ui + */ + void closeUiEvent(); + + /*! + *Close wait note + */ + void stopShowWaitNoteEvent(); + + /*! + *Show SsWaitNote without Delay + */ + void showWaitNoteWithoutDelayEvent(); + + /*! + *ShowSsErrorNoteEvent + */ + void showSsErrorNoteEvent(); + + /*! + * Show BIP related Note + */ + void showBIPNoteEvent(int aCommand, const QString &aText); + +public slots: + /*! + *User cancel response, Send DTMF, Send Data, Receive Data + */ + void userCancelResponse(); + +public: // from MSatUiActionImplementer and impletment by QT + + /** + * Shows the wait note. + */ + virtual void ShowWaitNoteL() {}; + + /** + * Shows the wait note without delay + */ + virtual void ShowWaitNoteWithoutDelayL(); + + /** + * Removes the wait note from the screen. + */ + void StopShowWaitNote(); + + /** + * Handles the SetUpMenu view. + * @param aText The title text. + * @param aMenuItems The array of menu item captions. + * @param aMenuItemNextActions The array of menu item next action + * indicator captions. + * @param aIconBitmap The Context pane icon. + * @param aItemsIconArray Array of item icons + * @param aSelfExplanatoryItems Flag indicating if only icons are shown. + * @param aHelpIsAvailable A flag indicating if SAT help is available. + * @return Information of the operation result. + */ + virtual TSatUiResponse SetUpMenuL( + const TDesC &aText, + const MDesCArray &aMenuItems, + const CArrayFixFlat* aMenuItemNextActions, + const CFbsBitmap* aIconBitmap, + //const CAknIconArray* aItemIconsArray, + const TBool aSelfExplanatoryItems, + const TBool aHelpIsAvailable); + + /** + * Handles the SelectItem view. + * @param aText The title text. + * @param aMenuItems The array of menu items. + * @param aMenuItemNextActions The array of next action indicators. + * @param aDefaultItem The item in focus. + * @param aSelection The item index selected by the user. + * @param aIconBitmap The Context Pane icon. + * @param aItemsIconArray Array of item icons + * @param aSelfExplanatoryItems Flag indicating if only icons are shown. + * @param aHelpIsAvailable A flag indicating if SAT help is available. + * @return Information of the operation result. + */ + virtual TSatUiResponse SelectItemL( const TDesC &aText, + const MDesCArray &aMenuItems, + const CArrayFixFlat* aMenuItemNextActions, + const TInt aDefaultItem, + TUint8 &aSelection, + const CFbsBitmap* aIconBitmap, + //const CAknIconArray* aItemsIconArray, + const TBool aSelfExplanatoryItems, + const TBool aHelpIsAvailable ); + +public: // from MSatUiActionImplementer and impletment by Symbian + + /** + * Returns CoeEnv. + */ + virtual CCoeEnv* CoeEnv() { return 0; }; + + /** + * Handles the DisplayText operation. + * @param aText Text to be shown. + * @param aSimApplicationName Sim Application name + * @param aIconBitmapDisplayText Icon for dialog + * @param aSustainedText Indicates is this text sustained ie. no timers + * used if ETrue. + * @param aDuration Duration for showing the text + * @param aWaitUserToClear Indication if user is needed to clear + * message + * @return Information of the operation result. + */ + virtual TSatUiResponse DisplayTextL( + const TDesC &aText, + const TDesC &aSimApplicationName, + CFbsBitmap* aIconBitmapDisplayText, + const TBool aSelfExplanatoryIcon, + const TBool aSustainedText, + const TTimeIntervalSeconds aDuration, + const TBool aWaitUserToClear); + + /** + * Removes Display Text Dialog from the screen. + */ + virtual void ClearScreen(); + + /** + * Asks a Yes/No answer from the user. + * @param aText A question to be shown. + * @param aCharacterSet The character range allowed. + * @param aInkey Character user feeds. + * @param aIconBitmap Icon for query dialog. + * @param aSelfExplanatory Flag indicating if icon is self-explanatory. + * @param aDuration Duration for showing the dialog. + * @param aImmediateDigitResponse Indication if Immediate digit response + * is needed. + * @return Information of the operation result. + */ + virtual TSatUiResponse GetYesNoL( + const TDesC &aText, + const TSatCharacterSet aCharacterSet, + TChar &aInkey, + const CFbsBitmap* /*aIconBitmap*/, + const TBool aSelfExplanatory, + TUint &aDuration, + const TBool aImmediateDigitResponse); + + /** + * Asks input from the user. + * @param aText A question to be shown. + * @param aCharacterSet The character range allowed. + * @param aInput The input string. + * @param aMinLength The minimum length of the input allowed. + * @param aMaxLength The maximum length of the input allowed. + * @param aHideInput A flag indicating if the input should be hidden. + * @param aGetInkey A flag indicating if GetInkey command is used. + * @param aIconBitmapGetInput Icon for query dialog. + * @param aSelfExplanatory A flag indicating if icon is self-explanatory. + * @param aDuration Duration for showing the dialog. + * @return Information of the operation result. + */ + virtual TSatUiResponse GetInputL( + const TDesC &aText, + const TSatCharacterSet aCharacterSet, + TDes &aInput, + const TInt aMinLength, + const TInt aMaxLength, + const TBool aHideInput, + const TBool aGetInkey, + const CFbsBitmap* aIconBitmapGetInput, + const TBool aSelfExplanatory, + TUint &aDuration ); + + + /** + * Handles Standard Tone playing. + * @param aText The text to be displayed. + * @param aFileName The name of the file corresponding to the tone. + * @param aDuration The duration of the tone to be played. + * @param aIconBitmap The tone playing note icon + * @param aSelfExplanatory Flag indicating if icon is self-explanatory. + * @return Information of the operation result. + */ + virtual TSatUiResponse PlayStandardToneL( + const TDesC &aText, + const TDesC8 &aSequence, + TTimeIntervalMicroSeconds aDuration, + const CFbsBitmap* aIconBitmap, + const TBool aSelfExplanatory ); + + /** + * Shows the confirmation note about the SAT Send SMS, Send SS or + * Send USSD command. + * @param aText The text to be displayed. + * @param aActionAccepted Indicates whether the command was accepted. + * @param aType Type of the request (SMS, SS, USSD). + * @return Information of the operation result. + */ + virtual TSatUiResponse ConfirmSendL( + const TDesC &aText, + TBool &aActionAccepted, + TInt aType); + + /** + * Shows the wait note about the Send SMS command. + * @param aText The text to be displayed. + * @param aIconBitmapSendSM Sending dialog icon. + * @param aSelfExplanatoryIcon A flag indicating if only icon is shown. + */ + virtual void ShowSmsWaitNoteL( + const TDesC &aText, + const CFbsBitmap* aIconBitmapSendSM, + const TBool aSelfExplanatoryIcon); + + /** + * Shows the wait note about the Send SS command. + * @param aText The text to be displayed. + * @param aIconBitmap Sending dialog icon. + * @param aSelfExplanatoryIcon A flag indicating if only icon is shown. + */ + virtual void ShowSsWaitNoteL( + const TDesC &aText, + const CFbsBitmap* /*aIconBitmap*/, + const TBool aSelfExplanatoryIcon ); + + /** + * Shows the confirmation note about the SAT Refresh command. + * @param aActionAccepted Indicates whether the command was accepted. + * @return Information of the operation result. + */ + virtual TSatUiResponse ConfirmRefreshL( + TBool &/*aActionAccepted*/) + { + return ESatSuccess; + }; + + /** + * Notification of the SAT Call Control command. + * @param aText The text string to be displayed. + * @param aAlphaIdStatus Alpha Identifier status + * @param aControlResult Call control general result + * @return The response from the UI + */ + virtual TSatUiResponse CallControlL( + const TDesC &/*aText*/, + const TSatAlphaIdStatus /*aAlphaIdStatus*/ ) + { + return ESatSuccess; + }; + + /** + * Notification of the SAT Launch browser confirmation request + * @param aText The text to be displayed. + * @param aActionAccepted Indicates whether the command was accepted. + * @param aIconBitmap The confirm note icon + * @param aSelfExplanatory Flag indicating if icon is self-explanatory. + */ + virtual void ConfirmLaunchBrowserL( + const TDesC &/*aText*/, + TBool &/*aActionAccepted*/, + const CFbsBitmap* /*aIconBitmap*/, + const TBool /*aSelfExplanatory*/) {}; + + /** + * Notification of the SAT Mo Sm Control command. + * @param aText The text string to be displayed. + * @param aAlphaIdStatus Alpha Identifier status + * @param aControlResult Mo Sm control general result + * @return The response from the UI + */ + virtual TSatUiResponse MoSmControlL( + const TDesC &/*aText*/, + const TSatAlphaIdStatus /*aAlphaIdStatus*/ ) + { + return ESatSuccess; + }; + + /** + * Shows the wait note while DTMF are being sent. + * @param aText The text to be displayed. + * @param aIconBitmap The confirm note icon + * @param aSelfExplanatory Flag indicating if icon is self-explanatory. + * @return Information on the operation result. + */ + virtual TSatUiResponse ShowDtmfWaitNoteL( + const TDesC &aText, + const CFbsBitmap* aIconBitmap, + const TBool aSelfExplanatoryIcon ); + + /** + * Dispatch iWait to action implementer. + * @param aWait Timer. + */ + virtual void DispatchTimer(CActiveSchedulerWait &/*aWait*/) {}; + + /** + * Get flag which is indicating if end key is pressed. + * @return A Boolean flag which is indicating if end key is pressed. + */ + virtual TBool GetEndKey() + { + return EFalse; + }; + + /** + * Set a flag which is indicating if end key is pressed. + * @param aValue Status of end key + */ + virtual void SetEndKey(TBool /*aValue*/) {}; + + /** + * Set a flag which is indicating if proactive command is pending. + * @param aValue Status of proactive command + */ + virtual void SetCommandPending(TBool /*aValue*/) {}; + + /** + * Plays user selected tone. + * @param aText The text to be displayed. + * @param aDuration Play duration. + * @param aTone Tone to be played. + * @param aIconBitmap The tone playing note icon + * @param aSelfExplanatory Flag indicating if icon is self-explanatory. + * @return Information on the operation result. + */ + virtual TSatUiResponse PlayUserSelectedToneL( + const TDesC &aText, + TTimeIntervalMicroSeconds aDuration, + TSatTone aTone, + const CFbsBitmap* aIconBitmap, + const TBool aSelfExplanatory ); + + /** + * Confirm user permission for Open Channel. + * @param aText The text to be displayed. + * @param aActionAccepted Indicates whether the command was accepted. + * @param aIconBitmapOpenChannel Icon for query dialog + * @param aSelfExplanatory A flag indicating if icon is self-explanatory + * @return Operation result + */ + virtual TSatUiResponse ConfirmOpenChannelL( + const TDesC &aText, + TBool &aActionAccepted, + const CFbsBitmap* /*aIconBitmapOpenChannel*/, + const TBool aSelfExplanatory ); + + /** + * Shows the wait note while BIP packets are sent. + * @param aCommand Command type. + * @param aText The text to be displayed. + * @param aIconBitmap Icon for query dialog + * @param aSelfExplanatory A flag indicating if icon is self-explanatory + */ + virtual void ShowBIPNoteL( + TInt aCommand, + const TDesC &aText, + const CFbsBitmap* /*aIconBitmap*/, + const TBool /*aSelfExplanatory*/); + + /** + * Confirm user permission for SetUpCall + * @param aText The text to be displayed. + * @param aSimAppName Header for th equery + * @param aActionAccepted Indicates whether the command was accepted. + * @param aIconBitmap Icon for query dialog + * @param aSelfExplanatory A flag indicating if icon is self-explanatory + */ + virtual void ConfirmSetUpCallL( + const TDesC &aText, + const TDesC &aSimAppName, + TBool &aActionAccepted, + const CFbsBitmap* aIconBitmap, + const TBool aSelfExplanatory); + + /** + * Show note indicating SAT is not available. + */ + virtual void ShowNotAvailableNoteL() {}; + + /** + * Show the Ss error note. + */ + virtual void ShowSsErrorNoteL(); + + /** + * Start SatUi closing process. + */ + virtual void CloseSatUI(); + + +public: // new method + + /** + * Return current profile state. + * @return current profile state. + */ + int profileState(); + + /** + * Response to the Set Up Menu command. + * @param aMenuItem The selected menu item. + * @param aHelpRequested Indicates whether help was requested. + */ + void menuSelection( int aMenuItem, bool aHelpRequested ); + +protected: + //Q_DISABLE_COPY( SatAppEventProvider ); + +private: // Data + + /** + * The pointer to the sybmian class CSatUiObserver + * which will access Sat Client API + * own + */ + CSatUiObserver *mObs; + + /** + * Own,PlayTone + */ + DummyPlayToneProvider *mPlayTone; + +}; + +#endif //DUMMYEVENTPROVIDER_H diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/inc/dummyplaytoneprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/inc/dummyplaytoneprovider.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,144 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef DUMMYPLAYTONEPROVIDER_H +#define DUMMYPLAYTONEPROVIDER_H + +#include +#include //PlayStandardTone +#include //PlayUserSelectedTone +#include +#include + + +class CMdaAudioToneUtility; +class CMdaAudioPlayerUtility; +class QTimer; +class HbMessageBox; + +class DummyPlayToneProvider: public QObject, + public MMdaAudioToneObserver,//PlayStandardTone + public MMdaAudioPlayerCallback//PlayUserSelectedTone +{ + Q_OBJECT + +public: + + /** + * Constructor + */ + DummyPlayToneProvider(QObject *parent = 0); + + /** + * Distructor + */ + virtual ~DummyPlayToneProvider(); + +public: // from MSatUiActionImplementer and impletment by Symbian + + /** + * Handles Standard Tone playing. + * @param aText The text to be displayed. + * @param aFileName The name of the file corresponding to the tone. + * @param aDuration The duration of the tone to be played. + * @param aIconBitmap The tone playing note icon + * @param aSelfExplanatory Flag indicating if icon is self-explanatory. + * @return Information of the operation result. + */ + virtual TSatUiResponse PlayStandardToneL( + const TDesC &aText, + const TDesC8 &aSequence, + TTimeIntervalMicroSeconds aDuration, + const CFbsBitmap* aIconBitmap, + const TBool aSelfExplanatory ); + + /** + * Plays user selected tone. + * @param aText The text to be displayed. + * @param aDuration Play duration. + * @param aTone Tone to be played. + * @param aIconBitmap The tone playing note icon + * @param aSelfExplanatory Flag indicating if icon is self-explanatory. + * @return Information on the operation result. + */ + virtual TSatUiResponse PlayUserSelectedToneL( + const TDesC &aText, + TTimeIntervalMicroSeconds aDuration, + TSatTone aTone, + const CFbsBitmap* aIconBitmap, + const TBool aSelfExplanatory ); + + /** + * ClearScreen + */ + void clearScreen(); + + /** + * CloseSatUI + */ + void closeSatUI(); + +public:// from MMdaAudioToneObserver + + /** + * From MMdaAudioToneObserver Called by the player object when + * it has been initialised. + * @param aError Error type. + */ + void MatoPrepareComplete( TInt aError ); + + /** + * From MMdaAudioToneObserver Called by the player object when + * the playback has been terminated. + * @param aError Error type. + */ + void MatoPlayComplete( TInt aError ); + +public://from MMdaAudioPlayerCallback + /** + * Initialisation of an audio sample has completed. + * @param aError The status of the audio sample after initialisation. + * @param aDuration The duration of the audio sample. + */ + void MapcInitComplete( + TInt aError, + const TTimeIntervalMicroSeconds& /*aDuration*/ ); + + /** + * Play of an audio sample has completed. + * @param aError The status of playback. + */ + void MapcPlayComplete( TInt aError ); + +private:// for playTone + + /** + * Get settings from current profile like volume, warning tones on/off etc. + * @param aTone, optional specifies the type of needed tone if necessary + * @param aToneName, optional buffer to get a soundfile name from + * the active profile if necessary + */ + void GetProfileParamsL( TSatTone aTone = ESatToneNotSet, + TDes* aToneName = NULL ); + + /** + * showWaitNote + */ + void showWaitNote(); + +}; + +#endif //DUMMYPLAYTONEPROVIDER_H diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/inc/ut_csatuiobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/inc/ut_csatuiobserver.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,217 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Unit test CSatUiObserver class +* +*/ + +#ifndef UT_CSATUIOBSERVER_H +#define UT_CSATUIOBSERVER_H + +#include +#include + +// Class forwards +class CSatUiObserver; +class DummyEventProvider; + +/** + * CSatUiObserver unit test class. + * + * @since S60 + */ +class Ut_CSatUiObserver : public QObject +{ + Q_OBJECT + +public: + /** + * Constructor. + */ + Ut_CSatUiObserver(QObject *parent = 0); + /** + * Destructor. + */ + virtual ~Ut_CSatUiObserver(); + +private slots: + + /** + * Called before the first testfunction is executed. + * Handles the SetUpMenu command. + */ + void initTestCase(); + + /** + * Called after the last testfunction has been executed. + * + */ + void cleanupTestCase(); + + /** + * Test CSatUiObserver's ConnectRSatSessionL. + * + */ + void testConnectRSatSession(); + + /** + * Test CSatUiObserver's Adapter. + * + */ + void testAdapter(); + + /** + * Test CSatUiObserver's DisconnectRSatSession. + * + */ + void testDisconnectRSatSession(); + + /** + * Test CSatUiObserver's ProfileState. + * + */ + void testProfileState(); + + /** + * Test CSatUiObserver's SetImplementer. + * + */ + void testSetImplementer(); + + /** + * Test CSatUiObserver's testDisplayText's input param list. + * + */ + void testDisplayText_data(); + + /** + * Test CSatUiObserver's DisplayTextL. + * + */ + void testDisplayText(); + + /** + * Test CSatUiObserver's testSetUpMenu's input param list. + * + */ + void testSetUpMenu_data(); + + /** + * Test CSatUiObserver's SetUpMenuL. + * + */ + void testSetUpMenu(); + + /** + * Test CSatUiObserver's testGetInkey's input param list. + * + */ + void testGetInkey_data(); + + /** + * Test CSatUiObserver's GetInkeyL. + * + */ + void testGetInkey(); + + /** + * Test CSatUiObserver's testGetInput's input param list. + * + */ + void testGetInput_data(); + + /** + * Test CSatUiObserver's GetInputL. + * + */ + void testGetInput(); + + /** + * Test CSatUiObserver's testConfirmCommand's input param list. + * + */ + void testConfirmCommand_data(); + + /** + * Test CSatUiObserver's ConfirmCommand. + * + */ + void testConfirmCommand(); + + + /** + * Test CSatUiObserver's Notification input param list. + * + */ + void testNotification_data(); + + /** + * Test CSatUiObserver's Notification. + * + */ + void testNotification(); + + + /** + * Test CSatUiObserver's EventNotification input param list. + * + */ + void testEventNotification_data(); + + /** + * Test CSatUiObserver's Notification. + * + */ + void testEventNotification(); + + /** + * Test CSatUiObserver's testSetUpMenu's input param list. + * + */ + void testSelectItem_data(); + + /** + * Test CSatUiObserver's SetUpMenuL. + * + */ + void testSelectItem(); + + /** + * Test CSatUiObserver's testPlayTone input param list. + * + */ + void testPlayTone_data(); + + /** + * Test CSatUiObserver's testPlayTone. + * + */ + void testPlayTone(); + +private: + + /** + * Own. + * + */ + CSatUiObserver *mSatObserver; + + /** + * Own. + * + */ + DummyEventProvider *mImplementer; + +}; + +#endif // UT_CSATUIOBSERVER_H diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/inc/ut_playtoneprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/inc/ut_playtoneprovider.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef UT_SATAPPPLAYTONEPROVIDER_H +#define UT_SATAPPPLAYTONEPROVIDER_H + +#include +#include + + +// Class forwards +class SatAppPlayToneProvider; + +/** + * Satapp unit test class. + * + * @since S60 + */ +class Ut_SatAppPlayToneProvider : public QObject +{ + Q_OBJECT + +public: + + Ut_SatAppPlayToneProvider(QObject *parent = 0); + + virtual ~Ut_SatAppPlayToneProvider(); + +private slots: + /** + * Called before the first testfunction is executed. + * Handles the SetUpMenu command. + */ + void initTestCase(); + + /** + * Called after the last testfunction has been executed. + * + */ + void cleanupTestCase(); + + /** + * Test SatAppPlayToneProvider's constructor. + * + */ + void testCreatePlayTone(); + + /** + * Test SatAppPlayToneProvider's testPlayStandardTone input param list. + * + */ + void testPlayStandardTone_data(); + + /** + * Test SatAppPlayToneProvider's PlayStandardToneL. + * + */ + void testPlayStandardTone(); + + /** + * Test SatAppPlayToneProvider's testPlayUserSelectedTone input param list. + * + */ + void testPlayUserSelectedTone_data(); + + /** + * Test SatAppPlayToneProvider's PlayUserSelectedToneL. + * + */ + void testPlayUserSelectedTone(); + + /** + * Test SatAppPlayToneProvider's closeSatUI. + * + */ + void testCloseSatUI(); + + /** + * Test SatAppPlayToneProvider's clearScreen. + * + */ + void testClearScreen(); + + /** + * Test SatAppPlayToneProvider's testMapcPlayComplete input param list. + * + */ + void testMapcPlayComplete_data(); + + /** + * Test SatAppPlayToneProvider's MapcPlayComplete. + * + */ + void testMapcPlayComplete(); + + /** + * Test SatAppPlayToneProvider's testMapcInitComplete input param list. + * + */ + void testMapcInitComplete_data(); + + + /** + * Test SatAppPlayToneProvider's MapcInitComplete. + * + */ + void testMapcInitComplete(); + +private: + /** + * Own. + */ + SatAppPlayToneProvider *mPlayTone; + +}; + +#endif // UT_SATAPPPLAYTONEPROVIDER_H diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/inc/ut_satappeventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/inc/ut_satappeventhandler.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef UT_SATAPPEVENTPROVIDER_H +#define UT_SATAPPEVENTPROVIDER_H + +#include +#include +#include + +// Class forwards +class HbMainWindow; +class HbView; +class SatAppEventProvider; + +/** + * Satapp unit test class. + * + * @since S60 + */ +class Ut_SatAppEventProvider : public QObject +{ + Q_OBJECT + +public: + + Ut_SatAppEventProvider(QObject *parent = 0); + + + virtual ~Ut_SatAppEventProvider(); + +private slots: + /** + * Called before the first testfunction is executed. + * Handles the SetUpMenu command. + */ + void initTestCase(); + + /** + * Called after the last testfunction has been executed. + * + */ + void cleanupTestCase(); + + /** + * Test SatAppEventProvider's constructor. + * + */ + void testCreateEventHandler(); + + /** + * Test SatAppEventProvider's testShowSsWaitNote param list. + * + */ + void testShowSsWaitNote_data(); + + /** + * Test SatAppEventProvider's showSsWaitNote. + * + */ + void testShowSsWaitNote(); + + /** + * Test SatAppEventProvider's StopShowWaitNote. + * + */ + void testStopShowWaitNote(); + + /** + * Test SatAppEventProvider's ShowWaitNoteWithoutDelayL. + * + */ + void testShowWaitNoteWithoutDelay(); + + /** + * Test SatAppEventProvider's ShowSsErrorNoteL. + * + */ + void testShowSsErrorNote(); + +private: + /** + * Own. + */ + SatAppEventProvider *mEventHandler; + + /** + * Own. + */ + HbMainWindow *mWindow; + + +}; + +#endif // UT_SATAPPEVENTPROVIDER_H diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/inc/ut_satappmainhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/inc/ut_satappmainhandler.h Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef UT_SATAPPMAINHANDLER_H +#define UT_SATAPPMAINHANDLER_H + +#include +#include + + +// Class forwards +class SatAppMainHandler; + +/** + * Satapp unit test class. + * + * @since S60 + */ +class Ut_SatAppMainHandler : public QObject +{ + Q_OBJECT + +public: + + Ut_SatAppMainHandler(QObject *parent = 0); + + virtual ~Ut_SatAppMainHandler(); + +private slots: + /** + * Called before the first testfunction is executed. + * Handles the SetUpMenu command. + */ + void initTestCase(); + + /** + * Called after the last testfunction has been executed. + * + */ + void cleanupTestCase(); + + /** + * Test SatAppMainHandler's constructor. + * + */ + void testCreateMainHandler(); + +private: + /** + * Own. + */ + SatAppMainHandler *mMainHandler; + +}; + +#endif // UT_SATAPPMAINHANDLER_H diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/src/dummyeventprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/src/dummyeventprovider.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,681 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include "dummyeventprovider.h" +#include "tflogger.h" +#include "csatuiobserver.h" +#include "dummyplaytoneprovider.h" + +// ---------------------------------------------------------------------------- +// DummyEventProvider::DummyEventProvider +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +DummyEventProvider::DummyEventProvider(QObject *parent) : + QObject(parent), mObs(NULL) +{ + qDebug("SATAPP: DummyEventProvider::DummyEventProvider call"); + TRAPD(err, mObs = CSatUiObserver::NewL()); + + if (KErrNone != err) { + CloseSatUI(); + } else { + mObs->SetImplementer(this); + TFLOGSTRING("SATAPP: DummyEventProvider::DummyEventProvider \ + SetImplementer") + mPlayTone = new DummyPlayToneProvider(this); + } + qDebug("SATAPP: DummyEventProvider::DummyEventProvider exit"); +} + +// ---------------------------------------------------------------------------- +// DummyEventProvider::~DummyEventProvider +// Sets a pointer to CSatUiViewAppUi object. +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +DummyEventProvider::~DummyEventProvider() +{ + qDebug("SATAPP: DummyEventProvider::~DummyEventProvider call"); + delete mObs; + mObs = NULL; + if (mPlayTone) { + delete mPlayTone; + mPlayTone = 0; + TFLOGSTRING("SATAPP: DummyEventProvider::~DummyEventProvider delete\ + mPlayTone") + } + qDebug("SATAPP: DummyEventProvider::~DummyEventProvider exit"); +} + +// ---------------------------------------------------------------------------- +// DummyEventProvider::SetUpMenuL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse DummyEventProvider::SetUpMenuL( + const TDesC &aText, + const MDesCArray &aMenuItems, + const CArrayFixFlat */*aMenuItemNextActions*/, + const CFbsBitmap */*aIconBitmap*/, + //const CAknIconArray */*aItemIconsArray*/, + const TBool aSelfExplanatoryItems, + const TBool aHelpIsAvailable) + { + qDebug("SATAPP: DummyEventProvider::SetUpMenuL call"); + + TSatUiResponse response(ESatSuccess); + QString title; + if (aText.Length() > 0) { + title = QString::fromUtf16 (aText.Ptr(), aText.Length()); + } + + QStringList *menuList = new QStringList(); + qDebug("SATAPP: DummyEventProvider::SetUpMenuL List"); + + //Add Item + if(menuList) { + for (int i=0 ; iappend(item); + } + + qDebug("SATAPP: DummyEventProvider::SetUpMenuL add item"); + + emit setUpMenuEvent( + response, + title, + *menuList, + //const CArrayFixFlat *aMenuItemNextActions, + //const HbIcon &aIcon, + //const CArrayFixFlat *aMenuIcons, + aSelfExplanatoryItems, + aHelpIsAvailable); + + delete menuList; + } + qDebug("SATAPP: DummyEventProvider::SetUpMenuL exit"); + + return response; + } + +// ---------------------------------------------------------------------------- +// DummyEventProvider::SetUpMenuL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse DummyEventProvider::SelectItemL( + const TDesC &aText, + const MDesCArray &aMenuItems, + const CArrayFixFlat */*aMenuItemNextActions*/, + const TInt aDefaultItem, + TUint8 &aSelection, + const CFbsBitmap */*aIconBitmap*/, + //const CAknIconArray */*aItemsIconArray*/, + const TBool aSelfExplanatoryItems, + const TBool aHelpIsAvailable) +{ + qDebug("SATAPP: DummyEventProvider::SelectItemL call"); + + TSatUiResponse response(ESatSuccess); + aSelection = 0; + QString title; + if (aText.Length() > 0) { + title=QString::fromUtf16(aText.Ptr(), aText.Length()); + } + + QStringList *menuList = new QStringList(); + //Add Item + if(menuList) { + for (int i=0 ; iappend(item); + } + qDebug("SATAPP: DummyEventProvider::SelectItemL add item"); + + emit selectItemEvent( + response, + title, + *menuList, + aDefaultItem, + aSelection, + //const CArrayFixFlat *aMenuItemNextActions, + //const HbIcon &aIcon, + //const CArrayFixFlat *aMenuIcons, + aSelfExplanatoryItems, + aHelpIsAvailable); + + delete menuList; + } + qDebug("SATAPP: DummyEventProvider::SelectItemL exit"); + + return response; +} + +// ---------------------------------------------------------------------------- +// DummyEventProvider::ProfileState +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +int DummyEventProvider::profileState() +{ + qDebug("SATAPP: DummyEventProvider::ProfileState call"); + int res (0); + if (mObs) { + res = mObs->ProfileState(); + } + qDebug("SATAPP: DummyEventProvider::ProfileState exit"); + return res; +} + +// ---------------------------------------------------------------------------- +// DummyEventProvider::MenuSelection +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyEventProvider::menuSelection(int aMenuItem, bool aHelpRequested) + { + if(mObs && mObs->Adapter()) { + mObs->Adapter()->MenuSelection(aMenuItem, aHelpRequested); + } + + qDebug("SATAPP: DummyEventProvider::MenuSelection exit"); + } + +// ---------------------------------------------------------------------------- +// DummyEventProvider::DisplayTextL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse DummyEventProvider::DisplayTextL( + const TDesC &aText, + const TDesC &aSimApplicationName, + CFbsBitmap */*aIconBitmapDisplayText*/, + const TBool aSelfExplanatoryIcon, + const TBool aSustainedText, + const TTimeIntervalSeconds aDuration, + const TBool aWaitUserToClear) + { + qDebug("SATAPP: DummyEventProvider::DisplayTextL call"); + + TSatUiResponse response(ESatFailure); + QString title; + if (aText.Length() > 0) { + title=QString::fromUtf16(aText.Ptr(), aText.Length()); + } else { + qDebug("SATAPP: DummyEventProvider::DisplayTextL null text"); + response = ESatFailure; + } + + QString appName; + if (aSimApplicationName.Length() > 0) { + appName=QString::fromUtf16(aSimApplicationName.Ptr(), + aSimApplicationName.Length()); + } else { + // test leave + qDebug("SATAPP: DummyEventProvider::DisplayTextL leave exit"); + User::Leave(KErrNotFound); + } + + int timeInterval = aDuration.Int(); + + bool isSelfExplanatoryIcon = (aSelfExplanatoryIcon) ? true : false; + + emit displayTextEvent( + response, + title, + appName, + //const HbIcon &aIcon, + isSelfExplanatoryIcon, + aSustainedText, + timeInterval, + aWaitUserToClear); + + qDebug("SATAPP: DummyEventProvider::DisplayTextL exit"); + return response; + } + +// ---------------------------------------------------------------------------- +// DummyEventProvider::GetInputLL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse DummyEventProvider::GetInputL( + const TDesC &aText, + const TSatCharacterSet aCharacterSet, + TDes &aInput, + const TInt aMinLength, + const TInt aMaxLength, + const TBool aHideInput, + const TBool aGetInkey, + const CFbsBitmap */*aIconBitmapGetInput*/, + const TBool aSelfExplanatory, + TUint &aDuration) +{ + qDebug("SATAPP: DummyEventProvider::GetInputL call"); + + TSatUiResponse response(ESatSuccess); + + QString title; + if (aText.Length() > 0) { + title=QString::fromUtf16(aText.Ptr(), aText.Length()); + TFLOGSTRING2("SATAPP: DummyEventProvider::GetInputL \ + Title=%S", &aText) + } + + QString inputText; + if (aInput.Length() > 0) { + inputText = QString::fromUtf16(aInput.Ptr(), aInput.Length()); + } else { + // test leave + TFLOGSTRING("SATAPP: DummyEventProvider::GetInkey test leave") + User::Leave(KErrNotFound); + } + bool isSelfExplanatory = aSelfExplanatory; + unsigned int duration = aDuration; + if (aGetInkey) { + //Get Inkey + emit getInkeyEvent( + response, + title, + aCharacterSet, + inputText, + //iconBitmapGetInput, + isSelfExplanatory, + duration); + qDebug("SATAPP: DummyEventProvider::GetInputL: GetInkey"); + aInput.Copy(reinterpret_cast(inputText.utf16()), inputText.length()); + } else { + // Get Input + bool hideInput = aHideInput; + int minLength = aMinLength; + int maxLength = aMaxLength; + emit getInputEvent( + response, + title, + aCharacterSet, + inputText, + minLength, + maxLength, + hideInput, + //iconBitmapGetInput, + isSelfExplanatory, + duration); + int length = inputText.length(); + if (length > maxLength) { + length = maxLength; + } + qDebug("SATAPP: DummyEventProvider::GetInputL: GetInput"); + aInput.Copy(reinterpret_cast(inputText.utf16()), length); + } + qDebug("SATAPP: DummyEventProvider::GetInputL exit"); + return response; + } + + // ---------------------------------------------------------------------------- +// DummyEventProvider::GetYesNoL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse DummyEventProvider::GetYesNoL( + const TDesC &aText, + const TSatCharacterSet aCharacterSet, + TChar &aInkey, + const CFbsBitmap */*aIconBitmap*/, + const TBool aSelfExplanatory, + TUint &aDuration, + const TBool aImmediateDigitResponse) +{ + qDebug("SATAPP: DummyEventProvider::GetYesNoL call"); + TSatUiResponse response(ESatSuccess); + QString text; + if (aText.Length() > 0) { + text=QString::fromUtf16(aText.Ptr(), aText.Length()); + } + + unsigned int inKey = static_cast < TUint >(aInkey); + + bool selfExplanatory = aSelfExplanatory; + bool immediateDigitResponse = aImmediateDigitResponse; + unsigned int duration = aDuration; + + emit getYesNoEvent( + response, + text, + aCharacterSet, + inKey, + //const TSatIconId &aIconId, + selfExplanatory, + duration, + immediateDigitResponse); + + aInkey = inKey; + qDebug("SATAPP: DummyEventProvider::GetYesNoL exit"); + return response; +} + +// ---------------------------------------------------------------------------- +// DummyEventProvider::ConfirmSendL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse DummyEventProvider::ConfirmSendL( + const TDesC &aText, + TBool &aActionAccepted, + TInt aType) +{ + qDebug("SATAPP: DummyEventProvider::ConfirmSendL call"); + TSatUiResponse response(ESatSuccess); + QString text; + if (aText.Length() > 0) { + text=QString::fromUtf16(aText.Ptr(), aText.Length()); + } + bool actionAccepted = aActionAccepted; + int type = aType; + emit confirmSendEvent( + response, + text, + actionAccepted, + type); + qDebug("SATAPP: DummyEventProvider::ConfirmSendL exit"); + return response; +} + +// ---------------------------------------------------------------------------- +// DummyEventProvider::ShowSmsWaitNoteL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyEventProvider::ShowSmsWaitNoteL( + const TDesC &aText, + const CFbsBitmap */*aIconBitmapSendSM*/, + const TBool aSelfExplanatoryIcon) +{ + qDebug("SATAPP: DummyEventProvider::ShowSmsWaitNoteL call"); + QString title; + if (aText.Length() > 0) { + title = QString::fromUtf16 (aText.Ptr(), aText.Length()); + } + bool selfExplanatoryIcon = aSelfExplanatoryIcon; + + emit showSmsWaitNoteEvent( + title, + selfExplanatoryIcon); + qDebug("SATAPP: DummyEventProvider::ShowSmsWaitNoteL exit"); +} + +// ---------------------------------------------------------------------------- +// DummyEventProvider::ConfirmSetUpCallL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyEventProvider::ConfirmSetUpCallL( + const TDesC &aText, + const TDesC &aSimAppName, + TBool &aActionAccepted, + const CFbsBitmap */*aIconBitmap*/, + const TBool /*aSelfExplanatory*/) + { + qDebug("SATAPP: DummyEventProvider::ConfirmSetUpCallL call"); + QString text; + if (aText.Length() > 0) { + text = QString::fromUtf16 (aText.Ptr(), aText.Length()); + TFLOGSTRING2("SATAPP: DummyEventProvider::ConfirmSetUpCallL \ + text=%S", text.utf16()) + } + + QString title; + if (aText.Length() > 0) { + title = QString::fromUtf16 (aSimAppName.Ptr(), aSimAppName.Length()); + TFLOGSTRING2("SATAPP: DummyEventProvider::ConfirmSetUpCallL \ + Title=%S", title.utf16()) + } + bool actionAccepted = aActionAccepted; + + emit showSetUpCallConfirmEvent( + text, + title, + actionAccepted); + qDebug("SATAPP: DummyEventProvider::ConfirmSetUpCallL exit"); + } + +// ---------------------------------------------------------------------------- +// DummyEventProvider::ShowDtmfWaitNoteL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse DummyEventProvider::ShowDtmfWaitNoteL( + const TDesC &aText, + const CFbsBitmap */*aIconBitmapSendSM*/, + const TBool /*aSelfExplanatoryIcon*/) +{ + TSatUiResponse response(ESatSuccess); + qDebug("SATAPP: DummyEventProvider::ShowDtmfWaitNoteL call"); + QString title; + if (aText.Length() > 0) { + title = QString::fromUtf16 (aText.Ptr(), aText.Length()); + TFLOGSTRING2("SATAPP: DummyEventProvider::ShowDtmfWaitNoteL \ + Title=%S", title.utf16()) + } + emit showDtmfWaitNoteEvent( + response, + title); + qDebug("SATAPP: DummyEventProvider::ShowDtmfWaitNoteL exit"); + return response; +} + +// ---------------------------------------------------------------------------- +// DummyEventProvider::clearScreen +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyEventProvider::ClearScreen() +{ + qDebug("SATAPP: DummyEventProvider::ClearScreen call"); + if (mPlayTone) { + mPlayTone->clearScreen(); + } + emit clearScreenEvent(); + qDebug("SATAPP: DummyEventProvider::ClearScreen exit"); +} + +// ---------------------------------------------------------------------------- +// DummyEventProvider::CloseSatUI +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyEventProvider::CloseSatUI() +{ + qDebug("SATAPP: DummyEventProvider::CloseSatUI call"); + if (mPlayTone) { + mPlayTone->closeSatUI(); + } + emit closeUiEvent(); + qDebug("SATAPP: DummyEventProvider::CloseSatUI exit"); +} + +//----------------------------------------------------------------------------- +// DummyEventProvider::StopShowWaitNote +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyEventProvider::StopShowWaitNote() +{ + qDebug("SATAPP: DummyEventProvider::StopShowWaitNote call"); + emit stopShowWaitNoteEvent(); + qDebug("SATAPP: DummyEventProvider::StopShowWaitNote exit"); +} + +//----------------------------------------------------------------------------- +// DummyEventProvider::userCancelDtmfResponse +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyEventProvider::userCancelResponse() +{ + qDebug("SATAPP: DummyEventProvider::userCancelDtmfResponse call"); + mObs->Adapter()->SessionTerminated( ESessionCancel ); + qDebug("SATAPP: DummyEventProvider::userCancelDtmfResponse exit"); +} + +//----------------------------------------------------------------------------- +// DummyEventProvider::ShowSsWaitNoteL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyEventProvider::ShowSsWaitNoteL( + const TDesC &aText, + const CFbsBitmap* /*aIconBitmap*/, + const TBool aSelfExplanatoryIcon ) +{ + TFLOGSTRING("SATAPP: DummyEventProvider::ShowSsWaitNoteL call") + QString title; + if (aText.Length() > 0) { + title = QString::fromUtf16 (aText.Ptr(), aText.Length()); + TFLOGSTRING2("SATAPP: DummyEventProvider::ShowSsWaitNoteL \ + Title=%s", title.utf16()) + } + bool selfExplanatoryIcon = aSelfExplanatoryIcon; + + emit showSsWaitNoteEvent( + title, + selfExplanatoryIcon); + TFLOGSTRING("SATAPP: DummyEventProvider::ShowSsWaitNoteL exit") +} + +//----------------------------------------------------------------------------- +// DummyEventProvider::ShowWaitNoteWithoutDelayL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyEventProvider::ShowWaitNoteWithoutDelayL() +{ + TFLOGSTRING("SATAPP: DummyEventProvider::ShowWaitNoteWithoutDelayL call") + emit showWaitNoteWithoutDelayEvent(); + TFLOGSTRING("SATAPP: DummyEventProvider::ShowWaitNoteWithoutDelayL exit") +} + +//----------------------------------------------------------------------------- +// DummyEventProvider::showSsErrorNoteEvent +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyEventProvider::ShowSsErrorNoteL() +{ + TFLOGSTRING("SATAPP: DummyEventProvider::showSsErrorNoteEvent call") + emit showSsErrorNoteEvent(); + TFLOGSTRING("SATAPP: DummyEventProvider::showSsErrorNoteEvent exit") +} + +//----------------------------------------------------------------------------- +// DummyEventProvider::ShowBIPNoteL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyEventProvider::ShowBIPNoteL( TInt aCommand, const TDesC &aText, + const CFbsBitmap* /*aIconBitmap*/, const TBool /*aSelfExplanatory*/) +{ + TFLOGSTRING("SATAPP: DummyEventProvider::ShowBIPNoteL call") + int cmdType = aCommand; + QString title; + if (aText.Length() > 0) { + title=QString::fromUtf16(aText.Ptr(), aText.Length()); + TFLOGSTRING2("SATAPP: DummyEventProvider::ShowBIPNoteL \ + Title=%S", title.utf16()) + } + emit showBIPNoteEvent(cmdType, title); + TFLOGSTRING("SATAPP: DummyEventProvider::ShowBIPNoteL exit") +} + +//----------------------------------------------------------------------------- +// DummyEventProvider::ConfirmOpenChannelL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse DummyEventProvider::ConfirmOpenChannelL( + const TDesC &aText, + TBool &aActionAccepted, + const CFbsBitmap* /*aIconBitmapOpenChannel*/, + const TBool /*aSelfExplanatory*/ ) +{ + TFLOGSTRING("SATAPP: DummyEventProvider::ConfirmOpenChannelL call") + + TSatUiResponse response( ESatSuccess ); + + QString title; + if (aText.Length() > 0) { + title=QString::fromUtf16(aText.Ptr(), aText.Length()); + TFLOGSTRING2("SATAPP: DummyEventProvider::ConfirmOpenChannelL \ + Title=%s", title.utf16()) + } + + bool actionAccepted = aActionAccepted; + + emit showOpenChannelConfirmEvent(title, actionAccepted); + + TFLOGSTRING2( "SATAPP: DummyEventProvider::ConfirmOpenChannelL exit\ + response: %d", response) + return response; +} + +//----------------------------------------------------------------------------- +// DummyEventProvider::PlayStandardToneL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse DummyEventProvider::PlayStandardToneL( const TDesC& aText, + const TDesC8& aSequence, + TTimeIntervalMicroSeconds aDuration, + const CFbsBitmap* aIconBitmap, + const TBool aSelfExplanatory ) +{ + TFLOGSTRING("SATAPP: DummyEventProvider::PlayStandardToneL call") + TSatUiResponse response = mPlayTone->PlayStandardToneL( + aText, aSequence, aDuration, aIconBitmap, aSelfExplanatory); + TFLOGSTRING2("SATAPP: DummyEventProvider::PlayStandardToneL \ + response= %d exit", response) + return response; +} + +//----------------------------------------------------------------------------- +// DummyEventProvider::PlayUserSelectedToneL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse DummyEventProvider::PlayUserSelectedToneL( + const TDesC &aText, + TTimeIntervalMicroSeconds aDuration, + TSatTone aTone, + const CFbsBitmap* aIconBitmap, + const TBool aSelfExplanatory ) +{ + TFLOGSTRING("DummyEventProvider::PlayUserSelectedToneL calling") + if (100 == aTone) { + TFLOGSTRING("DummyEventProvider::PlayUserSelectedToneL test failure") + return ESatFailure; + } + TSatUiResponse response = mPlayTone->PlayUserSelectedToneL( + aText, aDuration, aTone, aIconBitmap, aSelfExplanatory); + TFLOGSTRING2( "DummyEventProvider::PlayUserSelectedToneL response= %d \ + exit", response) + return response; +} + //End of file diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/src/dummyplaytoneprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/src/dummyplaytoneprovider.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,178 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// PlayStandardTone +#include +#include +#include +#include +#include //KAudioPriorityLowLevel + +#include //KMdaRepeatForever +#include // timeout callback +#include //playtone note +#include // for CMdaAudioToneUtility&CMdaAudioPlayerUtility +#include //TTimeIntervalMicroSeconds + +#include "dummyplaytoneprovider.h" + +//#include "tflogger.h" + + +// ---------------------------------------------------------------------------- +// DummyPlayToneProvider::DummyPlayToneProvider +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +DummyPlayToneProvider::DummyPlayToneProvider(QObject *parent) : + QObject(parent) +{ + qDebug("SATAPP: DummyPlayToneProvider::DummyPlayToneProvider >"); + qDebug("SATAPP: DummyPlayToneProvider::DummyPlayToneProvider <"); +} + +// ---------------------------------------------------------------------------- +// DummyPlayToneProvider::~DummyPlayToneProvider +// Sets a pointer to CSatUiViewAppUi object. +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +DummyPlayToneProvider::~DummyPlayToneProvider() +{ + qDebug("SATAPP: DummyPlayToneProvider::~DummyPlayToneProvider >"); + qDebug("SATAPP: DummyPlayToneProvider::~DummyPlayToneProvider <"); +} + +//----------------------------------------------------------------------------- +// DummyPlayToneProvider::PlayStandardToneL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse DummyPlayToneProvider::PlayStandardToneL( const TDesC& /*aText*/, + const TDesC8& /*aSequence*/, + TTimeIntervalMicroSeconds /*aDuration*/, + const CFbsBitmap* /*aIconBitmap*/, + const TBool /*aSelfExplanatory*/ ) +{ + qDebug("SATAPP: DummyPlayToneProvider::PlayStandardToneL >"); + qDebug("SATAPP: DummyPlayToneProvider::PlayStandardToneL <"); + return ESatSuccess; +} + + +// --------------------------------------------------------- +// SatAppCommandHandler::GetProfileParamsL +// Get and store settings from current profile +// (other items were commented in a header). +// --------------------------------------------------------- +// +void DummyPlayToneProvider::GetProfileParamsL( TSatTone + /*aTone = ESatToneNotSet*/, TDes* /*aToneName = NULL*/ ) +{ + qDebug( "SatAppCommandHandler::GetProfileParamsL >"); + qDebug("SatAppCommandHandler::GetProfileParamsL <"); +} + +// --------------------------------------------------------- +// DummyPlayToneProvider::MatoPrepareComplete +// Indicates success or failure. +// (other items were commented in a header). +// --------------------------------------------------------- +// +void DummyPlayToneProvider::MatoPrepareComplete(TInt /*aError*/) +{ + qDebug("DummyPlayToneProvider::MatoPrepareComplete >"); + qDebug( "DummyPlayToneProvider::MatoPrepareComplete <"); +} + +//----------------------------------------------------------------------------- +// DummyPlayToneProvider::MatoPlayComplete +// Indicates success or failure. +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyPlayToneProvider::MatoPlayComplete( TInt /*aError*/ ) +{ + qDebug("DummyPlayToneProvider::MatoPlayComplete >"); + qDebug("DummyPlayToneProvider::MatoPlayComplete <"); +} + +//----------------------------------------------------------------------------- +// DummyPlayToneProvider::PlayUserSelectedToneL +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TSatUiResponse DummyPlayToneProvider::PlayUserSelectedToneL( + const TDesC &/*aText*/, + TTimeIntervalMicroSeconds /*aDuration*/, + TSatTone /*aTone*/, + const CFbsBitmap* /*aIconBitmap*/, + const TBool /*aSelfExplanatory*/ ) +{ + qDebug("DummyPlayToneProvider::PlayUserSelectedToneL >"); + qDebug( "DummyPlayToneProvider::PlayUserSelectedToneL <"); + return ESatSuccess; +} + +//----------------------------------------------------------------------------- +// DummyPlayToneProvider::MapcInitComplete +// Plays the tone. +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +void DummyPlayToneProvider::MapcInitComplete( TInt /*aError*/, + const TTimeIntervalMicroSeconds& /*aDuration*/ ) +{ + qDebug( "DummyPlayToneProvider::MapcInitComplete >" ); + qDebug( "DummyPlayToneProvider::MapcInitComplete <" ); +} + +//----------------------------------------------------------------------------- +// DummyPlayToneProvider::MapcPlayComplete +// Deletes audio player after playing is completed. +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +void DummyPlayToneProvider::MapcPlayComplete( TInt /*aError*/ ) +{ + qDebug( "DummyPlayToneProvider::MapcPlayComplete >"); + qDebug("DummyPlayToneProvider::MapcPlayComplete <"); +} + +// ---------------------------------------------------------------------------- +// DummyPlayToneProvider::clearScreen +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyPlayToneProvider::clearScreen() +{ + qDebug("SATAPP: SatAppEventProvider::clearScreen >"); + qDebug("SATAPP: DummyPlayToneProvider::clearScreen <"); +} + +// ---------------------------------------------------------------------------- +// DummyPlayToneProvider::clearScreen +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +void DummyPlayToneProvider::closeSatUI() +{ + qDebug("SATAPP: DummyPlayToneProvider::closeSatUI >"); + clearScreen(); + qDebug("SATAPP: DummyPlayToneProvider::closeSatUI <"); +} + + //End of file diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/src/main.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description:Unit testing of SatApp +* +* +*/ + + +#include + +#include "ut_satappmainhandler.h" +#include "ut_csatuiobserver.h" +#include "ut_satappeventhandler.h" +#include "ut_playtoneprovider.h" + +int main(int argc, char *argv[]) +{ + qDebug("Ut_SatApp: main() >"); + QApplication app(argc, argv); + + int result(0); + char *pass[3]; + pass[0] = argv[0]; + pass[1] = "-o"; + pass[2] = "c:\\logs\\sat\\ut_SatAppMainHandler.txt"; + + qDebug("Test SatAppMainHandler"); + Ut_SatAppMainHandler tc; + result = QTest::qExec(&tc, 3, pass); + qDebug("Ut_SatApp: main() test SatAppMainHandler, result=%d", result); + + //qDebug("Test CSatUiObserve"); + Ut_CSatUiObserver utCSatUiObserver; + char *test[3]; + test[0] = argv[0]; + test[1] = "-o"; + test[2] = "c:\\logs\\sat\\ut_CSatUiObserver.txt"; + result = QTest::qExec(&utCSatUiObserver, 3, test); + qDebug("Ut_SatApp: main() test CSatUiObserver<, result=%d", result); + + /*Ut_SatAppEventProvider utSatAppEventProvider; + char *test_event[3]; + test_event[0] = argv[0]; + test_event[1] = "-o"; + test_event[2] = "c:\\logs\\sat\\ut_SatAppEventProvide.txt"; + result = QTest::qExec(&utSatAppEventProvider, 3, test_event); + qDebug("Ut_SatApp: main() test SatAppEventProvide<, result=%d", result);*/ + + Ut_SatAppPlayToneProvider utPlayTone; + char *test_playtone[3]; + test_playtone[0] = argv[0]; + test_playtone[1] = "-o"; + test_playtone[2] = "c:\\logs\\sat\\Ut_SatAppPlayToneProvider.txt"; + result = QTest::qExec(&utPlayTone, 3, test_playtone); + qDebug("Ut_SatApp: main() test SatAppPlayToneProvider<, result=%d", result); + + return result; +} + +//End of file diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/src/ut_csatuiobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/src/ut_csatuiobserver.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,1079 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Unit test for CSatUiObserver +* +*/ + +//symbian +#include +//#include +#include +#include +//qt +#include +//test class +#include "csatuiobserver.h" +#include "ut_csatuiobserver.h" +#include "dummyeventprovider.h" + + + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::Ut_CSatUiObserver +// ----------------------------------------------------------------------------- +// +Ut_CSatUiObserver::Ut_CSatUiObserver(QObject *parent):QObject(parent) +{ + qDebug("Ut_CSatUiObserver::Ut_CSatUiObserver >"); + TRAPD(err, mSatObserver = CSatUiObserver::NewL()); + qDebug("Ut_CSatUiObserver: Ut_CSatUiObserver, err=%d", err); + mImplementer = new DummyEventProvider(); + QVERIFY(mImplementer); + qDebug("Ut_CSatUiObserver::Ut_CSatUiObserver <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::~Ut_CSatUiObserver +// ----------------------------------------------------------------------------- +// +Ut_CSatUiObserver::~Ut_CSatUiObserver() +{ + qDebug("Ut_CSatUiObserver::~Ut_CSatUiObserver >"); + if (mSatObserver) { + qDebug("Ut_CSatUiObserver::~Ut_CSatUiObserver delete mSatObserver..."); + delete mSatObserver; + mSatObserver = 0; + } + if (mImplementer) { + qDebug("Ut_CSatUiObserver::~Ut_CSatUiObserver delete mImplementer..."); + delete mImplementer; + mImplementer = 0; + } + qDebug("Ut_CSatUiObserver::~Ut_CSatUiObserver <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::initTestCase +// QTestLib cleanup method, called after the last testfunction . +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::initTestCase() +{ + qDebug("Ut_CSatUiObserver::initTestCase >"); + qDebug("Ut_CSatUiObserver::initTestCase <"); +} + + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::cleanupTestCase +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::cleanupTestCase() +{ + qDebug("Ut_CSatUiObserver::cleanupTestCase >"); + qDebug("Ut_CSatUiObserver::cleanupTestCase <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testConnectRSatSession +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testConnectRSatSession() +{ + qDebug("Ut_CSatUiObserver::testConnectRSatSession >"); + QVERIFY(mSatObserver); + TRAP_IGNORE(mSatObserver->ConnectRSatSessionL()); + qDebug("Ut_CSatUiObserver::testConnectRSatSession <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testAdapter +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testAdapter() +{ + qDebug("Ut_CSatUiObserver::testAdapter >"); + QVERIFY(mSatObserver); + mSatObserver->Adapter(); + qDebug("Ut_CSatUiObserver::testAdapter <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testDisconnectRSatSession +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testDisconnectRSatSession() +{ + qDebug("Ut_CSatUiObserver::testDisconnectRSatSession >"); + QVERIFY(mSatObserver); + mSatObserver->DisconnectRSatSession(); + qDebug("Ut_CSatUiObserver::testDisconnectRSatSession <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testProfileState +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testProfileState() +{ + qDebug("Ut_CSatUiObserver::testProfileState >"); + QVERIFY(mSatObserver); + mSatObserver->ProfileState(); + qDebug("Ut_CSatUiObserver::testProfileState <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testSetImplementer +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testSetImplementer() +{ + qDebug("Ut_CSatUiObserver::testSetImplementer >"); + QVERIFY(mSatObserver); + QVERIFY(mImplementer); + mSatObserver->SetImplementer(mImplementer); + qDebug("Ut_CSatUiObserver::testSetImplementer <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testDisplayText_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testDisplayText_data() +{ + qDebug("Ut_CSatUiObserver::testDisplayText_data >"); + QTest::addColumn("text"); + QTest::addColumn("appName"); + QTest::addColumn("iconIdIdentifier"); + QTest::addColumn("iconIdQualifier");//enum 0~3 + QTest::addColumn("isIconDisplayed"); + QTest::addColumn("sustainedText"); + QTest::addColumn("duration"); + QTest::addColumn("isWaitUsertoClear"); + QTest::addColumn("expectValue"); + + QTest::newRow("first") << "Show Display text!" << "Unit test SIM Service" << + 84 << 1 << false << false << 2500 << true << 0; + + QTest::newRow("second") << "Show Display text!" << "SIM Service" << + 84 << 1 << true << false << 2500 << false << 0; + // test null text + QTest::newRow("third") << "" << "SIM Service" << + 84 << 1 << true << false << 2500 << false << -1; + + // test icon is available for command + QTest::newRow("fouth") << "Show Display text!" << "SIM Service" << + 84 << 2 << true << false << 2500 << false << 0; + + // test leave occurs + //QTest::newRow("forth") << "Show Display text!" << "" << + // 84 << 2 << true << false << 2500 << false << 1; + + qDebug("Ut_CSatUiObserver::testDisplayText_data <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatApp::testDisplayText +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testDisplayText() +{ + qDebug("Ut_CSatUiObserver::testDisplayText >"); + QVERIFY(mSatObserver); + QFETCH(QString, text); + QFETCH(QString, appName); + QFETCH(int, iconIdIdentifier); + QFETCH(int, iconIdQualifier); + QFETCH(bool, isIconDisplayed); + QFETCH(bool, sustainedText); + QFETCH(int, duration); + QFETCH(bool, isWaitUsertoClear); + QFETCH(int, expectValue); + + // text + HBufC* hText = HBufC::New(text.length()); + TPtr aText( hText->Des() ); + aText.Copy( text.utf16() ); + // sim name + HBufC* hSimAppName = HBufC::New(appName.length()); + TPtr aSimApplicationName( hSimAppName->Des() ); + aSimApplicationName.Copy( appName.utf16() ); + + TSatIconId aIconId; + aIconId.iIdentifier = iconIdIdentifier; + aIconId.iIconQualifier = static_cast(iconIdQualifier); + TBool aIsIconDisplayed(isIconDisplayed); + + TSatUiResponse result(ESatSuccess); + // It seems that TRAPD&QT_TRAP_THROWING does nothing if leave occurs, need + // to investigate. + QT_TRAP_THROWING( result = mSatObserver->DisplayTextL( + aText, + aSimApplicationName, + aIconId, + aIsIconDisplayed, + sustainedText, + duration, + isWaitUsertoClear + )); + delete hText; + hText = 0; + TSatUiResponse exValue = static_cast(expectValue); + QCOMPARE(exValue, result); + qDebug("Ut_CSatUiObserver::testDisplayText <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testSetUpMenu_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testSetUpMenu_data() +{ + qDebug("Ut_CSatUiObserver::testSetUpMenu_data >"); + QTest::addColumn("text"); + QTest::addColumn("setupMenuItem"); + QTest::addColumn("isHelpIsAvailable"); + QTest::addColumn("iconIdIdentifier"); + QTest::addColumn("iconIdQualifier");//enum 0~3 + QTest::addColumn("iconListQualifier"); + QTest::addColumn("expectReturnValue"); + + QStringList testSetUpMenu_1_items; + testSetUpMenu_1_items + << "SendData" + << "ReceiveData" + << "CloseChannel" + << "OpenChannel" + << "GetChannelStatus" + << "DisplayText with different symbols and durations" + << "GetInkey" + << "GetInput" + << "SelectItem" + << "PlayTone" + << "RefreshRequired" + << "DoRefresh" + << "SendSm" + << "SendSs" + << "SendUssd" + << "SetUpCall" + << "SetUpIdleModeText" + << "CallControl" + << "MoSmControl" + << "LaunchBrowser" + << "SendDTMF" + << "SetUpEventList" + << "ProvideLocalInfo" + << "EventDownload for IdleScreen available event" + << "SetUpMenu"; + + QTest::newRow("first") << "SAT" << testSetUpMenu_1_items << + false << 80 << 1 << 2 << 0; + + qDebug("Ut_CSatUiObserver::testSetUpMenu_data <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testSetUpMenu +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testSetUpMenu() +{ + qDebug("Ut_CSatUiObserver::testSetUpMenu >"); + QVERIFY(mSatObserver); + QFETCH(QString, text); + QFETCH(QStringList, setupMenuItem); + QFETCH(bool, isHelpIsAvailable); + QFETCH(int, iconIdIdentifier); + QFETCH(int, iconIdQualifier); + QFETCH(int, iconListQualifier); + QFETCH(int, expectReturnValue); + + // aText + HBufC* hText = HBufC::New(text.length()); + TPtr aText( hText->Des() ); + aText.Copy( text.utf16() ); + // aMenuItems + TBuf<128> menuItem; + CDesCArrayFlat* aMenuItems = new CDesCArrayFlat(4); + QVERIFY(aMenuItems); + for (int i = 0; i< setupMenuItem.count(); i++) { + menuItem = setupMenuItem.at(i).utf16(); + QT_TRAP_THROWING(aMenuItems->AppendL(menuItem)); + } + // aIconId + TSatIconId aIconId; + aIconId.iIdentifier = iconIdIdentifier; + aIconId.iIconQualifier = static_cast(iconIdQualifier); + // aMenuItemNextActions + CArrayFixFlat* aMenuItemNextActions = + new CArrayFixFlat (4); + QVERIFY(aMenuItemNextActions); + // Temp test + QT_TRAP_THROWING(aMenuItemNextActions->AppendL(ESatSetUpMenuAction)); + // aMenuIcons + CArrayFixFlat* aMenuIcons = new CArrayFixFlat(2); + QVERIFY(aMenuIcons); + // Temp test + QT_TRAP_THROWING(aMenuIcons->AppendL(1)); + // aIconListQualifier + TSatIconQualifier aIconListQualifier = + static_cast(iconListQualifier); + // TSatSelectionPreference, useless + TSatSelectionPreference aSelectionPreference(ESatNoSelectionPreference); + TSatUiResponse result(ESatSuccess); + QT_TRAP_THROWING(result = mSatObserver->SetUpMenuL( + aText, + *aMenuItems, + aMenuItemNextActions, + isHelpIsAvailable, + aIconId, + aMenuIcons, + aIconListQualifier, + aSelectionPreference + )); + TSatUiResponse exValue = static_cast(expectReturnValue); + QCOMPARE(exValue, result); + + delete hText; + hText = 0; + delete aMenuItems; + aMenuItems = 0; + delete aMenuItemNextActions; + aMenuItemNextActions = 0; + delete aMenuIcons; + aMenuIcons = 0; + qDebug("Ut_CSatUiObserver::testSetUpMenu <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testGetInkey_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testGetInkey_data() +{ + qDebug("Ut_CSatUiObserver::testGetInkey_data >"); + QTest::addColumn("text"); + QTest::addColumn("characterSet");//enum 0~3 + QTest::addColumn("input"); + QTest::addColumn("isHelpIsAvailable"); + QTest::addColumn("iconIdIdentifier"); + QTest::addColumn("iconIdQualifier");//enum 0~3 + QTest::addColumn("isRequestedIconDisplayed"); + QTest::addColumn("duration"); + QTest::addColumn("isImmediateDigitResponse"); + QTest::addColumn("expectValue"); + //// test ESatDigitOnly + QTest::newRow("first") << "Test GetInKey" << 0 << + "8" << false << 60 << 1 << false << 2500 << true << 0; + // null text && EIconGetYesNo + QTest::newRow("second") << "" << 0 << + "s" << false<< 60 << 1 << false << 2500 << true << 0; + // test EIconGetYesNo + QTest::newRow("third") << "Test GetInKey" << 3 << + "s" << false << 60 << 1 << false << 2500 << true << 0; + // test ESatCharSmsDefaultAlphabet + QTest::newRow("fourth") << "Test GetInKey" << 3 << + "$" << false << 60 << 1 << false << 2500 << true << 0; + // ino immediateDigitResponse + QTest::newRow("fifth") << "Test GetInKey" << 1 << + "#" << false<< 60 << 1 << false << 2500 << false << 0; + // test leave + //QTest::newRow("sisth") << "Test GetInKey" << 1 << + // "" << false << 60 << 1 << false << 2500 << true << 0; + qDebug("Ut_CSatUiObserver::testGetInkey_data <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testGetInkey +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testGetInkey() +{ + qDebug("Ut_CSatUiObserver::testGetInkey >"); + QVERIFY(mSatObserver); + QFETCH(QString, text); + QFETCH(int, characterSet); + QFETCH(QString, input); + QFETCH(bool, isHelpIsAvailable); + QFETCH(int, iconIdIdentifier); + QFETCH(int, iconIdQualifier); + QFETCH(bool, isRequestedIconDisplayed); + QFETCH(int, duration); + QFETCH(bool, isImmediateDigitResponse); + QFETCH(int, expectValue); + + // text + HBufC* hText = HBufC::New(text.length()); + TPtr aText( hText->Des() ); + aText.Copy( text.utf16() ); + // aCharacterSet + TSatCharacterSet aCharacterSet = static_cast(characterSet); + // aInput + TBuf<1> tInput = input.utf16(); + TChar aInput(tInput[0]); + // aHelpIsAvailable + TBool aHelpIsAvailable(isHelpIsAvailable); + // aIconId + TSatIconId aIconId; + aIconId.iIdentifier = iconIdIdentifier; + aIconId.iIconQualifier = static_cast(iconIdQualifier); + // aRequestedIconDisplayed + TBool aRequestedIconDisplayed(isRequestedIconDisplayed); + // aDuration + TUint aDuration= static_cast(duration); + // aRequestedIconDisplayed + //TBool aImmediateDigitResponse(isImmediateDigitResponse); + + TSatUiResponse result(ESatSuccess); + QT_TRAP_THROWING( result = mSatObserver->GetInkeyL( + aText, + aCharacterSet, + aInput, + aHelpIsAvailable, + aIconId, + aRequestedIconDisplayed, + aDuration, + isImmediateDigitResponse + )); + delete hText; + hText = 0; + TSatUiResponse exValue = static_cast(expectValue); + QCOMPARE(exValue, result); + + qDebug("Ut_CSatUiObserver::testGetInkey <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testGetInput_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testGetInput_data() +{ + qDebug("Ut_CSatUiObserver::testGetInput_data >"); + QTest::addColumn("text"); + QTest::addColumn("characterSet");//enum 0~3 + QTest::addColumn("input"); + QTest::addColumn("minLength"); + QTest::addColumn("maxLength"); + QTest::addColumn("isHideInput"); + QTest::addColumn("isHelpIsAvailable"); + QTest::addColumn("iconIdIdentifier"); + QTest::addColumn("iconIdQualifier");//enum 0~3 + QTest::addColumn("isRequestedIconDisplayed"); + QTest::addColumn("expectValue"); + // test characterSet ESatCharSmsDefaultAlphabet + QTest::newRow("first") << "Test GetInput" << 1 << + "get input" << 1 << 5 << false << false <<60 << 1 << true << 0; + // test iconIdQualifier ESatSelfExplanatory + QTest::newRow("second") << "Test GetInput" << 0 << + "get input" << 1 << 5 << false << false <<60 << 2 << true << 0; + // test leave + //QTest::newRow("third") << "Test GetInput" << 0 << + // "" << 1 << 5 << false << false <<60 << 2 << true << 0; + qDebug("Ut_CSatUiObserver::testGetInput_data <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testGetInput +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testGetInput() +{ + qDebug("Ut_CSatUiObserver::testGetInput >"); + QVERIFY(mSatObserver); + QFETCH(QString, text); + QFETCH(int, characterSet); + QFETCH(QString, input); + QFETCH(int, minLength); + QFETCH(int, maxLength); + QFETCH(bool, isHideInput); + QFETCH(bool, isHelpIsAvailable); + QFETCH(int, iconIdIdentifier); + QFETCH(int, iconIdQualifier); + QFETCH(bool, isRequestedIconDisplayed); + QFETCH(int, expectValue); + + // text + HBufC* hText = HBufC::New(text.length()); + TPtr aText( hText->Des() ); + aText.Copy( text.utf16() ); + // aCharacterSet + TSatCharacterSet aCharacterSet = static_cast(characterSet); + // aInput + HBufC* hInput = HBufC::New(input.length()); + TPtr aInput( hInput->Des() ); + aInput.Copy( input.utf16() ); + // aIconId + TSatIconId aIconId; + aIconId.iIdentifier = iconIdIdentifier; + aIconId.iIconQualifier = static_cast(iconIdQualifier); + // aRequestedIconDisplayed + TBool aRequestedIconDisplayed(isRequestedIconDisplayed); + + TSatUiResponse result(ESatSuccess); + QT_TRAP_THROWING( result = mSatObserver->GetInputL( + aText, + aCharacterSet, + aInput, + minLength, + maxLength, + isHideInput, + isHelpIsAvailable, + aIconId, + aRequestedIconDisplayed + )); + delete hText; + hText = 0; + delete hInput; + hInput = 0; + TSatUiResponse exValue = static_cast(expectValue); + QCOMPARE(exValue, result); + qDebug("Ut_CSatUiObserver::testGetInput <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testConfirmCommand_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testConfirmCommand_data() +{ + qDebug("Ut_CSatUiObserver::testConfirmCommand_data >"); + QTest::addColumn("commandId");// enum 0~6 + QTest::addColumn("alphaIdStatus"); + QTest::addColumn("text"); + QTest::addColumn("additionalText"); + QTest::addColumn("isctionAccepted"); + QTest::addColumn("iconIdIdentifier"); + QTest::addColumn("iconIdQualifier");//enum 0~3 + QTest::addColumn("isRequestedIconDisplayed"); + QTest::addColumn("isterminatedByUser"); + // test commandId ESatSSendSmQuery + QTest::newRow("first") << 0 << 1 << "ConfirmCommand SendSm" + << "SendSm" <"); + QVERIFY(mSatObserver); + QFETCH(int, commandId); + QFETCH(int, alphaIdStatus); + QFETCH(QString, text); + QFETCH(QString, additionalText); + QFETCH(bool, isctionAccepted); + QFETCH(int, iconIdIdentifier); + QFETCH(int, iconIdQualifier); + QFETCH(bool, isRequestedIconDisplayed); + QFETCH(bool, isterminatedByUser); + + // aCharacterSet + TSatSQueryCommand aCommandId = static_cast(commandId); + // aAlphaIdStatus + TSatAlphaIdStatus aAlphaIdStatus = static_cast(alphaIdStatus); + // text + HBufC* hText = HBufC::New(text.length()); + TPtr aText( hText->Des() ); + aText.Copy( text.utf16() ); + // aAdditionalText + HBufC* hAdditionalText = HBufC::New(additionalText.length()); + TPtr aAdditionalText( hAdditionalText->Des() ); + aAdditionalText.Copy( additionalText.utf16() ); + // aActionAccepted + TBool aActionAccepted(isctionAccepted); + // aIconId + TSatIconId aIconId; + aIconId.iIdentifier = iconIdIdentifier; + aIconId.iIconQualifier = static_cast(iconIdQualifier); + // aRequestedIconDisplayed + TBool aRequestedIconDisplayed(isRequestedIconDisplayed); + // aRequestedIconDisplayed + TBool aTerminatedByUser(isterminatedByUser); + + mSatObserver->ConfirmCommand( + aCommandId, + aAlphaIdStatus, + aText, + aAdditionalText, + aActionAccepted, + aIconId, + aRequestedIconDisplayed, + aTerminatedByUser + ); + delete hText; + hText = 0; + delete hAdditionalText; + hAdditionalText = 0; + qDebug("Ut_CSatUiObserver::testConfirmCommand <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testNotification_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testNotification_data() +{ + qDebug("Ut_CSatUiObserver::testNotification_data >"); + QTest::addColumn("commandId");// enum 0~6 + QTest::addColumn("alphaIdStatus"); + QTest::addColumn("text"); + QTest::addColumn("iconIdIdentifier"); + QTest::addColumn("iconIdQualifier");//enum 0~3 + QTest::addColumn("isRequestedIconDisplayed"); + QTest::addColumn("controlResult"); + + // test commandId ESatSSendDataNotify + QTest::newRow("Senddata_0id") << 0 << 0 << "Send data notify" + << 2 << 0 << false <<0; + // test commandId ESatSSendDataNotify alpha id not null but string length is zero + QTest::newRow("Senddata_1id") << 0 << 1 << "" + << 2 << 0 << false <<0; + QTest::newRow("Senddata_2id") << 0 << 2 << "Send data notify AlphaIdNotProvided" + << 2 << 0 << false <<0; + // test commandId ESatSReceiveDataNotify + QTest::newRow("Recievedata_0id") << 1 << 0 << "Recieve data notify" + << 2 << 3 << false <<0; + QTest::newRow("Recievedata_1id") << 1 << 1 << "Recieve data notify" + << 2 << 3 << false <<0; + QTest::newRow("Recievedata_2id") << 1 << 2 << "Recieve data notify AlphaIdNotProvided" + << 2 << 3 << false <<0; + // test commandId ESatSCloseChannelNotify + QTest::newRow("CloseChannel_0id") << 2 << 0 << "Close channel notify" + << 2 << 3 << false <<0; + QTest::newRow("CloseChannel_1id") << 2 << 1 << "" + << 2 << 3 << false <<0; + QTest::newRow("CloseChannel_2id") << 2 << 2 << "Close channel notify AlphaIdNotProvided" + << 2 << 3 << false <<0; + // test commandId ESatSMoSmControlNotify + QTest::newRow("MoSm_0id") << 3 << 0 << "SM control notify" + << 2 << 0 << false <<0; + QTest::newRow("MoSm_1id") << 3 << 1 << "0" + << 2 << 0 << false <<0; + QTest::newRow("MoSm_2id") << 3 << 2 << "SM control notify AlphaIdNotProvided" + << 2 << 0 << false <<0; + // test commandId ESatSCallControlNotify + QTest::newRow("CallControl_0id") << 4 << 0 << "Call control notify" + << 2 << 1 << false <<0; + QTest::newRow("CallControl_1id") << 4 << 1 << "" + << 2 << 1 << false <<0; + QTest::newRow("CallControl_2id") << 4 << 2 << "Call control notify AlphaIdNotProvided" + << 2 << 1 << false <<0; + // test commandId ESatSSendSsNotify + QTest::newRow("SendSs_0id") << 5 << 0 << "Send SS notify" + << 2 << 2 << false <<0; + QTest::newRow("SendSs_1id") << 5 << 1 << "" + << 2 << 2 << false <<0; + QTest::newRow("SendSs_2id") << 5 << 2 << "Send SS notify AlphaIdNotProvided" + << 2 << 2 << false <<0; + // test commandId ESatSSendUssdNotify + QTest::newRow("SendUssd_0id") << 6 << 0 << "Send Ussd notify" + << 2 << 3 << false <<0; + // test commandId ESatSSendUssdNotify + QTest::newRow("SendUssd_1id") << 6 << 1 << "" + << 2 << 3 << false <<0; + // test commandId ESatSSendUssdNotify + QTest::newRow("SendUssd_2id") << 6 << 2 << "Send Ussd notify AlphaIdNotProvided" + << 2 << 3 << false <<0; + // test commandId ESatSSendDtmfNotify + QTest::newRow("SendDtmf_0id") << 7 << 0 << "Send dtmf notify" + << 2 << 3 << false <<0; + QTest::newRow("SendDtmf_1id") << 7 << 1 << "Send dtmf notify" + << 2 << 3 << false <<0; + QTest::newRow("SendDtmf_2id") << 7 << 2 << "Send dtmf notify AlphaIdNotProvided" + << 2 << 3 << false <<0; + // test commandId ESatSSendSmsNotify + QTest::newRow("SendSm_0id") << 8 << 0 << "SendSm notify" + << 2 << 2 << false <<0; + QTest::newRow("SendSm_1id") << 8 << 1 << "SendSm notify" + << 2 << 2 << false <<0; + QTest::newRow("SendSm_2id") << 8 << 2 << "SendSm notify AlphaIdNotProvided" + << 2 << 2 << false <<0; + qDebug("Ut_CSatUiObserver::testNotification_data <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testNotification +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testNotification() +{ + qDebug("Ut_CSatUiObserver::testNotification >"); + QVERIFY(mSatObserver); + QFETCH(int, commandId); + QFETCH(int, alphaIdStatus); + QFETCH(QString, text); + QFETCH(int, iconIdIdentifier); + QFETCH(int, iconIdQualifier); + QFETCH(bool, isRequestedIconDisplayed); + QFETCH(int, controlResult); + + // aCommandId + TSatSNotifyCommand aCommandId = static_cast(commandId); + // aAlphaIdStatus + TSatAlphaIdStatus aAlphaIdStatus = static_cast(alphaIdStatus); + // text + HBufC* hText = HBufC::New(text.length()); + TPtr aText( hText->Des() ); + aText.Copy( text.utf16() ); + + // aIconId + TSatIconId aIconId; + aIconId.iIdentifier = iconIdIdentifier; + aIconId.iIconQualifier = static_cast(iconIdQualifier); + // aRequestedIconDisplayed + TBool aRequestedIconDisplayed(isRequestedIconDisplayed); + // aRequestedIconDisplayed + TSatControlResult aControlResult = static_cast(controlResult); + + mSatObserver->Notification( + aCommandId, + aAlphaIdStatus, + aText, + aIconId, + aRequestedIconDisplayed, + aControlResult + ); + delete hText; + hText = 0; + qDebug("Ut_CSatUiObserver::testNotification <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testEventNotification_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testEventNotification_data() +{ + qDebug("Ut_CSatUiObserver::testEventNotification_data >"); + QTest::addColumn("eventId");// enum 0~6 + + // test eventId ESatSRefreshStartEvent + QTest::newRow("RefreshStartEvent") << 0 ; + // test eventId ESatSRefreshEndEvent + QTest::newRow("RefreshEndEvent") << 1; + // test eventId ESatSSmEndEvent + QTest::newRow("SSmEndEvent") << 2; + // test eventId ESatSClearScreenEvent + QTest::newRow("ClearScreenEvent") << 3; + // test eventId ESatSCloseSatUiAppEvent + QTest::newRow("CloseSatUiAppEvent") << 4; + // test eventId ESatSsEndEvent + QTest::newRow("SsEndEvent") << 5; + // test eventId ESatSsErrorEvent + QTest::newRow("SsErrorEvent") << 6; + // test eventId ESatSDtmfEndEvent + QTest::newRow("DtmfEndEvent") << 7; + + qDebug("Ut_CSatUiObserver::testEventNotification_data <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testEventNotification +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testEventNotification() +{ + qDebug("Ut_CSatUiObserver::testEventNotification >"); + QVERIFY(mSatObserver); + QFETCH(int, eventId); + + TSatSEvent aEventId = static_cast(eventId); + TSatSEventStatus aEventStatus = ESatEventCompleteOk; + mSatObserver->EventNotification(aEventId, aEventStatus, 0); + qDebug("Ut_CSatUiObserver::testEventNotification <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testSelectItem_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testSelectItem_data() +{ + qDebug("Ut_CSatUiObserver::testSelectItem_data >"); + QTest::addColumn("text"); + QTest::addColumn("selectItemItem"); + QTest::addColumn("defaultItem"); + QTest::addColumn("isHelpIsAvailable"); + QTest::addColumn("iconIdIdentifier"); + QTest::addColumn("iconIdQualifier");//enum 0~3 + QTest::addColumn("iconListQualifier"); + QTest::addColumn("expectReturnValue"); + + QStringList testSelectItem_1_items; + testSelectItem_1_items + << "Select Item 1" + << "Select Item 2" + << "Select Item 3" + << "Select Item 4" + << "Select Item 5"; + + QTest::newRow("first") << "Make a Choice" << testSelectItem_1_items << + 0 << false << 80 << 1 << 2 << 0; + + qDebug("Ut_CSatUiObserver::testSelectItem_data <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testSetUpMenu +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testSelectItem() +{ + qDebug("Ut_CSatUiObserver::testSelectItem >"); + QVERIFY(mSatObserver); + QFETCH(QString, text); + QFETCH(QStringList, selectItemItem); + QFETCH(int, defaultItem); + QFETCH(bool, isHelpIsAvailable); + QFETCH(int, iconIdIdentifier); + QFETCH(int, iconIdQualifier); + QFETCH(int, iconListQualifier); + QFETCH(int, expectReturnValue); + + // aText + HBufC* hText = HBufC::New(text.length()); + TPtr aText( hText->Des() ); + aText.Copy( text.utf16() ); + // aMenuItems + TBuf<128> menuItem; + CDesCArrayFlat* aMenuItems = new CDesCArrayFlat(4); + QVERIFY(aMenuItems); + for (int i = 0; i< selectItemItem.count(); i++) { + menuItem = selectItemItem.at(i).utf16(); + QT_TRAP_THROWING(aMenuItems->AppendL(menuItem)); + } + + TUint8 aSelectedItem( 1 ); + // aIconId + TSatIconId aIconId; + aIconId.iIdentifier = iconIdIdentifier; + aIconId.iIconQualifier = static_cast(iconIdQualifier); + // aMenuItemNextActions + CArrayFixFlat* aMenuItemNextActions = + new CArrayFixFlat (4); + QVERIFY(aMenuItemNextActions); + // Temp test + QT_TRAP_THROWING(aMenuItemNextActions->AppendL(ESatSelectItemAction)); + // aMenuIcons + CArrayFixFlat* aMenuIcons = new CArrayFixFlat(2); + QVERIFY(aMenuIcons); + // Temp test + QT_TRAP_THROWING(aMenuIcons->AppendL(1)); + // aIconListQualifier + TSatIconQualifier aIconListQualifier = + static_cast(iconListQualifier); + // TSatSelectionPreference, useless + TSatSelectionPreference aSelectionPreference(ESatNoSelectionPreference); + TBool aRequestIconDisplayed (EFalse); + + TSatUiResponse result(ESatSuccess); + QT_TRAP_THROWING(result = mSatObserver->SelectItemL( + aText, + *aMenuItems, + aMenuItemNextActions, + defaultItem, + aSelectedItem, + isHelpIsAvailable, + aIconId, + aMenuIcons, + aIconListQualifier, + aRequestIconDisplayed, + aSelectionPreference + )); + TSatUiResponse exValue = static_cast(expectReturnValue); + QCOMPARE(exValue, result); + + delete hText; + hText = 0; + delete aMenuItems; + aMenuItems = 0; + delete aMenuItemNextActions; + aMenuItemNextActions = 0; + delete aMenuIcons; + aMenuIcons = 0; + qDebug("Ut_CSatUiObserver::testSelectItem <"); +} + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testSetUpMenu +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testPlayTone_data() +{ + qDebug("Ut_CSatUiObserver::testPlayTone_data >"); + QTest::addColumn("text");//enum 0~3 + QTest::addColumn("satTone"); + QTest::addColumn("duration"); + QTest::addColumn("iconIdIdentifier"); + QTest::addColumn("iconIdQualifier");//enum 0~3 + QTest::addColumn("isRequestedIconDisplayed"); + QTest::addColumn("expectReturnValue"); + QTest::newRow("Response_Failure") << "PlayStandardTone" << 100 << + 0 << 80 << 1 << false << -1; + QTest::newRow("ToneNotSet") << "PlayStandardTone" << -1 << + 0 << 80<< 0 << false << 0; + QTest::newRow("DialTone_0") << "PlayStandardTone" << 1 << + 0 << 80<< 1 << false << 0; + QTest::newRow("DialTone_2000") << "PlayStandardTone" << 1 << + 2000 << 80 << 2 << false << 0; + QTest::newRow("DialTone_true") << "PlayStandardTone" << 1 << + 2000 << 80 << 3 << true << 0; + QTest::newRow("Busy") << "PlayStandardTone" << 2 << + 2000 << 80 << 3 << false << 0; + QTest::newRow("Congestion") << "PlayStandardTone" << 3 << + 25000 << 80 << 3 << false << 0; + QTest::newRow("Congestion_0") << "PlayStandardTone" << 3 << + 0 << 80 << 3 << false << 0; + QTest::newRow("Acknowledge ") << "PlayStandardTone" << 4 << + 25000 << 80 << 3 << false << 0; + QTest::newRow("Acknowledge_0") << "PlayStandardTone" << 4 << + 0 << 80 << 3 << false << 0; + QTest::newRow("CallDropped") << "PlayStandardTone" << 5 << + 25000 << 80 << 1 << false << 0; + QTest::newRow("CallDropped_0") << "PlayStandardTone" << 5 << + 0 << 80 << 1 << false << 0; + QTest::newRow("SpecialInfo") << "PlayStandardTone" << 6 << + 25000 << 80 << 1 << false << 0; + QTest::newRow("SpecialInfo_0") << "PlayStandardTone" << 6 << + 0 << 80 << 1 << false << 0; + QTest::newRow("WaitingTone") << "PlayStandardTone" << 7 << + 25000 << 80 << 1 << false << 0; + QTest::newRow("WaitingTone_0") << "PlayStandardTone" << 7 << + 0 << 80 << 1 << false << 0; + QTest::newRow("RingingTone") << "PlayStandardTone" << 8 << + 25000 << 80 << 1 << false << 0; + QTest::newRow("RingingTone_0") << "PlayStandardTone" << 8 << + 0 << 80 << 1 << false << 0; + QTest::newRow("GeneralBeep") << "PlayStandardTone" << 16 << + 25000 << 80 << 1 << false << 0; + QTest::newRow("GeneralBeep_0") << "PlayStandardTone" << 16 << + 0 << 80 << 1 << false << 0; + QTest::newRow("PositiveTone") << "PlayStandardTone" << 17 << + 25000 << 80 << 1 << false << 0; + QTest::newRow("PositiveTone_0") << "PlayStandardTone" << 17 << + 0 << 80 << 1 << false << 0; + QTest::newRow("NegativeTone") << "PlayStandardTone" << 18 << + 25000 << 80 << 1 << false << 0; + QTest::newRow("NegativeTone_0") << "PlayStandardTone" << 18 << + 0 << 80 << 1 << false << 0; + QTest::newRow("Speech") << "PlayStandardTone" << 19 << + 25000 << 80 << 1 << false << 0; + QTest::newRow("Speech_0") << "PlayStandardTone" << 19 << + 25000 << 80 << 1 << false << 0; + QTest::newRow("Sms") << "PlayStandardTone" << 20 << + 25000 << 80 << 1 << false << 0; + QTest::newRow("Sms_0") << "PlayStandardTone" << 20 << + 0 << 80 << 1 << false << 0; + QTest::newRow("Busy_0") << "PlayStandardTone" << 2 << + 0 << 80 << 3 << false << 0; + qDebug("Ut_CSatUiObserver::testPlayTone_data <"); +} + + +// ----------------------------------------------------------------------------- +// Ut_CSatUiObserver::testSetUpMenu +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_CSatUiObserver::testPlayTone() +{ + qDebug("Ut_CSatUiObserver::testPlayTone >"); + QVERIFY(mSatObserver); + QFETCH(QString, text); + QFETCH(int, duration); + QFETCH(int, satTone); + QFETCH(int, iconIdIdentifier); + QFETCH(int, iconIdQualifier); + QFETCH(bool, isRequestedIconDisplayed); + QFETCH(int, expectReturnValue); + qDebug("Ut_CSatUiObserver::testPlayTone after fetch"); + // text + HBufC* hText = HBufC::New(text.length()); + TPtr aText( hText->Des() ); + aText.Copy( text.utf16() ); + // aTone + TSatTone aTone = static_cast(satTone); + // aDuration + TUint aDuration= static_cast(duration); + // aIconId + TSatIconId aIconId; + aIconId.iIdentifier = iconIdIdentifier; + aIconId.iIconQualifier = static_cast(iconIdQualifier); + // aRequestedIconDisplayed + TBool aRequestedIconDisplayed(isRequestedIconDisplayed); + qDebug("Ut_CSatUiObserver::testPlayTone call observer"); + TSatUiResponse result(ESatSuccess); + result = mSatObserver->PlayTone( + aText, + aTone, + aDuration, + aIconId, + aRequestedIconDisplayed + ); + TSatUiResponse exValue = static_cast(expectReturnValue); + QCOMPARE(exValue, result); + delete hText; + hText = 0; + qDebug("Ut_CSatUiObserver::testPlayTone <"); +} + +// End of file diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/src/ut_playtoneprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/src/ut_playtoneprovider.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,287 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Unit test for satappmainhandler +* +*/ + + +#include +#include "ut_playtoneprovider.h" +//test class +#include "satappplaytoneprovider.h" + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::Ut_SatAppPlayToneProvider +// ----------------------------------------------------------------------------- +// +Ut_SatAppPlayToneProvider::Ut_SatAppPlayToneProvider(QObject *parent):QObject(parent) +{ + qDebug("Ut_SatAppPlayToneProvider::Ut_SatAppPlayToneProvider >"); + qDebug("Ut_SatAppPlayToneProvider::Ut_SatAppPlayToneProvider <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::~Ut_SatAppPlayToneProvider +// ----------------------------------------------------------------------------- +// +Ut_SatAppPlayToneProvider::~Ut_SatAppPlayToneProvider() +{ + qDebug("Ut_SatAppPlayToneProvider::~Ut_SatAppPlayToneProvider >"); + qDebug("Ut_SatAppPlayToneProvider::~Ut_SatAppPlayToneProvider <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::initTestCase +// QTestLib cleanup method, called after the last testfunction . +// ----------------------------------------------------------------------------- +void Ut_SatAppPlayToneProvider::initTestCase() +{ + qDebug("Ut_SatAppPlayToneProvider::initTestCase >"); + qDebug("Ut_SatAppPlayToneProvider::initTestCase <"); +} + + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::cleanupTestCase +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppPlayToneProvider::cleanupTestCase() +{ + qDebug("Ut_SatAppPlayToneProvider::cleanupTestCase >"); + if (mPlayTone) { + qDebug("Ut_SatAppPlayToneProvider::cleanupTestCase delete mPlayTone..."); + delete mPlayTone; + mPlayTone = 0; + } + qDebug("Ut_SatAppPlayToneProvider::cleanupTestCase <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::testCreatePlayTone +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppPlayToneProvider::testCreatePlayTone() +{ + qDebug("Ut_SatAppPlayToneProvider::testCreatePlayTone >"); + mPlayTone = new SatAppPlayToneProvider(); + QVERIFY(mPlayTone); + qDebug("Ut_SatAppPlayToneProvider::testCreatePlayTone <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::testPlayStandardTone_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppPlayToneProvider::testPlayStandardTone_data() +{ + qDebug("Ut_SatAppPlayToneProvider::testPlayStandardTone_data >"); + QTest::addColumn("text");//enum 0~3 + QTest::addColumn("duration"); + QTest::addColumn("isRequestedIconDisplayed"); + QTest::addColumn("expectReturnValue"); + // test duration 0 + QTest::newRow("duration_0") << "Play Standard tone" << 0 << false << 0; + QTest::newRow("duration") << "Play Standard tone" << 1000000 << false << 0; + QTest::newRow("textnull") << "" << 10000000 << false << 0; + qDebug("Ut_SatAppPlayToneProvider::testPlayStandardTone_data <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::testPlayStandardTone +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppPlayToneProvider::testPlayStandardTone() +{ + qDebug("Ut_SatAppPlayToneProvider::testPlayStandardTone >"); + QVERIFY(mPlayTone); + QFETCH(QString, text); + QFETCH(int, duration); + QFETCH(bool, isRequestedIconDisplayed); + QFETCH(int, expectReturnValue); + qDebug("Ut_SatAppPlayToneProvider::testPlayTone after fetch"); + // text + HBufC* hText = HBufC::New(text.length()); + TPtr aText( hText->Des() ); + aText.Copy( text.utf16() ); + // text + _LIT( KPlayToneSequence, "Play tone sequence"); + TBuf8<32> aSequence; + aSequence.Copy(KPlayToneSequence); + + // aDuration + TUint aDuration= static_cast(duration); + CFbsBitmap* bitmap(NULL); + qDebug("Ut_SatAppPlayToneProvider::testPlayStandardTone call"); + TSatUiResponse result(ESatSuccess); + TRAPD(err, result = mPlayTone->PlayStandardToneL( + aText, + aSequence, + aDuration, + bitmap, + isRequestedIconDisplayed)); + QCOMPARE(KErrNone, err); + TSatUiResponse exValue = static_cast(expectReturnValue); + QCOMPARE(exValue, result); + delete hText; + qDebug("Ut_SatAppPlayToneProvider::testPlayStandardTone <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::testPlayUserSelectedTone_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppPlayToneProvider::testPlayUserSelectedTone_data() +{ + qDebug("Ut_SatAppPlayToneProvider::testPlayUserSelectedTone_data >"); + QTest::addColumn("text");//enum 0~3 + QTest::addColumn("duration"); + QTest::addColumn("satTone"); + QTest::addColumn("isaSelfExplanatory"); + QTest::addColumn("expectReturnValue"); + //QTest::newRow("duration_0") << "Play UserSelectedTone" << 0 << 1 <"); + QVERIFY(mPlayTone); + QFETCH(QString, text); + QFETCH(int, duration); + QFETCH(int, satTone); + QFETCH(bool, isaSelfExplanatory); + QFETCH(int, expectReturnValue); + qDebug("Ut_SatAppPlayToneProvider::testPlayTone after fetch"); + // text + HBufC* hText = HBufC::New(text.length()); + TPtr aText( hText->Des() ); + aText.Copy( text.utf16() ); + // aTone + TSatTone aTone = static_cast(satTone); + // aDuration + TUint aDuration= static_cast(duration); + CFbsBitmap* bitmap(NULL); + TBool aSelfExplanatory(isaSelfExplanatory); + TSatUiResponse result(ESatSuccess); + TRAPD(err, result = mPlayTone->PlayUserSelectedToneL( + aText, + aDuration, + aTone, + bitmap, + aSelfExplanatory )); + QCOMPARE(KErrNone, err); + delete hText; + hText = 0; + TSatUiResponse exValue = static_cast(expectReturnValue); + QCOMPARE(exValue, result); + qDebug("Ut_SatAppPlayToneProvider::testPlayUserSelectedTone <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::testPlayUserSelectedTone +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppPlayToneProvider::testCloseSatUI() +{ + qDebug("Ut_SatAppPlayToneProvider::closeSatUI >"); + QVERIFY(mPlayTone); + mPlayTone->closeSatUI(); + qDebug("Ut_SatAppPlayToneProvider::closeSatUI <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::testPlayUserSelectedTone +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppPlayToneProvider::testClearScreen() +{ + qDebug("Ut_SatAppPlayToneProvider::clearScreen >"); + QVERIFY(mPlayTone); + mPlayTone->clearScreen(); + qDebug("Ut_SatAppPlayToneProvider::clearScreen <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::testMapcPlayComplete_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppPlayToneProvider::testMapcPlayComplete_data() +{ + qDebug("Ut_SatAppPlayToneProvider::testMapcPlayComplete_data >"); + QTest::addColumn("error"); + QTest::newRow("error_0") << 0; + QTest::newRow("error_-6") << -6; + qDebug("Ut_SatAppPlayToneProvider::testMapcPlayComplete_data <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::testMapcPlayComplete +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppPlayToneProvider::testMapcPlayComplete() +{ + qDebug("Ut_SatAppPlayToneProvider::testMapcPlayComplete >"); + QVERIFY(mPlayTone); + QFETCH(int, error); + mPlayTone->MapcPlayComplete(error); + qDebug("Ut_SatAppPlayToneProvider::testMapcPlayComplete <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::testMapcInitComplete_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppPlayToneProvider::testMapcInitComplete_data() +{ + qDebug("Ut_SatAppPlayToneProvider::testMapcInitComplete_data >"); + QTest::addColumn("error"); + QTest::newRow("error_0") << 0; + QTest::newRow("error_-6") << -6; + qDebug("Ut_SatAppPlayToneProvider::testMapcInitComplete_data <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppPlayToneProvider::testMapcInitComplete +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppPlayToneProvider::testMapcInitComplete() +{ + qDebug("Ut_SatAppPlayToneProvider::testMapcInitComplete >"); + QVERIFY(mPlayTone); + QFETCH(int, error); + mPlayTone->MapcInitComplete(error, 0); + qDebug("Ut_SatAppPlayToneProvider::testMapcInitComplete <"); +} + +// End of file + diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/src/ut_satappeventhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/src/ut_satappeventhandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Unit test for satappeventprovider +* +*/ + +#include "ut_satappeventhandler.h" +//test class +#include "satappeventprovider.h" + +// ----------------------------------------------------------------------------- +// Ut_SatAppEventProvider::Ut_SatAppEventProvider +// ----------------------------------------------------------------------------- +// +Ut_SatAppEventProvider::Ut_SatAppEventProvider(QObject *parent): + QObject(parent), mEventHandler(0) +{ + qDebug("Ut_SatAppEventProvider::Ut_SatAppEventProvider >"); + qDebug("Ut_SatAppEventProvider::Ut_SatAppEventProvider <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppEventProvider::~Ut_SatAppEventProvider +// ----------------------------------------------------------------------------- +// +Ut_SatAppEventProvider::~Ut_SatAppEventProvider() +{ + qDebug("Ut_SatAppEventProvider::~Ut_SatAppEventProvider >"); + qDebug("Ut_SatAppEventProvider::~Ut_SatAppEventProvider <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppEventProvider::initTestCase +// QTestLib cleanup method, called after the last testfunction . +// ----------------------------------------------------------------------------- +void Ut_SatAppEventProvider::initTestCase() +{ + qDebug("Ut_SatAppEventProvider::initTestCase >"); + qDebug("Ut_SatAppEventProvider::initTestCase <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppEventProvider::cleanupTestCase +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppEventProvider::cleanupTestCase() +{ + qDebug("Ut_SatAppEventProvider::cleanupTestCase >"); + delete mEventHandler; + mEventHandler = 0; + qDebug("Ut_SatAppEventProvider::cleanupTestCase <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppEventProvider::testProfileState +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppEventProvider::testCreateEventHandler() +{ + qDebug("Ut_SatAppEventProvider::testCreateEventHandler >"); + mEventHandler = new SatAppEventProvider; + QVERIFY(mEventHandler); + qDebug("Ut_SatAppEventProvider::testCreateEventHandler <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppEventProvider::testShowSsWaitNote_data +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppEventProvider::testShowSsWaitNote_data() +{ + qDebug("Ut_SatAppEventProvider::testShowSsWaitNote_data >"); + QTest::addColumn("text"); + QTest::addColumn("isSelfExplanatoryIcon"); + QTest::newRow("first") << "Show Ss Wait note First!" << false; + QTest::newRow("second") << "Show Ss Wait note seconde!" << true; + QTest::newRow("third") << "" << false; + qDebug("Ut_SatAppEventProvider::testShowSsWaitNote_data <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppEventProvider::testProfileState +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppEventProvider::testShowSsWaitNote() +{ + qDebug("Ut_SatAppEventProvider::testShowSsWaitNote >"); + QVERIFY(mEventHandler); + QFETCH(QString, text); + QFETCH(bool, isSelfExplanatoryIcon); + // text + HBufC* hText = HBufC::New(text.length()); + TPtr aText( hText->Des() ); + aText.Copy( text.utf16() ); + CFbsBitmap* bitmap(NULL); + TRAPD(err, mEventHandler->ShowSsWaitNoteL(aText,bitmap, + isSelfExplanatoryIcon)); + delete hText; + hText = 0; + QCOMPARE(err, KErrNone); + qDebug("Ut_SatAppEventProvider::testShowSsWaitNote <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppEventProvider::testProfileState +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppEventProvider:: testStopShowWaitNote() +{ + qDebug("Ut_SatAppEventProvider::testStopShowWaitNote >"); + QVERIFY(mEventHandler); + mEventHandler->StopShowWaitNote(); + qDebug("Ut_SatAppEventProvider::testStopShowWaitNote <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppEventProvider::ShowWaitNoteWithoutDelayL +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppEventProvider::testShowWaitNoteWithoutDelay() +{ + qDebug("Ut_SatAppEventProvider::testShowWaitNoteWithoutDelay >"); + QVERIFY(mEventHandler); + TRAPD(err,mEventHandler->ShowWaitNoteWithoutDelayL()); + QCOMPARE(err, KErrNone); + qDebug("Ut_SatAppEventProvider::testShowWaitNoteWithoutDelay <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppEventProvider::testShowSsErrorNote +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppEventProvider::testShowSsErrorNote() +{ + qDebug("Ut_SatAppEventProvider::testShowSsErrorNote >"); + QVERIFY(mEventHandler); + TRAPD(err, mEventHandler->ShowSsErrorNoteL()); + QCOMPARE(err, KErrNone); + qDebug("Ut_SatAppEventProvider::testShowSsErrorNote <"); +} + +// End of file diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/src/ut_satappmainhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/src/ut_satappmainhandler.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Unit test for satappmainhandler +* +*/ + + +#include +#include "ut_satappmainhandler.h" +//test class +#include "satappmainhandler.h" + +// ----------------------------------------------------------------------------- +// Ut_SatAppMainHandler::Ut_SatAppMainHandler +// ----------------------------------------------------------------------------- +// +Ut_SatAppMainHandler::Ut_SatAppMainHandler(QObject *parent):QObject(parent) +{ + qDebug("Ut_SatAppMainHandler::Ut_SatAppMainHandler >"); + qDebug("Ut_SatAppMainHandler::Ut_SatAppMainHandler <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppMainHandler::~Ut_SatAppMainHandler +// ----------------------------------------------------------------------------- +// +Ut_SatAppMainHandler::~Ut_SatAppMainHandler() +{ + qDebug("Ut_SatAppMainHandler::~Ut_SatAppMainHandler >"); + qDebug("Ut_SatAppMainHandler::~Ut_SatAppMainHandler <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppMainHandler::initTestCase +// QTestLib cleanup method, called after the last testfunction . +// ----------------------------------------------------------------------------- +void Ut_SatAppMainHandler::initTestCase() +{ + qDebug("Ut_SatAppMainHandler::initTestCase >"); + qDebug("Ut_SatAppMainHandler::initTestCase <"); +} + + +// ----------------------------------------------------------------------------- +// Ut_SatAppMainHandler::cleanupTestCase +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppMainHandler::cleanupTestCase() +{ + qDebug("Ut_SatAppMainHandler::cleanupTestCase >"); + if (mMainHandler) { + qDebug("Ut_SatAppMainHandler::cleanupTestCase delete mMainHandler..."); + delete mMainHandler; + mMainHandler = 0; + } + qDebug("Ut_SatAppMainHandler::cleanupTestCase <"); +} + +// ----------------------------------------------------------------------------- +// Ut_SatAppMainHandler::testProfileState +// +// Connects to test object signal and verifies received data. +// ----------------------------------------------------------------------------- +void Ut_SatAppMainHandler::testCreateMainHandler() +{ + qDebug("Ut_SatAppMainHandler::testProfileState >"); + HbMainWindow* window = new HbMainWindow(); + QVERIFY(window); + mMainHandler = new SatAppMainHandler(*window); + QVERIFY(mMainHandler); + qDebug("Ut_SatAppMainHandler::testProfileState <"); +} + +// End of file diff -r e32024264ebb -r d7fc66ccd6fb satui/satapp/tsrc/ut_satapp/ut_satapp.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/ut_satapp.pro Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,83 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: unit test pro file for satapp. +# + +TEMPLATE = app +TARGET = utsatapp +DEPENDPATH += . +INCLUDEPATH += . +CONFIG += hb +CONFIG += qtestlib +HEADERS += $$PUBLIC_HEADERS +MOC_DIR = moc_utsatapp + +symbian { + TARGET.CAPABILITY = CAP_GENERAL_DLL + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ + .inc \ + ../../../../inc \ + .MOC_DIR + + LIBS += -lSatClient.dll \ + -lSatInternalClient.dll \ + -legul.dll \ + -lfbscli.dll \ + -lcentralrepository.dll \ + -lCenRepNotifHandler.dll \ + -lCdlEngine.dll \ + -lFlogger.dll \ + -lbafl.dll \ + -lprofileeng.dll + + HEADERS += ../../inc \ + ../../inc/msatuiactionimplementer.h \ + ../../inc/satappcommonconstant.h \ + ../../inc/tflogger.h \ + ../../inc/satappmainhandler.h \ + ../../inc/csatuiobserver.h\ + ../../inc/satappcommandhandler.h \ + ../../inc/satappeventprovider.h \ + ../../inc/satappuiprovider.h \ + ../../inc/satappview.h \ + ../../inc/satappgetinkeynote.h \ + ../../inc/csatuiobserver.h \ + ../../inc/csatuiiconhandler.h \ + ../../inc/satappplaytoneprovider.h \ + inc/dummyeventprovider.h \ + inc/dummyplaytoneprovider.h \ + inc/ut_satappmainhandler.h \ + inc/ut_csatuiobserver.h \ + inc/ut_satappeventhandler.h \ + inc/ut_playtoneprovider.h + + + SOURCES += ../../src/csatuiobserver.cpp \ + ../../src/satappmainhandler.cpp \ + ../../src/satappcommandhandler.cpp \ + ../../src/satappuiprovider.cpp \ + ../../src/satappeventprovider.cpp \ + ../../src/satappview.cpp \ + ../../src/satappgetinkeynote.cpp \ + ../../src/csatuiiconhandler.cpp\ + ../../src/satappplaytoneprovider.cpp\ + src/main.cpp \ + src/dummyeventprovider.cpp \ + src/dummyplaytoneprovider.cpp \ + src/ut_satappmainhandler.cpp \ + src/ut_csatuiobserver.cpp \ + src/ut_satappeventhandler.cpp \ + src/ut_playtoneprovider.cpp + +} diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/dialpad.qrc --- a/telutils/dialpad/dialpad.qrc Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/dialpad.qrc Mon May 03 13:01:45 2010 +0300 @@ -31,5 +31,6 @@ themes/icons/hbdefault/scalable/qtg_fr_input_bg_c.svg themes/icons/hbdefault/scalable/qtg_fr_input_bg_t.svg themes/icons/hbdefault/scalable/qtg_mono_backspace2.svg + resources/dialpad_color.css diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/inc/dialpadbluetootheventfilter.h --- a/telutils/dialpad/inc/dialpadbluetootheventfilter.h Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/inc/dialpadbluetootheventfilter.h Mon May 03 13:01:45 2010 +0300 @@ -18,7 +18,7 @@ #ifndef DIALPADBLUETOOTHEVENTFILTER_H #define DIALPADBLUETOOTHEVENTFILTER_H -#include +#include class QTimer; class Dialpad; diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/inc/dialpadbutton.h --- a/telutils/dialpad/inc/dialpadbutton.h Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/inc/dialpadbutton.h Mon May 03 13:01:45 2010 +0300 @@ -24,13 +24,30 @@ { Q_OBJECT + Q_PROPERTY(DialpadButtonType buttonType READ buttonType WRITE setButtonType) + Q_ENUMS(DialpadButtonType) + +public: + enum DialpadButtonType { + NumericButton = 0x1, + FunctionButton = 0x2, + CallButton = 0x3 + }; + public: explicit DialpadButton(QGraphicsItem *parent = 0 ); virtual ~DialpadButton( ); + DialpadButtonType buttonType() const; + void setButtonType(DialpadButtonType type); + protected: void changeEvent(QEvent *event); bool sceneEvent(QEvent *event); + void polish(HbStyleParameters& params); + +private: + DialpadButtonType mButtonType; }; #endif // DIALPADBUTTON_H diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/inc/dialpadsymbianwrapper.h --- a/telutils/dialpad/inc/dialpadsymbianwrapper.h Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/inc/dialpadsymbianwrapper.h Mon May 03 13:01:45 2010 +0300 @@ -18,8 +18,8 @@ #ifndef DIALPADSYMBIANWRAPPER_H #define DIALPADSYMBIANWRAPPER_H -#include -#include +#include +#include #include class DialpadSymbianWrapperPrivate; diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/inc/dialpadsymbianwrapper_p.h --- a/telutils/dialpad/inc/dialpadsymbianwrapper_p.h Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/inc/dialpadsymbianwrapper_p.h Mon May 03 13:01:45 2010 +0300 @@ -18,7 +18,7 @@ #ifndef DIALPADSYMBIANWRAPPERPRIVATE_H #define DIALPADSYMBIANWRAPPERPRIVATE_H -#include +#include #include class CVoiceMailbox; diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/inc/dialpadsymbianwrapper_p_stub.h --- a/telutils/dialpad/inc/dialpadsymbianwrapper_p_stub.h Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/inc/dialpadsymbianwrapper_p_stub.h Mon May 03 13:01:45 2010 +0300 @@ -18,7 +18,7 @@ #ifndef DIALPADSYMBIANWRAPPERPRIVATE_H #define DIALPADSYMBIANWRAPPERPRIVATE_H -#include +#include #include class DialpadSymbianWrapper; diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/inc/dialpadvoicemailboxeventfilter.h --- a/telutils/dialpad/inc/dialpadvoicemailboxeventfilter.h Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/inc/dialpadvoicemailboxeventfilter.h Mon May 03 13:01:45 2010 +0300 @@ -18,7 +18,7 @@ #ifndef DIALPADVOICEMAILBOXEVENTFILTER_H #define DIALPADVOICEMAILBOXEVENTFILTER_H -#include +#include class QTimer; class Dialpad; diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/resources/dialpad_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telutils/dialpad/resources/dialpad_color.css Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,55 @@ + + +/* numeric button normal state */ +DialpadButton[state = "normal"][buttonType = "1"]::icon{ + color: var(qtc_input_button_normal); +} + +DialpadButton[state = "normal"][buttonType = "1"]::text{ + color: var(qtc_input_button_normal); +} + +DialpadButton[state = "normal"][buttonType = "1"]::additional-text +{ + color: var(qtc_input_button_normal); +} + +/* numeric button pressed state */ +DialpadButton[state = "pressed"][buttonType = "1"]::icon{ + color: var(qtc_input_button_pressed); +} + +DialpadButton[state = "pressed"][buttonType = "1"]::text{ + color: var(qtc_input_button_pressed); +} + +DialpadButton[state = "pressed"][buttonType = "1"]::additional-text +{ + color: var(qtc_input_button_pressed); +} + +/* backspace */ +DialpadButton[state = "normal"][buttonType = "2"]::icon{ + color: var(qtc_input_function_normal); +} + +DialpadButton[state = "pressed"][buttonType = "2"]::icon{ + color: var(qtc_input_function_pressed); +} + +DialpadButton[buttonType = "2"]::icon[!enabled]{ + color: var(qtc_input_function_disabled); +} + +/* call button */ +DialpadButton[state = "normal"][buttonType = "3"]::icon{ + color: var(qtc_callhandling_answer_normal); +} + +DialpadButton[state = "pressed"][buttonType = "3"]::icon{ + color: var(qtc_callhandling_answer_pressed); +} + +DialpadButton[buttonType = "3"]::icon[!enabled]{ + color: var(qtc_input_function_disabled); +} diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/src/dialpad.cpp --- a/telutils/dialpad/src/dialpad.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/src/dialpad.cpp Mon May 03 13:01:45 2010 +0300 @@ -131,6 +131,7 @@ // custom button style HbStyleLoader::registerFilePath(":/dialpad.css"); + HbStyleLoader::registerFilePath(":/dialpad_color.css"); HbStyleLoader::registerFilePath(":/dialpad.dialpadbutton.widgetml"); } diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/src/dialpadbluetootheventfilter.cpp --- a/telutils/dialpad/src/dialpadbluetootheventfilter.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/src/dialpadbluetootheventfilter.cpp Mon May 03 13:01:45 2010 +0300 @@ -14,8 +14,8 @@ * Description: * */ -#include -#include +#include +#include #include #include "dialpadbluetootheventfilter.h" #include "dialpad.h" diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/src/dialpadbutton.cpp --- a/telutils/dialpad/src/dialpadbutton.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/src/dialpadbutton.cpp Mon May 03 13:01:45 2010 +0300 @@ -24,7 +24,7 @@ #include "dialpadbutton.h" DialpadButton::DialpadButton(QGraphicsItem *parent) - : HbPushButton(parent) + : HbPushButton(parent), mButtonType(NumericButton) { } @@ -32,6 +32,16 @@ { } +DialpadButton::DialpadButtonType DialpadButton::buttonType() const +{ + return mButtonType; +} + +void DialpadButton::setButtonType(DialpadButtonType type) +{ + mButtonType = type; +} + void DialpadButton::changeEvent(QEvent *event) { if (event->type() == HbEvent::ThemeChanged) { @@ -60,4 +70,10 @@ return result; } +void DialpadButton::polish(HbStyleParameters& params) +{ + // HbPushButton::polish() prevents layouting + // text and additional-text horizontally. + HbAbstractButton::polish( params ); +} diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/src/dialpadbuttonstyle.cpp --- a/telutils/dialpad/src/dialpadbuttonstyle.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/src/dialpadbuttonstyle.cpp Mon May 03 13:01:45 2010 +0300 @@ -19,9 +19,6 @@ #include #include #include -#include -#include -#include #include "dialpadbuttonstyle.h" DialpadButtonStyle::DialpadButtonStyle() @@ -63,7 +60,7 @@ state = QIcon::On; if (mode == QIcon::Disabled && state == QIcon::Off) { - frameGraphicsName = "qtg_fr_btn_disabled"; + frameGraphicsName = "qtg_fr_input_btn_function_disabled"; } else if (mode == QIcon::Normal && state == QIcon::On) { if (mButtonStyle==CallButtonStyle) { frameGraphicsName = "qtg_fr_btn_green_pressed"; @@ -99,54 +96,6 @@ break; } - case P_PushButton_icon: { - HbStyle::updatePrimitive(item,primitive,option); - - // override color (todo: via css, when supported by fw) - const HbStyleOptionPushButton *opt = - qstyleoption_cast(option); - QIcon::Mode mode = QIcon::Disabled; - QIcon::State state = QIcon::Off; - if (opt->state & QStyle::State_Enabled) - mode = QIcon::Normal; - if (opt->state & QStyle::State_On) - state = QIcon::On; - - if (mButtonStyle==CallButtonStyle && - mode == QIcon::Normal) { - if (state==QIcon::On) { - QColor color(HbColorScheme::color("qtc_callhandling_answer_pressed")); - setIconColor(item,color); - } else { - QColor color(HbColorScheme::color("qtc_callhandling_answer_normal")); - setIconColor(item,color); - } - } else if (mButtonStyle==NormalButtonStyle) { - QColor color; - color = HbColorScheme::color("qtc_input_button_normal"); - setIconColor(item,color); - } else { // function button - QColor color; - color = HbColorScheme::color("qtc_input_function_normal"); - setIconColor(item,color); - } - break; - } - - case P_PushButton_text: { - HbStyle::updatePrimitive(item,primitive,option); - // override color (todo: via css, when supported by fw) - setTextColor(item); - break; - } - - case P_PushButton_additionaltext: { - HbStyle::updatePrimitive(item,primitive,option); - // override color (todo: via css, when supported by fw) - setTextColor(item); - break; - } - default: HbStyle::updatePrimitive(item,primitive,option); break; @@ -157,32 +106,3 @@ { mButtonStyle = style; } - -void DialpadButtonStyle::setTextColor(QGraphicsItem *item) const -{ - HbTextItem *textPrim = qgraphicsitem_cast(item); - if (textPrim) { - QColor color; - color = HbColorScheme::color("qtc_input_button_normal"); - if (color.isValid()) { - textPrim->setTextColor(color); - } else { - textPrim->setTextColor(Qt::black); - } - } -} - -void DialpadButtonStyle::setIconColor( - QGraphicsItem *item, - const QColor &color ) const -{ - HbIconItem *iconItem = qgraphicsitem_cast(item); - - if (iconItem) { - if (color.isValid()) { - iconItem->setColor(color); - } else { - iconItem->setColor(Qt::black); - } - } -} diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/src/dialpadinputfield.cpp --- a/telutils/dialpad/src/dialpadinputfield.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/src/dialpadinputfield.cpp Mon May 03 13:01:45 2010 +0300 @@ -51,6 +51,7 @@ mFunctionButtonStyle->setButtonStyle( DialpadButtonStyle::FunctionButtonStyle); mBackspace->setStyle(mFunctionButtonStyle); + mBackspace->setButtonType(DialpadButton::FunctionButton); // for css mBackspace->setFocusPolicy(Qt::NoFocus); mBackspace->setFlag(QGraphicsItem::ItemIsFocusable,false); mBackspace->setIcon(HbIcon(HbBackspaceIcon)); diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/src/dialpadkeypad.cpp --- a/telutils/dialpad/src/dialpadkeypad.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/src/dialpadkeypad.cpp Mon May 03 13:01:45 2010 +0300 @@ -93,8 +93,10 @@ button->setStyle(mCallButtonStyle); HbIcon callIcon(handsetIcon); // todo correct icon button->setIcon(callIcon); + button->setButtonType(DialpadButton::CallButton); // for css } else { button->setStyle(mNormalButtonStyle); + button->setButtonType(DialpadButton::NumericButton); // for css } if (keyCode==Qt::Key_1) { diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/src/dialpadsymbianwrapper.cpp --- a/telutils/dialpad/src/dialpadsymbianwrapper.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/src/dialpadsymbianwrapper.cpp Mon May 03 13:01:45 2010 +0300 @@ -32,13 +32,13 @@ int DialpadSymbianWrapper::getMailboxNumber(QString &vmbxNumber) { - Q_D(DialpadSymbianWrapper); + //Q_D(DialpadSymbianWrapper); return d_ptr->getMailboxNumber(vmbxNumber); } int DialpadSymbianWrapper::defineMailboxNumber(QString &vmbxNumber) { - Q_D(DialpadSymbianWrapper); + //Q_D(DialpadSymbianWrapper); return d_ptr->defineMailboxNumber(vmbxNumber); } diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/src/dialpadvoicemailboxeventfilter.cpp --- a/telutils/dialpad/src/dialpadvoicemailboxeventfilter.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/src/dialpadvoicemailboxeventfilter.cpp Mon May 03 13:01:45 2010 +0300 @@ -14,8 +14,8 @@ * Description: * */ -#include -#include +#include +#include #include #include #include "dialpadvoicemailboxeventfilter.h" diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/tsrc/dialpadtest/dialpadtestview.cpp --- a/telutils/dialpad/tsrc/dialpadtest/dialpadtestview.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/tsrc/dialpadtest/dialpadtestview.cpp Mon May 03 13:01:45 2010 +0300 @@ -101,7 +101,10 @@ void DialpadTestView::setDialpadPosition() { - QRectF screenRect = mMainWindow.layoutRect(); + // workaround to tsw error JMKN-83NAPU (fix coming in MCL wk14) + // QRectF screenRect(mMainWindow.layoutRect()); + QRectF screenRect = (mMainWindow.orientation() == Qt::Horizontal) ? + QRectF(0,0,640,360) : QRectF(0,0,360,640); if (mMainWindow.orientation() == Qt::Horizontal) { // dialpad takes half of the screen diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/tsrc/unit/unit.pro --- a/telutils/dialpad/tsrc/unit/unit.pro Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/tsrc/unit/unit.pro Mon May 03 13:01:45 2010 +0300 @@ -17,6 +17,7 @@ TEMPLATE = subdirs SUBDIRS += ut_dialpadbuttonstyle +SUBDIRS += ut_dialpadbutton SUBDIRS += ut_dialpadmultitaphandler SUBDIRS += ut_dialpadvoicemailboxeventfilter SUBDIRS += ut_dialpadbluetootheventfilter diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/tsrc/unit/ut_dialpadbluetootheventfilter/ut_dialpadbluetootheventfilter.pro --- a/telutils/dialpad/tsrc/unit/ut_dialpadbluetootheventfilter/ut_dialpadbluetootheventfilter.pro Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/tsrc/unit/ut_dialpadbluetootheventfilter/ut_dialpadbluetootheventfilter.pro Mon May 03 13:01:45 2010 +0300 @@ -17,7 +17,7 @@ TEMPLATE = app TARGET = -INCLUDEPATH += . ../../../inc ../shared +INCLUDEPATH += . ../../../inc ../../../../../inc ../shared CONFIG += hb qtestlib diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/tsrc/unit/ut_dialpadbutton/ut_dialpadbutton.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telutils/dialpad/tsrc/unit/ut_dialpadbutton/ut_dialpadbutton.cpp Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,58 @@ +/*! +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + +#include + +#include "dialpadtest.h" +#include "dialpadbutton.h" + +class ut_DialpadButton : public QObject +{ + Q_OBJECT + +private slots: + void initTestCase(); + void cleanupTestCase(); + + void testButtonType(); + +private: + DialpadButton *mButton; +}; + +void ut_DialpadButton::initTestCase() +{ + mButton = new DialpadButton(); +} + +void ut_DialpadButton::cleanupTestCase() +{ + delete mButton; +} + +void ut_DialpadButton::testButtonType() +{ + QVERIFY(mButton->buttonType()==DialpadButton::NumericButton); + mButton->setButtonType(DialpadButton::FunctionButton); + QVERIFY(mButton->buttonType()==DialpadButton::FunctionButton); +} + +DIALPAD_TEST_MAIN(ut_DialpadButton) +#include "ut_dialpadbutton.moc" diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/tsrc/unit/ut_dialpadbutton/ut_dialpadbutton.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telutils/dialpad/tsrc/unit/ut_dialpadbutton/ut_dialpadbutton.pro Mon May 03 13:01:45 2010 +0300 @@ -0,0 +1,34 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +# + +TEMPLATE = app +TARGET = +DEPENDPATH += . ../../../src +INCLUDEPATH += . ../../../inc ../shared +CONFIG += hb qtestlib + +symbian { + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE +} else:win32 { + DESTDIR = ./ +} + +HEADERS += ../../../inc/dialpadbutton.h + +SOURCES += ut_dialpadbutton.cpp \ + ../../../src/dialpadbutton.cpp + diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/tsrc/unit/ut_dialpadbuttonstyle/ut_dialpadbuttonstyle.cpp --- a/telutils/dialpad/tsrc/unit/ut_dialpadbuttonstyle/ut_dialpadbuttonstyle.cpp Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/tsrc/unit/ut_dialpadbuttonstyle/ut_dialpadbuttonstyle.cpp Mon May 03 13:01:45 2010 +0300 @@ -39,9 +39,6 @@ void cleanupTestCase(); void testPushButtonFrame(); - void testTextColor(); - void testAdditionalTextColor(); - void testPushButtonIcon(); private: DialpadButtonStyle *mStyle; @@ -98,7 +95,7 @@ // Disabled option.state &= ~QStyle::State_Enabled; mStyle->updatePrimitive(item,HbStyle::P_PushButton_background,&option); - QVERIFY(item->frameDrawer().frameGraphicsName()=="qtg_fr_btn_disabled"); + QVERIFY(item->frameDrawer().frameGraphicsName()=="qtg_fr_input_btn_function_disabled"); // Selected option.state |= QStyle::State_Selected; @@ -113,72 +110,5 @@ delete item2; } -void ut_DialpadButtonStyle::testTextColor() -{ - HbTextItem* item = new HbTextItem(); - HbStyleOptionPushButton option; - option.backgroundFrameDrawer = 0; - QColor color; - color = HbColorScheme::color("qtc_input_button_normal"); - - // Enabled ON - option.state |= QStyle::State_On; - option.state |= QStyle::State_Enabled; - - mStyle->updatePrimitive(item,HbStyle::P_PushButton_text,&option); - - QVERIFY(item->textColor()==color); -} - -void ut_DialpadButtonStyle::testAdditionalTextColor() -{ - HbTextItem* item = new HbTextItem(); - HbStyleOptionPushButton option; - option.backgroundFrameDrawer = 0; - QColor color; - color = HbColorScheme::color("qtc_input_button_normal"); - - // Enabled ON - option.state |= QStyle::State_On; - option.state |= QStyle::State_Enabled; - - mStyle->updatePrimitive(item,HbStyle::P_PushButton_additionaltext,&option); - - QVERIFY(item->textColor()==color); -} - -void ut_DialpadButtonStyle::testPushButtonIcon() -{ - HbIconItem* item = new HbIconItem(); - HbStyleOptionPushButton option; - QColor funcColor(HbColorScheme::color("qtc_input_function_normal")); - QColor normColor(HbColorScheme::color("qtc_input_button_normal")); - QColor answerNormal(HbColorScheme::color("qtc_callhandling_answer_normal")); - QColor answerPressed(HbColorScheme::color("qtc_callhandling_answer_pressed")); - - // Normal - option.state |= QStyle::State_Enabled; - option.state |= QStyle::State_Off; - - mStyle->setButtonStyle(DialpadButtonStyle::NormalButtonStyle); - mStyle->updatePrimitive(item,HbStyle::P_PushButton_icon,&option); - QVERIFY(item->color()==normColor); - - mStyle->setButtonStyle(DialpadButtonStyle::FunctionButtonStyle); - mStyle->updatePrimitive(item,HbStyle::P_PushButton_icon,&option); - QVERIFY(item->color()==funcColor); - - mStyle->setButtonStyle(DialpadButtonStyle::CallButtonStyle); - mStyle->updatePrimitive(item,HbStyle::P_PushButton_icon,&option); - QVERIFY(item->color()==answerNormal); - - // Pressed - option.state |= QStyle::State_On; - option.state &= ~QStyle::State_Off; - mStyle->setButtonStyle(DialpadButtonStyle::CallButtonStyle); - mStyle->updatePrimitive(item,HbStyle::P_PushButton_icon,&option); - QVERIFY(item->color()==answerPressed); -} - DIALPAD_TEST_MAIN(ut_DialpadButtonStyle) #include "ut_dialpadbuttonstyle.moc" diff -r e32024264ebb -r d7fc66ccd6fb telutils/dialpad/tsrc/unit/ut_dialpadvoicemailboxeventfilter/ut_dialpadvoicemailboxeventfilter.pro --- a/telutils/dialpad/tsrc/unit/ut_dialpadvoicemailboxeventfilter/ut_dialpadvoicemailboxeventfilter.pro Fri Apr 16 15:31:58 2010 +0300 +++ b/telutils/dialpad/tsrc/unit/ut_dialpadvoicemailboxeventfilter/ut_dialpadvoicemailboxeventfilter.pro Mon May 03 13:01:45 2010 +0300 @@ -17,7 +17,7 @@ TEMPLATE = app TARGET = -INCLUDEPATH += . ../../../inc ../shared +INCLUDEPATH += . ../../../inc ../../../../../inc ../shared CONFIG += hb qtestlib diff -r e32024264ebb -r d7fc66ccd6fb vmbx/vmbxengine/inc/vmbxsatrefreshobserver.h --- a/vmbx/vmbxengine/inc/vmbxsatrefreshobserver.h Fri Apr 16 15:31:58 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxsatrefreshobserver.h Mon May 03 13:01:45 2010 +0300 @@ -22,8 +22,8 @@ // INCLUDES #include -#include -#include +#include +#include #include #include "mvmbxsatrefreshobserver.h"