# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273843486 -10800 # Node ID e44a8c097b1520f24859868ddb6e05e2ba159d05 # Parent d7fc66ccd6fb6ab43a361d08be165865495af500 Revision: 201017 Kit: 201019 diff -r d7fc66ccd6fb -r e44a8c097b15 cbs/cbsui/resources/cbs_app.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cbs/cbsui/resources/cbs_app.docml Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r d7fc66ccd6fb -r e44a8c097b15 cbs/cbsui/resources/cbs_topic_view.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cbs/cbsui/resources/cbs_topic_view.docml Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r d7fc66ccd6fb -r e44a8c097b15 cellular/telephonysettings/xqbindings/psetwrapper/src/psetcallbarringwrapper_p.cpp --- a/cellular/telephonysettings/xqbindings/psetwrapper/src/psetcallbarringwrapper_p.cpp Mon May 03 13:01:45 2010 +0300 +++ b/cellular/telephonysettings/xqbindings/psetwrapper/src/psetcallbarringwrapper_p.cpp Fri May 14 16:24:46 2010 +0300 @@ -202,12 +202,11 @@ TServiceGroup convertedServiceGroup = convertServiceGroup(serviceGroup); TBarringProgram convertedBarringType = convertBarringType(barringType); - + + m_currentRequest = RequestBarringStatus; QT_TRAP_THROWING(m_callBarring->GetBarringStatusL( convertedServiceGroup, convertedBarringType) ) - - m_currentRequest = RequestBarringStatus; } @@ -228,11 +227,11 @@ setting.iPassword.Copy(barringPassword.utf16()); TBasicServiceGroups serviceGroups = EAllTeleAndBearer; + + m_currentRequest = RequestEnableBarring; QT_TRAP_THROWING( m_callBarring->SetBarringL(setting, serviceGroups); ) - - m_currentRequest = RequestEnableBarring; } @@ -253,11 +252,11 @@ setting.iPassword.Copy(barringPassword.utf16()); TBasicServiceGroups serviceGroups = EAllTeleAndBearer; + + m_currentRequest = RequestDisableBarring; QT_TRAP_THROWING( m_callBarring->SetBarringL(setting, serviceGroups); - ) - - m_currentRequest = RequestDisableBarring; + ) } @@ -274,11 +273,10 @@ passwordChange.iNewPassword.Copy(newPassword.utf16()); passwordChange.iVerifiedPassword.Copy(verifiedPassword.utf16()); + m_currentRequest = RequestChangePassword; QT_TRAP_THROWING( m_callBarring->ChangePasswordL(passwordChange); ) - - m_currentRequest = RequestChangePassword; } diff -r d7fc66ccd6fb -r e44a8c097b15 convergedcallengine/cce/src/cccecallparameters.cpp --- a/convergedcallengine/cce/src/cccecallparameters.cpp Mon May 03 13:01:45 2010 +0300 +++ b/convergedcallengine/cce/src/cccecallparameters.cpp Fri May 14 16:24:46 2010 +0300 @@ -65,6 +65,7 @@ cloned->SetLineType(iLineType); cloned->SetUUSId(iUUSId); cloned->SetOrigin(iOrigin); + cloned->SetAlphaId(iAlphaId); return cloned; } @@ -175,6 +176,15 @@ return iOrigin; } +void CCCECallParameters::SetAlphaId(TBuf aAlphaId) + { + iAlphaId = aAlphaId; + } +TBuf CCCECallParameters::AlphaId() const + { + return iAlphaId; + } + // End of file diff -r d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/rom/callui.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/rom/callui.iby Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,30 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/rom/callui_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/rom/callui_variant.iby Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,26 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/rom/calluiresources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/rom/calluiresources.iby Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,24 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiengine/cauiactiveobject.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiengine/cauiactiveobject.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,467 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiengine/cauidialdatacontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiengine/cauidialdatacontainer.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,76 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiengine/cauidialogs.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiengine/cauidialogs.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,658 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiengine/cauiengfactimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiengine/cauiengfactimpl.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,71 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiengine/cauiengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiengine/cauiengine.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,1392 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiengine/cauienginemain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiengine/cauienginemain.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,38 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiengine/cauienginestub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiengine/cauienginestub.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,656 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiengine/cauimessagesender.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiengine/cauimessagesender.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,342 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiengine/cauimessagesenderstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiengine/cauimessagesenderstub.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,108 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiengine/cauiquery.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiengine/cauiquery.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,90 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiengine/cauivoipextension.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiengine/cauivoipextension.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,159 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiengine/ccauireconnectquery.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiengine/ccauireconnectquery.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,57 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiengine/ccauireconnectqueryimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiengine/ccauireconnectqueryimpl.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,68 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiplugin/cauimain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiplugin/cauimain.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,60 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/callui/src/cauiplugin/cauiplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneclientserver/callui/src/cauiplugin/cauiplugin.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,441 @@ +/* +* 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 d7fc66ccd6fb -r e44a8c097b15 phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdNoteController.cpp --- a/phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdNoteController.cpp Mon May 03 13:01:45 2010 +0300 +++ b/phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdNoteController.cpp Fri May 14 16:24:46 2010 +0300 @@ -28,8 +28,6 @@ _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 @@ -195,7 +193,7 @@ TFLOGSTRING("CPhCltUssdNoteController: DestroyGlobalWaitNote call") if ( iGlobalWaitNote ) { - iGlobalWaitNote->Cancel(); + iGlobalWaitNote->Close(); delete iGlobalWaitNote; iGlobalWaitNote = NULL; delete iGlobalResource; diff -r d7fc66ccd6fb -r e44a8c097b15 phonesrv_plat/converged_call_engine_api/inc/cccecallparameters.h --- a/phonesrv_plat/converged_call_engine_api/inc/cccecallparameters.h Mon May 03 13:01:45 2010 +0300 +++ b/phonesrv_plat/converged_call_engine_api/inc/cccecallparameters.h Fri May 14 16:24:46 2010 +0300 @@ -87,7 +87,11 @@ /** Gets the origin of the call. */ virtual TCCECallOrigin Origin() const; - + /** Sets the SAT alpha id identifying the text to be shown instead of number in + call bubble */ + virtual void SetAlphaId(TBuf aAlphaId); + /** Gets the SAT alpha id of the call. */ + virtual TBuf AlphaId() const; protected: CCCECallParameters(); @@ -106,6 +110,8 @@ TBuf iSubAddress; /** Call origin. */ TCCECallOrigin iOrigin; + /** Alpha id. */ + TBuf iAlphaId; }; diff -r d7fc66ccd6fb -r e44a8c097b15 phonesrv_plat/converged_call_provider_api/inc/ccpdefs.h --- a/phonesrv_plat/converged_call_provider_api/inc/ccpdefs.h Mon May 03 13:01:45 2010 +0300 +++ b/phonesrv_plat/converged_call_provider_api/inc/ccpdefs.h Fri May 14 16:24:46 2010 +0300 @@ -36,8 +36,9 @@ const TUint KCCPPhoneSerialNumberSize = 50; // const TUint KCCPSysUtilVersionTextLength = 64; // from sysutil.h const TUint KCCPPhoneModelIdSize = 50; // from RMobilePhone::KPhoneModelIdSize -const TUint KCCPPhoneManufacturerIdSize = 50; // fromRMobilePhone::KPhoneManufacturerIdSize +const TUint KCCPPhoneManufacturerIdSize = 50; // fromRMobilePhone::KPhoneManufacturerIdSize const TUint KCCPUUSIdSize = 129; // etelmm.h, as KMaxUUISize +const TUint KCCPAlphaIdMaxSize = 254; // etelmm.h, as KAlphaIdMaxSize /** diff -r d7fc66ccd6fb -r e44a8c097b15 phonesrv_plat/dialpad_api/inc/dialpadkeyhandler.h --- a/phonesrv_plat/dialpad_api/inc/dialpadkeyhandler.h Mon May 03 13:01:45 2010 +0300 +++ b/phonesrv_plat/dialpad_api/inc/dialpadkeyhandler.h Fri May 14 16:24:46 2010 +0300 @@ -23,6 +23,7 @@ class Dialpad; class DialpadVoiceMailboxEventFilter; class DialpadBluetoothEventFilter; +class DialpadKeySequenceEventFilter; class HbMainWindow; #ifdef BUILD_DIALPADKEYHANDLER @@ -49,9 +50,10 @@ virtual ~DialpadKeyHandler(); private: - DialpadVoiceMailboxEventFilter* mVmbxFilter; - DialpadBluetoothEventFilter* mBtFilter; HbMainWindow& mMainWindow; + QScopedPointer mVmbxFilter; + QScopedPointer mBtFilter; + QScopedPointer mKeySequenceFilter; }; #endif // DIALPADKEYHANDLER_H diff -r d7fc66ccd6fb -r e44a8c097b15 phonesrv_plat/voice_mailbox_number_api/inc/cvoicemailbox.h --- a/phonesrv_plat/voice_mailbox_number_api/inc/cvoicemailbox.h Mon May 03 13:01:45 2010 +0300 +++ b/phonesrv_plat/voice_mailbox_number_api/inc/cvoicemailbox.h Fri May 14 16:24:46 2010 +0300 @@ -32,7 +32,6 @@ * Parameter package for Voice Mailbox API operations. * * @lib vmbxengine.lib - * @since S60 v5.2 */ class TVoiceMailboxParams { @@ -171,7 +170,6 @@ /** * Retrieves voice mailbox entry for the specified service. * - * @since S60 v5.2 * @param in Params Service id and type of the mailbox for which * a number/address should be defined. * @param out aEntry If successful, a new result container is @@ -192,7 +190,6 @@ * In that case unsupported arguments are ignored. * This method may display related UI notes or queries. * - * @since S60 v5.2 * @param in aEntry The vmbx entry to save. * @return - KErrNone if the entry was saved * - KErrNotSupported if not capable or allowed to execute this @@ -214,7 +211,6 @@ * can be used to check permissions. * * - * @since S60 v5.2 * @param in aParams Service id and type of the mailbox for which * a number/address should be defined. * @param out aEntry If successful, a new result container is @@ -241,7 +237,6 @@ * If client is interested, CheckConfiguration() * can be used to check permissions. * - * @since S60 v5.2 * @param in aParams Service id and type of the mailbox. * @param out aEntry If successful, a new result container is * created and ownership passed to the caller. @@ -260,7 +255,6 @@ * Displays a query on the screen asking the user to select a * Voice Mailbox service. * - * @since S60 v5.2 * @param out aParams If successful, * contains selected mailbox info. * @return - KErrNone if successful. @@ -283,7 +277,6 @@ * if a second request is issued while one is active already. * Leaves if the notify request could not be served. * - * @since S60 v5.2 * @param in aObserver The observer for the notification. * @param in aNotifyOnActiveLineOnly if this is ETrue, notify events will * be generated only if the vmbx number of the active ALS line is @@ -298,7 +291,6 @@ /** * Cancels a notify request on a vmbx number change. * - * @since S60 v5.2 */ IMPORT_C virtual void NotifyVmbxNumberChangeCancel(); @@ -306,7 +298,6 @@ * Checks the Voice Mailbox configuration to find out if a features * are disabled or enabled. * - * @since S60 v5.2 * @param in aParams Specifies which mailbox capabilities, * the caller wants to check. * @param in aFlags Use TVmbxFeatureCapabilityFlag values @@ -323,7 +314,6 @@ /** * Checks the Voice Mailbox how many VoIP service Ids * - * @since S60 v5.2 * @param out aProfileIds * @return KErrNone if get service Ids successfully. */ @@ -335,7 +325,6 @@ * Some mailbox types may not support saving all arguments. * In that case unsupported arguments are ignored. * - * @since S60 v5.2 * @param in aEntry The provisioned vmbx entry to save. * @return - KErrNone if the entry was saved * - KErrNotSupported if not capable or allowed to execute this @@ -350,14 +339,12 @@ /** * Second phase constructor. * - * @since S60 v5.2 */ void ConstructL(); /** * Default constructor. * - * @since S60 v5.2 */ CVoiceMailbox(); diff -r d7fc66ccd6fb -r e44a8c097b15 phonesrv_plat/voice_mailbox_number_api/inc/cvoicemailboxentry.h --- a/phonesrv_plat/voice_mailbox_number_api/inc/cvoicemailboxentry.h Mon May 03 13:01:45 2010 +0300 +++ b/phonesrv_plat/voice_mailbox_number_api/inc/cvoicemailboxentry.h Fri May 14 16:24:46 2010 +0300 @@ -24,7 +24,6 @@ /** * Container class for Voice Mailbox info. * @lib vmbxengine.lib - * @since S60 v5.2 */ class CVoiceMailboxEntry : public CBase @@ -45,7 +44,6 @@ /** * Destructor - * @since S60 v5.2 * */ virtual ~CVoiceMailboxEntry(); @@ -53,7 +51,6 @@ /** * Gets the Voice Mailbox service. * - * @since S60 v5.2 * @return Mailbox service. */ IMPORT_C virtual TServiceId ServiceId() const; @@ -61,7 +58,6 @@ /** * Sets the Voice Mailbox service to container. * - * @since S60 v5.2 * @param in aVmbxServiceId Voice Mailbox service. */ virtual void SetServiceId( @@ -70,7 +66,6 @@ /** * Gets the Voice Mailbox type. * - * @since S60 v5.2 * @return Mailbox type. */ IMPORT_C virtual TVmbxType VoiceMailboxType() const; @@ -78,7 +73,6 @@ /** * Sets the Voice Mailbox type to container. * - * @since S60 v5.2 * @param in aVmbxType Voice Mailbox type. */ IMPORT_C virtual void SetVoiceMailboxType( @@ -87,7 +81,6 @@ /** * Gets the Voice Mailbox line type. * - * @since S60 v5.2 * @return Mailbox line type. * EVmbxAlsLineDefault is returned if mailbox does not * support several lines. @@ -98,7 +91,6 @@ * Sets the Voice Mailbox line type to container. * EVmbxAlsLineDefault is used by default. * - * @since S60 v5.2 * @param in aLine Selected Voice Mailbox line type. */ virtual void SetVmbxAlsLineType( @@ -107,7 +99,6 @@ /** * Gets the Voice Mailbox number or address. * - * @since S60 v5.2 * @param out aVmbxNumber If successful, contains the returned * mailbox number or address. * @return One of the system wide error codes. @@ -117,7 +108,6 @@ /** * Sets the Voice Mailbox number or address to container. * - * @since S60 v5.2 * @param in aVmbxNumber New Voice Mailbox number or address. * @return One of the system wide error codes. */ @@ -126,7 +116,6 @@ /** * Gets the Voice Mailbox brand id. * - * @since S60 v5.2 * @param out aBrandId If successful, contains the returned Brand id. * @return One of the system wide error codes. */ @@ -135,7 +124,6 @@ /** * Sets the Voice Mailbox Brand Id to container. * - * @since S60 v5.2 * @param in aBrandId New Brand Id. * @return One of the system wide error codes. */ @@ -145,7 +133,6 @@ /** * Gets the VoIp name. * - * @since S60 v5.2 * @param out aVmbxName If successful, contains the returned mailbox name. * @return One of the system wide error codes. */ @@ -154,7 +141,6 @@ /** * Sets the VoIp name to container. * - * @since S60 v5.2 * @param in aVmbxName New Voice Mailbox name. * @return One of the system wide error codes. */ @@ -163,7 +149,6 @@ /** * Gets the type of memory location. * - * @since S60 v5.2 * @return Memory location type. */ IMPORT_C virtual TVmbxMemoryLocation UsingMemoryLocation( ) const; @@ -171,14 +156,12 @@ /** * Resets the container to initial state. * - * @since S60 v5.2 */ IMPORT_C virtual void Reset(); /** * Sets the using memory location to entry. * - * @since S60 v5.2 * @param in aType Memory location type. */ virtual void SetUsingMemoryLocation( @@ -189,7 +172,6 @@ /** * Second phase constructor. * - * @since S60 v5.2 */ void ConstructL(); @@ -198,7 +180,6 @@ /** * Default constructor. * - * @since S60 v5.2 */ CVoiceMailboxEntry(); diff -r d7fc66ccd6fb -r e44a8c097b15 phonesrv_plat/voice_mailbox_number_api/inc/mvoicemailboxobserver.h --- a/phonesrv_plat/voice_mailbox_number_api/inc/mvoicemailboxobserver.h Mon May 03 13:01:45 2010 +0300 +++ b/phonesrv_plat/voice_mailbox_number_api/inc/mvoicemailboxobserver.h Fri May 14 16:24:46 2010 +0300 @@ -25,7 +25,6 @@ /** * Notifier for vmbx number/address changes * - * @since S60 v5.2 * @lib vmbxengine.lib * */ @@ -37,7 +36,6 @@ * Observer callback function which is called when * changes to voice mailbox entries occur. * - * @since S60 5.2 * @param aVmbxEntry The new vmbx entry. */ virtual void HandleNotifyL( const CVoiceMailboxEntry& aVmbxEntry ) = 0; diff -r d7fc66ccd6fb -r e44a8c097b15 phonesrv_plat/voice_mailbox_number_api/inc/voicemailboxdefs.h --- a/phonesrv_plat/voice_mailbox_number_api/inc/voicemailboxdefs.h Mon May 03 13:01:45 2010 +0300 +++ b/phonesrv_plat/voice_mailbox_number_api/inc/voicemailboxdefs.h Fri May 14 16:24:46 2010 +0300 @@ -76,7 +76,12 @@ * When flag is enabled the user is not allowed to define or * modify the voice mailbox number. */ - EVmbxChangeNbrNotAllowedOnUi = 0x01, + EVmbxChangeNbrAllowedOnUi = 0x01, + + /** + * Used to check whether video mailbox is supported or not + */ + EVmbxVideoMailboxSupported = 0x02 }; /** Vmbx Memory location which is currently used */ diff -r d7fc66ccd6fb -r e44a8c097b15 phonesrv_plat/voice_mailbox_number_api/tsrc/mt_vmbxengine.cpp --- a/phonesrv_plat/voice_mailbox_number_api/tsrc/mt_vmbxengine.cpp Mon May 03 13:01:45 2010 +0300 +++ b/phonesrv_plat/voice_mailbox_number_api/tsrc/mt_vmbxengine.cpp Fri May 14 16:24:46 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" @@ -111,92 +111,6 @@ } // ----------------------------------------------------------------------------- -// Mt_vmbxEngine::testVmbxType -// testVmbxType test case -// Connects to test object signal and verifies received data. -// ----------------------------------------------------------------------------- -void Mt_vmbxEngine::testVmbxType() -{ - qDebug("Mt_vmbxEngine::testVmbxType >"); - QVERIFY(mVmbxEntry); - mVmbxEntry->SetVoiceMailboxType(EVmbxVoice); - QCOMPARE(mVmbxEntry->VoiceMailboxType(), EVmbxVoice); - qDebug("Mt_vmbxEngine::testVmbxType <"); -} - -// ----------------------------------------------------------------------------- -// Mt_vmbxEngine::testServiceId -// testServiceId test case -// Connects to test object signal and verifies received data. -// ----------------------------------------------------------------------------- -void Mt_vmbxEngine::testServiceId() -{ - qDebug("Mt_vmbxEngine::testServiceId >"); - QVERIFY(mVmbxEntry); - mVmbxEntry->SetServiceId(KVmbxServiceIdNone); - QCOMPARE(mVmbxEntry->ServiceId(), KVmbxServiceIdNone); - qDebug("Mt_vmbxEngine::testServiceId <"); -} - -// ----------------------------------------------------------------------------- -// Mt_vmbxEngine::testAlsLineType -// testAlsLineType test case -// Connects to test object signal and verifies received data. -// ----------------------------------------------------------------------------- -void Mt_vmbxEngine::testAlsLineType() -{ - qDebug("Mt_vmbxEngine::testAlsLineType >"); - QVERIFY(mVmbxEntry); - mVmbxEntry->SetVmbxAlsLineType(EVmbxAlsLine1); - QCOMPARE(mVmbxEntry->VmbxAlsLineType(), EVmbxAlsLine1); - qDebug("Mt_vmbxEngine::testAlsLineType <"); -} - -// ----------------------------------------------------------------------------- -// Mt_vmbxEngine::testVmbxNumber -// testVmbxNumber test case -// Connects to test object signal and verifies received data. -// ----------------------------------------------------------------------------- -void Mt_vmbxEngine::testVmbxNumber() -{ - qDebug("Mt_vmbxEngine::testVmbxNumber >"); - QVERIFY(mVmbxEntry); - TInt result= mVmbxEntry->SetVmbxNumber(KVmbxNumber); - QCOMPARE(result, KErrNone); - TPtrC vmbxNumber(KNullDesC); - result = mVmbxEntry->GetVmbxNumber(vmbxNumber); - QVERIFY2(KErrNone == result, "GetVmbxNumber failed"); - QVERIFY2(vmbxNumber.Compare(KVmbxNumber) == 0, "Get wrong vmbxnumber"); - qDebug("Mt_vmbxEngine::testVmbxNumber <"); -} - -// ----------------------------------------------------------------------------- -// Mt_vmbxEngine::testReset -// testReset test case -// Connects to test object signal and verifies received data. -// ----------------------------------------------------------------------------- -void Mt_vmbxEngine::testReset() -{ - qDebug("Mt_vmbxEngine::testReset >"); - QVERIFY(mVmbxEntry); - mVmbxEntry->Reset(); - QCOMPARE(mVmbxEntry->VmbxAlsLineType(), EVmbxAlsLineDefault); - QCOMPARE(mVmbxEntry->ServiceId(), KVmbxServiceIdNone); - QCOMPARE(mVmbxEntry->VoiceMailboxType(), EVmbxNone); - QCOMPARE(mVmbxEntry->UsingMemoryLocation(),EVmbxSimMemory); - TPtrC vmbxNumber(KNullDesC); - TInt result = mVmbxEntry->GetVmbxNumber(vmbxNumber); - QCOMPARE(result, KErrNone); - QVERIFY(vmbxNumber.Compare(KNullDesC)==0); - // mVmbxEntry's vmbxname don't be set before - TPtrC vmbxName(KNullDesC); - result = mVmbxEntry->GetVmbxName(vmbxName); - QVERIFY2(KErrNotFound==result, "GetVmbxName failed"); - QVERIFY2(vmbxName.Compare(KNullDesC) == 0, "Get wrong vmbxname"); - qDebug("Mt_vmbxEngine::testReset <"); -} - -// ----------------------------------------------------------------------------- // Mt_vmbxEngine::testCheckConfiguration // CreateVmbxMailbox test case // Connects to test object signal and verifies received data. @@ -243,20 +157,6 @@ } // ----------------------------------------------------------------------------- -// Mt_vmbxEngine::testNotifyVmbxNumberChange -// testNotifyVmbxNumberChange test case -// Connects to test object signal and verifies received data. -// ----------------------------------------------------------------------------- -void Mt_vmbxEngine::testNotifyVmbxNumberChange() -{ - qDebug("Mt_vmbxEngine::testNotifyVmbxNumberChange >"); - QVERIFY(mVmbxEngine); - //const bool test = true; - //mVmbxEngine->NotifyVmbxNumberChangeL(*this, true); - qDebug("Mt_vmbxEngine::testNotifyVmbxNumberChange <"); -} - -// ----------------------------------------------------------------------------- // Mt_vmbxEngine::testSaveProvisionedEntry // testSaveProvisionedEntry test case // Connects to test object signal and verifies received data. @@ -324,8 +224,9 @@ qDebug("Mt_vmbxEngine::testQueryVmbxMailbox no number defined"); // test QueryNewEntry result = mVmbxEngine->QueryNewEntry( params, vmbxEntry ); - QVERIFY2(KErrNone == result, "QueryNewEntry Failed."); - if (mVmbxEngine->CheckConfiguration(params,EVmbxChangeNbrNotAllowedOnUi)) { + //QVERIFY2(KErrNone == result, "QueryNewEntry Failed."); + if (mVmbxEngine->CheckConfiguration(params,EVmbxChangeNbrNotAllowedOnUi) + && KErrNone == result) { // test SaveEntry result = mVmbxEngine->SaveEntry( *vmbxEntry ); QVERIFY2(KErrNone == result, "SaveEntry Failed."); @@ -334,8 +235,9 @@ qDebug("Mt_vmbxEngine::testQueryVmbxMailbox change number"); // test change entry result = mVmbxEngine->QueryChangeEntry( params, vmbxEntry ); - QVERIFY2(KErrNone == result, "QueryChangeEntry Failed."); - if (mVmbxEngine->CheckConfiguration(params,EVmbxChangeNbrNotAllowedOnUi)) { + //QVERIFY2(KErrNone == result, "QueryChangeEntry Failed."); + if (mVmbxEngine->CheckConfiguration(params,EVmbxChangeNbrNotAllowedOnUi) + && KErrNone == result ) { result = mVmbxEngine->SaveEntry( *vmbxEntry ); QVERIFY2(KErrNone == result, "SaveEntry Failed."); // test GetStoredEntry diff -r d7fc66ccd6fb -r e44a8c097b15 phonesrv_plat/voice_mailbox_number_api/tsrc/mt_vmbxengine.h --- a/phonesrv_plat/voice_mailbox_number_api/tsrc/mt_vmbxengine.h Mon May 03 13:01:45 2010 +0300 +++ b/phonesrv_plat/voice_mailbox_number_api/tsrc/mt_vmbxengine.h Fri May 14 16:24:46 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" @@ -40,7 +40,6 @@ * See cpp file for more information. * * @lib mt_vmbxngine.lib - * @since S60 */ class Mt_vmbxEngine : public QObject { @@ -53,73 +52,29 @@ private slots: - /** - * Called before the first testfunction is executed. - * Handles the SetUpMenu command. - */ + /*! + Called before the first testfunction is executed. + */ void initTestCase(); - /** - * Called after the last testfunction has been executed. - * - */ + /*! + Called after the last testfunction has been executed. + */ void cleanupTestCase(); - - // Called before each testfunction is executed. Currently not needed - //void init(); - - /** - * Called after every testfunction. Currently not needed - * - */ - //void cleanup(); - /** - * Test first case,Create testCreateVmbxEntry - * - */ - void testCreateVmbxEntry(); - - /** - * Test second case,Create CVoiceMailbox - * - */ - void testCreateVmbxMailbox(); - - /** - * Test middle case,vmbx type - * - */ - void testVmbxType(); - - /** - * Test middle case,ServiceId - * - */ - void testServiceId(); - - /** - * Test middle case, AlsLine Type - * - */ - void testAlsLineType(); - - /** - * Test middle case, VmbxNumber - * - */ - void testVmbxNumber(); - - /** - * Test middle case, reset - * - */ - void testReset(); + /*! + Create an empty vmbx entry + */ + void testCreateVmbxEntry(); + + /*! + Create CVoiceMailbox Api + */ + void testCreateVmbxMailbox(); - /** - * Test middle case,CheckConfiguration - * - */ + /*! + Test middle case,CheckConfiguration + */ void testCheckConfiguration(); /** @@ -129,11 +84,6 @@ */ void testCreateWindow(); - /** - * Test middle case,regsit observer for vmbx number changed - * - */ - void testNotifyVmbxNumberChange(); /** * Test middle case,SaveProvisionedEntry @@ -161,13 +111,11 @@ /** * Test middle case,delete CVoiceMailbox - * */ void testDeleteVmbxMailbox(); /** * Test last case,delete CVoiceMailboxEntry - * */ void testDeleteVmbxEntry(); @@ -176,7 +124,7 @@ /** * Own. */ - CVoiceMailboxEntry* mVmbxEntry; + CVoiceMailboxEntry* mVmbxEntry; /** * Own. diff -r d7fc66ccd6fb -r e44a8c097b15 phonesrv_plat/voice_mailbox_number_api/tsrc/mt_vmbxengine.pro --- a/phonesrv_plat/voice_mailbox_number_api/tsrc/mt_vmbxengine.pro Mon May 03 13:01:45 2010 +0300 +++ b/phonesrv_plat/voice_mailbox_number_api/tsrc/mt_vmbxengine.pro Fri May 14 16:24:46 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" @@ -15,7 +15,7 @@ # TEMPLATE = app -TARGET = +TARGET = mt_vmbxengine DEPENDPATH += . INCLUDEPATH += . CONFIG += hb @@ -30,10 +30,7 @@ /epoc32/include/mw/QtTest \ ../../inc - LIBS += -lvmbxengine.dll\ - -lflogger.dll - - + LIBS += -lvmbxengine.dll } # Input diff -r d7fc66ccd6fb -r e44a8c097b15 satengine/SatServer/Commands/SetUpCallCmd/group/SetUpCallCmd.mmp --- a/satengine/SatServer/Commands/SetUpCallCmd/group/SetUpCallCmd.mmp Mon May 03 13:01:45 2010 +0300 +++ b/satengine/SatServer/Commands/SetUpCallCmd/group/SetUpCallCmd.mmp Fri May 14 16:24:46 2010 +0300 @@ -31,7 +31,6 @@ SOURCE std.cpp SOURCE CSetUpCallHandler.cpp SOURCE csetupcallrequesthandler.cpp -SOURCE csetupcallstatushandler.cpp START RESOURCE 1000f005.rss TARGET SetUpCallCmd.rsc diff -r d7fc66ccd6fb -r e44a8c097b15 satengine/SatServer/Commands/SetUpCallCmd/inc/CSetUpCallHandler.h --- a/satengine/SatServer/Commands/SetUpCallCmd/inc/CSetUpCallHandler.h Mon May 03 13:01:45 2010 +0300 +++ b/satengine/SatServer/Commands/SetUpCallCmd/inc/CSetUpCallHandler.h Fri May 14 16:24:46 2010 +0300 @@ -189,6 +189,11 @@ */ void CreateEmergencyCall( CSetupCallRequestHandler& aHandler ); + /** + * Check the Param of the setup call + */ + TBool CheckSetupCallParam(); + private: // data /** diff -r d7fc66ccd6fb -r e44a8c097b15 satengine/SatServer/Commands/SetUpCallCmd/inc/csetupcallrequesthandler.h --- a/satengine/SatServer/Commands/SetUpCallCmd/inc/csetupcallrequesthandler.h Mon May 03 13:01:45 2010 +0300 +++ b/satengine/SatServer/Commands/SetUpCallCmd/inc/csetupcallrequesthandler.h Fri May 14 16:24:46 2010 +0300 @@ -22,8 +22,6 @@ #include #include "msatmultimodeapi.h" -#include "csetupcallstatushandler.h" - class CSetUpCallHandler; class MSatAsyncToSync; @@ -32,14 +30,10 @@ * This active objects is registered with ETelMM Api to send request and * receive notifications about some Request Complete. * -* @lib CallControlCmd -* @since S60 v5.0.1 */ -class CSetupCallRequestHandler : public CActive, - public MSetupCallStatusObserver +class CSetupCallRequestHandler : public CActive { - public: /** @@ -74,11 +68,6 @@ */ void CancelOperation(); - /** - * From MSetupCallStatusObserver - * The call status update notification from ETel MM - */ - void CallSatatusChanged( const TInt status ); protected: @@ -103,15 +92,6 @@ CSetupCallRequestHandler( MSatMultiModeApi& aPhone, CSetUpCallHandler* aDispatcher ); - /** - * Two phase contruction. - */ - void ConstructL(); - -private: //new method - - void HandleSetupCallStatusChange(); - private: // Data /** @@ -125,21 +105,10 @@ CSetUpCallHandler* iDispatcher; /** - * Use to monite the status of call - * Own - */ - CSetupCallStatusHandler *iStatusHandler; - - /** * Current call is an emergency call. */ TBool iEmergencyCall; - - /** - * Terminal response to the SIM has been send - */ - TBool iResponsed; - + }; #endif // CSETUPCALLREQUESTHANDLER_H diff -r d7fc66ccd6fb -r e44a8c097b15 satengine/SatServer/Commands/SetUpCallCmd/inc/csetupcallstatushandler.h --- a/satengine/SatServer/Commands/SetUpCallCmd/inc/csetupcallstatushandler.h Mon May 03 13:01:45 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/* -* 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" -* 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: Minite the call creating status by ETelMM -* -*/ - - - -#ifndef CSETUPCALLSTATUSHANDLER_H -#define CSETUPCALLSTATUSHANDLER_H - -#include -#include "msatmultimodeapi.h" - - -class MSetupCallStatusObserver - { -public: - /** - * The call status update notification from ETel MM - */ - virtual void CallSatatusChanged( const TInt status ) = 0; - }; - -/** -* This is the handler for the ETel MM api Request. -* This active objects is registered with ETelMM Api to send request and -* receive notifications about some Request Complete. -* -* @lib SetupCallCmd -* @since S60 v5.0.1 -*/ - -class CSetupCallStatusHandler : public CActive - { - -public: - - /** - * Two-phased constructor. - * @param aPhone A reference to the MSatMultiModeApi. - * @param aDispatcher Pointer to Ss handler - * @return a pointer to the newly created object. - */ - static CSetupCallStatusHandler* NewL( MSatMultiModeApi& aPhone, - MSetupCallStatusObserver* aDispatcher ); - - /** - * Destructor. - */ - virtual ~CSetupCallStatusHandler(); - - /** - * Start to monite the call status by using ETel MM api - */ - void Start(); - /** - * Cancel the asynchronous operations that required to the ETel MM api - */ - void CancelOperation(); - -protected: - - /** - * From CActive, handles the request completion. - */ - void RunL(); - - - /** - * From CActive, handle the request cancel - */ - void DoCancel(); - -private: - - /** - * C++ default constructor. - * @param aPriority An active object priority value. - * @param aPhone A reference to MSatMultiModeApi. - */ - CSetupCallStatusHandler( MSatMultiModeApi& aPhone, - MSetupCallStatusObserver* aDispatcher ); - -private: //new method - - void HandleConnectingStatusChange(); - -private: // Data - - /** - * Reference to the MSatMultiModeApi - */ - MSatMultiModeApi& iPhone; - - /** - * Pointer to SendSs command handler - */ - MSetupCallStatusObserver* iDispatcher; - - /** - * Use this to get the RMobileCall status in - * - */ - RMobileCall::TMobileCallStatus iMobileCallStatus; - - }; - -#endif // CSETUPCALLSTATUSHANDLER_H diff -r d7fc66ccd6fb -r e44a8c097b15 satengine/SatServer/Commands/SetUpCallCmd/src/CSetUpCallHandler.cpp --- a/satengine/SatServer/Commands/SetUpCallCmd/src/CSetUpCallHandler.cpp Mon May 03 13:01:45 2010 +0300 +++ b/satengine/SatServer/Commands/SetUpCallCmd/src/CSetUpCallHandler.cpp Fri May 14 16:24:46 2010 +0300 @@ -41,6 +41,20 @@ const TUint8 KWildChar( 0x77 ); const TUint8 KExpansionChar( 0x2E ); +/** Maximum name length. */ +const TInt KSatMaximumNameLength = 50; + +/** Maximum phone number length same as used by phone. */ +const TInt KSatMaximumPhoneNumberLength = 100; + +/** The subaddress length, see ITU-T I.330 and 3GPP TS 11.14. */ +const TInt KSatSubAddressLength = 21; + +/** The maximum bearer length. The bearer capabilities as +defined in GSM 04.08. */ +const TInt KSatBearerLength = 14; + + _LIT( KFixedSimEmergencyNumber, "112" ); // ======== MEMBER FUNCTIONS ======== @@ -606,70 +620,60 @@ // Performs the request to dial // ----------------------------------------------------------------------------- // -//ETel MM API Usage for SAT Todo -// -//2 RSAT::TSetUpCallV6 iCapabilityConfigParams we only have one TCcp and there -// are two in RMobilePhone::TMobileCallParamsV7 ( according the study of tommi -// the second TCcp in in TMobileCallParamsV7 will be ignored ) -//3 RMobilePhone::TMobileCallParamsV7 has TBCRepeatIndicator iBCRepeatIndicator -// RSat::TSetUpCallV6 don't have it. Does it needed from RSat -//4 RMobilePhone::TMobileCallParamsV7 has TMobileCallMulticallBearerMode -// iBearerMode, RSat::TSetUpCallV6 does not have it. can we just use the -// default value? -//5 SetShowNumber in AIW not provided by ETel MM, support needed? -//6 SetAllowMach in AIW not provided by ETel MM, support needed? -//8 Convert the return value from RMobilePhone::DialNoFdnCheck to the SAT error -// code, the return value is not enough, we need get more information from -// GetLineInfo. - - void CSetUpCallHandler::DoSetupCall( CSetupCallRequestHandler& aHandler ) { LOG( SIMPLE, "SETUPCALL: CSetUpCallHandler::DoSetupCallL calling" ) - - RSat::TSetUpCallType callType( iSetUpCallData.iType ); - - TDes& telNumber( iSetUpCallData.iAddress.iTelNumber ); - CheckNumber( telNumber ); - - RMobileCall::TMobileCallParamsV7 dialParams; - RMobileCall::TMobileCallParamsV7Pckg package( dialParams ); + + if( CheckSetupCallParam () ) + { - //Redail has been removed from MCL, no redail support. - dialParams.iAutoRedial = EFalse; - //TODO: check do we need to set bearer model - dialParams.iBearerMode = RMobileCall::EMulticallNewBearer; - dialParams.iCallParamOrigin = RMobileCall::EOriginatorSIM; - dialParams.iSubAddress = iSetUpCallData.iSubAddress; - dialParams.iBearerCap1 = iSetUpCallData.iCapabilityConfigParams; + RSat::TSetUpCallType callType( iSetUpCallData.iType ); - dialParams.iBCRepeatIndicator = RMobileCall::EBCAlternateMode; - - dialParams.iIconId.iQualifier = RMobileCall::ENoIconId; - + TDes& telNumber( iSetUpCallData.iAddress.iTelNumber ); + CheckNumber( telNumber ); + + RMobileCall::TMobileCallParamsV7 dialParams; + RMobileCall::TMobileCallParamsV7Pckg package( dialParams ); - dialParams.iAlphaId = iSetUpCallData.iAlphaIdCallSetUpPhase.iAlphaId; - LOG2( NORMAL, - "SETUPCALL: CSetUpCallHandler::DoSetupCallL id:%S", - &dialParams.iAlphaId ) - - LOG2( NORMAL, - "SETUPCALL: CSetUpCallHandler::DoSetupCallL number:%S", - &iSetUpCallData.iAddress.iTelNumber ) - - TBool terminateOtherCall( EFalse ); - // check if we need to disconnect other calls - if ( ( RSat::EDisconnectOtherCalls == callType ) || - ( RSat::EDisconnectOtherCallsWithRedial == callType ) ) + //Redail has been removed from MCL, no redail support. + dialParams.iAutoRedial = EFalse; + dialParams.iBearerMode = RMobileCall::EMulticallNewBearer; + dialParams.iCallParamOrigin = RMobileCall::EOriginatorSIM; + dialParams.iSubAddress = iSetUpCallData.iSubAddress; + dialParams.iBearerCap1 = iSetUpCallData.iCapabilityConfigParams; + + dialParams.iBCRepeatIndicator = RMobileCall::EBCAlternateMode; + + dialParams.iIconId.iQualifier = RMobileCall::ENoIconId; + + + dialParams.iAlphaId = iSetUpCallData.iAlphaIdCallSetUpPhase.iAlphaId; + LOG2( NORMAL, + "SETUPCALL: CSetUpCallHandler::DoSetupCallL id:%S", + &dialParams.iAlphaId ) + + LOG2( NORMAL, + "SETUPCALL: CSetUpCallHandler::DoSetupCallL number:%S", + &iSetUpCallData.iAddress.iTelNumber ) + + TBool terminateOtherCall( EFalse ); + // check if we need to disconnect other calls + if ( ( RSat::EDisconnectOtherCalls == callType ) || + ( RSat::EDisconnectOtherCallsWithRedial == callType ) ) + { + LOG( SIMPLE, + "SETUPCALL: CSetUpCallHandler::DoSetupCallL end other call" ) + terminateOtherCall = ETrue ; + } + + aHandler.DialNumber( package, iSetUpCallData.iAddress.iTelNumber, + terminateOtherCall, iUtils->CreateAsyncToSyncHelper() ); + } + else { - LOG( SIMPLE, - "SETUPCALL: CSetUpCallHandler::DoSetupCallL end other call" ) - terminateOtherCall = ETrue ; + CompleteSetupCallWithStatus( KErrArgument ); } - aHandler.DialNumber( package, iSetUpCallData.iAddress.iTelNumber, - terminateOtherCall, iUtils->CreateAsyncToSyncHelper() ); - LOG( SIMPLE, "SETUPCALL: CSetUpCallHandler::DoSetupCallL exiting" ) } @@ -733,6 +737,7 @@ } case KErrGeneral: + case KErrArgument: { LOG( SIMPLE, "SETUPCALL: CSetUpCallHandler::CompleteSetupCallWithStatus Data \ @@ -895,7 +900,7 @@ void CSetUpCallHandler::CheckNumber( TDes& aNumber ) const { LOG( SIMPLE, "SETUPCALL: CSetUpCallHandler::CheckNumber calling" ) - + for ( TInt i = 0; i < aNumber.Length(); i++ ) { // check values @@ -954,4 +959,42 @@ LOG( SIMPLE, "SETUPCALL: CSetUpCallHandler::CreateEmergencyCall exiting" ) } +// ----------------------------------------------------------------------------- +// check setup call param. +// ----------------------------------------------------------------------------- +// +TBool CSetUpCallHandler::CheckSetupCallParam() + { + LOG( SIMPLE, "SETUPCALL: CSetUpCallHandler::CheckSetupCallParam calling" ) + + TBool valid( ETrue ); + if ( iSetUpCallData.iAddress.iTelNumber.Length() + > KSatMaximumPhoneNumberLength ) + { + LOG( SIMPLE, "SETUPCALL: CSetUpCallHandler::CheckSetupCallParam num" ) + valid = EFalse; + } + else if ( iSetUpCallData.iAlphaIdCallSetUpPhase.iAlphaId.Length() + > KSatMaximumNameLength ) + { + LOG( SIMPLE, "SETUPCALL: CSetUpCallHandler::CheckSetupCallParam name" ) + valid = EFalse; + } + else if ( iSetUpCallData.iSubAddress.Length() > KSatSubAddressLength ) + { + LOG( SIMPLE, "SETUPCALL: CSetUpCallHandler::CheckSetupCallParam sub" ) + valid = EFalse; + } + else if ( iSetUpCallData.iCapabilityConfigParams.Length() + > KSatBearerLength ) + { + LOG( SIMPLE, "SETUPCALL: CSetUpCallHandler::CheckSetupCallParam bear" ) + valid = EFalse; + } + LOG2( SIMPLE, + "SETUPCALL: CSetUpCallHandler::CheckSetupCallParam exiting %d", valid ) + return valid; + } + + // End Of File diff -r d7fc66ccd6fb -r e44a8c097b15 satengine/SatServer/Commands/SetUpCallCmd/src/csetupcallrequesthandler.cpp --- a/satengine/SatServer/Commands/SetUpCallCmd/src/csetupcallrequesthandler.cpp Mon May 03 13:01:45 2010 +0300 +++ b/satengine/SatServer/Commands/SetUpCallCmd/src/csetupcallrequesthandler.cpp Fri May 14 16:24:46 2010 +0300 @@ -61,27 +61,11 @@ CSetupCallRequestHandler* self = new ( ELeave ) CSetupCallRequestHandler( aPhone, aDispatcher ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::NewL exiting" ) return self; } // ----------------------------------------------------------------------------- -// CSetupCallRequestHandler::ConstructL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -void CSetupCallRequestHandler::ConstructL() - { - LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::ConstructL calling" ) - iStatusHandler = CSetupCallStatusHandler::NewL( iPhone, this ); - LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::ConstructL exiting" ) - } - -// ----------------------------------------------------------------------------- // CSetupCallRequestHandler::~CSetupCallRequestHandler // Destructor // ----------------------------------------------------------------------------- @@ -92,8 +76,7 @@ CSetupCallRequestHandler::~CSetupCallRequestHandler calling" ) Cancel(); iDispatcher = NULL; - delete iStatusHandler; - + LOG( SIMPLE, "SETUPCALL: \ CSetupCallRequestHandler::~CSetupCallRequestHandler exiting" ) } @@ -130,10 +113,6 @@ if( KErrNone == terminateRes ) { iPhone.DialNoFdnCheck( iStatus, aCallParams, aTelNumber ); - if ( iStatusHandler ) - { - iStatusHandler->Start(); - } SetActive(); } else @@ -183,41 +162,13 @@ LOG2( NORMAL, "SETUPCALL: CSetupCallRequestHandler::RunL\ iStatus == %i", iStatus.Int() ) - if( !iResponsed ) + if ( iEmergencyCall ) { - if ( iEmergencyCall || KErrNone == iStatus.Int() ) - { - iEmergencyCall = EFalse; - iDispatcher->SetupCallRequestComplete( iStatus.Int() ); - } - else - { - RMobileCall::TMobileCallInfoV8 info; - RMobileCall::TMobileCallInfoV8Pckg infoPkg( info ); - TInt res = iPhone.GetMobileCallInfo( infoPkg ); - - LOG2( NORMAL, "SETUPCALL: CSetupCallRequestHandler::\ - HandleSetupCallStatusChange exit code == %i", - info.iExitCode ) - - if( ( KErrNone == res ) && - (KErrNone != info.iExitCode) && - (KErrNotFound != info.iExitCode) ) - { - iDispatcher->SetupCallRequestComplete( info.iExitCode ); - } - else - { - iDispatcher->SetupCallRequestComplete( iStatus.Int() ); - } - } + iEmergencyCall = EFalse; } - - if( iStatusHandler ) - { - iStatusHandler->Cancel(); - } - iResponsed = EFalse; + + iDispatcher->SetupCallRequestComplete( iStatus.Int() ); + LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::RunL exiting" ) } @@ -230,10 +181,6 @@ LOG( SIMPLE, "SETUPCALL: \ CSetupCallRequestHandler::CancelOperation calling" ) iPhone.DialCancel(); - if( iStatusHandler ) - { - iStatusHandler->Cancel(); - } LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::CancelOperation exiting" ) } @@ -250,37 +197,4 @@ LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::DoCancel exiting" ) } -// ----------------------------------------------------------------------------- -// CSetupCallRequestHandler::HandleConnectingStatusChange -// ----------------------------------------------------------------------------- -// -void CSetupCallRequestHandler::CallSatatusChanged( const TInt aStatus ) - { - LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::\ - CallSatatusChanged calling" ) - - LOG2( NORMAL, "SETUPCALL: CSetupCallRequestHandler::\ - CallSatatusChanged status == %i", aStatus ) - // We only care about the connecting status, after call is - // connecting, we can send the respones to the SIM. For other status we will - // waiting for the status of DialNumber. - if( ( aStatus == RMobileCall::EStatusConnected ) - || ( aStatus == RMobileCall::EStatusConnecting )) - { - iResponsed = ETrue; - iDispatcher->SetupCallRequestComplete( KErrNone ); - } - else - { - if ( iStatusHandler ) - { - iStatusHandler->Start(); - } - } - - LOG( SIMPLE, "SETUPCALL: CSetupCallRequestHandler::\ - CallSatatusChanged exiting" ) - } - - // End of File diff -r d7fc66ccd6fb -r e44a8c097b15 satengine/SatServer/Commands/SetUpCallCmd/src/csetupcallstatushandler.cpp --- a/satengine/SatServer/Commands/SetUpCallCmd/src/csetupcallstatushandler.cpp Mon May 03 13:01:45 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* 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" -* 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: Minite the call creating status by ETelMM -* -*/ - - -#include -#include - -#include "csetupcallstatushandler.h" -#include "CSetUpCallHandler.h" -#include "msatasynctosync.h" -#include "SatLog.h" - -// ================= MEMBER FUNCTIONS ======================= - -// ----------------------------------------------------------------------------- -// CSetupCallStatusHandler::CSetupCallStatusHandler -// The class constructor. -// ----------------------------------------------------------------------------- -// -CSetupCallStatusHandler::CSetupCallStatusHandler( - MSatMultiModeApi& aPhone, MSetupCallStatusObserver* aDispatcher ) - : CActive( EPriorityStandard ), iPhone( aPhone ), - iDispatcher( aDispatcher ) - { - LOG( SIMPLE, - "SETUPCALL: CSetupCallStatusHandler::CSetupCallStatusHandler \ - calling" ) - - CActiveScheduler::Add( this ); - - LOG( SIMPLE, - "SETUPCALL: CSetupCallStatusHandler::CSetupCallStatusHandler \ - exiting" ) - } - -// ----------------------------------------------------------------------------- -// CSetupCallStatusHandler::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CSetupCallStatusHandler* CSetupCallStatusHandler::NewL( - MSatMultiModeApi& aPhone, MSetupCallStatusObserver* aDispatcher ) - { - LOG( SIMPLE, "SETUPCALL: CSetupCallStatusHandler::NewL calling" ) - - CSetupCallStatusHandler* self = - new ( ELeave ) CSetupCallStatusHandler( aPhone, aDispatcher ); - - LOG( SIMPLE, "SETUPCALL: CSetupCallStatusHandler::NewL exiting" ) - return self; - } - - -// ----------------------------------------------------------------------------- -// CSetupCallStatusHandler::~CSetupCallStatusHandler -// Destructor -// ----------------------------------------------------------------------------- -// -CSetupCallStatusHandler::~CSetupCallStatusHandler() - { - LOG( SIMPLE, "SETUPCALL: \ - CSetupCallStatusHandler::~CSetupCallStatusHandler calling" ) - Cancel(); - - LOG( SIMPLE, "SETUPCALL: \ - CSetupCallStatusHandler::~CSetupCallStatusHandler exiting" ) - } - -// ----------------------------------------------------------------------------- -// CSetupCallStatusHandler::DialNumber -// ----------------------------------------------------------------------------- -// -void CSetupCallStatusHandler::Start() - { - LOG( SIMPLE, "SETUPCALL: CSetupCallStatusHandler::Start calling" ) - if( !IsActive() ) - { - iPhone.NotifyMobileCallStatusChange( iStatus, - iMobileCallStatus ); - SetActive(); - } - LOG( SIMPLE, "SETUPCALL: CSetupCallStatusHandler::Start exiting" ) - - } - -// ----------------------------------------------------------------------------- -// CSetupCallStatusHandler::RunL -// Handles the command. -// ----------------------------------------------------------------------------- -// -void CSetupCallStatusHandler::RunL() - { - LOG( SIMPLE, "SETUPCALL: CSetupCallStatusHandler::RunL calling" ) - - LOG2( NORMAL, "SETUPCALL: CSetupCallStatusHandler::RunL\ - iStatus == %i", iStatus.Int() ) - - LOG2( NORMAL, "SETUPCALL: CSetupCallStatusHandler::RunL\ - iMobileCallStatus == %i", iMobileCallStatus ) - - if( ( KErrNone == iStatus.Int() ) && iDispatcher ) - { - iDispatcher->CallSatatusChanged ( iMobileCallStatus ); - } - - LOG( SIMPLE, "SETUPCALL: CSetupCallStatusHandler::RunL exiting" ) - } - -// ----------------------------------------------------------------------------- -// CSetupCallStatusHandler::CancelOperation -// ----------------------------------------------------------------------------- -// -void CSetupCallStatusHandler::CancelOperation() - { - LOG( SIMPLE, "SETUPCALL: \ - CSetupCallStatusHandler::CancelOperation calling" ) - iPhone.NotifyCallStatusChangeCancel(); - LOG( SIMPLE, - "SETUPCALL: CSetupCallStatusHandler::CancelOperation exiting" ) - } - -// ----------------------------------------------------------------------------- -// From class CActive. -// Cancels the sat request. -// ----------------------------------------------------------------------------- -// -void CSetupCallStatusHandler::DoCancel() - { - LOG( SIMPLE, "SETUPCALL: CSetupCallStatusHandler::DoCancel calling" ) - CancelOperation(); - LOG( SIMPLE, "SETUPCALL: CSetupCallStatusHandler::DoCancel exiting" ) - } - -// End of File diff -r d7fc66ccd6fb -r e44a8c097b15 satengine/SatServer/Commands/SetUpIdleModeTextCmd/inc/CSetUpIdleModeTextHandler.h --- a/satengine/SatServer/Commands/SetUpIdleModeTextCmd/inc/CSetUpIdleModeTextHandler.h Mon May 03 13:01:45 2010 +0300 +++ b/satengine/SatServer/Commands/SetUpIdleModeTextCmd/inc/CSetUpIdleModeTextHandler.h Fri May 14 16:24:46 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" @@ -119,9 +119,6 @@ // Response package. RSat::TSetUpIdleModeTextRspV1Pckg iSetUpIdleModeTextRspPckg; - // Indicates are we waiting for response - TBool iWaitingForResponse; - // Store for restoring last valid idle mode text. TBool iSimResetExecuting; RSat::TIdleModeText iLastValidText; diff -r d7fc66ccd6fb -r e44a8c097b15 satengine/SatServer/Commands/SetUpIdleModeTextCmd/src/CSetUpIdleModeTextHandler.cpp --- a/satengine/SatServer/Commands/SetUpIdleModeTextCmd/src/CSetUpIdleModeTextHandler.cpp Mon May 03 13:01:45 2010 +0300 +++ b/satengine/SatServer/Commands/SetUpIdleModeTextCmd/src/CSetUpIdleModeTextHandler.cpp Fri May 14 16:24:46 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" @@ -66,14 +66,6 @@ LOG( SIMPLE, "SETUPIDLEMODETEXT: \ CSetUpIdleModeTextHandler::ConstructL calling" ) - iWaitingForResponse = EFalse; - - // Register to listen Idle mode responses. - iUtils->RegisterL( this, MSatUtils::EIdleModeResponseSuccess ); - iUtils->RegisterL( this, MSatUtils::EIdleModeResponseSuccessNoIcon ); - iUtils->RegisterL( this, MSatUtils::EIdleModeResponseUnableToProcess ); - iUtils->RegisterL( this, MSatUtils::EIdleModeResponseBeyondCapabilities ); - // Register to listen ESimReset execution. iUtils->RegisterL( this, MSatUtils::ESimResetCalled ); iUtils->RegisterL( this, MSatUtils::ESimResetCancelled ); @@ -135,50 +127,9 @@ { LOG( SIMPLE, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler::Event calling" ) - TBool responseOk( EFalse ); - // Check the response switch ( aEvent ) { - case MSatUtils::EIdleModeResponseSuccess: - { - LOG( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \ - KSuccess") - iSetUpIdleModeTextRsp.iGeneralResult = RSat::KSuccess; - responseOk = ETrue; - break; - } - - case MSatUtils::EIdleModeResponseSuccessNoIcon: - { - LOG( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \ - KSuccessReqIconNotDisplayed") - iSetUpIdleModeTextRsp.iGeneralResult = - RSat::KSuccessRequestedIconNotDisplayed; - responseOk = ETrue; - break; - } - - case MSatUtils::EIdleModeResponseUnableToProcess: - { - LOG( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \ - KMeUnableToProcessCmd") - iSetUpIdleModeTextRsp.iGeneralResult = - RSat::KMeUnableToProcessCmd; - responseOk = ETrue; - break; - } - - case MSatUtils::EIdleModeResponseBeyondCapabilities: - { - LOG( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \ - KBeyondMeCapabilities") - iSetUpIdleModeTextRsp.iGeneralResult = - RSat::KCmdBeyondMeCapabilities; - responseOk = ETrue; - break; - } - case MSatUtils::ESimResetCalled: { LOG( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \ @@ -244,17 +195,6 @@ break; } } - - if ( responseOk && iWaitingForResponse ) - { - LOG( NORMAL, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler \ - send response") - iWaitingForResponse = EFalse; - - // Send terminal response, if the event was solved - TerminalRsp( RSat::ESetUpIdleModeText, iSetUpIdleModeTextRspPckg ); - } - LOG( SIMPLE, "SETUPIDLEMODETEXT: CSetUpIdleModeTextHandler::Event exiting" ) } @@ -402,8 +342,6 @@ } else { - iWaitingForResponse = ETrue; - // Save data for restore. iSimResetExecuting = EFalse; iLastValidText = idleModeText; @@ -431,6 +369,9 @@ remove the homezone indicator and return %d", errorCode ) } } + + iSetUpIdleModeTextRsp.iGeneralResult = RSat::KSuccess; + TerminalRsp( RSat::ESetUpIdleModeText, iSetUpIdleModeTextRspPckg ); } LOG( SIMPLE, diff -r d7fc66ccd6fb -r e44a8c097b15 satui/satapp/inc/dialogwaiter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/inc/dialogwaiter.h Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,62 @@ +/* +* 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" +* 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: dialog waiter +* +* +*/ + +#ifndef DIALOGWAITER_H +#define DIALOGWAITER_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATION +class HbAction; + +/** + * This utility synchronises access to dialogs, popups, menus and + * other ORBIT resources. How to use: + * + * HbDialog* dialog = new HbDialog(); + * DialogWaiter waiter(); + * dialog->open(&waiter, SLOT(done(HbAction*))); + * HbAction* result = waiter.wait(); + * delete dialog; + * if (result==...) ... + * + */ +class DialogWaiter : public QObject +{ + Q_OBJECT + + public: + + /** + * waits until dialog exits + * returns dialog exit action + */ + HbAction* wait(); + + private slots: + void done(HbAction* result); + + private: + QEventLoop mLoop; + HbAction* mResult; + +}; + +#endif // DIALOGWAITER_H diff -r d7fc66ccd6fb -r e44a8c097b15 satui/satapp/resource/qgn_menu_sat.svg --- a/satui/satapp/resource/qgn_menu_sat.svg Mon May 03 13:01:45 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r d7fc66ccd6fb -r e44a8c097b15 satui/satapp/resource/qtg_large_sat.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/resource/qtg_large_sat.svg Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r d7fc66ccd6fb -r e44a8c097b15 satui/satapp/resource/sat_text_map.xls Binary file satui/satapp/resource/sat_text_map.xls has changed diff -r d7fc66ccd6fb -r e44a8c097b15 satui/satapp/resource/satapp.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/resource/satapp.docml Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r d7fc66ccd6fb -r e44a8c097b15 satui/satapp/resource/satapp.qrc --- a/satui/satapp/resource/satapp.qrc Mon May 03 13:01:45 2010 +0300 +++ b/satui/satapp/resource/satapp.qrc Fri May 14 16:24:46 2010 +0300 @@ -7,6 +7,6 @@ satapp_en.qm - qgn_menu_sat.svg + qtg_large_sat.svg diff -r d7fc66ccd6fb -r e44a8c097b15 satui/satapp/satapp.pro --- a/satui/satapp/satapp.pro Mon May 03 13:01:45 2010 +0300 +++ b/satui/satapp/satapp.pro Fri May 14 16:24:46 2010 +0300 @@ -24,7 +24,7 @@ CONFIG += hb -ICON = resource/qgn_menu_sat.svg +ICON = resource/qtg_large_sat.svg symbian: { TARGET.CAPABILITY = CAP_GENERAL_DLL TARGET.UID3=0x101f4ce0 @@ -53,7 +53,8 @@ inc/satappgetinkeynote.h \ inc/csatuiobserver.h \ inc/csatuiiconhandler.h \ - inc/satappplaytoneprovider.h + inc/satappplaytoneprovider.h \ + inc/dialogwaiter.h SOURCES += src/main.cpp \ src/satappmainhandler.cpp \ @@ -64,7 +65,8 @@ src/satappgetinkeynote.cpp \ src/csatuiobserver.cpp \ src/csatuiiconhandler.cpp \ - src/satappplaytoneprovider.cpp + src/satappplaytoneprovider.cpp \ + src/dialogwaiter.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" \ diff -r d7fc66ccd6fb -r e44a8c097b15 satui/satapp/src/dialogwaiter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/src/dialogwaiter.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,34 @@ +/* +* 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: dialog waiter +* +* +*/ + +#include "dialogwaiter.h" + +HbAction* DialogWaiter::wait() +{ + mLoop.exec(); + HbAction* a=mResult; + mResult=0; + return a; +} + +void DialogWaiter::done(HbAction* result) +{ + mResult=result; + mLoop.quit(); +} + diff -r d7fc66ccd6fb -r e44a8c097b15 satui/satapp/src/satappuiprovider.cpp --- a/satui/satapp/src/satappuiprovider.cpp Mon May 03 13:01:45 2010 +0300 +++ b/satui/satapp/src/satappuiprovider.cpp Fri May 14 16:24:46 2010 +0300 @@ -20,7 +20,6 @@ #include // softkey #include // application xml #include // action user response -#include #include // DisplayText, ConfirmSend, #include // CallControl, SetUpCall #include // DisplayText, GetInput, SetUpCall @@ -28,6 +27,10 @@ #include // SendSms wait note #include // For GetInput #include // GetInput +#include +#include +#include +#include #include "satappview.h" // SetUpMenu, SelectItem #include "satappgetinkeynote.h" // GetYesNo immediate digit response #include "satappuiprovider.h" @@ -276,10 +279,12 @@ composeDialog(mDisplayPopup, aDuration, ESatDialogDisplayText); TFLOGSTRING( - "SATAPP: SatAppUiProvider::showDisplayTextPopup duration before exec") - mDisplayPopup->exec(); + "SATAPP: SatAppUiProvider::showDisplayTextPopup duration before open") + DialogWaiter waiter; + mDisplayPopup->open(&waiter, SLOT(done(HbAction *))); + waiter.wait(); TFLOGSTRING( - "SATAPP: SatAppUiProvider::showDisplayTextPopup duration end exec") + "SATAPP: SatAppUiProvider::showDisplayTextPopup duration end open") delete mDisplayPopup; mDisplayPopup = 0; @@ -311,20 +316,14 @@ // Set ContentText QVariant vContent(aContent); mGetInkeyQuery->setValue(vContent); - - // Validation rule, what can be entered - HbValidator *val =new HbValidator; - + HbEditorInterface inputMode(mGetInkeyQuery->lineEdit()); if (ESatDigitOnly == aCharacterSet) { // 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 - val->setMasterValidator(new QRegExpValidator(r,0)); - mGetInkeyQuery->setValidator(val); - } else { +// inputMode.setUpAsPhoneNumberEditor(); + inputMode.setFilter(HbPhoneNumberFilter::instance()); + } else { // char mode - mGetInkeyQuery->setInputMode(HbInputDialog::TextInput); + inputMode.setUpAsLatinAlphabetOnlyEditor(); } unsigned int duration = KDefaultSelectionTimeoutMseconds; @@ -336,12 +335,13 @@ connect(mGetInkeyQuery->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(updateQueryAction(QString))); TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInkeyQuery before pop") - mGetInkeyQuery->exec(); + DialogWaiter waiter; + mGetInkeyQuery->open(&waiter, SLOT(done(HbAction *))); + waiter.wait(); TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInkeyQuery end pop") QString inputString = (mGetInkeyQuery->value()).toString(); aContent = inputString; - delete val; delete mGetInkeyQuery; mGetInkeyQuery = 0; } @@ -394,7 +394,9 @@ time.start(); TFLOGSTRING("SATAPP: SatAppUiProvider::showGetYesNoQuery befor pop") - mYesNoPopup->exec(); + DialogWaiter waiter; + mYesNoPopup->open(&waiter, SLOT(done(HbAction *))); + waiter.wait(); TFLOGSTRING("SATAPP: SatAppUiProvider::showGetYesNoQuery end pop") aDuration = time.elapsed() / KSymbianTimeConvertQtTime; TFLOGSTRING2("SATAPP: SatAppUiProvider::showGetYesNoQuery duration out=%d", @@ -435,22 +437,14 @@ // Set ContentText QVariant vContent(content); mGetInputQuery->setValue(vContent); - - // Validation rule, what can be entered - HbValidator *val =new HbValidator; - QRegExp r; + HbEditorInterface inputMode(mGetInputQuery->lineEdit()); if (ESatDigitOnly == characterSet) { // 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 - val->setMasterValidator(new QRegExpValidator(r,0)); - mGetInputQuery->lineEdit()->setValidator(val); + inputMode.setFilter(HbPhoneNumberFilter::instance()); } else { // char mode - mGetInputQuery->setInputMode(HbInputDialog::TextInput); + inputMode.setUpAsLatinAlphabetOnlyEditor(); } - connect(mGetInputQuery->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(updateQueryAction(QString))); mGetInputQuery->lineEdit()->setMaxLength(maxLength); @@ -476,12 +470,13 @@ } TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInputQuery before pop") - mGetInputQuery->exec(); + DialogWaiter waiter; + mGetInputQuery->open(&waiter, SLOT(done(HbAction *))); + waiter.wait(); TFLOGSTRING("SATAPP: SatAppUiProvider::showGetInputQuery end pop") content = (mGetInputQuery->value()).toString(); - delete val; delete mGetInputQuery; mGetInputQuery = 0; @@ -559,9 +554,11 @@ mConfirmSendQuery->setText(aText); composeDialog(mConfirmSendQuery, 0, ESatDialogConfirmSend); - TFLOGSTRING("SATAPP: SatAppUiProvider::confirmSend before exec") - mConfirmSendQuery->exec(); - TFLOGSTRING("SATAPP: SatAppUiProvider::confirmSend after exec") + TFLOGSTRING("SATAPP: SatAppUiProvider::confirmSend before open") + DialogWaiter waiter; + mConfirmSendQuery->open(&waiter, SLOT(done(HbAction *))); + waiter.wait(); + TFLOGSTRING("SATAPP: SatAppUiProvider::confirmSend after open") delete mConfirmSendQuery; mConfirmSendQuery = 0; @@ -683,9 +680,11 @@ mSetUpCallQuery->setText(alphaId); composeDialog(mSetUpCallQuery, 0, ESatDialogSetUpCall); - TFLOGSTRING("SATAPP: SatAppSetUpCall::showSetUpCallConfirm before exec") - mSetUpCallQuery->exec(); - TFLOGSTRING("SATAPP: SatAppSetUpCall::showSetUpCallConfirm after exec") + TFLOGSTRING("SATAPP: SatAppSetUpCall::showSetUpCallConfirm before open") + DialogWaiter waiter; + mSetUpCallQuery->open(&waiter, SLOT(done(HbAction *))); + waiter.wait(); + TFLOGSTRING("SATAPP: SatAppSetUpCall::showSetUpCallConfirm after open") delete mSetUpCallQuery; mSetUpCallQuery = 0; @@ -1021,7 +1020,9 @@ TFLOGSTRING("SATAPP: SatAppUiProvider::showSsErrorNote") HbMessageBox *msgBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); msgBox->setText(hbTrId("txt_sat_sendss_error_note")); - msgBox->exec(); + DialogWaiter waiter; + msgBox->open(&waiter, SLOT(done(HbAction *))); + waiter.wait(); delete msgBox; msgBox = NULL; TFLOGSTRING("SATAPP: SatAppUiProvider::showSsErrorNote exit") @@ -1047,9 +1048,11 @@ mConfirmBipQuery->setText(title); composeDialog(mConfirmBipQuery, 0, ESatDialogConfirmBip); - TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmOpenChannelQuery before exec") - mConfirmBipQuery->exec(); - TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmOpenChannelQuery after exec") + TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmOpenChannelQuery before open") + DialogWaiter waiter; + mConfirmBipQuery->open(&waiter, SLOT(done(HbAction *))); + waiter.wait(); + TFLOGSTRING("SATAPP: SatAppUiProvider::showConfirmOpenChannelQuery after open") delete mConfirmBipQuery; mConfirmBipQuery = 0; @@ -1117,7 +1120,9 @@ HbMessageBox *msgBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); msgBox->setText(aText); msgBox->setTimeout(KMoSmControlTimeOut); - msgBox->exec(); + DialogWaiter waiter; + msgBox->open(&waiter, SLOT(done(HbAction *))); + waiter.wait(); delete msgBox; TFLOGSTRING("SATAPP: SatAppUiProvider::showMoSmControlNote exit") @@ -1151,7 +1156,9 @@ TFLOGSTRING("SATAPP: SatAppUiProvider::showSatInfoNote") HbMessageBox *msgBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); msgBox->setText(aText); - msgBox->exec(); + DialogWaiter waiter; + msgBox->open(&waiter, SLOT(done(HbAction *))); + waiter.wait(); delete msgBox; msgBox = 0; TFLOGSTRING("SATAPP: SatAppUiProvider::showSatInfoNote exit") diff -r d7fc66ccd6fb -r e44a8c097b15 satui/satapp/src/satappview.cpp --- a/satui/satapp/src/satappview.cpp Mon May 03 13:01:45 2010 +0300 +++ b/satui/satapp/src/satappview.cpp Fri May 14 16:24:46 2010 +0300 @@ -105,7 +105,7 @@ mListWidget = qobject_cast ( mUi->docmlLoader()->findWidget(SATAPP_MENUITEM )); if (mListWidget && mWindow) { - mSoftKeyQuitAction = new HbAction(Hb::QuitAction,this); + mSoftKeyQuitAction = new HbAction(Hb::QuitNaviAction,this); HbAction *menuAction = menu()->addAction("Exit"); bool ret = connect(menuAction, SIGNAL(triggered()), mSoftKeyQuitAction, SIGNAL(triggered())); @@ -141,7 +141,7 @@ ( mUi->docmlLoader()->findWidget(SATAPP_SELECTITEM )); if (mSelectListWidget && mWindow) { - mSoftKeyBackAction = new HbAction(Hb::BackAction,this); + mSoftKeyBackAction = new HbAction(Hb::BackNaviAction,this); HbAction *menuBack = menu()->addAction("Back"); bool ret = connect(menuBack, SIGNAL(triggered()), mSoftKeyBackAction, SIGNAL(triggered())); @@ -211,7 +211,7 @@ const QString& aText, const QStringList& aMenuItems, //const CArrayFixFlat* aMenuItemNextActions, - const int aDefaultItem, + const int /*aDefaultItem*/, unsigned char& aSelection, //const HbIcon& aIcon, //const CAknIconArray* aItemsIconArray, @@ -224,10 +224,7 @@ aRes = ESatSuccess; mSelectItem = true; mClickBackSoftkey = false; - if (mWindow){ - mWindow->setCurrentViewIndex(aDefaultItem); - } - + // Set sub title if (!aText.isEmpty()) { mSubTitle->setPlainText(aText); diff -r d7fc66ccd6fb -r e44a8c097b15 satui/satapp/tsrc/ut_satapp/sis/utsatapp_template.SIS Binary file satui/satapp/tsrc/ut_satapp/sis/utsatapp_template.SIS has changed diff -r d7fc66ccd6fb -r e44a8c097b15 satui/satapp/tsrc/ut_satapp/sis/utsatapp_template.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/satui/satapp/tsrc/ut_satapp/sis/utsatapp_template.pkg Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,32 @@ +; utsatapp_template.pkg generated by qmake at 2010-02-04T14:06:21 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"utsatapp"},(0xEead1c8b),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + +; Default dependency to Qt libraries +;(0x2001E61C), , , , {"Qt"} + +; Executable and default resource files +"/epoc32/release/armv5/urel/utsatapp.exe" - "!:\sys\bin\utsatapp.exe" +"/epoc32/data/z/resource/apps/utsatapp.rsc" - "!:\resource\apps\utsatapp.rsc" +"/epoc32/data/z/private/10003a3f/import/apps/utsatapp_reg.rsc" - "!:\private\10003a3f\import\apps\utsatapp_reg.rsc" + +; Manual PKG post-rules from PRO files diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/dialpad.pro --- a/telutils/dialpad/dialpad.pro Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/dialpad.pro Fri May 14 16:24:46 2010 +0300 @@ -24,18 +24,17 @@ HEADERS += ../../phonesrv_plat/dialpad_api/inc/dialpad.h \ ../../phonesrv_plat/dialpad_api/inc/dialpadkeyhandler.h \ inc/dialpadbutton.h \ - inc/dialpadbuttonstyle.h \ inc/dialpadinputfield.h \ inc/dialpadkeypad.h \ inc/dialpadmultitaphandler.h\ inc/dialpadsymbianwrapper.h \ inc/dialpadbackground.h \ inc/dialpadvoicemailboxeventfilter.h \ - inc/dialpadbluetootheventfilter.h + inc/dialpadbluetootheventfilter.h \ + inc/dialpadkeysequenceeventfilter.h SOURCES += src/dialpad.cpp \ src/dialpadbutton.cpp \ - src/dialpadbuttonstyle.cpp \ src/dialpadinputfield.cpp \ src/dialpadkeypad.cpp \ src/dialpadmultitaphandler.cpp\ @@ -43,7 +42,8 @@ src/dialpadsymbianwrapper.cpp \ src/dialpadbackground.cpp \ src/dialpadvoicemailboxeventfilter.cpp \ - src/dialpadbluetootheventfilter.cpp + src/dialpadbluetootheventfilter.cpp \ + src/dialpadkeysequenceeventfilter.cpp RESOURCES += dialpad.qrc diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/inc/dialpadbutton.h --- a/telutils/dialpad/inc/dialpadbutton.h Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/inc/dialpadbutton.h Fri May 14 16:24:46 2010 +0300 @@ -46,6 +46,8 @@ bool sceneEvent(QEvent *event); void polish(HbStyleParameters& params); + void updatePrimitives(); + private: DialpadButtonType mButtonType; }; diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/inc/dialpadbuttonstyle.h --- a/telutils/dialpad/inc/dialpadbuttonstyle.h Mon May 03 13:01:45 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/*! -* 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: Custom button style -* -*/ - -#ifndef DIALPADBUTTONSTYLE_H_ -#define DIALPADBUTTONSTYLE_H_ - -#include - -class DialpadButtonStyle : public HbStyle - { -public: - enum ButtonStyle - { - NormalButtonStyle, - FunctionButtonStyle, - CallButtonStyle - }; - -public: - explicit DialpadButtonStyle(); - virtual ~DialpadButtonStyle(); - - void updatePrimitive( - QGraphicsItem *item, - HbStyle::Primitive primitive, - const QStyleOption *option ) const; - - void setButtonStyle(ButtonStyle style); - -private: - void setTextColor(QGraphicsItem *item) const; - void setIconColor(QGraphicsItem *item, const QColor &color) const; - -private: - int mButtonStyle; - }; - -#endif /* DIALPADBUTTONSTYLE_H_ */ diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/inc/dialpadinputfield.h --- a/telutils/dialpad/inc/dialpadinputfield.h Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/inc/dialpadinputfield.h Fri May 14 16:24:46 2010 +0300 @@ -46,7 +46,6 @@ private: HbLineEdit* mNumberEditor; DialpadButton* mBackspace; - DialpadButtonStyle* mFunctionButtonStyle; int mHeight; }; diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/inc/dialpadkeypad.h --- a/telutils/dialpad/inc/dialpadkeypad.h Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/inc/dialpadkeypad.h Fri May 14 16:24:46 2010 +0300 @@ -21,7 +21,6 @@ #include class DialpadButton; -class DialpadButtonStyle; class DialpadInputField; class DialpadButton; class QSignalMapper; @@ -47,6 +46,8 @@ void setCallButtonEnabled(bool enabled); void createButtonGrid(); + + void resetButtons(); protected slots: void setButtonTexts(); @@ -68,8 +69,6 @@ DialpadInputField& mInputField; QGraphicsGridLayout* mGridLayout; DialpadButton* mButtons[DialpadButtonCount]; - DialpadButtonStyle* mNormalButtonStyle; - DialpadButtonStyle* mCallButtonStyle; QSignalMapper* mKeyPressedSignalMapper; QSignalMapper* mKeyReleasedSignalMapper; QSignalMapper* mKeyClickedSignalMapper; diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/inc/dialpadkeysequenceeventfilter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telutils/dialpad/inc/dialpadkeysequenceeventfilter.h Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,58 @@ +/*! +* 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: Implements key sequence recognition filter for Dialpad. +* +*/ + +#ifndef DIALPADKEYSEQUENCEEVENTFILTER_H +#define DIALPADKEYSEQUENCEEVENTFILTER_H + +#include + +class Dialpad; + +/*! + DialpadKeySequenceEventFilter + Class provides key sequence recognition and handling. +*/ +class DialpadKeySequenceEventFilter : public QObject +{ + Q_OBJECT + +public: + explicit DialpadKeySequenceEventFilter( + Dialpad* dialpad, + QObject* parent = 0); + virtual ~DialpadKeySequenceEventFilter(); + +public: + bool eventFilter(QObject *watched, QEvent *event); + +private: + /*! + \fn bool preValidateKeySequence() + + Checks if the given sequence conforms key sequence command syntax. + + \return true if sequence conforms key sequence command syntax, + false otherwise. + */ + bool preValidateKeySequence(const QString &sequence); + +private: + /*! Dialpad. Not own. */ + Dialpad* mDialpad; +}; + +#endif // DIALPADKEYSEQUENCEEVENTFILTER_H diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/resources/dialpad.css --- a/telutils/dialpad/resources/dialpad.css Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/resources/dialpad.css Fri May 14 16:24:46 2010 +0300 @@ -7,6 +7,12 @@ fixed-height: var(hb-param-graphic-size-function); } +DialpadButton[icon][!text][!additionalText]{ + layout:icon_button; + min-height:6.25un; + min-width:6.25un; +} + /* text and additional text */ DialpadButton[stretched][!icon][text][additionalText]{ layout:text_additionalText_horizontal; @@ -39,13 +45,28 @@ font-variant:primary; text-height:var(hb-param-text-height-title); text-line-count-max:1; - text-align:left center; + text-align:left center; } DialpadButton[stretched][icon][text][!additionalText]::icon{ top: -var(hb-param-margin-gene-middle-vertical); bottom: var(hb-param-margin-gene-middle-vertical); fixed-width: var(hb-param-graphic-size-primary-small); - fixed-height: var(hb-param-graphic-size-primary-small); + fixed-height: var(hb-param-graphic-size-primary-small); + left: 0; + right: 0; + size-policy: fixed fixed; } +DialpadInputField > HbLineEdit{ + text-align: right; + size-policy: expanding expanding; +} + +DialpadInputField > HbLineEdit::text{ + left: -var(hb-param-margin-gene-middle-horizontal); + right: var(hb-param-margin-gene-middle-horizontal); + top: -var(hb-param-margin-gene-middle-vertical); + bottom: var(hb-param-margin-gene-middle-vertical);; +} + diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/resources/dialpad.dialpadbutton.widgetml --- a/telutils/dialpad/resources/dialpad.dialpadbutton.widgetml Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/resources/dialpad.dialpadbutton.widgetml Fri May 14 16:24:46 2010 +0300 @@ -4,7 +4,7 @@ - + @@ -20,10 +20,12 @@ + - - - + + + + diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/src/dialpad.cpp --- a/telutils/dialpad/src/dialpad.cpp Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/src/dialpad.cpp Fri May 14 16:24:46 2010 +0300 @@ -33,9 +33,9 @@ #include "dialpadmultitaphandler.h" #include "dialpadbackground.h" -static const QString backgroundGraphics("qtg_fr_input_bg"); +static const QString backgroundGraphics("qtg_fr_input_v_bg"); static const QString backgroundGraphicsH("qtg_fr_input_h_bg"); -static const QString minimizeIcon("qtg_graf_input_swipe"); +static const QString minimizeIcon("qtg_graf_input_v_swipe"); static const QString minimizeIconH("qtg_graf_input_h_swipe"); static const qreal DialpadCloseSwipeDistanceV = 0.25; //compared to total height static const qreal DialpadCloseSwipeDistanceH = 0.33; // > button width @@ -133,6 +133,13 @@ HbStyleLoader::registerFilePath(":/dialpad.css"); HbStyleLoader::registerFilePath(":/dialpad_color.css"); HbStyleLoader::registerFilePath(":/dialpad.dialpadbutton.widgetml"); + + // grab gestures so that those are not passed to widgets behind dialpad + grabGesture(Qt::TapGesture); + grabGesture(Qt::TapAndHoldGesture); + grabGesture(Qt::PanGesture); + grabGesture(Qt::SwipeGesture); + grabGesture(Qt::PinchGesture); } Dialpad::~Dialpad() @@ -197,6 +204,8 @@ void Dialpad::openDialpad() { + mKeypad->resetButtons(); + if (mIsOpen) { return; } diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/src/dialpadbutton.cpp --- a/telutils/dialpad/src/dialpadbutton.cpp Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/src/dialpadbutton.cpp Fri May 14 16:24:46 2010 +0300 @@ -15,11 +15,9 @@ * */ -#include -#include -#include -#include + #include +#include #include "dialpadbutton.h" @@ -77,3 +75,38 @@ HbAbstractButton::polish( params ); } +void DialpadButton::updatePrimitives() +{ + HbPushButton::updatePrimitives(); + + HbFrameItem* frame = + qgraphicsitem_cast(HbWidget::primitive("background")); + + if (!frame) { + return; + } + + QString graphicsName; + + if (!isEnabled()) { + graphicsName = "qtg_fr_input_btn_function_disabled"; + } else if (isDown()) { + if (buttonType()==CallButton) { + graphicsName = "qtg_fr_btn_green_pressed"; + } else if (buttonType()==FunctionButton) { + graphicsName = "qtg_fr_input_btn_function_pressed"; + } else { + graphicsName = "qtg_fr_input_btn_keypad_pressed"; + } + } else { + if (buttonType()==CallButton) { + graphicsName = "qtg_fr_btn_green_normal"; + } else if (buttonType()==FunctionButton) { + graphicsName = "qtg_fr_input_btn_function_normal"; + } else { + graphicsName = "qtg_fr_input_btn_keypad_normal"; + } + } + + frame->frameDrawer().setFrameGraphicsName(graphicsName); +} diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/src/dialpadbuttonstyle.cpp --- a/telutils/dialpad/src/dialpadbuttonstyle.cpp Mon May 03 13:01:45 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/*! -* 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: Custom button style -* -*/ - -#include -#include -#include -#include -#include "dialpadbuttonstyle.h" - -DialpadButtonStyle::DialpadButtonStyle() - : mButtonStyle(NormalButtonStyle) -{ -} - -DialpadButtonStyle::~DialpadButtonStyle() -{ -} - -void DialpadButtonStyle::updatePrimitive( - QGraphicsItem *item, - HbStyle::Primitive primitive, - const QStyleOption *option ) const -{ - switch(primitive){ - case P_PushButton_background:{ - const HbStyleOptionPushButton *opt = - qstyleoption_cast(option); - HbFrameItem *frameItem = qgraphicsitem_cast( item ); - if(!frameItem) - return; - - frameItem->setZValue(-1.0); - if(opt->backgroundFrameDrawer &&!(opt->backgroundFrameDrawer->isNull())) { - frameItem->setFrameDrawer( (opt->backgroundFrameDrawer)); - } else { - QString frameGraphicsName; - QIcon::Mode mode = QIcon::Disabled; - QIcon::State state = QIcon::Off; - if (opt->state & QStyle::State_Enabled) - mode = QIcon::Normal; - if (opt->state & QStyle::State_Active) - mode = QIcon::Active; - if (opt->state & QStyle::State_Selected) - mode = QIcon::Selected; - if (opt->state & QStyle::State_On) - state = QIcon::On; - - if (mode == QIcon::Disabled && state == QIcon::Off) { - frameGraphicsName = "qtg_fr_input_btn_function_disabled"; - } else if (mode == QIcon::Normal && state == QIcon::On) { - if (mButtonStyle==CallButtonStyle) { - frameGraphicsName = "qtg_fr_btn_green_pressed"; - } else if (mButtonStyle==NormalButtonStyle) { - frameGraphicsName = "qtg_fr_input_btn_keypad_pressed"; - } else { - frameGraphicsName = "qtg_fr_input_btn_function_pressed"; - } - } else if (mode == QIcon::Selected && state == QIcon::Off) { - frameGraphicsName = "qtg_fr_btn_highlight"; - } else { - if (mButtonStyle==CallButtonStyle) { - frameGraphicsName = "qtg_fr_btn_green_normal"; - } else if (mButtonStyle==NormalButtonStyle) { - frameGraphicsName = "qtg_fr_input_btn_keypad_normal"; - } else { - frameGraphicsName = "qtg_fr_input_btn_function_normal"; - } - } - - frameItem->frameDrawer().setFrameGraphicsName(frameGraphicsName); - if (!opt->background.isNull()) { - QString customName = opt->background.iconName(mode, state); - frameItem->frameDrawer().setFrameGraphicsName(customName); - frameItem->setGeometry(opt->rect); - frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - break; - } - frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - } - - frameItem->setGeometry(opt->rect); - break; - } - - default: - HbStyle::updatePrimitive(item,primitive,option); - break; - } // switch -} - -void DialpadButtonStyle::setButtonStyle(ButtonStyle style) -{ - mButtonStyle = style; -} diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/src/dialpadinputfield.cpp --- a/telutils/dialpad/src/dialpadinputfield.cpp Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/src/dialpadinputfield.cpp Fri May 14 16:24:46 2010 +0300 @@ -23,14 +23,13 @@ #include #include "dialpadinputfield.h" -#include "dialpadbuttonstyle.h" #include "dialpadbutton.h" static const QString HbBackspaceIcon("qtg_mono_backspace2"); static const int DialpadAutoRepeatInterval = 150; // ms static const int DialpadAutoRepeatDelay = 1000; // ms static const qreal DialpadComponentMargin = 0.75; // units -static const qreal DialpadBackspaceHeight = 9.4; // units +static const qreal DialpadBackspaceWidth = 9.4; // units static const qreal DialpadInputFieldHeight = 6.3; // units static const int DialpadMaxEditStringLenght = 100; @@ -41,16 +40,14 @@ mNumberEditor = new HbLineEdit(this); HbEditorInterface editorInterface(mNumberEditor); editorInterface.setFilter(HbPhoneNumberFilter::instance()); - editorInterface.setUpAsPhoneNumberEditor(); - editorInterface.setConstraints(HbEditorConstraintIgnoreFocus); + editorInterface.setInputConstraints(HbEditorConstraintIgnoreFocus); mNumberEditor->setMaxLength(DialpadMaxEditStringLenght); + mNumberEditor->setMinRows(1); + mNumberEditor->setMaxRows(2); + mNumberEditor->setAdjustFontSizeToFitHeight(true); // create backspace button mBackspace = new DialpadButton(this); - mFunctionButtonStyle = new DialpadButtonStyle(); - mFunctionButtonStyle->setButtonStyle( - DialpadButtonStyle::FunctionButtonStyle); - mBackspace->setStyle(mFunctionButtonStyle); mBackspace->setButtonType(DialpadButton::FunctionButton); // for css mBackspace->setFocusPolicy(Qt::NoFocus); mBackspace->setFlag(QGraphicsItem::ItemIsFocusable,false); @@ -76,19 +73,13 @@ layout->setContentsMargins(0,0,0,0); layout->setSpacing(DialpadComponentMargin* unit); // layout parameters - mBackspace->setPreferredWidth(DialpadBackspaceHeight * unit); + mBackspace->setPreferredWidth(DialpadBackspaceWidth * unit); mBackspace->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding); setLayout(layout); - - HbFontSpec editFont(HbFontSpec::Primary); - // 85% of input field height - editFont.setTextHeight(mHeight*0.85); - mNumberEditor->setFontSpec(editFont); } DialpadInputField::~DialpadInputField() { - delete mFunctionButtonStyle; } HbLineEdit& DialpadInputField::editor() const diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/src/dialpadkeyhandler.cpp --- a/telutils/dialpad/src/dialpadkeyhandler.cpp Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/src/dialpadkeyhandler.cpp Fri May 14 16:24:46 2010 +0300 @@ -19,19 +19,28 @@ #include "dialpadkeyhandler.h" #include "dialpadvoicemailboxeventfilter.h" #include "dialpadbluetootheventfilter.h" +#include "dialpadkeysequenceeventfilter.h" #include "qtphonesrvlog.h" -DialpadKeyHandler::DialpadKeyHandler(Dialpad *dialPad, HbMainWindow& mainWindow, QObject *parent) : QObject(parent), mMainWindow(mainWindow) +DialpadKeyHandler::DialpadKeyHandler( + Dialpad *dialPad, HbMainWindow& mainWindow, QObject *parent) + : + QObject(parent), + mMainWindow(mainWindow), + mVmbxFilter(0), + mBtFilter(0), + mKeySequenceFilter(0) { PHONE_TRACE; - mVmbxFilter = new DialpadVoiceMailboxEventFilter(dialPad, this); - Q_ASSERT(mVmbxFilter != NULL); - mBtFilter = new DialpadBluetoothEventFilter(dialPad, this); - Q_ASSERT(mBtFilter != NULL); - + + mVmbxFilter.reset(new DialpadVoiceMailboxEventFilter(dialPad)); + mBtFilter.reset(new DialpadBluetoothEventFilter(dialPad)); + mKeySequenceFilter.reset(new DialpadKeySequenceEventFilter(dialPad)); + // Stack different event filters - mMainWindow.installEventFilter(mVmbxFilter); - mMainWindow.installEventFilter(mBtFilter); + mMainWindow.installEventFilter(mVmbxFilter.data()); + mMainWindow.installEventFilter(mBtFilter.data()); + mMainWindow.installEventFilter(mKeySequenceFilter.data()); } DialpadKeyHandler::~DialpadKeyHandler() diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/src/dialpadkeypad.cpp --- a/telutils/dialpad/src/dialpadkeypad.cpp Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/src/dialpadkeypad.cpp Fri May 14 16:24:46 2010 +0300 @@ -26,7 +26,6 @@ #include #include "dialpadkeypad.h" -#include "dialpadbuttonstyle.h" #include "dialpadbutton.h" #include "dialpadinputfield.h" @@ -71,10 +70,6 @@ Qt::Key_Backspace); // create keypad - mNormalButtonStyle = new DialpadButtonStyle(); - mCallButtonStyle = new DialpadButtonStyle(); - mCallButtonStyle->setButtonStyle(DialpadButtonStyle::CallButtonStyle); - for (int i = 0; i < DialpadButtonCount; i++) { int keyCode = DialpadButtonToKeyCodeTable[i]; @@ -90,12 +85,10 @@ button->setObjectName(buttonName); if (keyCode==Qt::Key_Yes) { - 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 } @@ -136,8 +129,6 @@ DialpadKeypad::~DialpadKeypad() { - delete mCallButtonStyle; - delete mNormalButtonStyle; } void DialpadKeypad::createButtonGrid() @@ -322,3 +313,10 @@ } } } + +void DialpadKeypad::resetButtons() +{ + for(int i = 0; i < DialpadButtonCount; i++) { + mButtons[i]->setDown(false); + } +} diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/src/dialpadkeysequenceeventfilter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telutils/dialpad/src/dialpadkeysequenceeventfilter.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,115 @@ +/* +* 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: Implements key sequence recognition filter for Dialpad. +* +*/ +#include +#include +#include +#include +#ifdef Q_OS_SYMBIAN +#include +#include +#endif //Q_OS_SYMBIAN +#include "dialpadkeysequenceeventfilter.h" +#include "dialpad.h" +#include "qtphonesrvlog.h" + +/*! + DialpadKeySequenceEventFilter::DialpadKeySequenceEventFilter. + */ +DialpadKeySequenceEventFilter::DialpadKeySequenceEventFilter( + Dialpad* dialpad, QObject* parent) + : + QObject(parent), mDialpad(dialpad) +{ + PHONE_TRACE; +} + + +/*! + DialpadKeySequenceEventFilter::~DialpadKeySequenceEventFilter. + */ +DialpadKeySequenceEventFilter::~DialpadKeySequenceEventFilter() +{ + PHONE_TRACE; +} + + +/*! + DialpadKeySequenceEventFilter::eventFilter. + */ +bool DialpadKeySequenceEventFilter::eventFilter(QObject *watched, QEvent *event) +{ + PHONE_TRACE; + Q_UNUSED(watched) + + const bool eventFiltered = false; +#ifdef Q_OS_SYMBIAN + QKeyEvent *keyEvent = static_cast(event); + const int keyCode = keyEvent->key(); + const int eventType = event->type(); + + // Code is executed after '#' is pressed as specified in Dialer UI + // specification. + QString keySequenceCandidate = HbStringUtil::convertDigitsTo( + mDialpad->editor().text(), WesternDigit); + if (QEvent::KeyRelease == eventType && + Qt::Key_NumberSign == keyCode && + preValidateKeySequence(keySequenceCandidate)) { + XQServiceRequest request( + "com.nokia.services.telephony", + "executeKeySequence(QString)", + true); + + // Workaround for getting focus back to dialer after service request. + XQRequestInfo requestInfo; + requestInfo.setBackground(true); + request.setInfo(requestInfo); + + QVariant keySequenceProcessed; + request << keySequenceCandidate; + bool requestOk = request.send(keySequenceProcessed); + if (requestOk && keySequenceProcessed.toBool()) { + mDialpad->editor().setText(QString("")); + } + } +#else + Q_UNUSED(event) +#endif // Q_OS_SYMBIAN + + return eventFiltered; +} + + +/*! + DialpadKeySequenceEventFilter::preValidateKeySequence. + Checks that key sequence starts with '*#'and ends with '#'. + */ +bool DialpadKeySequenceEventFilter::preValidateKeySequence( + const QString &sequence) +{ + const int KMinimumLength = 4; + bool isValid = false; + + int lengthOfSequence = sequence.length(); + if (KMinimumLength <= lengthOfSequence) { + isValid = + (sequence.at(0) == '*') && + (sequence.at(1) == '#') && + (sequence.at(lengthOfSequence - 1) == '#'); + } + + return isValid; +} diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/src/dialpadvoicemailboxeventfilter.cpp --- a/telutils/dialpad/src/dialpadvoicemailboxeventfilter.cpp Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/src/dialpadvoicemailboxeventfilter.cpp Fri May 14 16:24:46 2010 +0300 @@ -188,7 +188,7 @@ { PHONE_TRACE2("phoneNumber:", phoneNumber); #ifdef Q_OS_SYMBIAN - XQServiceRequest snd("com.nokia.services.telephony","dial(QString)", false); + XQServiceRequest snd("com.nokia.symbian.ICallDial","dial(QString)", false); snd << phoneNumber; QVariant retValue; snd.send(retValue); diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/tsrc/dialpadtest/dialpadtestview.cpp --- a/telutils/dialpad/tsrc/dialpadtest/dialpadtestview.cpp Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/tsrc/dialpadtest/dialpadtestview.cpp Fri May 14 16:24:46 2010 +0300 @@ -218,7 +218,7 @@ msgBox.setText(msg); msgBox.setTimeout(3000); - msgBox.exec(); + msgBox.show(); } void DialpadTestView::handleDial() @@ -235,7 +235,7 @@ msgBox.setText(msg); msgBox.setTimeout(3000); - msgBox.exec(); + msgBox.show(); } void DialpadTestView::setTapOutsideDismiss() diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/tsrc/unit/runall.cmd --- a/telutils/dialpad/tsrc/unit/runall.cmd Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/tsrc/unit/runall.cmd Fri May 14 16:24:46 2010 +0300 @@ -23,6 +23,7 @@ call runtest.cmd ut_dialpadvoicemailboxeventfilter call runtest.cmd mt_keyhandler call runtest.cmd ut_dialpadbluetootheventfilter +call runtest.cmd ut_dialpadkeysequenceeventfilter ) @echo off diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/tsrc/unit/shared/mock_dialpad.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telutils/dialpad/tsrc/unit/shared/mock_dialpad.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,302 @@ +/* +* 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include "dialpad.h" + +static const int DialpadCloseAnimDuration = 200; // ms +static const int DialpadOpenAnimDuration = 200; // ms + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Dialpad::Dialpad +// ----------------------------------------------------------------------------- +// +Dialpad::Dialpad( ) + : + mMainWindow(*hbInstance->allMainWindows().at(0)), + mBackgroundDrawer(0), + mIconDrawer(0), + mBackgroundItem(0), + mInputField(0), + mKeypad(0), + mMultitap(0), + mMouseButtonPressedDown(false), + mOpenTimeLine(DialpadOpenAnimDuration), + mCloseTimeLine(DialpadCloseAnimDuration), + mAnimationOngoing(false), + mOrientation(Qt::Vertical), + mIsOpen(false) + { + + } + + +// ----------------------------------------------------------------------------- +// Dialpad::Dialpad +// ----------------------------------------------------------------------------- +// +Dialpad::Dialpad( const HbMainWindow & mainWindow ) + : + mMainWindow(mainWindow), + mBackgroundDrawer(0), + mIconDrawer(0), + mBackgroundItem(0), + mInputField(0), + mKeypad(0), + mMultitap(0), + mMouseButtonPressedDown(false), + mOpenTimeLine(DialpadOpenAnimDuration), + mCloseTimeLine(DialpadCloseAnimDuration), + mAnimationOngoing(false), + mOrientation(Qt::Vertical), + mIsOpen(false) + { + + } + + +// ----------------------------------------------------------------------------- +// Dialpad::~Dialpad +// ----------------------------------------------------------------------------- +// +Dialpad::~Dialpad( ) + { + delete mBackgroundDrawer; + delete mIconDrawer; + delete mBackgroundItem; + } + + +// ----------------------------------------------------------------------------- +// Dialpad::editor +// ----------------------------------------------------------------------------- +// +HbLineEdit & Dialpad::editor( ) const + { + SMC_MOCK_METHOD0( HbLineEdit & ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::isOpen +// ----------------------------------------------------------------------------- +// +bool Dialpad::isOpen( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::openDialpad +// ----------------------------------------------------------------------------- +// +void Dialpad::openDialpad( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::closeDialpad +// ----------------------------------------------------------------------------- +// +void Dialpad::closeDialpad( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::setCallButtonEnabled +// ----------------------------------------------------------------------------- +// +void Dialpad::setCallButtonEnabled( + bool enabled ) + { + SMC_MOCK_METHOD1( void, bool, enabled ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::setTapOutsideDismiss +// ----------------------------------------------------------------------------- +// +void Dialpad::setTapOutsideDismiss( + bool dismiss ) + { + SMC_MOCK_METHOD1( void, bool, dismiss ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::paint +// ----------------------------------------------------------------------------- +// +void Dialpad::paint( + QPainter * painter, + const QStyleOptionGraphicsItem * option, + QWidget * widget ) + { + SMC_MOCK_METHOD3( void, QPainter *, painter, + const QStyleOptionGraphicsItem *, option, + QWidget *, widget ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::sceneEvent +// ----------------------------------------------------------------------------- +// +bool Dialpad::sceneEvent( + QEvent * event ) + { + SMC_MOCK_METHOD1( bool, QEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::sceneEventFilter +// ----------------------------------------------------------------------------- +// +bool Dialpad::sceneEventFilter( + QGraphicsItem * watched, + QEvent * event ) + { + SMC_MOCK_METHOD2( bool, QGraphicsItem *, watched, + QEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::handleSceneEvent +// ----------------------------------------------------------------------------- +// +bool Dialpad::handleSceneEvent( + QEvent * event ) + { + SMC_MOCK_METHOD1( bool, QEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::showEvent +// ----------------------------------------------------------------------------- +// +void Dialpad::showEvent( + QShowEvent * event ) + { + SMC_MOCK_METHOD1( void, QShowEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::hideEvent +// ----------------------------------------------------------------------------- +// +void Dialpad::hideEvent( + QHideEvent * event ) + { + SMC_MOCK_METHOD1( void, QHideEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::closeEvent +// ----------------------------------------------------------------------------- +// +void Dialpad::closeEvent( + QCloseEvent * event ) + { + SMC_MOCK_METHOD1( void, QCloseEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::closeAnimValueChanged +// ----------------------------------------------------------------------------- +// +void Dialpad::closeAnimValueChanged( + qreal value ) + { + SMC_MOCK_METHOD1( void, qreal, value ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::closeAnimFinished +// ----------------------------------------------------------------------------- +// +void Dialpad::closeAnimFinished( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::openAnimValueChanged +// ----------------------------------------------------------------------------- +// +void Dialpad::openAnimValueChanged( + qreal value ) + { + SMC_MOCK_METHOD1( void, qreal, value ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::openAnimFinished +// ----------------------------------------------------------------------------- +// +void Dialpad::openAnimFinished( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::orientationChangeStarted +// ----------------------------------------------------------------------------- +// +void Dialpad::orientationChangeStarted( ) + { + SMC_MOCK_METHOD0( void ) + } + + +// ----------------------------------------------------------------------------- +// Dialpad::orientationChangeFinished +// ----------------------------------------------------------------------------- +// +void Dialpad::orientationChangeFinished( + Qt::Orientation current ) + { + SMC_MOCK_METHOD1( void, Qt::Orientation, current ) + } + + diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/tsrc/unit/shared/mock_hblineedit.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telutils/dialpad/tsrc/unit/shared/mock_hblineedit.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,381 @@ +/* +* 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 +#include +#include +#include + +#include +#include "hblineedit.h" +#include "hbabstractedit.h" +#include "hbwidget.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// HbLineEdit::HbLineEdit +// ----------------------------------------------------------------------------- +// +HbLineEdit::HbLineEdit(QGraphicsItem *parent) +{ + Q_UNUSED(parent) +} + +// ----------------------------------------------------------------------------- +// HbLineEdit::HbLineEdit +// ----------------------------------------------------------------------------- +// +HbLineEdit::HbLineEdit( + const QString & text, + QGraphicsItem * parent ) + { + Q_UNUSED(text) + Q_UNUSED(parent) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::~HbLineEdit +// ----------------------------------------------------------------------------- +// +HbLineEdit::~HbLineEdit( ) + { + + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::type +// ----------------------------------------------------------------------------- +// +int HbLineEdit::type( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::maxLength +// ----------------------------------------------------------------------------- +// +int HbLineEdit::maxLength( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::setMaxLength +// ----------------------------------------------------------------------------- +// +void HbLineEdit::setMaxLength( + int length ) + { + SMC_MOCK_METHOD1( void, int, length ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::setMinRows +// ----------------------------------------------------------------------------- +// +void HbLineEdit::setMinRows( + int rows ) + { + SMC_MOCK_METHOD1( void, int, rows ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::minRows +// ----------------------------------------------------------------------------- +// +int HbLineEdit::minRows( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::setMaxRows +// ----------------------------------------------------------------------------- +// +void HbLineEdit::setMaxRows( + int rows ) + { + SMC_MOCK_METHOD1( void, int, rows ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::maxRows +// ----------------------------------------------------------------------------- +// +int HbLineEdit::maxRows( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::isExpandable +// ----------------------------------------------------------------------------- +// +bool HbLineEdit::isExpandable( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::text +// ----------------------------------------------------------------------------- +// +QString HbLineEdit::text( ) const + { + SMC_MOCK_METHOD0( QString ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::displayText +// ----------------------------------------------------------------------------- +// +QString HbLineEdit::displayText( ) const + { + SMC_MOCK_METHOD0( QString ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::hasSelectedText +// ----------------------------------------------------------------------------- +// +bool HbLineEdit::hasSelectedText( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::selectedText +// ----------------------------------------------------------------------------- +// +QString HbLineEdit::selectedText( ) const + { + SMC_MOCK_METHOD0( QString ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::selectionStart +// ----------------------------------------------------------------------------- +// +int HbLineEdit::selectionStart( ) const + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::setSelection +// ----------------------------------------------------------------------------- +// +void HbLineEdit::setSelection( + int start, + int length ) + { + SMC_MOCK_METHOD2( void, int, start, + int, length ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::cursorPosition +// ----------------------------------------------------------------------------- +// +int HbLineEdit::cursorPosition() const + { + SMC_MOCK_METHOD0( int ) + } + +// ----------------------------------------------------------------------------- +// HbLineEdit::setCursorPosition +// ----------------------------------------------------------------------------- +// +void HbLineEdit::setCursorPosition( + int pos ) + { + SMC_MOCK_METHOD1( void, int, pos ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::echoMode +// ----------------------------------------------------------------------------- +// +HbLineEdit::EchoMode HbLineEdit::echoMode( ) const + { + SMC_MOCK_METHOD0( HbLineEdit::EchoMode ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::setEchoMode +// ----------------------------------------------------------------------------- +// +void HbLineEdit::setEchoMode( HbLineEdit::EchoMode echoMode ) + { + SMC_MOCK_METHOD1( void, HbLineEdit::EchoMode, echoMode ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::setCapitalization +// ----------------------------------------------------------------------------- +// +void HbLineEdit::setCapitalization( + QFont::Capitalization caps ) + { + SMC_MOCK_METHOD1( void, QFont::Capitalization, caps ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::capitalization +// ----------------------------------------------------------------------------- +// +QFont::Capitalization HbLineEdit::capitalization( ) const + { + SMC_MOCK_METHOD0( QFont::Capitalization ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::setText +// ----------------------------------------------------------------------------- +// +void HbLineEdit::setText( + const QString & text ) + { + SMC_MOCK_METHOD1( void, const QString &, text ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::HbLineEdit +// ----------------------------------------------------------------------------- +// +HbLineEdit::HbLineEdit( + HbLineEditPrivate & dd, + QGraphicsItem * parent ) + { + Q_UNUSED(text) + Q_UNUSED(parent) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::inputMethodEvent +// ----------------------------------------------------------------------------- +// +void HbLineEdit::inputMethodEvent( + QInputMethodEvent * event ) + { + SMC_MOCK_METHOD1( void, QInputMethodEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::keyPressEvent +// ----------------------------------------------------------------------------- +// +void HbLineEdit::keyPressEvent( + QKeyEvent * event ) + { + SMC_MOCK_METHOD1( void, QKeyEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::keyReleaseEvent +// ----------------------------------------------------------------------------- +// +void HbLineEdit::keyReleaseEvent( + QKeyEvent * event ) + { + SMC_MOCK_METHOD1( void, QKeyEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::resizeEvent +// ----------------------------------------------------------------------------- +// +void HbLineEdit::resizeEvent( + QGraphicsSceneResizeEvent * event ) + { + SMC_MOCK_METHOD1( void, QGraphicsSceneResizeEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::canInsertFromMimeData +// ----------------------------------------------------------------------------- +// +bool HbLineEdit::canInsertFromMimeData( + const QMimeData * source ) const + { + SMC_MOCK_METHOD1( bool, const QMimeData *, source ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::insertFromMimeData +// ----------------------------------------------------------------------------- +// +void HbLineEdit::insertFromMimeData( + const QMimeData * source ) + { + SMC_MOCK_METHOD1( void, const QMimeData *, source ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::focusOutEvent +// ----------------------------------------------------------------------------- +// +void HbLineEdit::focusOutEvent( + QFocusEvent * event ) + { + SMC_MOCK_METHOD1( void, QFocusEvent *, event ) + } + + +// ----------------------------------------------------------------------------- +// HbLineEdit::focusInEvent +// ----------------------------------------------------------------------------- +// +void HbLineEdit::focusInEvent( + QFocusEvent * event ) + { + SMC_MOCK_METHOD1( void, QFocusEvent *, event ) + } + + diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/tsrc/unit/shared/mock_xqservicerequest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telutils/dialpad/tsrc/unit/shared/mock_xqservicerequest.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,296 @@ +/* +* 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 +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// XQServiceRequest::XQServiceRequest +// ----------------------------------------------------------------------------- +// +XQServiceRequest::XQServiceRequest( ) + { + + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::XQServiceRequest +// ----------------------------------------------------------------------------- +// +XQServiceRequest::XQServiceRequest( + const QString & service, + const QString & message, + const bool & synchronous ) + { + Q_UNUSED(service) + Q_UNUSED(message) + Q_UNUSED(synchronous) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::XQServiceRequest +// ----------------------------------------------------------------------------- +// +XQServiceRequest::XQServiceRequest( + const XQServiceRequest & orig ) + { + Q_UNUSED(orig) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::XQServiceRequest +// ----------------------------------------------------------------------------- +// +XQServiceRequest::XQServiceRequest( + const XQAiwInterfaceDescriptor & descriptor, + const QString & message, + const bool & synchronous ) + { + Q_UNUSED(descriptor) + Q_UNUSED(message) + Q_UNUSED(synchronous) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::~XQServiceRequest +// ----------------------------------------------------------------------------- +// +XQServiceRequest::~XQServiceRequest( ) + { + + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::send +// ----------------------------------------------------------------------------- +// +bool XQServiceRequest::send( ) + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::send +// ----------------------------------------------------------------------------- +// +bool XQServiceRequest::send( + QVariant & retValue ) + { + SMC_MOCK_METHOD1( bool, QVariant &, retValue ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::isNull +// ----------------------------------------------------------------------------- +// +bool XQServiceRequest::isNull( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::setSynchronous +// ----------------------------------------------------------------------------- +// +void XQServiceRequest::setSynchronous( + const bool & synchronous ) + { + SMC_MOCK_METHOD1( void, const bool &, synchronous ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::isSynchronous +// ----------------------------------------------------------------------------- +// +bool XQServiceRequest::isSynchronous( ) const + { + SMC_MOCK_METHOD0( bool ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::setService +// ----------------------------------------------------------------------------- +// +void XQServiceRequest::setService( + const QString & service ) + { + SMC_MOCK_METHOD1( void, const QString &, service ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::service +// ----------------------------------------------------------------------------- +// +QString XQServiceRequest::service( ) const + { + SMC_MOCK_METHOD0( QString ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::setMessage +// ----------------------------------------------------------------------------- +// +void XQServiceRequest::setMessage( + const QString & message ) + { + SMC_MOCK_METHOD1( void, const QString &, message ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::message +// ----------------------------------------------------------------------------- +// +QString XQServiceRequest::message( ) const + { + SMC_MOCK_METHOD0( QString ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::arguments +// ----------------------------------------------------------------------------- +// +const QList & XQServiceRequest::arguments( ) const + { + SMC_MOCK_METHOD0( const QList & ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::setArguments +// ----------------------------------------------------------------------------- +// +void XQServiceRequest::setArguments( + const QList & arguments ) + { + SMC_MOCK_METHOD1( void, const QList &, arguments ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::latestError +// ----------------------------------------------------------------------------- +// +int XQServiceRequest::latestError( ) + { + SMC_MOCK_METHOD0( int ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::setInfo +// ----------------------------------------------------------------------------- +// +void XQServiceRequest::setInfo( + const XQRequestInfo & requestInfo ) + { + SMC_MOCK_METHOD1( void, const XQRequestInfo &, requestInfo ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::info +// ----------------------------------------------------------------------------- +// +XQRequestInfo XQServiceRequest::info( ) const + { + //SMC_MOCK_METHOD0( XQRequestInfo ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::= +// ----------------------------------------------------------------------------- +// +XQServiceRequest & XQServiceRequest::operator=( + const XQServiceRequest & orig ) + { + SMC_MOCK_METHOD1( XQServiceRequest &, const XQServiceRequest &, orig ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::serializeArguments +// ----------------------------------------------------------------------------- +// +QByteArray XQServiceRequest::serializeArguments( + const XQServiceRequest & request ) + { + SMC_MOCK_METHOD1( QByteArray, const XQServiceRequest &, request ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::deserializeArguments +// ----------------------------------------------------------------------------- +// +void XQServiceRequest::deserializeArguments( + XQServiceRequest & request, + const QByteArray & data ) + { + SMC_MOCK_METHOD2( void, XQServiceRequest &, request, + const QByteArray &, data ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::serialize +// ----------------------------------------------------------------------------- +// +template void XQServiceRequest::serialize( + Stream & stream ) const + { + SMC_MOCK_METHOD1( template void, Stream &, stream ) + } + + +// ----------------------------------------------------------------------------- +// XQServiceRequest::deserialize +// ----------------------------------------------------------------------------- +// +template void XQServiceRequest::deserialize( + Stream & stream ) + { + SMC_MOCK_METHOD1( template void, Stream &, stream ) + } + +void XQServiceRequest::addArg(const QVariant& v) +{ + Q_UNUSED(v) +} + +bool XQServiceRequest::handleSharableFileArgs() +{ + SMC_MOCK_METHOD0( bool ) +} diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/tsrc/unit/unit.pro --- a/telutils/dialpad/tsrc/unit/unit.pro Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/tsrc/unit/unit.pro Fri May 14 16:24:46 2010 +0300 @@ -21,5 +21,6 @@ SUBDIRS += ut_dialpadmultitaphandler SUBDIRS += ut_dialpadvoicemailboxeventfilter SUBDIRS += ut_dialpadbluetootheventfilter +SUBDIRS += ut_dialpadkeysequenceeventfilter SUBDIRS += mt_dialpad SUBDIRS += mt_keyhandler diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/tsrc/unit/ut_dialpadkeysequenceeventfilter/hblineedit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telutils/dialpad/tsrc/unit/ut_dialpadkeysequenceeventfilter/hblineedit.h Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2008-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 HBLINEEDIT_H +#define HBLINEEDIT_H + +#include +#include +#include +#include + +class HbLineEditPrivate; + +class HB_WIDGETS_EXPORT HbLineEdit: public QObject +{ + Q_OBJECT + + Q_ENUMS(EchoMode) + + Q_PROPERTY(QString text READ text WRITE setText USER true) + Q_PROPERTY(QString displayText READ displayText) + Q_PROPERTY(int maxLength READ maxLength WRITE setMaxLength) + Q_PROPERTY(bool hasSelectedText READ hasSelectedText) + Q_PROPERTY(QString selectedText READ selectedText) + Q_PROPERTY(int selectionStart READ selectionStart) + Q_PROPERTY(int maxRows READ maxRows WRITE setMaxRows) + Q_PROPERTY(int minRows READ minRows WRITE setMinRows) + Q_PROPERTY(bool expandable READ isExpandable) + Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode) + +public: + + explicit HbLineEdit(QGraphicsItem *parent = 0); + explicit HbLineEdit(const QString &text, QGraphicsItem *parent = 0); + virtual ~HbLineEdit(); + + enum { + Type = Hb::ItemType_LineEdit + }; + + int type() const; + + int maxLength() const; + void setMaxLength(int length); + + void setMinRows(int rows); + int minRows() const; + + void setMaxRows(int rows); + int maxRows() const; + + bool isExpandable() const; + + QString text() const; + QString displayText() const; + + bool hasSelectedText() const; + QString selectedText() const; + int selectionStart() const; + void setSelection(int start, int length); + + int cursorPosition() const; + void setCursorPosition(int pos); + + enum EchoMode { Normal, NoEcho, Password, PasswordEchoOnEdit }; + EchoMode echoMode() const; + void setEchoMode(EchoMode); + + void setCapitalization ( QFont::Capitalization caps ); + QFont::Capitalization capitalization () const; + +public slots: + void setText(const QString &text); + +signals: + void editingFinished(); + void textChanged(const QString &text); + void selectionChanged(); + +protected: + HbLineEdit(HbLineEditPrivate &dd, QGraphicsItem *parent); + + void inputMethodEvent(QInputMethodEvent *event); + void keyPressEvent(QKeyEvent *event); + void keyReleaseEvent(QKeyEvent *event); + + void resizeEvent(QGraphicsSceneResizeEvent *event); + + bool canInsertFromMimeData(const QMimeData *source) const; + void insertFromMimeData(const QMimeData *source); + + void focusOutEvent ( QFocusEvent * event ); + void focusInEvent ( QFocusEvent * event ); +private: + Q_DISABLE_COPY(HbLineEdit) + //Q_DECLARE_PRIVATE_D(d_ptr, HbLineEdit) + Q_PRIVATE_SLOT(d_func(), void _q_textChanged()) +}; + +#endif // HBLINEEDIT_H diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/tsrc/unit/ut_dialpadkeysequenceeventfilter/ut_dialpadkeysequenceeventfilter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telutils/dialpad/tsrc/unit/ut_dialpadkeysequenceeventfilter/ut_dialpadkeysequenceeventfilter.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,151 @@ +/*! +* 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 +#include +#ifdef Q_OS_SYMBIAN +#include "xqservicerequest.h" +#endif +#include "ut_dialpadkeysequenceeventfilter.h" +#include "dialpadtest.h" +#include "dialpadkeysequenceeventfilter.h" +#include "dialpad.h" + +UT_DialpadKeySequenceEventFilter::UT_DialpadKeySequenceEventFilter() +{ + +} + +UT_DialpadKeySequenceEventFilter::~UT_DialpadKeySequenceEventFilter() +{ + +} + +void UT_DialpadKeySequenceEventFilter::init() +{ + initialize(); + + SmcDefaultValue::SetL(QString()); + HbMainWindow *dummyWindow = NULL; + m_dialPad = new Dialpad(*dummyWindow); + m_eventFilter = new DialpadKeySequenceEventFilter(m_dialPad); +} + +void UT_DialpadKeySequenceEventFilter::cleanup() +{ + reset(); + + SmcDefaultValue::Reset(); + delete m_dialPad; + m_dialPad = NULL; + delete m_eventFilter; + m_eventFilter = NULL; +} + +#ifdef Q_OS_SYMBIAN +void UT_DialpadKeySequenceEventFilter::eventFilterValidKeySequence() +{ + const QString KValidKeySequence("*#1#"); + HbLineEdit lineEdit; + EXPECT(Dialpad::editor).returns(&lineEdit); + EXPECT(HbLineEdit::text).returns(KValidKeySequence); + EXPECT(XQServiceRequest::send).returns(true); + QKeyEvent keyEvent( + QEvent::KeyRelease, + Qt::Key_NumberSign, + Qt::NoModifier); + bool filtered = m_eventFilter->eventFilter(m_dialPad, &keyEvent); + QVERIFY(!filtered); + QVERIFY(verify()); +} + +void UT_DialpadKeySequenceEventFilter::eventFilterNotAKeyEvent() +{ + HbLineEdit lineEdit; + EXPECT(Dialpad::editor).returns(&lineEdit); + EXPECT(XQServiceRequest::send).times(0); + QMouseEvent mouseEvent( + QEvent::MouseMove, + QPoint(), + Qt::LeftButton, + Qt::LeftButton, + Qt::NoModifier); + bool filtered = m_eventFilter->eventFilter(m_dialPad, &mouseEvent); + QVERIFY(!filtered); + QVERIFY(verify()); +} + +void UT_DialpadKeySequenceEventFilter::eventFilterNotAHashKey() +{ + HbLineEdit lineEdit; + EXPECT(Dialpad::editor).returns(&lineEdit); + EXPECT(XQServiceRequest::send).times(0); + QKeyEvent keyEvent( + QEvent::KeyRelease, + Qt::Key_Escape, + Qt::NoModifier); + bool filtered = m_eventFilter->eventFilter(m_dialPad, &keyEvent); + QVERIFY(!filtered); + QVERIFY(verify()); +} + +void UT_DialpadKeySequenceEventFilter::eventFilterNotValidKeySequence() +{ + const QString KInvalidKeySequence1("*##"); + const QString KInvalidKeySequence2("#1234#"); + const QString KInvalidKeySequence3("**1234#"); + const QString KInvalidKeySequence4("*#1234*"); + + EXPECT(XQServiceRequest::send).times(0); + + HbLineEdit lineEdit; + EXPECT(Dialpad::editor).returns(&lineEdit); + EXPECT(HbLineEdit::text).returns(KInvalidKeySequence1); + QKeyEvent keyEvent( + QEvent::KeyRelease, + Qt::Key_NumberSign, + Qt::NoModifier); + bool filtered = m_eventFilter->eventFilter(m_dialPad, &keyEvent); + QVERIFY(!filtered); + + EXPECT(Dialpad::editor).returns(&lineEdit); + EXPECT(HbLineEdit::text).returns(KInvalidKeySequence2); + filtered = m_eventFilter->eventFilter(m_dialPad, &keyEvent); + QVERIFY(!filtered); + + EXPECT(Dialpad::editor).returns(&lineEdit); + EXPECT(HbLineEdit::text).returns(KInvalidKeySequence3); + filtered = m_eventFilter->eventFilter(m_dialPad, &keyEvent); + QVERIFY(!filtered); + + EXPECT(Dialpad::editor).returns(&lineEdit); + EXPECT(HbLineEdit::text).returns(KInvalidKeySequence4); + filtered = m_eventFilter->eventFilter(m_dialPad, &keyEvent); + QVERIFY(!filtered); + + QVERIFY(verify()); +} +#endif + +int main(int argc, char *argv[]) +{ + QCoreApplication app(argc, argv); + UT_DialpadKeySequenceEventFilter tc; + return QTest::qExec(&tc, argc, argv); +} diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/tsrc/unit/ut_dialpadkeysequenceeventfilter/ut_dialpadkeysequenceeventfilter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telutils/dialpad/tsrc/unit/ut_dialpadkeysequenceeventfilter/ut_dialpadkeysequenceeventfilter.h Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,52 @@ +/* +* 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_DIALPADKEYSEQUENCEEVENTFILTER_H +#define UT_DIALPADKEYSEQUENCEEVENTFILTER_H + +#include +#include + +class Dialpad; +class DialpadKeySequenceEventFilter; + +class UT_DialpadKeySequenceEventFilter : public QObject, public MockService +{ + Q_OBJECT + +public: + + UT_DialpadKeySequenceEventFilter(); + ~UT_DialpadKeySequenceEventFilter(); + +private slots: + + void init(); + void cleanup(); +#ifdef Q_OS_SYMBIAN + void eventFilterValidKeySequence(); + void eventFilterNotAKeyEvent(); + void eventFilterNotAHashKey(); + void eventFilterNotValidKeySequence(); +#endif + +private: + Dialpad *m_dialPad; + DialpadKeySequenceEventFilter *m_eventFilter; +}; + +#endif // UT_DIALPADKEYSEQUENCEEVENTFILTER_H diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/tsrc/unit/ut_dialpadkeysequenceeventfilter/ut_dialpadkeysequenceeventfilter.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telutils/dialpad/tsrc/unit/ut_dialpadkeysequenceeventfilter/ut_dialpadkeysequenceeventfilter.pro Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,50 @@ +# +# 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 = +INCLUDEPATH += . ../../../inc ../../../../../inc ../shared + +CONFIG += hb qtestlib + +QT -= gui + +DEFINES += BUILD_DIALPAD \ + BUILD_DIALPADKEYHANDLER \ + XQ_BUILD_XQSERVICE_LIB \ + BUILD_HB_WIDGETS + +symbian { + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE +} else:win32 { + DESTDIR = ./ + INCLUDEPATH += ../../../../../phonesrv_plat/dialpad_api/inc +} + +HEADERS += ../../../inc/dialpadkeysequenceeventfilter.h +SOURCES += ../../../src/dialpadkeysequenceeventfilter.cpp + +HEADERS += ut_dialpadkeysequenceeventfilter.h +SOURCES += ut_dialpadkeysequenceeventfilter.cpp + +HEADERS += ../../../../../phonesrv_plat/dialpad_api/inc/dialpad.h +HEADERS += /epoc32/include/mw/xqservicerequest.h +SOURCES += ../shared/mock_dialpad.cpp \ + ../shared/mock_xqservicerequest.cpp \ + ../shared/mock_hblineedit.cpp + +LIBS += -lmocklib -lsymbianmock -lxqserviceutil diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/dialpad/tsrc/unit/ut_dialpadvoicemailboxeventfilter/ut_dialpadvoicemailboxeventfilter.cpp --- a/telutils/dialpad/tsrc/unit/ut_dialpadvoicemailboxeventfilter/ut_dialpadvoicemailboxeventfilter.cpp Mon May 03 13:01:45 2010 +0300 +++ b/telutils/dialpad/tsrc/unit/ut_dialpadvoicemailboxeventfilter/ut_dialpadvoicemailboxeventfilter.cpp Fri May 14 16:24:46 2010 +0300 @@ -241,7 +241,7 @@ #ifdef Q_OS_SYMBIAN QVERIFY(mXQServiceConstructed == true); QVERIFY(mSendCalled == true); - QCOMPARE(mService, QString("com.nokia.services.telephony")); + QCOMPARE(mService, QString("com.nokia.symbian.ICallDial")); QCOMPARE(mMessage, QString("dial(QString)")); #endif } diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/telephonyservice/src/ccallinformationimpl.cpp --- a/telutils/telephonyservice/src/ccallinformationimpl.cpp Mon May 03 13:01:45 2010 +0300 +++ b/telutils/telephonyservice/src/ccallinformationimpl.cpp Fri May 14 16:24:46 2010 +0300 @@ -58,10 +58,11 @@ CCallInformationImpl* self = new (ELeave) CCallInformationImpl( ); CleanupStack::PushL( self ); - CMediatorService* mediatorService = CMediatorService::NewLC( CMediatorService::ECallInfo ); - self->ConstructL(mediatorService); - - CleanupStack::Pop( 2,self ); + CMediatorService* mediatorService = + CMediatorService::NewL( CMediatorService::ECallInfo ); + self->ConstructL(mediatorService); + + CleanupStack::Pop( self ); TSLOGSTRING("CCallInformationImpl::NewL >>"); return self; } diff -r d7fc66ccd6fb -r e44a8c097b15 telutils/xqtelephonyservice/xqtelephonyservice.pro --- a/telutils/xqtelephonyservice/xqtelephonyservice.pro Mon May 03 13:01:45 2010 +0300 +++ b/telutils/xqtelephonyservice/xqtelephonyservice.pro Fri May 14 16:24:46 2010 +0300 @@ -36,9 +36,7 @@ MMP_RULES += defFiles - LIBS += -lxqservice \ - -lxqserviceutil \ - -ltelephonyservice + LIBS += -ltelephonyservice BLD_INF_RULES.prj_exports += \ "$${LITERAL_HASH}include " \ diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/inc/vmbxcpgroup.h --- a/vmbx/vmbxcpplugin/inc/vmbxcpgroup.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/inc/vmbxcpgroup.h Fri May 14 16:24:46 2010 +0300 @@ -14,40 +14,34 @@ * Description: * */ + #ifndef VMBXCPGROUP_H #define VMBXCPGROUP_H // System includes #include +#include + // Forward declarations class VmbxUiEngine; class CpItemDataHelper; +class HbDataFormModelItem; // Class declaration class VmbxCpGroup : public CpSettingFormItemData { Q_OBJECT + public: /*! Constructor */ VmbxCpGroup( - HbDataFormModelItem::DataItemType type, - const QString &label, - const QString &configFile, - const HbDataFormModelItem *parent, CpItemDataHelper &itemDataHelper); /*! - Constructor - */ - explicit VmbxCpGroup( - const QString &configFile = QString(), - const HbDataFormModelItem *parent = 0); - - /*! Destructor */ ~VmbxCpGroup(); @@ -60,51 +54,52 @@ */ void voiceMailboxEngineEntriesUpdated(); + /*! + Save default Mailbox + */ + void saveDefaultMailbox(int aIndex); + + /*! + Query cs voice number when user click line edit + */ + void queryCsVoiceNumber(); + + /*! + Query cs video number when user click line edit + */ + void queryCsVideoNumber(); + + /*! + Update number when vmbx number changed by OTA,OMA etc. + */ + void vmbxNumberChanged(const TVmbxType vmbxType); + private: + + /*! + Preparation before loading + */ + void loadingPreparation(CpItemDataHelper &itemDataHelper); + + /*! + Update default mailbox + */ + void updateDefaultMailboxToUi(); /*! Update Cs voice primary */ - void updateCsVoicePrimaryToUi(); - - /*! - Update Cs voice Als - */ - void updateCsVoiceAlsToUi(); + void updateCsVoice1ToUi(); /*! update Cs video primary */ - void updateCsVideoPrimaryToUi(); - - /*! - NOTICE: IT IS POSSIBLE THAT PS SERVICES WILL NOT BE DISPLAYED - BY VMBX CONTROL PANEL WHEN WE GET THE NEW UI CONCEPT!!!!!! - In that case this is not needed - */ - - /*! - update Ps services - */ - void updatePsServicesToUi(); - - /*! - Update default mailbox - */ - void updateDefaultMailboxToUi(); + void updateCsVideo1ToUi(); /*! Update all mailboxes */ void updateAllMailboxesToUi(); - -private: - - /*! - Preparation before loading - */ - void loadingPreparation(CpItemDataHelper &itemDataHelper); - private: @@ -112,16 +107,13 @@ VmbxUiEngine *mUiEngine; // Not own. - CpSettingFormItemData *mEditorCsVoice1; - + CpSettingFormItemData *mDefaultMailboxEditor; + // Not own. - CpSettingFormItemData *mEditorCsVoice2; - + HbDataFormModelItem *mCsVoice1Editor; + // Not own. - CpSettingFormItemData *mEditorCsVideo1; - - // Contained pointers not own. - QList mPsServiceEditors; + HbDataFormModelItem *mCsVideo1Editor; }; #endif // VMBXCPGROUP_H diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/inc/vmbxcpplugin.h --- a/vmbx/vmbxcpplugin/inc/vmbxcpplugin.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/inc/vmbxcpplugin.h Fri May 14 16:24:46 2010 +0300 @@ -14,6 +14,7 @@ * Description: * */ + #ifndef VMBXCPPLUGIN_H #define VMBXCPPLUGIN_H @@ -29,11 +30,13 @@ { Q_OBJECT Q_INTERFACES(CpPluginInterface) + public: /*! Constructor */ VmbxCpPlugin(); + /*! Destructor */ @@ -46,4 +49,5 @@ virtual QList createSettingFormItemData( CpItemDataHelper &itemDataHelper) const; }; + #endif // VMBXCPPLUGIN_H diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/inc/vmbxuiengine.h --- a/vmbx/vmbxcpplugin/inc/vmbxuiengine.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/inc/vmbxuiengine.h Fri May 14 16:24:46 2010 +0300 @@ -20,6 +20,7 @@ // System includes #include #include +#include // Forward declarations class CVoiceMailbox; @@ -31,6 +32,7 @@ Q_OBJECT public: + /*! Constructor. */ @@ -48,21 +50,43 @@ @param aValue Retrieved number. */ void getCsVoice1Number(QString &aValue); - /*! - Getter method for voice ALS number of Voice Mailbox. - @param aValue Retrieved number. - */ - void getCsVoice2Number(QString &aValue); /*! Getter method for primary video number of Voice Mailbox. @param aValue Retrieved number. */ void getCsVideo1Number(QString &aValue); + + /*! + Set number when cs voice number has been edited on UI. + @param aValue New value. + */ + void setCsVoice1Number( const QString &aValue ); + + /*! + Set number when cs voice number has been edited on UI. + @param aValue New value. + */ + void setCsVideo1Number( const QString &aValue ); + + /*! + If video mailbox supported. + */ + bool isVideoSupport(); + + /*! + If voice mailbox is writable. + */ + bool isVoiceWritable(); + + /*! + If video mailbox is writable. + */ + bool isVideoWritable(); + // Add new Getter methods for other voice mailbox types - - // From MVoiceMailboxObserver + /*! From MVoiceMailboxObserver Observer callback for number/address change notification @@ -72,21 +96,32 @@ */ void HandleNotifyL(const CVoiceMailboxEntry &aVmbxEntry); + /*! + Query number when cs voice number has been edited on UI. + @param aValue New value. + */ + int queryVoiceNumber(QString &aValue); + + /*! + Query number when cs video number has been edited on UI. + @param aValue New value. + */ + int queryVideoNumber(QString &aValue); + + /*! + Request notify when VMBX number changed + @param aNotifyOnActiveLineOnly Only active line or NOT + */ + void notifyVmbxNumberChange(bool aNotifyOnActiveLineOnly); + signals: /*! Signal emitted when voice mailbox data has been updated. */ - void voiceMailboxEngineEntriesUpdated(); - -public slots: + void voiceMailboxEngineEntriesUpdated(const TVmbxType vmbxType); - /*! - Slot for signal when number has been edited on UI. - @param aValue New value. - */ - void uiCsVoice1Changed( const QString &aValue ); - + private: // New Method /*! @@ -105,6 +140,14 @@ void setNumber(const TVoiceMailboxParams &aParam, const QString &aValue); + /*! + Query method for voice mailbox number. + @param aParam Identify voice mailbox type + @param aValue Retrieved number. + */ + int queryNumber(const TVoiceMailboxParams &aParam, QString &aValue); + + private: /*! diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/rom/rom.pri --- a/vmbx/vmbxcpplugin/rom/rom.pri Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/rom/rom.pri Fri May 14 16:24:46 2010 +0300 @@ -17,5 +17,6 @@ symbian: { BLD_INF_RULES.prj_exports += \ "$${LITERAL_HASH}include" \ - "rom/vmbxcpplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(vmbxcpplugin.iby)" + "rom/vmbxcpplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(vmbxcpplugin.iby)" \ + "rom/vmbxcpplugin_stub.sis /epoc32/data/z/system/install/vmbxcpplugin_stub.sis" } \ No newline at end of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/rom/vmbxcpplugin.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxcpplugin/rom/vmbxcpplugin.pkg Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,25 @@ +; +; 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". +; + +; Language +&EN + +; SIS header: name, uid, version +#{"vmbxcpplugin"},(0x20029F5D),10, 1, 0, TYPE=PU + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; DEPLOYMENT +"\epoc32\release\armv5\urel\vmbxcpplugin.dll" - "!:\sys\bin\vmbxcpplugin.dll" +"\sf\mw\phonesrv\vmbx\vmbxcpplugin\qmakepluginstubs\vmbxcpplugin.qtplugin" - "!:\resource\qt\plugins\controlpanel\vmbxcpplugin.qtplugin" + diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/rom/vmbxcpplugin_stub.pkg --- a/vmbx/vmbxcpplugin/rom/vmbxcpplugin_stub.pkg Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/rom/vmbxcpplugin_stub.pkg Fri May 14 16:24:46 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" @@ -13,6 +13,7 @@ ; ; Description: For packing vmbxcpplugin stub. ; +; Languages &EN ; Header @@ -25,4 +26,5 @@ :"Nokia" ;Files -""-"z:\sys\bin\vmbxcpplugin.dll" +""-"!:\sys\bin\vmbxcpplugin.dll" +""-"!:\resource\qt\plugins\controlpanel\vmbxcpplugin.qtplugin" diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/rom/vmbxcpplugin_stub.sis Binary file vmbx/vmbxcpplugin/rom/vmbxcpplugin_stub.sis has changed diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/src/vmbxcpgroup.cpp --- a/vmbx/vmbxcpplugin/src/vmbxcpgroup.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/src/vmbxcpgroup.cpp Fri May 14 16:24:46 2010 +0300 @@ -16,47 +16,56 @@ */ // System includes +#include +#include +#include +#include #include +#include // User includes #include "vmbxuiengine.h" #include "vmbxcpgroup.h" #include "loggerutil.h" -/*! - Constructor -*/ -VmbxCpGroup::VmbxCpGroup( - const QString &configFile, - const HbDataFormModelItem *parent) : - CpSettingFormItemData(parent), - mUiEngine(0), - mEditorCsVoice1(0), - mEditorCsVoice2(0), - mEditorCsVideo1(0) -{ - Q_UNUSED(configFile); -} +// custom dataform type +#define CustomDataFormType \ + static_cast(HbDataFormModelItem::CustomItemBase) /*! Constructor */ VmbxCpGroup::VmbxCpGroup( - HbDataFormModelItem::DataItemType type, - const QString &label, - const QString &configFile, - const HbDataFormModelItem *parent, CpItemDataHelper &itemDataHelper) : - CpSettingFormItemData(type, label, parent), - mUiEngine(0), - mEditorCsVoice1(0), - mEditorCsVoice2(0), - mEditorCsVideo1(0) + CpSettingFormItemData(HbDataFormModelItem::GroupItem, + hbTrId("txt_phone_subhead_call_mbx"), NULL), + mUiEngine(NULL), + mDefaultMailboxEditor(NULL), + mCsVoice1Editor(NULL), + mCsVideo1Editor(NULL) { _DBGLOG2("VmbxCpGroup::VmbxCpGroup label=",label) - Q_UNUSED(configFile); + // Localization file loading + QTranslator translator; + QString lang = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + + bool translatorLoaded = translator.load(path + "telephone_cp_" + lang); + _DBGLOG("VmbxCpGroup::VmbxCpGroup translator loaded") + if (translatorLoaded && qApp) { + qApp->installTranslator(&translator); + _DBGLOG("VmbxCpGroup::VmbxCpGroup translator installed") + } + mUiEngine = new VmbxUiEngine(); loadingPreparation(itemDataHelper); + + // Request notify when VMBX number changed + mUiEngine->notifyVmbxNumberChange(true); + bool ret = connect(mUiEngine, + SIGNAL(voiceMailboxEngineEntriesUpdated(const TVmbxType)), + this, SLOT(vmbxNumberChanged(const TVmbxType))); + _DBGLOG2("VmbxCpGroup::VmbxCpGroup connect ret=", ret) _DBGLOG("VmbxCpGroup::VmbxCpGroup <") } @@ -73,51 +82,110 @@ } /*! + Notification slot for engine signal about + Voice Mailbox entries' changes +*/ +void VmbxCpGroup::voiceMailboxEngineEntriesUpdated() +{ + _DBGLOG("VmbxCpGroup::voiceMailboxEngineEntriesUpdated") + // Consider is there need to pass the actual modified data + // and mailbox type enum to slot (here) so only needed + // data can be updated. + updateAllMailboxesToUi(); +} + +/*! + Save default mailbox when user selection finished +*/ +void VmbxCpGroup::saveDefaultMailbox(int aIndex) +{ + if (0 == aIndex){ + _DBGLOG("VmbxCpGroup::saveDefaultMailbox voice") + }else if(1 == aIndex){ + _DBGLOG("VmbxCpGroup::saveDefaultMailbox video") + }else{ + _DBGLOG("VmbxCpGroup::saveDefaultMailbox other") + } +} + +/*! Preparation before loading */ void VmbxCpGroup::loadingPreparation(CpItemDataHelper &itemDataHelper) { _DBGLOG("VmbxCpGroup::loadingPreparation >") - QString newUiValue(""); - - mEditorCsVoice1 = new CpSettingFormItemData( - HbDataFormModelItem::TextItem, tr("Call mailbox") ); - _DBGLOG("VmbxCpGroup::loadingPreparation appendChild") - itemDataHelper.addConnection( - mEditorCsVoice1, - SIGNAL(textChanged(QString)), - mUiEngine, SLOT(uiCsVoice1Changed(QString)) - ); + // #Following code is reserved for TB10.2 + // Create default mailbox selection // appendChild takes ownership - appendChild(mEditorCsVoice1); + //if (mUiEngine->isVideoSupport()){ + // mDefaultMailboxEditor = new CpSettingFormItemData( + // HbDataFormModelItem::ComboBoxItem, + // hbTrId("Default mailbox"), + // this); + //itemDataHelper.addConnection( + // mDefaultMailboxEditor, SIGNAL(currentIndexChanged(int)), + // mUiEngine, SLOT(saveCsVoice1Number())); + //QStringList list; + //list.append(hbTrId("Voice")); + //list.append(hbTrId("Video")); + //mDefaultMailboxEditor->setContentWidgetData("items", QVariant(list)); + //appendChild(mDefaultMailboxEditor); + //} + + // Create cs voice primary editor + mCsVoice1Editor= new HbDataFormModelItem( + CustomDataFormType, + hbTrId("txt_phone_setlabel_default_mbx_val_voice")); + _DBGLOG("VmbxCpGroup::loadingPreparation appendChild voice1 mailbox") - // Todo: add csVoice2 if ALS supported - - // Todo: add video only if supported - //mEditorCsVideo1 = new CpSettingFormItemData( - // HbDataFormModelItem::TextItem, tr("Video mailbox") ); - //_DBGLOG("VmbxCpGroup::loadingPreparation appendChild") - //appendChild( mEditorCsVideo1 ); - - // TODO: get all ps addresses AND THEIR NAMES from engine and add ui controls - //for them - // Set UI control pointers to mPsServiceEditors + QString voice1Number; + mUiEngine->getCsVoice1Number(voice1Number); + // Show voice line1 number on lineedit + mCsVoice1Editor->setContentWidgetData(QString("text"), voice1Number); + // Connect ui editing signals and allow ui control + // eidting if vmbx allows editing + if (mUiEngine->isVoiceWritable()) { + // When click the lineedit, the query dialog would pop up. + itemDataHelper.addConnection(mCsVoice1Editor, SIGNAL(clicked()), + this, SLOT(queryCsVoiceNumber())); + } else { + // If not writable, Dim the voice editor + mCsVoice1Editor->setEnabled(false); + } + // Add child + appendChild(mCsVoice1Editor); + + // Create cs video primary editor + if (mUiEngine->isVideoSupport()){ + mCsVideo1Editor= new HbDataFormModelItem( + CustomDataFormType, + hbTrId("txt_phone_setlabel_default_mbx_val_video")); + _DBGLOG("VmbxCpGroup::loadingPreparation appendChild video1 mailbox") + QString video1Number; + mUiEngine->getCsVideo1Number(video1Number); + // Show video line1 number on lineedit + mCsVideo1Editor->setContentWidgetData(QString("text"), video1Number); + // Check video editing permission and connect signal + if (mUiEngine->isVideoWritable()) { + itemDataHelper.addConnection(mCsVideo1Editor, SIGNAL(clicked()), + this, SLOT(queryCsVideoNumber())); + } else { + // If not writable, Dim the Video editor + mCsVideo1Editor->setEnabled(false); + } + appendChild( mCsVideo1Editor ); + } + // TODO: Create cs voice als editor + // TODO: Create cs video als editor + // TODO: Create all ps service editors updateAllMailboxesToUi(); - - // TODO: below connect ui editing signals and allow ui control - // eidting if vmbx allows editing // TODO: here check CS ALS editing permission and connnect signal // and enable editing - // TODO: here check video editing permission and connect signal - // if ok - // No need for Video ALS on UI, implement later if necessary. - - // Editing of PS Services is not allowed by default, disable ui editing // for them. @@ -125,61 +193,6 @@ } /*! - Update Cs voice primary -*/ -void VmbxCpGroup::updateCsVoicePrimaryToUi() -{ - _DBGLOG("VmbxCpGroup::updateCsVoicePrimaryToUi") - if (mEditorCsVoice1 && mUiEngine) { - QString newUiValue(""); - mUiEngine->getCsVoice1Number(newUiValue); - mEditorCsVoice1->setContentWidgetData("text", newUiValue); - } -} - -/*! - Update Cs voice Als -*/ -void VmbxCpGroup::updateCsVoiceAlsToUi() -{ - _DBGLOG("VmbxCpGroup::updateCsVoiceAlsToUi") - if (mEditorCsVoice2 && mUiEngine){ - QString newUiValue(""); - mUiEngine->getCsVoice1Number(newUiValue ); - _DBGLOG2("VmbxCpGroup::updateCsVoiceAlsToUi newUiValue=", newUiValue) - mEditorCsVoice2->setContentWidgetData("text", newUiValue ); - } -} - -/*! - update Cs video primary -*/ -void VmbxCpGroup::updateCsVideoPrimaryToUi() -{ - _DBGLOG("VmbxCpGroup::updateCsVideoPrimaryToUi >") - if (mEditorCsVideo1 && mUiEngine){ - QString newUiValue(""); - mUiEngine->getCsVideo1Number(newUiValue); - _DBGLOG2("VmbxCpGroup::updateCsVideoPrimaryToUi newUiValue=", \ - newUiValue) - mEditorCsVideo1->setContentWidgetData("text", newUiValue); - } - _DBGLOG("VmbxCpGroup::updateCsVideoPrimaryToUi <") -} - -/*! - update Ps services -*/ -void VmbxCpGroup::updatePsServicesToUi() -{ - _DBGLOG("VmbxCpGroup::updatePsServicesToUi >") - // Set values from engine to ui - // NOTICE: IT IS POSSIBLE THAT PS SERVICES WILL NOT BE DISPLAYED BY VMBX - // CONTROL PANEL WHEN WE GET THE NEW UI CONCEPT!!!!!! - _DBGLOG("VmbxCpGroup::updatePsServicesToUi <") -} - -/*! Update default mailbox */ void VmbxCpGroup::updateDefaultMailboxToUi() @@ -189,34 +202,109 @@ // length of the default mailbox // and reset the default mailbox type selection to "none" if it is. // If you do so, remember to save the new value to engine. + if (mDefaultMailboxEditor && mUiEngine) { + // TODO: Need a new API to save default mailbox + } _DBGLOG("VmbxCpGroup::updateDefaultMailboxToUi <") } /*! + Update Cs voice primary +*/ +void VmbxCpGroup::updateCsVoice1ToUi() +{ + _DBGLOG("VmbxCpGroup::updateCsVoice1ToUi") + if (mCsVoice1Editor && mUiEngine) { + QString newUiValue(""); + mUiEngine->getCsVoice1Number(newUiValue); + _DBGLOG2("VmbxCpGroup::updateCsVoice1ToUi\ + newUiValue=", newUiValue) + mCsVoice1Editor->setContentWidgetData("text", newUiValue); + } +} + +/*! + update Cs video primary +*/ +void VmbxCpGroup::updateCsVideo1ToUi() +{ + _DBGLOG("VmbxCpGroup::updateCsVideo1ToUi >") + if (mCsVideo1Editor && mUiEngine){ + QString newUiValue(""); + mUiEngine->getCsVideo1Number(newUiValue); + _DBGLOG2("VmbxCpGroup::updateCsVideo1ToUi\ + newUiValue=", newUiValue) + mCsVideo1Editor->setContentWidgetData("text", newUiValue); + } + _DBGLOG("VmbxCpGroup::updateCsVideo1ToUi <") +} + +/*! Update all mailboxes */ void VmbxCpGroup::updateAllMailboxesToUi() { _DBGLOG("VmbxCpGroup::updateAllMailboxesToUi >") - updateCsVoicePrimaryToUi(); - //updateCsVoiceAlsToUi(); - //updateCsVideoPrimaryToUi(); - //updatePsServicesToUi(); - //updateDefaultMailboxToUi(); + updateCsVoice1ToUi(); + if (mUiEngine->isVideoSupport()) { + updateDefaultMailboxToUi(); + updateCsVideo1ToUi(); + } _DBGLOG("VmbxCpGroup::updateAllMailboxesToUi <") } /*! - Notification slot for engine signal about - Voice Mailbox entries' changes + Query voice number */ -void VmbxCpGroup::voiceMailboxEngineEntriesUpdated() +void VmbxCpGroup::queryCsVoiceNumber() { - _DBGLOG("VmbxCpGroup::voiceMailboxEngineEntriesUpdated") - // Consider is there need to pass the actual modified data - // and mailbox type enum to slot (here) so only needed - // data can be updated. - updateAllMailboxesToUi(); + _DBGLOG("VmbxCpGroup::queryCsVoiceNumber >") + mCsVoice1Editor->setEnabled(false); + QString number; + int result = mUiEngine->queryVoiceNumber(number); + _DBGLOG2("VmbxCpGroup::queryCsVoiceNumber result=", result) + if (KErrNone == result) { + mCsVoice1Editor->setContentWidgetData(QString("text"), number); + _DBGLOG2("VmbxCpGroup::queryCsVoiceNumber >, number=", number) + mUiEngine->setCsVoice1Number(number); + } + mCsVoice1Editor->setEnabled(true); + _DBGLOG("VmbxCpGroup::queryCsVoiceNumber <") } -//End of file \ No newline at end of file +/*! + Query video number +*/ +void VmbxCpGroup::queryCsVideoNumber() +{ + _DBGLOG("VmbxCpGroup::queryCsVideoNumber >") + mCsVideo1Editor->setEnabled(false); + QString number; + int result = mUiEngine->queryVideoNumber(number); + _DBGLOG2("VmbxCpGroup::queryCsVideoNumber result=", result) + if (KErrNone == result) { + mCsVideo1Editor->setContentWidgetData(QString("text"), number); + _DBGLOG2("VmbxCpGroup::queryCsVideoNumber >, number=", number) + mUiEngine->setCsVideo1Number(number); + } + mCsVideo1Editor->setEnabled(true); + _DBGLOG("VmbxCpGroup::queryCsVideoNumber <") +} + +/*! + Update number when vmbx number changed by OTA,OMA etc. +*/ +void VmbxCpGroup::vmbxNumberChanged(const TVmbxType vmbxType) +{ + _DBGLOG("VmbxCpGroup::vmbxNumberChanged >") + // Update cs voice number + if (EVmbxVoice == vmbxType) { + updateCsVoice1ToUi(); + // Update cs video number + } else if (EVmbxVideo == vmbxType) { + updateCsVideo1ToUi(); + } + _DBGLOG("VmbxCpGroup::vmbxNumberChanged <") +} + +//End of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/src/vmbxcpplugin.cpp --- a/vmbx/vmbxcpplugin/src/vmbxcpplugin.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/src/vmbxcpplugin.cpp Fri May 14 16:24:46 2010 +0300 @@ -29,7 +29,7 @@ */ VmbxCpPlugin::VmbxCpPlugin() { - _DBGLOG( "VmbxCpPlugin::VmbxCpPlugin()" ) + _DBGLOG("VmbxCpPlugin::VmbxCpPlugin()") } /*! @@ -37,7 +37,7 @@ */ VmbxCpPlugin::~VmbxCpPlugin() { -_DBGLOG( "VmbxCpPlugin::~VmbxCpPlugin()" ) + _DBGLOG("VmbxCpPlugin::~VmbxCpPlugin()") } /*! @@ -46,19 +46,11 @@ QList VmbxCpPlugin::createSettingFormItemData( CpItemDataHelper &itemDataHelper) const { - _DBGLOG( "VmbxCpPlugin::createSettingFormItemData" ) - - QList itemList; - - VmbxCpGroup *itemData = new VmbxCpGroup( - HbDataFormModelItem::GroupItem, - QString("Voice Mailbox"), - QString("vmbxcpplugin.cpcfg"), - 0, - itemDataHelper ); - itemList << itemData; - return itemList; + _DBGLOG("VmbxCpPlugin::createSettingFormItemData") + QList ret; + ret.append(new VmbxCpGroup(itemDataHelper)); _DBGLOG("VmbxCpPlugin::createSettingFormItemData created") + return ret; } Q_EXPORT_PLUGIN2(VmbxCpPlugin, VmbxCpPlugin); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/src/vmbxuiengine.cpp --- a/vmbx/vmbxcpplugin/src/vmbxuiengine.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/src/vmbxuiengine.cpp Fri May 14 16:24:46 2010 +0300 @@ -18,7 +18,6 @@ // System includes #include #include -#include // User includes #include "vmbxuiengine.h" @@ -27,8 +26,7 @@ /*! Constructor */ -VmbxUiEngine::VmbxUiEngine() : - mVmbxEngine(NULL) +VmbxUiEngine::VmbxUiEngine() : mVmbxEngine(NULL) { _DBGLOG("VmbxUiEngine::VmbxUiEngine >") QT_TRAP_THROWING(mVmbxEngine = CVoiceMailbox::NewL()); @@ -41,6 +39,7 @@ VmbxUiEngine::~VmbxUiEngine() { _DBGLOG( "VmbxUiEngine::~VmbxUiEngine >") + mVmbxEngine->NotifyVmbxNumberChangeCancel(); delete mVmbxEngine; mVmbxEngine = NULL; _DBGLOG( "VmbxUiEngine::~VmbxUiEngine <") @@ -52,7 +51,6 @@ void VmbxUiEngine::getCsVoice1Number(QString &aValue) { _DBGLOG("VmbxUiEngine::getCsVoice1Number >") - TVoiceMailboxParams vmbxParams; vmbxParams.iType = EVmbxVoice; vmbxParams.iLineType = EVmbxAlsLine1; @@ -62,20 +60,6 @@ } /*! - Getter method for voice ALS number of Voice Mailbox. -*/ -void VmbxUiEngine::getCsVoice2Number(QString &aValue) -{ - _DBGLOG("VmbxUiEngine::getCsVoice2Number >") - TVoiceMailboxParams vmbxParams; - vmbxParams.iType = EVmbxVoice; - vmbxParams.iLineType = EVmbxAlsLine2; - vmbxParams.iServiceId = KVmbxServiceVoice; - getNumber(vmbxParams, aValue); - _DBGLOG2("VmbxUiEngine::getCsVoice2Number < , string=", aValue) -} - -/*! Getter method for primary video number of Voice Mailbox. */ void VmbxUiEngine::getCsVideo1Number(QString &aValue) @@ -90,18 +74,126 @@ } /*! - Callback from voice mailbox engine when number has been updated - This method notifies the UI to refresh its data. + Set number when cs voice number has been edited on UI. + @param aValue New value. */ -void VmbxUiEngine::uiCsVoice1Changed(const QString& aValue) +void VmbxUiEngine::setCsVoice1Number(const QString &aValue) { - _DBGLOG2("VmbxUiEngine::uiCsVoice1Changed >, value=",aValue) + _DBGLOG2("VmbxUiEngine::setCsVoice1Number >, value=",aValue) TVoiceMailboxParams vmbxParams; vmbxParams.iType = EVmbxVoice; vmbxParams.iLineType = EVmbxAlsLine1; vmbxParams.iServiceId = KVmbxServiceVoice; setNumber(vmbxParams, aValue); - _DBGLOG("VmbxUiEngine::uiCsVoice1Changed <"); + _DBGLOG("VmbxUiEngine::setCsVoice1Number <"); +} + +/*! + Set number when cs video number has been edited on UI. + @param aValue New value. +*/ +void VmbxUiEngine::setCsVideo1Number(const QString &aValue) +{ + _DBGLOG2("VmbxUiEngine::setCsVideo1Number >, value=",aValue) + TVoiceMailboxParams vmbxParams; + vmbxParams.iType = EVmbxVideo; + vmbxParams.iLineType = EVmbxAlsLine1; + vmbxParams.iServiceId = KVmbxServiceVideo; + setNumber(vmbxParams, aValue); + _DBGLOG("VmbxUiEngine::setCsVideo1Number <"); +} + +/*! + If video mailbox supported. +*/ +bool VmbxUiEngine::isVideoSupport() +{ + _DBGLOG("VmbxUiEngine::isVideoSupport >") + // video support + bool isVideoSupport(false); + TVoiceMailboxParams vmbxParams; + vmbxParams.iType = EVmbxVideo; + vmbxParams.iLineType = EVmbxAlsLine1; + vmbxParams.iServiceId = KVmbxServiceVideo; + isVideoSupport = mVmbxEngine->CheckConfiguration(vmbxParams, + EVmbxVideoMailboxSupported); + _DBGLOG2("VmbxUiEngine::isVideoSupport ", isVideoSupport); + return isVideoSupport; +} + +/*! + If voice mailbox allow to write. +*/ +bool VmbxUiEngine::isVoiceWritable() +{ + _DBGLOG("VmbxUiEngine::isVoiceWritable >") + bool isVoiceWritable(false); + TVoiceMailboxParams vmbxParams; + vmbxParams.iType = EVmbxVoice; + vmbxParams.iLineType = EVmbxAlsLine1; + vmbxParams.iServiceId = KVmbxServiceVoice; + isVoiceWritable = mVmbxEngine->CheckConfiguration(vmbxParams, + EVmbxChangeNbrAllowedOnUi); + _DBGLOG2("VmbxUiEngine::isVoiceWritable <", isVoiceWritable); + return isVoiceWritable; +} + +/*! + If video mailbox allow to write. +*/ +bool VmbxUiEngine::isVideoWritable() +{ + _DBGLOG( "VmbxUiEngine::isVideoWritable >") + bool isVideoWritable(false); + TVoiceMailboxParams vmbxParams; + vmbxParams.iType = EVmbxVideo; + vmbxParams.iLineType = EVmbxAlsLine1; + vmbxParams.iServiceId = KVmbxServiceVideo; + isVideoWritable = mVmbxEngine->CheckConfiguration(vmbxParams, + EVmbxChangeNbrAllowedOnUi); + _DBGLOG2("VmbxUiEngine::isVoiceWritable >", isVideoWritable); + return isVideoWritable; +} + +/*! + queryVoiceNumber +*/ +int VmbxUiEngine::queryVoiceNumber(QString &aValue) +{ + _DBGLOG2("VmbxUiEngine::queryVoiceNumber >, value=",aValue) + TVoiceMailboxParams vmbxParams; + vmbxParams.iType = EVmbxVoice; + vmbxParams.iServiceId = KVmbxServiceVoice; + int result = queryNumber(vmbxParams, aValue); + _DBGLOG2("VmbxUiEngine::queryVoiceNumber <, value=", aValue) + return result; +} + +/*! + queryVideoNumber +*/ +int VmbxUiEngine::queryVideoNumber(QString &aValue) +{ + _DBGLOG2("VmbxUiEngine::queryVideoNumber >, value=", aValue) + TVoiceMailboxParams vmbxParams; + vmbxParams.iType = EVmbxVideo; + vmbxParams.iServiceId = KVmbxServiceVideo; + int result = queryNumber(vmbxParams, aValue); + _DBGLOG2("VmbxUiEngine::queryVideoNumber <, value=", aValue) + return result; +} + +/*! + Request notify when VMBX number changed + */ +void VmbxUiEngine::notifyVmbxNumberChange(bool aNotifyOnActiveLineOnly) +{ + _DBGLOG2("VmbxUiEngine::notifyVmbxNumberChange >, OnActiveLineOnly=", + aNotifyOnActiveLineOnly) + QT_TRAP_THROWING(mVmbxEngine->NotifyVmbxNumberChangeL + (*this, aNotifyOnActiveLineOnly)); + _DBGLOG2("VmbxUiEngine::notifyVmbxNumberChange <, OnActiveLineOnly=", + aNotifyOnActiveLineOnly) } /*! @@ -110,14 +202,10 @@ */ void VmbxUiEngine::HandleNotifyL(const CVoiceMailboxEntry &aVmbxEntry) { - _DBGLOG( "VmbxUiEngine::HandleNotifyL") - Q_UNUSED(aVmbxEntry); - // Consider is there need to pass the actual modified data - // and mailbox type enum to slot. - // - // Issue the notification request to vmbxengine, that is missing - // at the moment ! - emit voiceMailboxEngineEntriesUpdated(); + _DBGLOG( "VmbxUiEngine::HandleNotifyL >") + TVmbxType type = aVmbxEntry.VoiceMailboxType(); + emit voiceMailboxEngineEntriesUpdated(type); + _DBGLOG( "VmbxUiEngine::HandleNotifyL <") } /*! @@ -135,7 +223,7 @@ result = vmbxEntry->GetVmbxNumber( entryNumber ); _DBGLOG3("VmbxUiEngine::getNumber, GetVmbxNumber result=", result, - " but ignore code and allow returing of an empty string to UI"); + " but ignore code and allow returning of an empty string to UI"); aValue = QString::fromUtf16 (entryNumber.Ptr(), entryNumber.Length()); } delete vmbxEntry; @@ -152,31 +240,52 @@ _DBGLOG("VmbxUiEngine::setNumber >") CVoiceMailboxEntry* vmbxEntry = NULL; - TInt result = mVmbxEngine->GetStoredEntry(aParam, vmbxEntry); - _DBGLOG2("VmbxUiEngine::setNumber, GetStoredEntry result=", result); - if ( KErrNone != result ){ - QT_TRAP_THROWING(vmbxEntry = CVoiceMailboxEntry::NewL()); - vmbxEntry->SetServiceId(aParam.iServiceId); - vmbxEntry->SetVoiceMailboxType(aParam.iType); - vmbxEntry->SetVmbxAlsLineType(aParam.iLineType); - // Service name for cs is basically the one in service table, - // but in this case it's not used for anything by vmbx. - // So let's not set anything as name...fix if problems arise - } + QT_TRAP_THROWING(vmbxEntry = CVoiceMailboxEntry::NewL()); + vmbxEntry->SetServiceId(aParam.iServiceId); + vmbxEntry->SetVoiceMailboxType(aParam.iType); + vmbxEntry->SetVmbxAlsLineType(aParam.iLineType); + _DBGLOG2("VmbxUiEngine::setNumber, SetVmbxNumber aValue=", aValue); _DBGLOG( "VmbxUiEngine::setNumber: cast to TPtrC") TPtrC newNumber( reinterpret_cast( aValue.utf16() ), aValue.length() ); - result = vmbxEntry->SetVmbxNumber( newNumber ); - _DBGLOG2("VmbxUiEngine::setNumber, SetVmbxNumber result=", result); - - if ( KErrNone == result ){ + int result = vmbxEntry->SetVmbxNumber( newNumber ); + if ( KErrNone == result ) { result = mVmbxEngine->SaveEntry( *vmbxEntry ); _DBGLOG2("VmbxUiEngine::setNumber, SaveEntry result=", result); } delete vmbxEntry; - // TODO: handle error here + vmbxEntry = 0; _DBGLOG("VmbxUiEngine::setNumber <"); } +/*! + Query method for voice mailbox number. +*/ +int VmbxUiEngine::queryNumber(const TVoiceMailboxParams &aParam, + QString &aValue) +{ + _DBGLOG2("VmbxUiEngine::queryNumber >, value=", aValue) + getNumber(aParam, aValue); + CVoiceMailboxEntry *vmbxEntry = NULL; + int result(0); + if (aValue.length() > 0) { + result = mVmbxEngine->QueryChangeEntry(aParam, vmbxEntry); + } else { + result = mVmbxEngine->QueryNewEntry(aParam, vmbxEntry); + } + if (KErrNone == result && vmbxEntry) { + TPtrC entryNumber(KNullDesC); + result = vmbxEntry->GetVmbxNumber(entryNumber); + _DBGLOG3("VmbxUiEngine::queryNumber, GetVmbxNumber result=", + result, + " but ignore code and allow returing of an empty string to UI"); + aValue = QString::fromUtf16(entryNumber.Ptr(), entryNumber.Length()); + } + delete vmbxEntry; + vmbxEntry = NULL; + _DBGLOG2("VmbxUiEngine::queryNumber <, value=", aValue) + return result; +} + //End of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/tsrc/inc/ut_vmbxcpplugin.h --- a/vmbx/vmbxcpplugin/tsrc/inc/ut_vmbxcpplugin.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/tsrc/inc/ut_vmbxcpplugin.h Fri May 14 16:24:46 2010 +0300 @@ -21,19 +21,10 @@ // System includes #include -#include -#include -#include -#include #include - -// Class forwards -class VmbxCpPlugin; -class VmbxCpGroup; - /*! - Mt_vmbxEngine module test class. + Ut_vmbxCpPlugin module test class. Tests Ut_vmbxCpPlugin interface. See cpp file for more information. @@ -46,35 +37,17 @@ { Q_OBJECT -public: - Ut_vmbxCpPlugin(); - - virtual ~Ut_vmbxCpPlugin(); - private slots: /*! - Called before the first testfunction is executed. - */ - void initTestCase(); - - /*! - Called after the last testfunction has been executed. - */ - void cleanupTestCase(); - - /*! Test method in VmbxCpPlugin */ void testCreateSettingFormItemData(); - -private: //data - + /*! - Own. - */ - VmbxCpPlugin *mCpPlugin; - + Test method in VmbxCpGroup + */ + void testCreateVmbxCpGroup(); }; #endif // _UT_VMBXCPPLUGIN_H diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/tsrc/inc/ut_vmbxuiengine.h --- a/vmbx/vmbxcpplugin/tsrc/inc/ut_vmbxuiengine.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/tsrc/inc/ut_vmbxuiengine.h Fri May 14 16:24:46 2010 +0300 @@ -24,6 +24,9 @@ // Class forwards class VmbxUiEngine; +static TInt globalExpRet; +static QString globalNumber; + /*! Ut_VmbxUiEngine module test class. @@ -36,24 +39,15 @@ { Q_OBJECT -public: - Ut_VmbxUiEngine(); - - virtual ~Ut_VmbxUiEngine(); - private slots: void initTestCase(); - void cleanupTestCase(); - - void testGetCsVoice1Number(); - - void testGetCsVoice2Number(); - - void testGetCsVideo1Number(); - void testUiCsVoice1Changed(); + void testCsVoice1Number(); + void testCsVideo1Number(); + void testIsVideoSupport(); + void testHandleNotifyL(); private: //data diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/tsrc/src/main.cpp --- a/vmbx/vmbxcpplugin/tsrc/src/main.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/tsrc/src/main.cpp Fri May 14 16:24:46 2010 +0300 @@ -37,13 +37,11 @@ int result = QTest::qExec(&tcUiEngine, 3, pass); qDebug("ut_vmbxuiengine result %d", result); - qDebug("ut_vmbxcpplugin"); Ut_vmbxCpPlugin tcCpPlugin; pass[2] = "c:\\logs\\vmbx\\ut_vmbxcpplugin.txt"; result = QTest::qExec(&tcCpPlugin, 3, pass); qDebug("ut_vmbxcpplugin result=%d", result); - qDebug("main() <"); return result; diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/tsrc/src/ut_dummyvoicemailbox.cpp --- a/vmbx/vmbxcpplugin/tsrc/src/ut_dummyvoicemailbox.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/tsrc/src/ut_dummyvoicemailbox.cpp Fri May 14 16:24:46 2010 +0300 @@ -19,6 +19,8 @@ #include #include #include +// For global export return value +#include "ut_vmbxuiengine.h" // ============================ MEMBER FUNCTIONS ============================= @@ -114,14 +116,14 @@ // // --------------------------------------------------------------------------- // - TInt CVoiceMailbox::GetStoredEntry( +TInt CVoiceMailbox::GetStoredEntry( const TVoiceMailboxParams& aParams, CVoiceMailboxEntry*& aEntry) const { - qDebug("DummyVoiceMailbox::GetStoredEntry <>"); + qDebug("DummyVoiceMailbox::GetStoredEntry >"); Q_UNUSED(aParams); TRAPD (err, aEntry = CVoiceMailboxEntry::NewL()); qDebug("DummyVoiceMailbox::GetStoredEntry err %d<", err); - return err; + return globalExpRet; } // --------------------------------------------------------------------------- @@ -129,11 +131,11 @@ // Destructor // --------------------------------------------------------------------------- // - TInt CVoiceMailbox::SaveEntry(const CVoiceMailboxEntry& aEntry) +TInt CVoiceMailbox::SaveEntry(const CVoiceMailboxEntry& aEntry) { qDebug("DummyVoiceMailbox::SaveEntry <>"); Q_UNUSED(aEntry); - return KErrNone; + return globalExpRet; } // --------------------------------------------------------------------------- @@ -141,13 +143,13 @@ // // --------------------------------------------------------------------------- // - TInt CVoiceMailbox::QueryNewEntry( +TInt CVoiceMailbox::QueryNewEntry( const TVoiceMailboxParams& aParams, CVoiceMailboxEntry*& aEntry) { qDebug("DummyVoiceMailbox::QueryNewEntry <>"); Q_UNUSED(aParams); TRAPD (err, aEntry = CVoiceMailboxEntry::NewL()); - return err; + return globalExpRet; } // --------------------------------------------------------------------------- @@ -155,13 +157,13 @@ // // --------------------------------------------------------------------------- // - TInt CVoiceMailbox::QueryChangeEntry( +TInt CVoiceMailbox::QueryChangeEntry( const TVoiceMailboxParams& aParams, CVoiceMailboxEntry*& aEntry) { qDebug("DummyVoiceMailbox::QueryChangeEntry <>"); Q_UNUSED(aParams); TRAPD (err, aEntry = CVoiceMailboxEntry::NewL()); - return err; + return globalExpRet; } // --------------------------------------------------------------------------- @@ -169,14 +171,14 @@ // // --------------------------------------------------------------------------- // - TInt CVoiceMailbox::QueryVmbxType( +TInt CVoiceMailbox::QueryVmbxType( TVoiceMailboxParams& aParams ) { qDebug("DummyVoiceMailbox::QueryVmbxType <>"); aParams.iType = EVmbxVoice; aParams.iServiceId = KVmbxServiceVoice; aParams.iLineType = EVmbxAlsLine1; - return KErrNone; + return globalExpRet; } // --------------------------------------------------------------------------- @@ -184,7 +186,7 @@ // // --------------------------------------------------------------------------- // - void CVoiceMailbox::NotifyVmbxNumberChangeL( +void CVoiceMailbox::NotifyVmbxNumberChangeL( MVoiceMailboxObserver& aObserver, const TBool aNotifyOnActiveLineOnly ) { qDebug("DummyVoiceMailbox::NotifyVmbxNumberChangeL <>"); @@ -197,7 +199,7 @@ // // --------------------------------------------------------------------------- // - void CVoiceMailbox::NotifyVmbxNumberChangeCancel() +void CVoiceMailbox::NotifyVmbxNumberChangeCancel() { qDebug("DummyVoiceMailbox::NotifyVmbxNumberChangeCancel <>"); } @@ -207,13 +209,13 @@ // // --------------------------------------------------------------------------- // - TBool CVoiceMailbox::CheckConfiguration( +TBool CVoiceMailbox::CheckConfiguration( const TVoiceMailboxParams& aParams, const TInt aFlags ) { qDebug("DummyVoiceMailbox::CheckConfiguration <>"); Q_UNUSED(aParams); Q_UNUSED(aFlags); - return ETrue; + return globalExpRet; } // --------------------------------------------------------------------------- @@ -221,7 +223,7 @@ // // --------------------------------------------------------------------------- // - TInt CVoiceMailbox::GetServiceIds( RIdArray& aProfileIds ) const +TInt CVoiceMailbox::GetServiceIds( RIdArray& aProfileIds ) const { qDebug("DummyVoiceMailbox::GetServiceIds <>"); Q_UNUSED(aProfileIds); @@ -234,12 +236,12 @@ // // --------------------------------------------------------------------------- // - TInt CVoiceMailbox::SaveProvisionedEntry( +TInt CVoiceMailbox::SaveProvisionedEntry( const CVoiceMailboxEntry& aEntry) { qDebug("DummyVoiceMailbox::SaveProvisionedEntry <>"); Q_UNUSED(aEntry); - return KErrNone; + return globalExpRet; } // End of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/tsrc/src/ut_dummyvoicemailboxentry.cpp --- a/vmbx/vmbxcpplugin/tsrc/src/ut_dummyvoicemailboxentry.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/tsrc/src/ut_dummyvoicemailboxentry.cpp Fri May 14 16:24:46 2010 +0300 @@ -18,6 +18,8 @@ // System includes #include #include +// For global value +#include "ut_vmbxuiengine.h" // CONSTANTS @@ -148,23 +150,12 @@ // Get number or address of the entry instance // --------------------------------------------------------------------------- // -EXPORT_C TInt CVoiceMailboxEntry::GetVmbxNumber( TPtrC& aVmbxNumber ) const +TInt CVoiceMailboxEntry::GetVmbxNumber( TPtrC& aVmbxNumber ) const { qDebug("DummyVoiceMailboxEntry::GetVmbxNumber >"); - TInt result( KErrNotFound ); - if ( ivmbxNumber ) - { - aVmbxNumber.Set( ivmbxNumber->Des() ); - qDebug("DummyVoiceMailboxEntry::GetVmbxNumber"); - result = KErrNone; - } - else - { - qDebug("DummyVoiceMailboxEntry::GetVmbxNumber:KNullDesC"); - aVmbxNumber.Set( KNullDesC ); - } - qDebug("DummyVoiceMailboxEntry::GetVmbxNumber <"); - return result; + aVmbxNumber.Set(globalNumber.utf16()); + qDebug("DummyVoiceMailboxEntry::GetVmbxNumber %d", globalExpRet); + return globalExpRet; } // --------------------------------------------------------------------------- @@ -172,25 +163,12 @@ // Set number or address of the entry instance // --------------------------------------------------------------------------- // -EXPORT_C TInt CVoiceMailboxEntry::SetVmbxNumber( const TDesC& aVmbxNumber ) +TInt CVoiceMailboxEntry::SetVmbxNumber( const TDesC& aVmbxNumber ) { qDebug("DummyVoiceMailboxEntry::SetVmbxNumber >"); - TInt result( KErrNoMemory ); - if ( aVmbxNumber.Length() > KVmbxMaxNumberLength ) - { - result = KErrArgument; - } - else - { - delete ivmbxNumber; - ivmbxNumber = aVmbxNumber.Alloc(); // Returns NULL if fails. - if ( ivmbxNumber ) - { - result = KErrNone; - } - } - qDebug("DummyVoiceMailboxEntry::SetVmbxNumber <"); - return result; + globalNumber = QString::fromUtf16(aVmbxNumber.Ptr(), aVmbxNumber.Length()); + qDebug("DummyVoiceMailboxEntry::SetVmbxNumber %d", globalExpRet); + return globalExpRet; } // --------------------------------------------------------------------------- @@ -198,7 +176,7 @@ // Get Brand Id of the entry instance // --------------------------------------------------------------------------- // -EXPORT_C TInt CVoiceMailboxEntry::GetBrandId( TPtrC8& aBrandId ) const +TInt CVoiceMailboxEntry::GetBrandId( TPtrC8& aBrandId ) const { qDebug("DummyVoiceMailboxEntry::GetBrandId >"); TInt result( KErrNotFound ); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/tsrc/src/ut_vmbxcpplugin.cpp --- a/vmbx/vmbxcpplugin/tsrc/src/ut_vmbxcpplugin.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/tsrc/src/ut_vmbxcpplugin.cpp Fri May 14 16:24:46 2010 +0300 @@ -16,74 +16,43 @@ */ // System includes -#include #include +#include // User includes #include "vmbxcpplugin.h" +#include "vmbxcpgroup.h" #include "ut_vmbxcpplugin.h" -// load plugin -#include - /*! - Ut_vmbxCpPlugin::Ut_vmbxCpPlugin - Default constructor, remember to null new members here. + Ut_vmbxCpPlugin::createSettingFormItemData */ -Ut_vmbxCpPlugin::Ut_vmbxCpPlugin() +void Ut_vmbxCpPlugin::testCreateSettingFormItemData() { - qDebug("Ut_vmbxCpPlugin::Ut_vmbxCpPlugin >"); - qDebug("Ut_vmbxCpPlugin::Ut_vmbxCpPlugin <"); -} - -/*! - Ut_vmbxCpPlugin::~Ut_vmbxCpPlugin -*/ -Ut_vmbxCpPlugin::~Ut_vmbxCpPlugin() -{ - qDebug("Ut_vmbxCpPlugin::~Ut_vmbxCpPlugin >"); - qDebug("Ut_vmbxCpPlugin::~Ut_vmbxCpPlugin <"); + CpItemDataHelper itemDataHelper; + VmbxCpPlugin *plugin = new VmbxCpPlugin(); + QVERIFY(plugin); + QList list; + list = plugin->createSettingFormItemData(itemDataHelper); + QVERIFY2(0 != list[0], "createSettingFormItemData failed"); + delete plugin; + plugin = NULL; } /*! - Ut_vmbxCpPlugin::initTestCase - QTestLib initialization method, called for each test case. + VmbxCpGroup construtor and destroctor */ -void Ut_vmbxCpPlugin::initTestCase() -{ - qDebug("Ut_vmbxCpPlugin::initTestCase >"); - mCpPlugin = new VmbxCpPlugin(); - QVERIFY(mCpPlugin); - qDebug("Ut_vmbxCpPlugin::initTestCase <"); -} - -/*! - Ut_vmbxCpPlugin::cleanupTestCase - QTestLib cleanup method, called for each test case. -*/ -void Ut_vmbxCpPlugin::cleanupTestCase() +void Ut_vmbxCpPlugin::testCreateVmbxCpGroup() { - qDebug("Ut_SatAppEngine::cleanupTestCase >"); - if ( mCpPlugin ) { - delete mCpPlugin; - qDebug("Ut_SatAppEngine::cleanupTestCase <"); - } + CpItemDataHelper itemDataHelper; + VmbxCpGroup *group = new VmbxCpGroup(itemDataHelper); + QVERIFY(group); + delete group; + group = NULL; + + group = new VmbxCpGroup(); + QVERIFY(group); + delete group; + group = NULL; } - -/*! - Ut_vmbxCpPlugin::t_createSettingFormItemData - testServiceId test case - Connects to test object signal and verifies received data. -*/ -void Ut_vmbxCpPlugin::testCreateSettingFormItemData() -{ - qDebug("Ut_vmbxCpPlugin::testCreateSettingFormItemData >"); - CpItemDataHelper itemDataHelper; - QVERIFY(mCpPlugin); - QList list; - list = mCpPlugin->createSettingFormItemData(itemDataHelper); - QVERIFY2(0 != list[0], "createSettingFormItemData failed"); - qDebug("Ut_vmbxCpPlugin::testCreateSettingFormItemData <"); -} - //End of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/tsrc/src/ut_vmbxuiengine.cpp --- a/vmbx/vmbxcpplugin/tsrc/src/ut_vmbxuiengine.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/tsrc/src/ut_vmbxuiengine.cpp Fri May 14 16:24:46 2010 +0300 @@ -17,27 +17,18 @@ // System includes #include +#include // User includes #include "vmbxuiengine.h" #include "ut_vmbxuiengine.h" -/*! - Ut_VmbxUiEngine::Ut_VmbxUiEngine - Default constructor, remember to null new members here. -*/ -Ut_VmbxUiEngine::Ut_VmbxUiEngine() +void setTestEnv(TInt aExpRet) { - qDebug("Ut_VmbxUiEngine <>"); + globalExpRet = aExpRet; + qDebug("setTestEnv %d", globalExpRet); } -/*! - Ut_VmbxUiEngine::~Ut_VmbxUiEngine -*/ -Ut_VmbxUiEngine::~Ut_VmbxUiEngine() -{ - qDebug("~Ut_VmbxUiEngine <>"); -} /*! Ut_VmbxUiEngine::initTestCase @@ -45,10 +36,8 @@ */ void Ut_VmbxUiEngine::initTestCase() { - qDebug("initTestCase >"); mUiEngine = new VmbxUiEngine(); QVERIFY(mUiEngine); - qDebug("initTestCase <"); } /*! @@ -57,12 +46,10 @@ */ void Ut_VmbxUiEngine::cleanupTestCase() { - qDebug("cleanupTestCase >"); if ( mUiEngine ) { delete mUiEngine; mUiEngine = NULL; } - qDebug("cleanupTestCase <"); } /*! @@ -70,27 +57,20 @@ testCreateVmbxEntry test case Connects to test object signal and verifies received data. */ -void Ut_VmbxUiEngine::testGetCsVoice1Number() +void Ut_VmbxUiEngine::testCsVoice1Number() { - qDebug("testGetCsVoice1Number >"); - QString voice1; QVERIFY(mUiEngine); - mUiEngine->getCsVoice1Number(voice1); - qDebug("testGetCsVoice1Number <"); -} - -/*! - Ut_VmbxUiEngine::testCreateVmbxMailbox - CreateVmbxMailbox test case - Connects to test object signal and verifies received data. -*/ -void Ut_VmbxUiEngine::testGetCsVoice2Number() -{ - qDebug("testGetCsVoice2Number >"); - QString voice2; - QVERIFY(mUiEngine); - mUiEngine->getCsVoice2Number(voice2); - qDebug("testGetCsVoice2Number <"); + QString in("123456"); + QString out(""); + setTestEnv(KErrNone); + mUiEngine->setCsVoice1Number(in); + mUiEngine->getCsVoice1Number(out); + QCOMPARE(in, out); + + setTestEnv(KErrNotFound); + mUiEngine->setCsVoice1Number(in); + mUiEngine->getCsVoice1Number(out); + QCOMPARE(in, out); } /*! @@ -98,28 +78,37 @@ testVmbxType test case Connects to test object signal and verifies received data. */ -void Ut_VmbxUiEngine::testGetCsVideo1Number() +void Ut_VmbxUiEngine::testCsVideo1Number() { - qDebug("testGetCsVideo1Number >"); - QString video1; QVERIFY(mUiEngine); - mUiEngine->getCsVideo1Number(video1); + + QString in("123456"); + QString out(""); - qDebug("testGetCsVideo1Number <"); + setTestEnv(KErrNone); + mUiEngine->setCsVideo1Number(in); + mUiEngine->getCsVideo1Number(out); + QCOMPARE(in, out); + + setTestEnv(KErrNotFound); + mUiEngine->setCsVideo1Number(in); + mUiEngine->getCsVideo1Number(out); + QCOMPARE(in, out); } -/*! - Ut_VmbxUiEngine::testUiCsVoice1Changed - testServiceId test case - Connects to test object signal and verifies received data. -*/ -void Ut_VmbxUiEngine::testUiCsVoice1Changed() +void Ut_VmbxUiEngine::testIsVideoSupport() { - qDebug("testUiCsVoice1Changed >"); QVERIFY(mUiEngine); - QString newNumber("123456"); - mUiEngine->uiCsVoice1Changed(newNumber); - qDebug("testUiCsVoice1Changed <"); + mUiEngine->isVideoSupport(); } +void Ut_VmbxUiEngine::testHandleNotifyL() +{ + QVERIFY(mUiEngine); + CVoiceMailboxEntry *entry = CVoiceMailboxEntry::NewL(); + QVERIFY(entry); + mUiEngine->HandleNotifyL(*entry); +} + + //End file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/tsrc/ut_vmbxcpplugin.pro --- a/vmbx/vmbxcpplugin/tsrc/ut_vmbxcpplugin.pro Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/tsrc/ut_vmbxcpplugin.pro Fri May 14 16:24:46 2010 +0300 @@ -15,7 +15,7 @@ # TEMPLATE = app -TARGET = +TARGET = ut_vmbxcpplugin DEPENDPATH += . INCLUDEPATH += . CONFIG += hb @@ -39,7 +39,9 @@ inc\ut_vmbxcpplugin.h \ ..\inc\vmbxuiengine.h \ ..\inc\vmbxcpplugin.h \ - ..\inc\vmbxcpgroup.h + ..\inc\vmbxcpgroup.h \ + ..\inc\actioncustomitem.h \ + ..\inc\customedit.h SOURCES += src\main.cpp\ @@ -49,5 +51,7 @@ src\ut_dummyvoicemailboxentry.cpp\ ..\src\vmbxuiengine.cpp \ ..\src\vmbxcpplugin.cpp \ - ..\src\vmbxcpgroup.cpp + ..\src\vmbxcpgroup.cpp \ + ..\src\actioncustomitem.cpp \ + ..\src\customedit.cpp diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin/vmbxcpplugin.pri --- a/vmbx/vmbxcpplugin/vmbxcpplugin.pri Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxcpplugin/vmbxcpplugin.pri Fri May 14 16:24:46 2010 +0300 @@ -67,4 +67,5 @@ SOURCES += src/vmbxcpplugin.cpp \ src/vmbxcpgroup.cpp \ - src/vmbxuiengine.cpp \ No newline at end of file + src/vmbxuiengine.cpp + diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxcpplugin_version_history.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxcpplugin_version_history.txt Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,62 @@ + +22-Oct-2009 Tommi Kenakkala + +HOW TO INTEGRATE: +- This version uses MCLwk32+QtOrbitDeltawk37+QtControlPanelwk38 +- To get this working you have use the refactored vmbxengine. +Copy cvoicemailbox.h, cvoicemailboxentry.h, voicemailboxdefs.h to the phonesrv_plat api folder (Same as old) +(I'll also remove vmbxengine app layer api dependencies from mercurial) +- Copy Qt control panel to root +- Edit \qtcontrolpanel\qtcontrolpanel\controlpanelplugins\communicationplugin\data\cpcommunicationplugin.cpcfg +by adding: + + I'm a description + +(remember to check that uid matches to implementation) +- To get signals from ui control in QtControlPanelwk38 package you have to fix the mistyped connect +in qtcontrolpanel\qtcontrolpanel\cpframework\src\cpsettingformitemdata.cpp: +"lineEditTextChanged" is mistyped as "lineEditTextChangge" +Signal is emitted on every character change so we or control panel have to fix that. +- After above is done compile qtcontrolpanel: + qmake -spec symbian-abld + bldmake bldfiles + abld build winscw udeb +- Copy vmbxcpplugin to root and compile similarly + +- If you want to avoid carbide: + - Install DebugView (debug traces are printed there) + - launch epoc.exe from shell, launch DebugView PC app + - In emulator open eshell and launch the application there by typing the exe name + +- If vmbxcpplugin is not loaded enable QtControlPanel tracing and check the control +panel fw traces, there should be a trace for every plugin load attemp. +After "desc" tag there's a "loading failed" string if e.g. vmbxcpplugin.dll +loading failed because linking to vmbxengine.dll had problems. +Here is an ok trace from qtcontrolpanel: + "[1876] diplayname = "displayname" + [1876] dll = "vmbxcpplugin.dll" + [1876] desc = "I'm a description" " + +HOW TO USE QT CONTROL PANEL ON UI: +- launch by selecting applications > qtcontrolpanel +or applications > eshell and type qtcontrolpanel +- Click the "+" to open communications group +- Click the "+" to open vmbx group +- when you start editing the number, it will be save every time you change even a single character + +ABOUT DESIGN & FEATURES: + +- TODO: update VmbxCpGroup to class VmbxCpGroup : public CpSettingFormItemData +when DataForm bug is fixed (QTControlPanel wk39-41?), now append/addchild() panics. +After the base class switch API will change but it should be just a few minutes of work to do that. + +- Ps Services to be implemented later when we know if they will be in vmbx control panel group or in service settings group. +- UI editing permit checking must be implemented +- Video ALS support not to be implemented on UI, do it later if there really is someone using it. +- Default mailbox setting to be implemented later to CVoiceMailbox API and to UI, if future UI concepts still specify it. +- Use QT_TRAP_THROWING when qt 4.6 available, but do test then that qt throws and symbian leaves work ok together. +- Triple-check cleanup everywhere +- .pro file include paths are hard-coded, fix those for phonesrv_plat api folders. + +test + diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/dialogwaiter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/inc/dialogwaiter.h Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,62 @@ +/* +* 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: dialog waiter +* +* +*/ + +#ifndef DIALOGWAITER_H +#define DIALOGWAITER_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATION +class HbAction; + +/** + * This utility synchronises access to dialogs, popups, menus and + * other ORBIT resources. How to use: + * + * HbDialog* dialog = new HbDialog(); + * DialogWaiter waiter(); + * dialog->open(&waiter, SLOT(done(HbAction*))); + * HbAction* result = waiter.wait(); + * delete dialog; + * if (result==...) ... + * + */ +class DialogWaiter : public QObject +{ + Q_OBJECT + + public: + + /** + * waits until dialog exits + * returns dialog exit action + */ + HbAction* wait(); + + private slots: + void done(HbAction* result); + + private: + QEventLoop mLoop; + HbAction* mResult; + +}; + +#endif // DIALOGWAITER_H diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/mvmbxcenrephandler.h --- a/vmbx/vmbxengine/inc/mvmbxcenrephandler.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/mvmbxcenrephandler.h Fri May 14 16:24:46 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" @@ -42,7 +42,6 @@ /** * Get mailbox number from CenRep * - * @since S60 v5.2 * @param in&out aEntry the voice mailbox information data type * @return Symbian OS error code (KErrNone if successful) */ @@ -51,7 +50,6 @@ /** * Saves the mailbox number * - * @since S60 v5.2 * @param in aEntry vmbx number data to save * @return Symbian OS error code (KErrNone if successful) */ @@ -60,7 +58,6 @@ /** * Fetches active store type * - * @since S60 v5.2 * @return aStoreType Active store in use */ virtual TVmbxMemoryLocation StoreType() = 0; @@ -68,7 +65,6 @@ /** * Returns state of the video support * - * @since S60 v5.2 * @return ETrue if supported */ virtual TBool VideoSupported() = 0; @@ -76,7 +72,6 @@ /** * Returns ETrue if CenRep setting Sim read only * - * @since S60 v5.2 * @return ETrue if Sim read only */ virtual TBool IsSimReadOnly() = 0; @@ -84,7 +79,6 @@ /** * Returns ETrue if number allowed to user change * - * @since S60 v5.2 * @return ETrue if from Sim */ virtual TBool IsAllowedUserEdit() = 0; diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/mvmbxcenrepobserver.h --- a/vmbx/vmbxengine/inc/mvmbxcenrepobserver.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/mvmbxcenrepobserver.h Fri May 14 16:24:46 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" @@ -28,7 +28,6 @@ /** * MVmbxCenRepObserver * - * @since S60 v5.2 * @lib vmbxengine.lib * */ @@ -39,7 +38,6 @@ /** * Does the action user wants when the CenRep value has been changed. * - * @since S60 v5.2 * @param aId id related with the key of CenRep **/ virtual void HandleCenRepChange( TVmbxCenRepKey aId ) = 0; diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/mvmbxchangeobserver.h --- a/vmbx/vmbxengine/inc/mvmbxchangeobserver.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/mvmbxchangeobserver.h Fri May 14 16:24:46 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" @@ -32,7 +32,6 @@ * * @lib vmbxengine.lib * -* @since S60 v5.2 * **/ NONSHARABLE_CLASS ( MVmbxChangeObserver ) @@ -44,7 +43,6 @@ * Observer callback function which is called when *sat refresh * - * @since S60 5.2 **/ virtual void SatRefreshL() = 0; @@ -53,7 +51,6 @@ *CenRep Key value changed * * @param aId id related with the key of CenRep - * @since S60 5.2 **/ virtual void CenRepChangedL( TVmbxCenRepKey aId ) = 0; @@ -61,7 +58,6 @@ * Observer callback function which is called when *sim store changed * - * @since S60 5.2 **/ virtual void SimStoreChangedL() = 0; }; diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/mvmbxresourceprovider.h --- a/vmbx/vmbxengine/inc/mvmbxresourceprovider.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/mvmbxresourceprovider.h Fri May 14 16:24:46 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" @@ -29,7 +29,6 @@ /** * Resource provider * - * @since S60 v5.2 * @lib vmbxengine.lib * */ @@ -40,7 +39,6 @@ /** * Gets handler of MVmbxUiUtilities * - * @since S60 v5.2 * @return handler of MVmbxUiUtilities **/ virtual MVmbxUiUtilities& VmbxUiUtilities() = 0; @@ -48,7 +46,6 @@ /** * Gets handler of MVmbxCenrepHandler * - * @since S60 v5.2 * @return handler of MVmbxCenrepHandler **/ virtual MVmbxCenrepHandler& VmbxCenRepHandler() = 0; diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/mvmbxsatrefreshobserver.h --- a/vmbx/vmbxengine/inc/mvmbxsatrefreshobserver.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/mvmbxsatrefreshobserver.h Fri May 14 16:24:46 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" @@ -38,7 +38,6 @@ /** * Does the action user wants when the sim file is refreshed. * - * @since S60 v5.2 * @param **/ virtual void HandleSatRefresh() = 0; diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/mvmbxservicenotify.h --- a/vmbx/vmbxengine/inc/mvmbxservicenotify.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/mvmbxservicenotify.h Fri May 14 16:24:46 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" @@ -30,7 +30,6 @@ /** * MServiceNotifyHandler * - * @since S60 v5.2 * @lib vmbxengine.lib * */ @@ -43,4 +42,4 @@ virtual void HandleServiceNotifyL() = 0; }; -#endif // M_VMBXSERVICENOTIFY_H \ No newline at end of file +#endif // M_VMBXSERVICENOTIFY_H diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/mvmbxsimstoreobserver.h --- a/vmbx/vmbxengine/inc/mvmbxsimstoreobserver.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/mvmbxsimstoreobserver.h Fri May 14 16:24:46 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" @@ -27,7 +27,6 @@ /** * Notifier for sim store file entry changes * - * @since S60 v5.2 * @lib vmbxengine.lib * */ @@ -38,7 +37,6 @@ /** * Does the user wants when the sim store file entry has been changed. * - * @since S60 v5.2 **/ virtual void HandleSimStoreChanged() = 0; diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/mvmbxuihandler.h --- a/vmbx/vmbxengine/inc/mvmbxuihandler.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/mvmbxuihandler.h Fri May 14 16:24:46 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" @@ -30,7 +30,6 @@ /** * MVmbxUiHandler * - * @since S60 v5.2 * @lib vmbxengine.lib * */ @@ -42,20 +41,17 @@ /** * Show mailbox query dialog * - * @since S60 v5.2 * @param aType in TVmbxType type - * @param aMode Tin VmbxQueryMode mode * @param aNumber the voice mailbox number * @param aResult out the result of dialog */ virtual void ShowVmbxQueryDialog( const TVmbxType& aType, - const TVmbxQueryMode & aMode, TDes& aNumber, TInt& aResult )= 0; + TDes& aNumber, TInt& aResult )= 0; /** * Show define number in selection dialog * - * @since S60 v5.2 * @param in aType vmbx type * @param out aResult the result of dialog */ @@ -64,61 +60,23 @@ /** * Show call number in selection dialog + * Leave if aArray < 1 * - * @since S60 v5.2 * @param in aArray array of the defined voice mailbox entry - * @param in aIcons icons of the defined voice mailbox * @param out aParams the type TVoiceMailboxParams which should include * the service id and the type of seclected TVmbxType * @param out aResult the result user seclected */ - /*virtual void ShowCallSelectionDialogL( + virtual void ShowCallSelectionDialogL( const RPointerArray& aArray, - //CArrayPtr* aIcons, - TVoiceMailboxParams& aParams, TInt& aResult ) = 0;*/ - - /** - * Show confirmation dialog when save number to phone - * - * @since S60 v5.2 - */ - virtual void ShowSaveToPhoneNote() = 0; - - /** - * Show confirmation dialog when save number to SIM - * - * @since S60 v5.2 - */ - virtual void ShowSaveToSimNote() = 0; - - /** - * Show confirmation dialog when save video number - * - * @since S60 v5.2 - */ - virtual void ShowVideoSavedNote() = 0; + TVoiceMailboxParams& aParams, TInt& aResult ) = 0; /** * show an error dialog for invalid number * - * @since S60 v5.2 */ - virtual void ShowInvalidNumberNote() = 0; + virtual void ShowInvalidWarningNoteL() = 0; - /** - * show an error dialog for invalid number - * - * @since S60 v5.2 - */ - virtual void ShowInvalidWarningNote() = 0; - - /** - * Show save empty information note - * - * @since S60 v5.2 - * @param aType TVmbxType type - */ - virtual void ShowSaveEmptyNote( const TVmbxType& aType ) = 0; }; #endif // M_MVMBXUIHANDLER_H diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/mvmbxuiutilities.h --- a/vmbx/vmbxengine/inc/mvmbxuiutilities.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/mvmbxuiutilities.h Fri May 14 16:24:46 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" @@ -22,13 +22,13 @@ // INCLUDES #include +#include "voicemailboxdefsinternal.h" // CLASS DECLARATION /** * MVmbxUiUtilities * - * @since S60 v5.2 * @lib vmbxengine.lib * */ @@ -39,7 +39,6 @@ /** * Show mailbox query * - * @since S60 v5.2 * @param in aType TVmbxType type * @param in aMode TVmbxQueryMode mode * @param out aNumber the voice mailbox number @@ -52,7 +51,6 @@ * Show mailbox query dialog * Leaves if user cancel selected. * - * @since S60 v5.2 * @param aType in TVmbxType type * @param aMode Tin VmbxQueryMode mode * @param aNumber the voice mailbox number @@ -62,41 +60,25 @@ const TVmbxQueryMode & aMode, TDes& aNumber, TInt& aResult ) = 0; /** - * Show confirmation dialog when save number to phone - * - * @since S60 v5.2 - */ - virtual void ShowSaveToPhoneNote() = 0; - - /** - * Show confirmation dialog when save number to SIM + * Show informationd note * - * @since S60 v5.2 + * @param aType in TVmbxNoteType type */ - virtual void ShowSaveToSimNote() = 0; + virtual void ShowInformationdNoteL(const TVmbxNoteType aType) = 0; - /** - * Show confirmation dialog when save video number - * - * @since S60 v5.2 - */ - virtual void ShowVideoSavedNote() = 0; /** * Show define number in selection dialog - * Leaves if user cancel selected. * - * @since S60 v5.2 * @param in aType vmbx type * @param out aResult the result of dialog */ - virtual void ShowDefineSelectionDialogL( TVmbxType& aType, TInt& aResult ) = 0; + virtual void ShowDefineSelectionDialog( TVmbxType& aType, TInt& aResult ) = 0; /** * Show call number in selection dialog * Leaves if user cancel selected. * - * @since S60 v5.2 * @param in aArray array of the defined voice mailbox entry * @param in aIcons icons of the defined voice mailbox * @param out aParams the type TVoiceMailboxParams which should include @@ -105,46 +87,33 @@ */ virtual void ShowCallSelectionDialogL( const RPointerArray& aArray, - // CArrayPtr* aIcons, TVoiceMailboxParams& aParams, TInt& aResult ) = 0; /** * Tries to close all open dialogs * - * @since S60 v5.2 */ virtual void DismissDialogL() = 0; - /** - * To get mailbox entry value - * Leaves with Symbian OS error code - * - * @since S60 v5.2 - * @param aType TVmbxType type - */ - virtual void ShowSaveEmptyNoteL( const TVmbxType& aType ) = 0; /** * Get Mailbox type default image. * If get unseccessful, Leaves with Symbian OS error code * - * @since S60 v5.2 * @param aParams Mailbox type for which image is needed. * @return aImage New image. Ownership is transferred. */ //virtual CGulIcon* GetVmbxImageL( const TVoiceMailboxParams& aParams ) = 0; /** - * Show error dialog + * Show not allowed editing dialog * - * @since S60 v5.2 */ - virtual void ShowErrorDialogL() = 0; + virtual void ShowNotAllowedEditingDialogL() = 0; /** * Show Invalid Warning dialog. * - * @since S60 v5.2 */ virtual void ShowInvalidWarningDialogL() = 0; }; diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbshandler.h --- a/vmbx/vmbxengine/inc/vmbshandler.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbshandler.h Fri May 14 16:24:46 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-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" @@ -31,7 +31,6 @@ /** * CVmBSHandler declaration. * - * @since S60 3.2 */ NONSHARABLE_CLASS( CVmBSHandler ) : public CBase { @@ -57,7 +56,6 @@ /** * Get branded icon - * @since S60 3.2 * @param aBrandingId Brandind Id * @param aBrandedBitmap Bitmap for branded icon * @param aBrandedBitmapMask Mask to branded icon diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxcenrephandler.h --- a/vmbx/vmbxengine/inc/vmbxcenrephandler.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxcenrephandler.h Fri May 14 16:24:46 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" @@ -36,7 +36,6 @@ * Creates connection to central repository and handles data flow from/to it * * @lib vmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxCenRepHandler ) : public CBase, public MVmbxCenrepHandler @@ -58,7 +57,6 @@ /** * Get saved mailbox number * - * @since S60 v5.2 * @param aEntry saved vmbx number data * @return Symbian OS error code (KErrNone if successful) */ @@ -67,7 +65,6 @@ /** * Saves the mailbox number * - * @since S60 v5.2 * @param aEntry vmbx number data to save * @return Symbian OS error code (KErrNone if successful) */ @@ -76,7 +73,6 @@ /** * Fetches active store type * - * @since S60 v5.2 * @return aStoreType Active store in use */ TVmbxMemoryLocation StoreType(); @@ -84,7 +80,6 @@ /** * Returns state of the video support * - * @since S60 v5.2 * @return ETrue if supported */ TBool VideoSupported(); @@ -92,7 +87,6 @@ /** * Returns ETrue if CenRep setting Sim read only * - * @since S60 v5.2 * @return ETrue if CenRep setting Sim read only */ TBool IsSimReadOnly(); @@ -100,7 +94,6 @@ /** * Returns ETrue if number allowed to user change * - * @since S60 v5.2 * @return ETrue if from Sim */ TBool IsAllowedUserEdit(); @@ -121,7 +114,6 @@ /** * Resolves Voice CenRep key to be used * - * @since S60 v5.2 * @param in aLine current ALS lne * @return CenRep key */ @@ -130,7 +122,6 @@ /** * Resolves Video CenRep key to be used * - * @since S60 v5.2 * @param in aLine current ALS lne * @return CenRep key */ @@ -139,7 +130,6 @@ /** * Resolves CenRep key to be used * - * @since S60 v5.2 * @param aEntry entry type * @return CenRep key */ diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxcenrepobserver.h --- a/vmbx/vmbxengine/inc/vmbxcenrepobserver.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxcenrepobserver.h Fri May 14 16:24:46 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" @@ -35,7 +35,6 @@ /** * CVmbxCenRepObserver declaration. * - * @since S60 5.2 */ NONSHARABLE_CLASS( CVmbxCenRepObserver ) : public CBase, public MCenRepNotifyHandlerCallback @@ -45,7 +44,6 @@ /** * Two-phased constructor. - * @since S60 v5.2 * @param in aObserver observer notify the CenRep changed. * @return New instance of the object. Ownership transferred. */ @@ -53,7 +51,6 @@ /** * Two-phased constructor. - * @since S60 v5.2 * @param in aObserver observer notify the CenRep changed. * @return New instance of the object. Ownership transferred. */ @@ -76,7 +73,6 @@ /** * C++ default constructor. - * @since S60 v5.2 * @param in aObserver observer notify the CenRep changed. */ CVmbxCenRepObserver( MVmbxCenRepObserver& aObserver ); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxcsvideoengine.h --- a/vmbx/vmbxengine/inc/vmbxcsvideoengine.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxcsvideoengine.h Fri May 14 16:24:46 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" @@ -32,7 +32,6 @@ * Implements functionality specifig to video mailbox implementation * * @lib vmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxCsVideoEngine ) : public CVmbxEngineBase { @@ -56,7 +55,6 @@ /** * @see CVmbxEntryBase::GetL * - * @since S60 v5.2 * @param in aEntry a pointer reference of CVoiceMailboxEntry */ void GetL( CVoiceMailboxEntry*& aEntry ); @@ -64,7 +62,6 @@ /** * @see CVmbxEntryBase::SaveL * - * @since S60 v5.2 * @param aEntry Reference to CVoiceMailboxEntry */ void SaveL( const CVoiceMailboxEntry& aEntry ); @@ -72,17 +69,28 @@ /** * To save mailbox Provisioned entry value * - * @since S60 v5.2 * @param in aEntry Reference to CVoiceMailboxEntry */ void SaveProvisionedEntryL( const CVoiceMailboxEntry& aEntry ); + + /** + * @see CVoiceMailbox::CheckConfiguration + * + * @param aParams Specifies which mailbox capabilities, + * the caller wants to check. + * @param aFlags Use TVmbxFeatureCapabilityFlag values for this parameter. + * Specifies what features client wants to check. + + * @return True if feature(s) enabled. + */ + TBool CheckConfiguration( const TVoiceMailboxParams& aParams, + const TInt aFlags ); private: /** * C++ default constructor. * - * @since S60 v5.2 * @param in aProvider Reference to Ui Utilities */ CVmbxCsVideoEngine( MVmbxResourceProvider& aProvider ); @@ -90,7 +98,6 @@ /** * By default Symbian 2nd phase constructor is private. * - * @since S60 v5.2 */ void ConstructL(); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxcsvoiceengine.h --- a/vmbx/vmbxengine/inc/vmbxcsvoiceengine.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxcsvoiceengine.h Fri May 14 16:24:46 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" @@ -32,7 +32,6 @@ * Implements functionality specifig to voice mailbox entry * * @lib vmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxCsVoiceEngine ) : public CVmbxEngineBase { @@ -41,7 +40,6 @@ /** * Two-phased constructor - * @since S60 v5.2 * @param aProvider Reference to MVmbxResourceProvider. * @return New instance of the object. Ownership transferred. */ @@ -57,7 +55,6 @@ /** * @see CVmbxEntryBase::GetL * - * @since S60 v5.2 * @param aEntry Reference to CVoiceMailboxEntry */ void GetL( CVoiceMailboxEntry*& aEntry ); @@ -65,7 +62,6 @@ /** * @see CVmbxEntryBase::SaveL * - * @since S60 v5.2 * @param aEntry */ void SaveL( const CVoiceMailboxEntry& aEntry ); @@ -73,7 +69,6 @@ /** * To save mailbox Provisioned entry value * - * @since S60 v5.2 * @param aEntry Provisioned Entry data */ void SaveProvisionedEntryL( const CVoiceMailboxEntry& aEntry ); @@ -81,7 +76,6 @@ /** * @see CVoiceMailbox::CheckConfiguration * - * @since S60 v5.2 * @param aParams Specifies which mailbox capabilities, * the caller wants to check. * @param aFlags Use TVmbxFeatureCapabilityFlag values for this parameter. @@ -95,7 +89,6 @@ /** * Check Entry writable * - * @since S60 v5.2 * @param aParams params of Entry data * @return ETrue if entry is writable */ @@ -106,7 +99,6 @@ /** * C++ default constructor. * - * @since S60 v5.2 * @param aProvider Reference to MVmbxResourceProvider */ CVmbxCsVoiceEngine( MVmbxResourceProvider& aProvider ); @@ -114,14 +106,12 @@ /** * By default Symbian 2nd phase constructor is private. * - * @since S60 v5.2 */ void ConstructL(); /** * Queries where to save and then saves * - * @since S60 v5.2 * @param in aEntry Entry data */ void SaveEntryToPhoneL( const CVoiceMailboxEntry& aEntry ); @@ -129,7 +119,6 @@ /** * For saving to place that user selects * - * @since S60 v5.2 * @param in aEntry Entry data */ void SaveEntryToSimL( const CVoiceMailboxEntry& aEntry ); @@ -137,7 +126,6 @@ /** * Returns Sim writable or not * - * @since S60 v5.2 * @return ETrue if writable */ TBool IsSimWritable(); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxemergencycall.h --- a/vmbx/vmbxengine/inc/vmbxemergencycall.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxemergencycall.h Fri May 14 16:24:46 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" @@ -31,7 +31,6 @@ * CVmbxEmergencyCall declaration * * @lib vmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxEmergencyCall ) : public CBase, public MPhCltEmergencyCallObserver @@ -40,20 +39,17 @@ /** * Two-phased constructor - * @since S60 v5.2 */ static CVmbxEmergencyCall* NewL(); /** * Destructor. - * @since S60 v5.2 */ ~CVmbxEmergencyCall(); /** * Verifies that the given number is not an emergency number. * - * @since S60 v5.2 * @param aNumber Mailbox number * @return ETrue if emergency number */ @@ -64,13 +60,11 @@ /** * C++ default constructor. * - * @since S60 v5.2 */ CVmbxEmergencyCall(); /** * C++ Two-phased constructor. - * @since S60 v5.2 */ void ConstructL(); @@ -81,7 +75,6 @@ * * @see MPhCltExtPhoneObserver::HandleDialL(). * - * @since S60 v5.2 * @param aEntry Reference to store handler */ void HandleDialL( const TInt aStatus ); @@ -89,7 +82,6 @@ /** * Handling of emergency dial result. * - * @since S60 v5.2 * @param aEntry Reference to store handler */ void HandleEmergencyDialL( const TInt aStatus ); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxenginebase.h --- a/vmbx/vmbxengine/inc/vmbxenginebase.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxenginebase.h Fri May 14 16:24:46 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" @@ -33,7 +33,6 @@ * Implemets mailbox entry base class functionality * * @lib vmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxEngineBase ) : public CBase { @@ -56,7 +55,6 @@ * To get mailbox entry value * Leave if no number got or Symbian OS error code * - * @since S60 v5.2 * @param aEntry Entry data */ virtual void GetL( CVoiceMailboxEntry*& aEntry ) = 0; @@ -65,7 +63,6 @@ * To save mailbox entry value * Leave with Symbian OS error code * - * @since S60 v5.2 * @param aEntry Entry data */ virtual void SaveL( const CVoiceMailboxEntry& aEntry ) = 0; @@ -74,7 +71,6 @@ * To save mailbox Provisioned entry value * Leave with Symbian OS error code * - * @since S60 v5.2 * @param aEntry Provisioned Entry data */ virtual void SaveProvisionedEntryL( const CVoiceMailboxEntry& aEntry ) = 0; @@ -83,7 +79,6 @@ * Checks the Voice Mailbox how many VoIP service Ids * Leave with Symbian OS error code * - * @since S60 v5.2 * @param aProfileIds id of voip profile */ virtual void GetServiceIdsL( RIdArray& aProfileIds ); @@ -91,14 +86,12 @@ /** * see CVoiceMailbox::GetVmbxImage * - * @since S60 v5.2 */ //virtual CGulIcon* GetVmbxImageL( const TVoiceMailboxParams& aParams ); /** * Sets the Voice Mailbox current service id. * - * @since S60 v5.2 * @param aVmbxServiceId Voice Mailbox service id. */ virtual void SetCurrentServiceId( const TServiceId& aVmbxServiceId ); @@ -107,7 +100,6 @@ * Checks the Voice Mailbox configuration to find out if a features * are disabled or enabled. * - * @since S60 v5.2 * @param aParams Specifies which mailbox capabilities, * the caller wants to check. * @param aFlags Use TVmbxFeatureCapability values for this parameter. @@ -122,7 +114,6 @@ * Displays number query dialog * Leave if user don't select or Symbian OS error code * - * @since S60 v5.2 * @param aEntry CVoiceMailboxEntry */ virtual void QueryDefineNumberL( CVoiceMailboxEntry& aEntry ); @@ -131,7 +122,6 @@ * Displays number query dialog * Leave if user don't select or Symbian OS error code * - * @since S60 v5.2 * @param aEntry Entry data */ virtual void QueryChangeNumberL( CVoiceMailboxEntry& aEntry ); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxenginefactory.h --- a/vmbx/vmbxengine/inc/vmbxenginefactory.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxenginefactory.h Fri May 14 16:24:46 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" @@ -32,7 +32,6 @@ * CVmbxEngineFactory declaration * * @lib vmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxEngineFactory ) : public CBase { @@ -41,7 +40,6 @@ /** * Two-phased constructor - * @since S60 v5.2 * @param aProvider Reference to MVmbxResourceProvider */ static CVmbxEngineFactory* NewL( MVmbxResourceProvider& aProvider ); @@ -56,7 +54,6 @@ /** * Creates instance of the mailbox entry * - * @since S60 v5.2 * @param aEngine ownership is transferred * @param aType mailbox type */ @@ -66,7 +63,6 @@ /** * C++ default constructor. - * @since S60 v5.2 * @param aProvider Reference to MVmbxResourceProvider */ CVmbxEngineFactory( MVmbxResourceProvider& aProvider ); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxetelconnection.h --- a/vmbx/vmbxengine/inc/vmbxetelconnection.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxetelconnection.h Fri May 14 16:24:46 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" @@ -34,7 +34,6 @@ /** * Creates connection to RTelServer and opens RMobilePhone * -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxETelConnection ): public CBase { @@ -57,7 +56,6 @@ /** * Returns a reference to the ETel RTelServer * - * @since S60 v5.2 * @return a reference to the ETel RTelServer */ RTelServer& TelServer(); @@ -65,7 +63,6 @@ /** * Returns a reference to the ETel RMobilePhone * - * @since S60 v5.2 * @return a reference to the ETel RMobilePhone */ RMobilePhone& Phone(); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxlogger.h --- a/vmbx/vmbxengine/inc/vmbxlogger.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxlogger.h Fri May 14 16:24:46 2010 +0300 @@ -39,12 +39,12 @@ * 2 = RDebug ***************************/ -#define VMB_LOGGING_METHOD 1 // UREL BUILD +#define VMB_LOGGING_METHOD 0 // UREL BUILD #else #ifdef __WINS__ -#define VMB_LOGGING_METHOD 2 // UDEB BUILD, WINS +#define VMB_LOGGING_METHOD 1 // UDEB BUILD, WINS #else #define VMB_LOGGING_METHOD 2 // UDEB BUILD, HW #endif // __WINS__ diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxobserver.h --- a/vmbx/vmbxengine/inc/vmbxobserver.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxobserver.h Fri May 14 16:24:46 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" @@ -42,7 +42,6 @@ * Mailbox observer * * @lib vmbxengine.lib - * @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxObserver ) : public CBase, public MVmbxSimStoreObserver, @@ -55,14 +54,12 @@ /** * Two-phased constructor. * @param in aProvider Reference to MVmbxResourceProvider - * @since S60 v5.2 */ static CVmbxObserver* NewL( MVmbxResourceProvider& aProvider ); /** * Two-phased constructor. * @param in aProvider Reference to MVmbxResourceProvider - * @since S60 v5.2 */ static CVmbxObserver* NewLC( MVmbxResourceProvider& aProvider ); @@ -76,7 +73,6 @@ /** * Observe vmbx change. * @param in aObserver Reference to MVmbxChangeObserver - * @since S60 v5.2 */ void SetVmbxObserver( MVmbxChangeObserver& aObserver ); @@ -84,20 +80,17 @@ /** * From MVmbxSimStoreObserver::HandleSimStoreChanged - * @since S60 v5.2 */ void HandleSimStoreChanged(); /** * From MVmbxSatRefreshObserver::HandleSatRefresh - * @since S60 v5.2 */ void HandleSatRefresh(); /** * From MVmbxCenRepObserver::HandleCenRepChange * @param in aId the changed key Id - * @since S60 v5.2 */ void HandleCenRepChange( TVmbxCenRepKey aId ); @@ -106,7 +99,6 @@ /** * C++ default constructor. * @param in aProvider Reference to MVmbxResourceProvider - * @since S60 v5.2 */ CVmbxObserver( MVmbxResourceProvider& aProvider ); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxpbkstore.h --- a/vmbx/vmbxengine/inc/vmbxpbkstore.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxpbkstore.h Fri May 14 16:24:46 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" @@ -38,7 +38,6 @@ * Creates connection to Sim phonebook and handles data flow from/to it * * @lib vmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxPbkStore ) : public CActive { @@ -60,14 +59,12 @@ /** * Sim write support * - * @since S60 v5.2 * @return ETrue if writable */ TBool IsWritable(); /** * sim PhoneBook Type - * @since S60 v5.2 * @return TVmbxSimPhonebookType */ TVmbxSimPhonebookType PhoneBookType(); @@ -75,7 +72,6 @@ /** * Writes an entry into ICC-based phonebook. * - * @since S60 v5.2 * @param in aEntry Reference of CVoiceMailboxEntry * @return KErrNone if succesful, * Other system wide errors. @@ -85,14 +81,12 @@ /** * Retrieves hanlder of RMobilePhoneBookStore * - * @since S60 v5.2 * @retuns hanlder of RMobilePhoneBookStore */ RMobilePhoneBookStore& PhonebookStore(); /** * Retrieves mailbox number from Sim - * @since S60 v5.2 * @param out aEntry a data type CVoiceMailboxEntry */ void GetL( CVoiceMailboxEntry& aEntry ); @@ -119,21 +113,18 @@ /** * Reads an entry from the ICC-based phonebook. * - * @since S60 v5.2 * @param out aEntry Reference of CVoiceMailboxEntry **/ void SimReadL( CVoiceMailboxEntry& aEntry ); /** * Opens VMBX phonebook - * @since S60 v5.2 * @retuns KErrNone if succesful **/ TInt OpenVmbxPhonebook(); /** * Opens MBDN phonebook - * @since S60 v5.2 * @retuns KErrNone if succesful **/ TInt OpenMbdnPhonebook(); @@ -142,7 +133,6 @@ * Get Phonebook Info * @param out aInfo information from RPhonebookStore * - * @since S60 v5.2 **/ TInt GetVmbxInfo( RMobilePhoneBookStore::TMobilePhoneBookInfoV1& aInfo ); @@ -150,7 +140,6 @@ * Retrieves the Mailbox numbers identifier information * @param in aAlsLine curent als line * @param out aInfo information from RPhonebookStore - * @since S60 v5.2 * @retuns KErrNone if succesful **/ TInt GetMbdnInfo( const TVmbxAlsLineType aAlsLine, @@ -160,7 +149,6 @@ /** * Reads "ParseDataL" from phonebook data from Sim * - * @since S60 v5.2 * @param out aEntry entry of CVoiceMailboxEntry * @param in aPbData */ @@ -169,7 +157,6 @@ /** * Reads "new-entry-tag" from phonebook data from Sim * - * @since S60 v5.2 * @param in aPbkBuffer Phonebook data buffer * @retuns KErrNone if succesful */ @@ -178,7 +165,6 @@ /** * Reads tags from buffer retrieved from sim * - * @since S60 v5.2 * @param in aPbkBuffer Phonebook data buffer * @param out aEntry Reference of CVoiceMailboxEntry */ @@ -186,19 +172,24 @@ CVoiceMailboxEntry& aEntry ); /** - * Checks if sim-card is USim + * Checks sim file existing * - * @since S60 v5.2 - * @return ETrue if USim + * @retuns ETrue if file exists **/ - TBool SimFileExistsAndReadAccess(); + TBool IsSimFileExisting( const TVmbxSimPhonebookType aType ); + + /** + * Sim write acces support + * + * @return ETrue if writable access + */ + TBool IsWriteAccess(); protected: /** * C++ constructor. * - * @since S60 v5.2 */ CVmbxPbkStore(); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxqtuihandler.h --- a/vmbx/vmbxengine/inc/vmbxqtuihandler.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxqtuihandler.h Fri May 14 16:24:46 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" @@ -22,74 +22,108 @@ // INCLUDES #include +#include #include +#include "voicemailboxdefsinternal.h" + // FORWARD DECLARATION +class CVoiceMailboxEntry; +class TVoiceMailboxParams; +class HbInputDialog; - // CLASS DECLARATION /** * Dialog manager * * @lib vmbxengine.lib -* @since S60 v5.2 */ -NONSHARABLE_CLASS( VmbxQtUiHandler ): public QObject +class VmbxQtUiHandler : public QObject { - + Q_OBJECT + public: // Constructors and destructor /** * C++ default constructor. * - * @since S60 v5.2 */ VmbxQtUiHandler(QObject* parent = 0 ); /** * Destructor. */ - ~VmbxQtUiHandler(); + virtual ~VmbxQtUiHandler(); + + /** + * Initialize, load qt translator. + */ + void init(); /** * Show mailbox query dialog * - * @since S60 v5.2 * @param aType in TVmbxType type - * @param aMode Tin VmbxQueryMode mode * @param aNumber the voice mailbox number * @param aResult out the result of dialog */ void showVmbxQueryDialog(const TVmbxType& aType, - const TVmbxQueryMode& aMode, - QString& aNumber, int& aResult); + QString& aNumber, int& aResult); /** * Show define number in selection dialog * Leaves if user cancel selected. * - * @since S60 v5.2 * @param in aType vmbx type * @param out aResult the result of dialog */ void showDefineSelectionDialog(TVmbxType& aType, int& aResult); /** + * Show call number in selection dialog + * + * @param in entryList array of the defined voice mailbox entry + * @param out params the type TVoiceMailboxParams which should include + * the service id and the type of seclected TVmbxType + * @param out result the result user seclected + */ + void showCallSelectionDialog( + const QList entryList, + TVoiceMailboxParams ¶ms, int &result ); + + /** * Show voice mailbox information number * - * @since S60 v5.2 * @param aNoteType in TVmbxType type */ - void showInformationNote(int aNoteType); + void showInformationNote(const TVmbxNoteType aType); + +private slots: + /** + * update Ok button status according to user input string + * + * @param aInput User input string + */ + void updatePrimaryAction(const QString &aInput); + +private: /** - * Show save empty number note - * - * @since S60 v5.2 - * @param aType in TVmbxType type + * Translator vmbx localization + */ + QTranslator iTranslator; + + /** + * Translator common localization */ - void showSaveEmptyNote(const TVmbxType& aType); + QTranslator iCommonTranslator; + + /** + * Query and Define mailbox dialog. Own + */ + HbInputDialog *iQueryDialog; + }; #endif // VMBXQTUIHANDLER_H diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxsatrefreshobserver.h --- a/vmbx/vmbxengine/inc/vmbxsatrefreshobserver.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxsatrefreshobserver.h Fri May 14 16:24:46 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" @@ -38,7 +38,6 @@ * * @lib vmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxSatRefreshObserver ) : public CBase, public MSatRefreshObserver diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxsimhandler.h --- a/vmbx/vmbxengine/inc/vmbxsimhandler.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxsimhandler.h Fri May 14 16:24:46 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" @@ -36,7 +36,6 @@ * Creates connection to Sim phonebook and handles data flow from/to it * * @lib vmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxSimHandler ) : public CBase { @@ -57,14 +56,12 @@ /** * Retrieves mailbox number from Sim - * @since S60 v5.2 * @param in aEntry a data type of CVoiceMailboxEntry */ void GetL( CVoiceMailboxEntry& aEntry ); /** * Saves vmbx number to Sim - * @since S60 v5.2 * @param in aEntry a data type of CVoiceMailboxEntry * @return Symbian OS error code (KErrNone if successful) */ @@ -72,7 +69,6 @@ /** * Returns sim write access info - * @since S60 v5.2 * @return ETrue if Sim is writable **/ TBool IsWritable(); @@ -80,21 +76,18 @@ /** * @see RMobilePhoneStore::NotifyStoreEvent * - * @since S60 v5.2 */ void NotifyStoreEvent( TRequestStatus& aStatus, TUint32& aEvent, TInt& aIndex ) const; /** * Retrieves Sim PhoneBook Type - * @since S60 v5.2 * @return TVmbxSimPhonebookType */ TVmbxSimPhonebookType PhoneBookType(); /** * CancelAsyncRequest - * @since S60 v5.2 * @param aReqToCancel Entry data */ void CancelAsyncRequest( TInt aReqToCancel ) const; diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxsimstoreobserver.h --- a/vmbx/vmbxengine/inc/vmbxsimstoreobserver.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxsimstoreobserver.h Fri May 14 16:24:46 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" @@ -33,7 +33,6 @@ * DECLARATION CVmbxSimStoreObserver * * @lib vmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxSimStoreObserver ) : public CActive { diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxuihandler.h --- a/vmbx/vmbxengine/inc/vmbxuihandler.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxuihandler.h Fri May 14 16:24:46 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" @@ -31,7 +31,6 @@ /** * * @lib qvmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxUiHandler ):public CBase, public MVmbxUiHandler @@ -40,7 +39,6 @@ public: // Constructors and destructor /** * Two-phased constructor - * @since S60 v5.2 */ static CVmbxUiHandler* NewL(); @@ -55,19 +53,16 @@ * Show mailbox query dialog * Leaves if user cancel selected. * - * @since S60 v5.2 * @param aType in TVmbxType type - * @param aMode Tin VmbxQueryMode mode * @param aNumber the voice mailbox number * @param aResult out the result of dialog */ virtual void ShowVmbxQueryDialog( const TVmbxType& aType, - const TVmbxQueryMode & aMode, TDes& aNumber, TInt& aResult ); + TDes& aNumber, TInt& aResult ); /** * Show define number in selection dialog * - * @since S60 v5.2 * @param in aType vmbx type * @param out aResult the result of dialog */ @@ -75,74 +70,41 @@ /** * Show call number in selection dialog + * Leave if aArray < 1 * - * @since S60 v5.2 * @param in aArray array of the defined voice mailbox entry * @param in aIcons icons of the defined voice mailbox * @param out aParams the type TVoiceMailboxParams which should include * the service id and the type of seclected TVmbxType * @param out aResult the result user seclected */ - /*virtual void ShowCallSelectionDialogL( + virtual void ShowCallSelectionDialogL( const RPointerArray& aArray, //CArrayPtr* aIcons, - TVoiceMailboxParams& aParams, TInt& aResult ) = 0;*/ - - /** - * Show confirmation dialog when save number to phone - * - * @since S60 v5.2 - */ - virtual void ShowSaveToPhoneNote(); + TVoiceMailboxParams& aParams, TInt& aResult ); /** - * Show confirmation dialog when save number to SIM + * Show informationd note * - * @since S60 v5.2 + * @param aType in TVmbxNoteType type */ - virtual void ShowSaveToSimNote(); - - /** - * Show confirmation dialog when save video number - * - * @since S60 v5.2 - */ - virtual void ShowVideoSavedNote(); + virtual void ShowInformationdNoteL(const TVmbxNoteType aType); /** * show an error dialog for invalid number * - * @since S60 v5.2 */ - virtual void ShowInvalidNumberNote(); - - /** - * show an error dialog for invalid number - * - * @since S60 v5.2 - */ - virtual void ShowInvalidWarningNote(); - - /** - * To get mailbox entry value - * Leaves if Symbian OS error code - * - * @since S60 v5.2 - * @param aType TVmbxType type - */ - virtual void ShowSaveEmptyNote( const TVmbxType& aType ); + virtual void ShowInvalidWarningNoteL(); private: /** C++ default constructor. * - * @since S60 v5.2 */ CVmbxUiHandler(); /** * C++ Two-phased constructor. - * @since S60 v5.2 */ void ConstructL(); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxuiutilities.h --- a/vmbx/vmbxengine/inc/vmbxuiutilities.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxuiutilities.h Fri May 14 16:24:46 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" @@ -44,13 +44,11 @@ /** * Two-phased constructor - * @since S60 v5.2 */ static CVmbxUiUtilities* NewL(); /** * Destructor. - * @since S60 v5.2 */ ~CVmbxUiUtilities(); @@ -70,7 +68,6 @@ * Show mailbox query dialog * Leaves if user cancel selected. * - * @since S60 v5.2 * @param aType in TVmbxType type * @param aMode Tin VmbxQueryMode mode * @param aNumber the voice mailbox number @@ -80,41 +77,26 @@ const TVmbxQueryMode & aMode, TDes& aNumber, TInt& aResult ); /** - * Show confirmation dialog when save number to phone - * - * @since S60 v5.2 - */ - void ShowSaveToPhoneNote(); - - /** - * Show confirmation dialog when save number to SIM + * Show informationd note * - * @since S60 v5.2 + * @param aType in TVmbxNoteType type */ - void ShowSaveToSimNote(); - - /** - * Show confirmation dialog when save video number - * - * @since S60 v5.2 - */ - void ShowVideoSavedNote(); + void ShowInformationdNoteL(const TVmbxNoteType aType); + /** * Show define number in selection dialog * Leaves if user cancel selected. * - * @since S60 v5.2 * @param in aType vmbx type * @param out aResult the result of dialog */ - void ShowDefineSelectionDialogL( TVmbxType& aType, TInt& aResult ); + void ShowDefineSelectionDialog( TVmbxType& aType, TInt& aResult ); /** * Show call number in selection dialog * Leaves if user cancel selected. * - * @since S60 v5.2 * @param in aArray array of the defined voice mailbox entry * @param in aIcons icons of the defined voice mailbox * @param out aParams the type TVoiceMailboxParams which should include @@ -129,40 +111,28 @@ /** * Tries to close all open dialogs * - * @since S60 v5.2 */ void DismissDialogL(); - /** - * To get mailbox entry value - * Leaves if Symbian OS error code - * - * @since S60 v5.2 - * @param aType TVmbxType type - */ - void ShowSaveEmptyNoteL( const TVmbxType& aType ); /** * Get Mailbox type default image. * If get unseccessful, Leaves with Symbian OS error code * - * @since S60 v5.2 * @param aParams Mailbox type for which image is needed. * @return aImage New image. Ownership is transferred. */ //CGulIcon* GetVmbxImageL( const TVoiceMailboxParams& aParams ); /** - * Show error dialog + * Show not allowed editing dialog * - * @since S60 v5.2 */ - void ShowErrorDialogL(); + void ShowNotAllowedEditingDialogL(); /** * Show invalid or warning dialog * - * @since S60 v5.2 */ void ShowInvalidWarningDialogL(); @@ -176,7 +146,6 @@ /** * C++ Two-phased constructor. - * @since S60 v5.2 */ void ConstructL(); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxutilities.h --- a/vmbx/vmbxengine/inc/vmbxutilities.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxutilities.h Fri May 14 16:24:46 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" @@ -32,7 +32,6 @@ * Implementation of the auxiliary methods for the VMBX engine classes * * @lib vmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( VmbxUtilities ) { @@ -45,7 +44,6 @@ * - '+' is only allowed as the first character * - The phone number part must be between 3-40 digits * - * @since S60 v5.2 * @param in aNumber Vmbx number * @return ETrue if valid number */ @@ -55,7 +53,6 @@ /** * Returns active ALS * - * @since S60 v5.2 * @return Active ALS line */ static TVmbxAlsLineType AlsLine(); @@ -63,7 +60,6 @@ /** * Returns state of the video support * - * @since S60 v5.2 * @return ETrue if Video supported */ static TBool VideoSupported(); @@ -71,7 +67,6 @@ /** * Returns state of the VoIP Support * - * @since S60 v5.2 * @return ETrue if VoIP Supported */ static TBool VoIPSupported(); @@ -79,7 +74,6 @@ /** * Verifies that the given number is not an emergency number. * - * @since S60 v5.2 * @param in aNumber Mailbox number * @return ETrue if emergency number */ @@ -88,18 +82,8 @@ private: /** - * Verifies that the given string is a valid SS. - * - * @since S60 v5.2 - * @param in&out aLexer string to be validate - * @return ETrue if supplementary service code validate - */ - static TBool ValidateSsNum( TLex& aLexer ); - - /** * Verifies that the given string is a valid Tel number. * - * @since S60 v5.2 * @param in aLexer string to be validate * @return ETrue if tel number validate */ @@ -108,7 +92,6 @@ /** * Verifies that the given string is a valid DTMF number. * - * @since S60 v5.2 * @param in aLexer string to be validate * @return ETrue if DTMf validate */ @@ -116,4 +99,4 @@ }; -#endif // VMBXUTILITIES_H +#endif // VMBXUTILITIES_H diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/vmbxvoipengine.h --- a/vmbx/vmbxengine/inc/vmbxvoipengine.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/vmbxvoipengine.h Fri May 14 16:24:46 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" @@ -38,7 +38,6 @@ * Implements functionality specifig to voip mailbox entry * * @lib vmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVmbxVoIpEngine ) : public CVmbxEngineBase { @@ -61,7 +60,6 @@ /** * - * @since S60 v5.2 * @see CVmbxEntryBase::GetL * @param aEntry Reference to store handler */ @@ -69,7 +67,6 @@ /** * - * @since S60 v5.2 * @see CVmbxEntryBase::SaveL * @param aEntry Reference to CVoiceMailboxEntry */ @@ -78,7 +75,6 @@ /** * To save mailbox Provisioned entry value * - * @since S60 v5.2 * @param aEntry Provisioned Entry data */ void SaveProvisionedEntryL( const CVoiceMailboxEntry& aEntry ); @@ -86,7 +82,6 @@ /** * see CVmbxEntryBase::CheckConfiguration * - * @since S60 v5.2 */ TBool CheckConfiguration( const TVoiceMailboxParams& aParams, const TInt aFlags ); @@ -94,7 +89,6 @@ /** * Displays number query dialog * - * @since S60 v5.2 * @param aEntry CVoiceMailboxEntry */ void QueryDefineNumberL( CVoiceMailboxEntry& aEntry ); @@ -102,7 +96,6 @@ /** * Displays number query dialog * - * @since S60 v5.2 * @param aEntry Entry data */ void QueryChangeNumberL( CVoiceMailboxEntry& aEntry ); @@ -112,7 +105,6 @@ /** * C++ default constructor. * - * @since S60 v5.2 * @param aProvider Reference to Ui Utilities */ CVmbxVoIpEngine( MVmbxResourceProvider& aProvider ); @@ -120,13 +112,11 @@ /** * By default Symbian 2nd phase constructor is private. * - * @since S60 v5.2 */ void ConstructL(); /** * Check from SPSettings if there are VoIP profiles - * @since S60 3.2.3 * @param None * @return ETrue if VoIP profiles were found, otherwise EFalse */ @@ -135,7 +125,6 @@ /** * Checks the Voice Mailbox how many VoIP service Ids * - * @since S60 v5.2 * @param aProfileIds * @return KErrNone if get service Ids successfully. */ @@ -143,7 +132,6 @@ /** * Get branded icon - * @since S60 v5.2 * @param in aBrandingId Brandind Id * @param out aBrandedBitmap Bitmap for branded icon * @param out aBrandedBitmapMask Mask to branded icon @@ -154,13 +142,11 @@ /** * see CVoiceMailbox::GetVmbxImage * - * @since S60 v5.2 */ //CGulIcon* GetVmbxImageL( const TVoiceMailboxParams& aParams ); /** * Get brand id - * @since S60 v5.2 * @param in aServiceId Used Service * @param out aBrandId On completion, contains Brand Id */ @@ -168,7 +154,6 @@ /** * Get service ids - * @since S60 v5.2 * @param in&out aServiceInfo On completion contains service ids */ TInt GetServiceInfo( TVmbxServiceInfo& aServiceInfo ); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/voicemailboxdefsinternal.h --- a/vmbx/vmbxengine/inc/voicemailboxdefsinternal.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/voicemailboxdefsinternal.h Fri May 14 16:24:46 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" @@ -23,6 +23,7 @@ // CONSTANTS const TInt KVmLbxItemsArraySize = 3; +const TInt KVmbxPhoneCharMaxLength = 48; /**Sim card voice mailbox file type*/ enum TVmbxSimPhonebookType @@ -123,10 +124,10 @@ EInvalidNumber, ESavedToPhoneMemory, ESavedToSimMemory, - ENumberEmpty, - EVoiceNumberEmpty, - EVideoNumberEmpty, - EVideoNumberSaved + EVideoNumberSaved, + EDefineVoiceNumber, + EDefineVideoNumber, + ENotAllowUserEditing }; #endif // C_VOICEMAILBOXDEFSINTERNAL_H diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/inc/voicemailboximpl.h --- a/vmbx/vmbxengine/inc/voicemailboximpl.h Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/inc/voicemailboximpl.h Fri May 14 16:24:46 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" @@ -41,7 +41,6 @@ * Implemets mailbox entry base class functionality * * @lib vmbxengine.lib -* @since S60 v5.2 */ NONSHARABLE_CLASS( CVoiceMailboxImpl ) : public CBase, public MVmbxChangeObserver, @@ -70,7 +69,6 @@ /** * see CVoiceMailbox::GetStoredEntry * - * @since S60 v5.2 */ TInt GetStoredEntry( const TVoiceMailboxParams& aParams, CVoiceMailboxEntry*& aEntry ) const; @@ -78,14 +76,12 @@ /** * see CVoiceMailbox::SaveEntry * - * @since S60 v5.2 */ TInt SaveEntry( const CVoiceMailboxEntry& aEntry ); /** * see CVoiceMailbox::QueryNewEntry * - * @since S60 v5.2 */ TInt QueryNewEntry( const TVoiceMailboxParams& aParams, CVoiceMailboxEntry*& aEntry ); @@ -93,7 +89,6 @@ /** * see CVoiceMailbox::QueryChangeEntry * - * @since S60 v5.2 */ TInt QueryChangeEntry( const TVoiceMailboxParams& aParams, CVoiceMailboxEntry*& aEntry); @@ -101,14 +96,12 @@ /** * see CVoiceMailbox::QueryVmbxType * - * @since S60 v5.2 */ TInt QueryVmbxType( TVoiceMailboxParams& aParams ); /** * see CVoiceMailbox::NotifyVmbxNumberChangeL * - * @since S60 v5.2 */ void NotifyVmbxNumberChangeL( MVoiceMailboxObserver& aObserver, const TBool aNotifyOnActiveLineOnly ); @@ -116,7 +109,6 @@ /** * see CVoiceMailbox::NotifyVmbxNumberChangeCancel * - * @since S60 v5.2 */ void NotifyVmbxNumberChangeCancel(); @@ -131,21 +123,18 @@ /** * see CVoiceMailbox::GetServiceIds * - * @since S60 v5.2 */ TInt GetServiceIds( RIdArray& aProfileIds ); /** * see CVoiceMailbox::GetVmbxImage * - * @since S60 v5.2 */ //CGulIcon* GetVmbxImage( const TVoiceMailboxParams& aParams ); /** * see CVoiceMailbox::GetVmbxImages * - * @since S60 v5.2 */ //CArrayPtr* GetVmbxImages( // RArray& aParams ); @@ -153,7 +142,6 @@ /** * see CVoiceMailbox::SaveProvisionedEntry * - * @since S60 v5.2 */ TInt SaveProvisionedEntry( const CVoiceMailboxEntry& aEntry ); @@ -163,21 +151,18 @@ /** * see MVmbxChangeObserver::SatRefreshL * - * @since S60 v5.2 */ void SatRefreshL(); /** * see MVmbxChangeObserver::CenRepChangedL * - * @since S60 v5.2 */ void CenRepChangedL( TVmbxCenRepKey aId ); /** * see MVmbxChangeObserver::SimStoreChangedL * - * @since S60 v5.2 */ void SimStoreChangedL(); @@ -186,7 +171,6 @@ /** * Get Handler of VmbxUiUtilities * - * @since S60 v5.2 * @return Refereance of MVmbxUiUtilities */ MVmbxUiUtilities& VmbxUiUtilities(); @@ -194,7 +178,6 @@ /** * Get Handler of VmbxCenrepHandler * - * @since S60 v5.2 * @return Refereance of MVmbxCenrepHandler */ MVmbxCenrepHandler& VmbxCenRepHandler(); @@ -211,7 +194,6 @@ /** * ConstructL * - * @since S60 v5.2 */ void ConstructL(); @@ -221,7 +203,6 @@ * - KErrArgument when illegal argument * - Other system wide errors. * - * @since S60 v5.2 * @param in Params Service id and type of the mailbox for which * a number/address should be defined. * @param out aEntry If successful, a new result container is @@ -248,7 +229,6 @@ * for the specified mailbox. * - Other system wide errors. * - * @since S60 v5.2 * @param in aParams Service id and type of the mailbox for which * a number/address should be defined. * @param out aEntry If successful, a new result container is @@ -268,7 +248,6 @@ * In that case unsupported arguments are ignored. * This method may display related UI notes or queries. * - * @since S60 v5.2 * @param in aEntry The vmbx entry to save. */ void SaveEntryL( const CVoiceMailboxEntry& aEntry ); @@ -291,7 +270,6 @@ * for the specified mailbox. * - Other system wide errors. * - * @since S60 v5.2 * @param in aParams Service id and type of the mailbox. * @param out aEntry If successful, a new result container is */ @@ -308,7 +286,6 @@ * type given. * - Other system wide errors. * - * @since S60 v5.2 * @param out aParams If successful, * contains selected mailbox info. */ @@ -318,7 +295,6 @@ * Get defined entries via an array * Leave with symbian OS error code except KErrNotFound and KErrSupported. * - * @since S60 v5.2 * @param out aArray array contains the defined entries */ void GetDefinedEntriesL( RPointerArray& aArray ); @@ -327,7 +303,6 @@ * Get defined voice entry via an array * Leave with symbian OS error code except KErrSupported. * - * @since S60 v5.2 * @param out aArray array contains the defined entries */ void GetDefinedVoiceEntryL( @@ -337,7 +312,6 @@ * Get defined video entry via an array * Leave with symbian OS error code except KErrNotFound and KErrSupported. * - * @since S60 v5.2 * @param out ay array contains the defined entries */ void GetDefinedVideoEntryL( @@ -347,7 +321,6 @@ * Get defined voip entries via an array * Leave with symbian OS error code except KErrNotFound and KErrSupported. * - * @since S60 v5.2 * @param out aArray array contains the defined entries */ void GetDefinedVoipEntriesL( @@ -357,7 +330,6 @@ * Checks the Voice Mailbox how many VoIP service Ids * Leave with symbian OS error code * - * @since S60 v5.2 * @param out aProfileIds * @return KErrNone if get service Ids successfully. */ @@ -369,7 +341,6 @@ * Image can be displayed e.g. in a selection list. * Leave with symbian OS error code. * - * @since S60 v5.2 * @param in aParams Mailbox service id and type for which image is needed. * @return aImage New image. Ownership is transferred. */ @@ -387,7 +358,6 @@ * NULL array pointer is returned if not a signle icon was retrieved * successfully. * - * @since S60 v5.2 * @param in aParams Mailboxes (id and type) for which an image is needed. * @return aImage Icons for the specified mailboxes. * Index of an image in the returned array corresponds to the @@ -403,7 +373,6 @@ * Notify entry changed * Leave with symbian OS error code. * - * @since S60 v5.2 * @param in aType Type of TVmbxType */ void NotifyChangedL( TVmbxType aType); @@ -419,11 +388,18 @@ * Some mailbox types may not support saving all arguments. * In that case unsupported arguments are ignored. * - * @since S60 v5.2 * @param in aEntry The provisioned vmbx entry to save. */ void SaveProvisionedEntryL( const CVoiceMailboxEntry& aEntry ); + /** + * Check number provisioned or not + * Leave if systrm wide errors + * + * @param in aParams params of TVoiceMailboxParams + */ + void CheckNumberProvisionedL( const TVoiceMailboxParams& aParams ); + protected: // data /** diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/rom/vmbxresources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/rom/vmbxresources.iby Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,24 @@ +/* +* 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: +* +*/ +#ifndef __VMBXRESOURCES_IBY__ +#define __VMBXRESOURCES_IBY__ + +#include + +data=DATAZ_\QT_TRANSLATIONS_DIR\vmbx.qm QT_TRANSLATIONS_DIR\vmbx.qm + +#endif \ No newline at end of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/src/dialogwaiter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/src/dialogwaiter.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,34 @@ +/* +* 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: dialog waiter +* +* +*/ + +#include "dialogwaiter.h" + +HbAction* DialogWaiter::wait() +{ + mLoop.exec(); + HbAction* a=mResult; + mResult=0; + return a; +} + +void DialogWaiter::done(HbAction* result) +{ + mResult=result; + mLoop.quit(); +} + diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/src/vmbxcenrephandler.cpp --- a/vmbx/vmbxengine/src/vmbxcenrephandler.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/src/vmbxcenrephandler.cpp Fri May 14 16:24:46 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" @@ -241,6 +241,9 @@ VMBLOGSTRING2( "VMBX: CVmbxCenRepHandler::StoreType: result = %d", result ); + VMBLOGSTRING2( "VMBX: CVmbxCenRepHandler::StoreType: location = %d<=", + location ); + if ( KErrNone == result && EVmbxSimMemory == location ) { memoryLocation = EVmbxSimMemory; diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/src/vmbxcsvideoengine.cpp --- a/vmbx/vmbxengine/src/vmbxcsvideoengine.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/src/vmbxcsvideoengine.cpp Fri May 14 16:24:46 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" @@ -134,19 +134,7 @@ // show note if ( KErrNone == result ) { - if ( vmbxNumber.Length() ) - { - VMBLOGSTRING( "VMBX: CVmbxCsVideoEngine::\ - Save Number Length" ); - iProvider.VmbxUiUtilities().ShowVideoSavedNote(); - } - else - { - VMBLOGSTRING( "VMBX: CVmbxCsVideoEngine::\ - Save Number Length zero" ); - iProvider.VmbxUiUtilities().ShowSaveEmptyNoteL( - aEntry.VoiceMailboxType() ); - } + iProvider.VmbxUiUtilities().ShowInformationdNoteL( EVideoNumberSaved ); } VMBLOGSTRING( "VMBX: CVmbxCsVideoEngine::SaveL <=" ); @@ -165,4 +153,29 @@ VMBLOGSTRING( "VMBX: CVmbxCsVideoEngine::SaveProvisionedEntryL <=" ); } +// ---------------------------------------------------------------------------- +// CVmbxCsVideoEngine::CheckConfiguration() +// ---------------------------------------------------------------------------- +// +TBool CVmbxCsVideoEngine::CheckConfiguration( + const TVoiceMailboxParams& aParams, const TInt aFlags ) + { + VMBLOGSTRING( "VMBX: CVmbxCsVideoEngine::CheckConfiguration =>" ); + TBool conf( EFalse ); + if ( EVmbxChangeNbrAllowedOnUi & aFlags ) + { + conf = iProvider.VmbxCenRepHandler().IsAllowedUserEdit(); + } + else if ( EVmbxVideoMailboxSupported & aFlags ) + { + conf = ETrue; + } + else + { + conf = CVmbxEngineBase::CheckConfiguration(aParams, aFlags); + } + VMBLOGSTRING2( "VMBX: CVmbxCsVideoEngine::CheckConfiguration: conf%I <=", + conf ); + return conf; + } // End of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/src/vmbxcsvoiceengine.cpp --- a/vmbx/vmbxengine/src/vmbxcsvoiceengine.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/src/vmbxcsvoiceengine.cpp Fri May 14 16:24:46 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" @@ -113,7 +113,7 @@ vmbxEntry->SetVmbxAlsLineType( VmbxUtilities::AlsLine() ); vmbxEntry->SetVoiceMailboxType( EVmbxVoice ); - vmbxEntry->SetServiceId( KVmbxServiceVideo ); + vmbxEntry->SetServiceId( KVmbxServiceVoice ); // get store type from CenRep TVmbxMemoryLocation storeType = iProvider.VmbxCenRepHandler().StoreType(); @@ -242,7 +242,7 @@ VMBLOGSTRING( "VMBX: CVmbxCsVoiceEngine::CheckConfiguration =>" ); TBool configuration( EFalse ); // check thr property whether allow user to edit number - if ( EVmbxChangeNbrNotAllowedOnUi & aFlags ) + if ( EVmbxChangeNbrAllowedOnUi & aFlags ) { configuration = iProvider.VmbxCenRepHandler().IsAllowedUserEdit(); if ( configuration ) @@ -250,6 +250,10 @@ configuration = IsWritable( aParams ); } } + else + { + configuration = CVmbxEngineBase::CheckConfiguration(aParams, aFlags); + } VMBLOGSTRING2( "VMBX: CVmbxCsVoiceEngine::CheckConfiguration: conf%I <=", configuration ); return configuration; @@ -269,22 +273,7 @@ if ( KErrNone == result ) { - // observer to change vmbx number - TPtrC vmbxNumber( KNullDesC ); - aEntry.GetVmbxNumber( vmbxNumber ); - if ( vmbxNumber.Length() ) - { - VMBLOGSTRING( "VMBX: CVmbxCsVoiceEngine::\ - SaveEntryToPhone Number Length" ) - iProvider.VmbxUiUtilities().ShowSaveToPhoneNote(); - } - else - { - VMBLOGSTRING( "VMBX: CVmbxCsVoiceEngine::\ - SaveEntryToPhone Number Length zero" ) - iProvider.VmbxUiUtilities().ShowSaveEmptyNoteL( - aEntry.VoiceMailboxType() ); - } + iProvider.VmbxUiUtilities().ShowInformationdNoteL( ESavedToPhoneMemory ); } VMBLOGSTRING2( "VMBX: CVmbxCsVoiceEngine::SaveEntryToPhoneL: result=%I <=", result ); @@ -314,19 +303,7 @@ result = iSimHandler->Save( aEntry ); if ( KErrNone == result ) { - if ( ptrNumber.Length() ) - { - VMBLOGSTRING( "VMBX: CVmbxCsVoiceEngine::\ - SaveEntryToSim Number Length" ) - iProvider.VmbxUiUtilities().ShowSaveToSimNote(); - } - else - { - VMBLOGSTRING( "VMBX: CVmbxCsVoiceEngine::\ - SaveEntryToPhone Number Length zero" ) - TRAP_IGNORE( iProvider.VmbxUiUtilities(). - ShowSaveEmptyNoteL( aEntry.VoiceMailboxType() ) ); - } + iProvider.VmbxUiUtilities().ShowInformationdNoteL( ESavedToSimMemory ); } } @@ -344,8 +321,8 @@ { VMBLOGSTRING( "VMBX: CVmbxCsVoiceEngine::IsSimWritable: =>" ); TBool result( EFalse ); - if ( iSimHandler && iSimHandler->IsWritable() - && !( iProvider.VmbxCenRepHandler().IsSimReadOnly() ) ) + if ( !( iProvider.VmbxCenRepHandler().IsSimReadOnly() ) + && iSimHandler && iSimHandler->IsWritable() ) { result = ETrue; } diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/src/vmbxenginebase.cpp --- a/vmbx/vmbxengine/src/vmbxenginebase.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/src/vmbxenginebase.cpp Fri May 14 16:24:46 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" @@ -86,7 +86,7 @@ } // ---------------------------------------------------------------------------- -// CVmbxEngineBase::CheckConfiguration() +// CVmbxCsVideoEngine::CheckConfiguration() // ---------------------------------------------------------------------------- // TBool CVmbxEngineBase::CheckConfiguration( @@ -94,9 +94,17 @@ { VMBLOGSTRING( "VMBX: CVmbxEngineBase::CheckConfiguration =>" ); TBool conf( EFalse ); - if ( EVmbxChangeNbrNotAllowedOnUi & aFlags ) + if ( EVmbxChangeNbrAllowedOnUi & aFlags ) + { + // NOT suppported as default + } + else if ( EVmbxVideoMailboxSupported & aFlags ) { - conf = iProvider.VmbxCenRepHandler().IsAllowedUserEdit(); + // NOT suppported as default + } + else + { + // default } VMBLOGSTRING2( "VMBX: CVmbxEngineBase::CheckConfiguration: conf%I <=", conf ); @@ -134,7 +142,7 @@ TInt err( KErrNone ); TPtrC vmbxNumber( KNullDesC ); err = aEntry.GetVmbxNumber( vmbxNumber ); - + if ( KErrNone == err ) { HBufC* changeNumber = HBufC::NewLC( KVmbxMaxNumberLength ); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/src/vmbxpbkstore.cpp --- a/vmbx/vmbxengine/src/vmbxpbkstore.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/src/vmbxpbkstore.cpp Fri May 14 16:24:46 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" @@ -24,9 +24,11 @@ #include "vmbxutilities.h" #include "vmbxetelconnection.h" #include "vmbxlogger.h" - #include "vmbxpbkstore.h" +#include +#include +#include //CONSTANTS // Amount of retries to be performed. const TInt KVmbxPhonebookBufferSize( 150 ); @@ -87,33 +89,42 @@ void CVmbxPbkStore::ConstructL() { VMBLOGSTRING( "VMBX: CVmbxPbkStore::ConstructL =>" ); + TInt value( 0 ); + TInt res = RProperty::Get( KPSUidStartup, KPSSimStatus, value ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::ConstructL res = %d", res ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::ConstructL value = %d", value ); + if ( (ESimUsable != value && ESimReadable != value ) || KErrNone != res ) + { + // Sim card not ready to use + User::Leave( KErrNotReady ); + } // Open tel server and phone iETelConnection = CVmbxETelConnection::NewL(); iWait = new( ELeave ) CActiveSchedulerWait; TVmbxAlsLineType alsLine = VmbxUtilities::AlsLine(); - // Supported ALS line + // Supported ALS line,ALS line on if ( EVmbxAlsLineDefault != alsLine ) { - // open 6f17 file + // open 6f17 file ,if not found the file, leave User::LeaveIfError( OpenVmbxPhonebook() ); } - // Not supported ALS line + // Not supported ALS line,ALS line off else { - // USIM exist - if ( SimFileExistsAndReadAccess() ) + // Open 6fc7 file, if not found, open 6f17 file + TInt result = OpenMbdnPhonebook(); + if ( KErrPathNotFound == result ) { - // Open 6fc7 file - User::LeaveIfError( OpenMbdnPhonebook() ); + //close 6fc7 and open 6f17 file + iPhoneBook.Close(); + // open 6f17 file ,if not found the file, leave + User::LeaveIfError( OpenVmbxPhonebook() ); } - // USIM not exist, open 6f17 file else { - VMBLOGSTRING( "VMBX: CVmbxPbkStore::ConstructL: no mbdn file\ - then open 6f17 file" ); - User::LeaveIfError( OpenVmbxPhonebook() ); + User::LeaveIfError( result ); } } VMBLOGSTRING( "VMBX: CVmbxPbkStore::ConstructL <=" ); @@ -142,7 +153,6 @@ VMBLOGSTRING2( "VMBX: CVmbxPbkStore::PhonebookInfo: \ SIM Phonebook info read, status: %I", result ); } - VMBLOGSTRING( "VMBX: CVmbxPbkStore::GetVmbxInfo <=" ); return result; } @@ -156,16 +166,41 @@ { VMBLOGSTRING( "VMBX: CVmbxPbkStore::IsWritable =>" ); TBool result( EFalse ); - RMobilePhoneBookStore::TMobilePhoneBookInfoV1 info; - TInt temp = GetVmbxInfo( info ); - if( KErrNone == temp ) + if ( IsWriteAccess() ) { - result = ( info.iCaps & - RMobilePhoneBookStore::KCapsWriteAccess ? 1 : 0 ); - + // Get current sim entry, then write the same entry + // to sim if read successufully + CVoiceMailboxEntry* simEntry(NULL); + TRAPD( newErr, simEntry = CVoiceMailboxEntry::NewL() ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::IsWritable newErr = %d ", + newErr ); + if ( KErrNone == newErr ) + { + // get als line info + simEntry->SetVmbxAlsLineType( VmbxUtilities::AlsLine() ); + simEntry->SetVoiceMailboxType( EVmbxVoice ); + simEntry->SetServiceId( KVmbxServiceVoice ); + TRAPD( err, SimReadL( *simEntry ) ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore:: IsWritable read %I <=", err ); + if ( KErrNotFound == err ) + { + simEntry->SetVmbxNumber( KNullDesC ); + } + if ( KErrNone == err || KErrNotFound == err ) + { + err = Write( *simEntry ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore:: IsWritable write %I <=", + err ); + // If write successfully, means writable + if ( KErrNone == err ) + { + result = ETrue; + } + } + } + delete simEntry; + simEntry = NULL; } - VMBLOGSTRING2( "VMBX: CVmbxPbkStore:: IsWritable: info.iCaps %I", - info.iCaps ); VMBLOGSTRING2( "VMBX: CVmbxPbkStore:: IsWritable result %I <=", result ); return result; } @@ -205,39 +240,43 @@ { pbkBuffer->Set( &pbData ); TInt activeAlsLine = aEntry.VmbxAlsLineType(); + // Add index, const value for vmbx write. + int entryIndex = 1; // New entry result = pbkBuffer->AddNewEntryTag(); if ( KErrNone == result ) { - // Add index // Type of index is TUint16 in Multimode ETel and TInt in old ETel. result = pbkBuffer->PutTagAndValue( - RMobilePhoneBookStore::ETagPBAdnIndex, (TUint16)activeAlsLine ); - } - // Add name if it existed on SIM card - // Type of ETagPBText is TDes16 - if ( KErrNone == result && iAlphaStringFromSIM ) - { - result = pbkBuffer->PutTagAndValue( - RMobilePhoneBookStore::ETagPBText, *iAlphaStringFromSIM ); - // Add number,Type of ETagPBNumber is TDes16 + RMobilePhoneBookStore::ETagPBAdnIndex, (TUint16)entryIndex ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::Write: ETagPBAdnIndex \ + result=%I", result ); + // Add name if it existed on SIM card,Type of ETagPBText is TDes16 + if ( iAlphaStringFromSIM ) + { + result = pbkBuffer->PutTagAndValue( + RMobilePhoneBookStore::ETagPBText, *iAlphaStringFromSIM ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::Write: ETagPBText\ + result=%I", result ); + } + TPtrC vmbxNumber( KNullDesC ); + result = aEntry.GetVmbxNumber( vmbxNumber ); if ( KErrNone == result ) { - TPtrC vmbxNumber( KNullDesC ); - result = aEntry.GetVmbxNumber( vmbxNumber ); - if ( KErrNone == result ) - { - result = pbkBuffer->PutTagAndValue( - RMobilePhoneBookStore::ETagPBNumber, vmbxNumber ); - } + // Add number,Type of ETagPBNumber is TDes16 + result = pbkBuffer->PutTagAndValue( + RMobilePhoneBookStore::ETagPBNumber, vmbxNumber ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::Write: ETagPBNumber\ + result=%I", result ); } } + if ( KErrNone == result ) { if ( iPhoneBookType == EMBDNPhoneBook ) { RMobilePhone::TMobilePhoneVoicemailIdsV3 mbdnInfo; - result = GetMbdnInfo( EVmbxAlsLine1, mbdnInfo ); + result = GetMbdnInfo( VmbxUtilities::AlsLine(), mbdnInfo ); if ( KErrNone == result ) { @@ -260,7 +299,7 @@ if( !IsActive() && !iWait->IsStarted() ) { // write vmbx number to 6f17 file - iPhoneBook.Write( iStatus, pbData, activeAlsLine ); + iPhoneBook.Write( iStatus, pbData, entryIndex ); iAsynType = EVmbxSimEntryWrite; // Wait for asynchronous call to finish SetActive(); @@ -278,7 +317,7 @@ // --------------------------------------------------------------------------- // CVmbxPbkStore::PhonebookStore -// Return Phonebook +// Return RMobilePhoneBookStore // --------------------------------------------------------------------------- RMobilePhoneBookStore& CVmbxPbkStore::PhonebookStore() { @@ -323,10 +362,12 @@ result = iStatus.Int(); } - if ( EVmbxAlsLineDefault == aAlsLine && KErrNone == result ) + if ( EVmbxAlsLineDefault == aAlsLine ) { aInfo.iVoice = EVmbxAlsLine1; } + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::GetMbdnInfo: aInfo.iVoice %I", + aInfo.iVoice ); } VMBLOGSTRING2( "VMBX: CVmbxPbkStore::GetMbdnInfo: result %I<=", result ); @@ -341,16 +382,21 @@ TInt CVmbxPbkStore::OpenMbdnPhonebook() { VMBLOGSTRING( "VMBX: CVmbxPbkStore::OpenMbdnPhonebook =>" ); - // try to open mbdn-type phonebook + //Open mbdn-type phonebook , Currently the file not exist, thr return + // value also KErrNone TInt result = iPhoneBook.Open( iETelConnection->Phone(), KETelIccMbdnPhoneBook ); VMBLOGSTRING2( "VMBX: CVmbxPbkStore::OpenMbdnPhonebook :\ - MBDN opening result = %I", result ); - if ( KErrNone == result ) + MBDN opening result = %d", result ); + + TBool res = IsSimFileExisting( EMBDNPhoneBook ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::OpenMbdnPhonebook :\ + MBDN reading res = %d", res ); + if ( !res ) { - iPhoneBookType = EMBDNPhoneBook; + result = KErrPathNotFound; } - VMBLOGSTRING( "VMBX: CVmbxPbkStore::OpenMbdnPhonebook <=" ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::OpenMbdnPhonebook res = %d<=", result ); return result; } @@ -362,15 +408,20 @@ TInt CVmbxPbkStore::OpenVmbxPhonebook() { VMBLOGSTRING( "VMBX: CVmbxPbkStore::OpenVmbxPhonebook =>" ); - // try to open vmbx-type phonebook + //Open vmbx-type phonebook , Currently the file not exist, thr return + // value also KErrNone TInt result = iPhoneBook.Open( iETelConnection->Phone(), KETelIccVoiceMailBox ); - if ( KErrNone == result ) + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::OpenVmbxPhonebook :\ + Vmbx opening result = %d", result ); + TBool res = IsSimFileExisting( EVMBXPhoneBook ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::OpenVmbxPhonebook :\ + Vmbx reading res = %d", res ); + if ( !res ) { - iPhoneBookType = EVMBXPhoneBook; + result = KErrPathNotFound; } - VMBLOGSTRING2( "Vmbx phonebook opening result = %I ", result ); - VMBLOGSTRING( "VMBX: CVmbxPbkStore::OpenVmbxPhonebook <=" ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::OpenVmbxPhonebook result=%d <=", result ); return result; } @@ -404,7 +455,7 @@ User::LeaveIfError( OpenVmbxPhonebook() ); // read vmbx number from 6f17 file SimReadL( aEntry ); - } + } } else { @@ -445,7 +496,7 @@ // Wait for asynchronous call to finish SetActive(); iWait->Start(); - } + } } } else @@ -454,10 +505,16 @@ // line2 number so line is used to fetch VMBLOGSTRING( "start VMBX PhoneBook read" ); TInt activeAlsLine = aEntry.VmbxAlsLineType(); + if ( EVmbxAlsLineDefault == activeAlsLine ) + { + activeAlsLine = EVmbxAlsLine1; + } if( !IsActive() && !iWait->IsStarted() ) { result = KErrNone; // read vmbx number from 6f17 file + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::SimReadLactiveAlsLine = %I", + activeAlsLine ); iPhoneBook.Read( iStatus, activeAlsLine, numEntries, pbData ); iAsynType = EVmbxSimEntryRead; // Wait for asynchronous call to finish @@ -484,7 +541,7 @@ // --------------------------------------------------------------------------- // CVmbxPbkStore::ParseDataL -// read vmbx number from sim +// // --------------------------------------------------------------------------- // void CVmbxPbkStore::ParseDataL( CVoiceMailboxEntry& aEntry, TDes8& aPbData ) @@ -641,34 +698,8 @@ } // --------------------------------------------------------------------------- -// CVmbxPbkStore::IsUsimSupport -// Checks if USim card in the phone -// --------------------------------------------------------------------------- -TBool CVmbxPbkStore::SimFileExistsAndReadAccess() - { - VMBLOGSTRING( "VMBX: CVmbxPbkStore::SimFileExistsAndReadAccess =>" ); - TBool result( EFalse ); - - TUint32 capability; - TInt err = iETelConnection->Phone().GetIccAccessCaps( capability ); - VMBLOGSTRING2( "VMBX: CVmbxSimHandler::SimFileExistsAndReadAccess:\ - Err = %I", err); - - if ( err == KErrNone && - // Phone has a USIM and it currently supports USIM access by clients. - // the current sim card is 3G - capability & RMobilePhone::KCapsUSimAccessSupported ) - { - result = ETrue; - } - VMBLOGSTRING2( "VMBX: CVmbxPbkStore::SimFileExistsAndReadAccess \ - return = %d <=", result ); - return result; - } - -// --------------------------------------------------------------------------- // CVmbxPbkStore::RunL -// read vmbx number from sim +// // --------------------------------------------------------------------------- // void CVmbxPbkStore::RunL() @@ -686,7 +717,7 @@ // --------------------------------------------------------------------------- // CVmbxPbkStore::DoCancel -// read vmbx number from sim +// // --------------------------------------------------------------------------- // void CVmbxPbkStore::DoCancel() @@ -724,16 +755,16 @@ iETelConnection->Phone().CancelAsyncRequest( EMobilePhoneStoreRead ); break; - } + } case EVmbxSimEntryWrite: { VMBLOGSTRING( "VMBX: CVmbxPbkStore::DoCancel : EVmbxSimEntryWrite" ); iETelConnection->Phone().CancelAsyncRequest( EMobilePhoneStoreWrite ); break; - } + } default: - break; + break; } VMBLOGSTRING( "VMBX: CVmbxPbkStore::DoCancel <=" ); @@ -741,13 +772,73 @@ // --------------------------------------------------------------------------- // CVmbxPbkStore::RunError -// read vmbx number from sim +// // --------------------------------------------------------------------------- // TInt CVmbxPbkStore::RunError(TInt aError) { + // Avoid warning + aError = aError; VMBLOGSTRING2( "VMBX: CVmbxPbkStore::RunError: %I", aError ); return KErrNone; } +// --------------------------------------------------------------------------- +// CVmbxPbkStore::IsSimFileExisting +// check sim file existing or not +// --------------------------------------------------------------------------- +// +TBool CVmbxPbkStore::IsSimFileExisting( const TVmbxSimPhonebookType aType ) + { + VMBLOGSTRING( "VMBX: CVmbxPbkStore::IsSimFileExisting =>" ); + iPhoneBookType = aType; + TBool result( ETrue ); + CVoiceMailboxEntry* entry(NULL); + TRAPD( err, entry = CVoiceMailboxEntry::NewL() ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::IsSimFileExisting err = %d ", + err ); + if ( KErrNone != err ) + { + result = EFalse; + } + else + { + entry->SetVoiceMailboxType( EVmbxVoice ); + TRAPD( err, SimReadL( *entry ) ); + // KErrPathNotFound means when current file path not found. + if ( KErrPathNotFound == err ) + { + result = EFalse; + } + } + delete entry; + entry = NULL; + VMBLOGSTRING2( "VMBX: CVmbxPbkStore::IsSimFileExisting result = %d <= ", + result ); + return result; + } + +// --------------------------------------------------------------------------- +// CVmbxPbkStore::IsWriteAccess +// Sim write access support +// --------------------------------------------------------------------------- +// +TBool CVmbxPbkStore::IsWriteAccess() + { + VMBLOGSTRING( "VMBX: CVmbxPbkStore::IsWriteAccess =>" ); + TBool result( EFalse ); + RMobilePhoneBookStore::TMobilePhoneBookInfoV1 info; + TInt temp = GetVmbxInfo( info ); + if( KErrNone == temp ) + { + result = ( info.iCaps & + RMobilePhoneBookStore::KCapsWriteAccess ? ETrue : EFalse ); + + } + VMBLOGSTRING2( "VMBX: CVmbxPbkStore:: IsWriteAccess: info.iCaps %X", + info.iCaps ); + VMBLOGSTRING2( "VMBX: CVmbxPbkStore:: IsWriteAccess result %I <=", result ); + return result; + } + //End of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/src/vmbxqtuihandler.cpp --- a/vmbx/vmbxengine/src/vmbxqtuihandler.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/src/vmbxqtuihandler.cpp Fri May 14 16:24:46 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,19 +17,23 @@ */ // qt -#include #include -#include +#include +#include -#include +#include #include #include -#include #include -#include #include #include +#include +#include #include +#include + +#include +#include #include "vmbxqtuihandler.h" #include "voicemailboxdefsinternal.h" @@ -42,9 +46,11 @@ // (Constructor). // ---------------------------------------------------------------------------- // -VmbxQtUiHandler::VmbxQtUiHandler(QObject* parent): QObject(parent) +VmbxQtUiHandler::VmbxQtUiHandler(QObject* parent): QObject(parent), + iTranslator(0), iCommonTranslator(0), iQueryDialog(NULL) { VMBLOGSTRING("VmbxQtUiHandler::VmbxQtUiHandler") + init(); VMBLOGSTRING("VmbxQtUiHandler::VmbxQtUiHandler Exit") } @@ -56,88 +62,95 @@ VmbxQtUiHandler::~VmbxQtUiHandler() { VMBLOGSTRING("VmbxQtUiHandler::~VmbxQtUiHandler") + if ( iQueryDialog ) { + delete iQueryDialog; + iQueryDialog = NULL; + VMBLOGSTRING("VmbxQtUiHandler::~VmbxQtUiHandler delete iQueryDialog") + } VMBLOGSTRING("VmbxQtUiHandler::~VmbxQtUiHandler Exit") } // ---------------------------------------------------------------------------- +// VmbxQtUiHandler::Init +// +// ---------------------------------------------------------------------------- +// +void VmbxQtUiHandler::init() +{ + VMBLOGSTRING("VmbxQtUiHandler::init") + QString lang = QLocale::system().name(); + VMBLOGSTRING2("VmbxQtUiHandler::init lang type %S", + lang.utf16()) + QString path = "Z:/resource/qt/translations/"; + bool translatorLoaded = iTranslator.load("vmbx_"+lang, path); + VMBLOGSTRING2("VmbxQtUiHandler::init load vmbx result %d", + translatorLoaded) + // Install vmbx localization + if (translatorLoaded && qApp) { + VMBLOGSTRING("VmbxQtUiHandler::init qApp !") + qApp->installTranslator(&iTranslator); + } + // Install common localization, for select type "cancel". + bool loaded = iCommonTranslator.load( "common_"+lang, path); + VMBLOGSTRING2("VmbxQtUiHandler::init load common result %d", + loaded) + if (loaded && qApp) { + VMBLOGSTRING("VmbxQtUiHandler::init qApp !!") + qApp->installTranslator(&iCommonTranslator); + } + VMBLOGSTRING("VmbxQtUiHandler::init Exit") +} + +// ---------------------------------------------------------------------------- // VmbxQtUiHandler::ShowVmbxQueryDialog // (show query dialog). // ---------------------------------------------------------------------------- // void VmbxQtUiHandler::showVmbxQueryDialog(const TVmbxType& aType, - const TVmbxQueryMode& aMode, QString& aNumber, int& aResult) { VMBLOGSTRING("VmbxQtUiHandler::showVmbxQueryDialog") - - HbDialog *displayPopup = new HbDialog(); - displayPopup->setDismissPolicy(HbDialog ::NoDismiss); - displayPopup->setTimeout(HbDialog ::NoTimeout); - - displayPopup->setModal(true); QString header; if (EVmbxVoice == aType) { - if (EVmbxDefineMode == aMode) { - header = tr("Define voice mailbox:"); - } else { - header = tr("Change voice mailbox:"); - } + header = hbTrId("txt_vmbx_title_voice_mailbox_number"); + } else if (EVmbxVideo == aType) { + // type of EVmbxVideo + header = hbTrId("txt_vmbx_title_video_mailbox_number"); } else { - // type of EVmbxVideo - if (EVmbxDefineMode == aMode) { - header = tr("Define video mailbox:"); - } else { - header = tr("Change video mailbox:"); - } + aResult = KErrCancel; + VMBLOGSTRING( "VmbxQtUiHandler::showVmbxQueryDialog type error" ) + return; } - // Set the label as heading widget - displayPopup->setHeadingWidget(new HbLabel(header)); - // Set the HbLineEdit as Content widget - // Define parameters for text box - HbLineEdit *lineEdit = new HbLineEdit(); - lineEdit->setText( aNumber ); // default text - //lineEdit->setMaximumRows( 3 ); // just a magic number - HbEditorInterface inputMode(lineEdit); // Enables VKB - inputMode.setInputMode( HbInputModeNumeric ); - // Limit charachter set - HbValidator *val = new HbValidator; - QRegExp r; - r.setPattern("[0123456789*#+]{0,255}"); // define what characters can be entered - val->setMasterValidator(new QRegExpValidator(r,0)); - lineEdit->setValidator( val ); + iQueryDialog = new HbInputDialog(); + iQueryDialog->setDismissPolicy(HbDialog::NoDismiss); + iQueryDialog->setTimeout(HbDialog::NoTimeout); - displayPopup->setContentWidget( lineEdit ); // ownership moved + iQueryDialog->setModal(true); + // Set heading content + iQueryDialog->setPromptText(header); - HbAction* okAction = new HbAction(tr("Ok")); - // Sets the "OK"-action/button - displayPopup->setPrimaryAction(okAction); - bool ret = connect(okAction, SIGNAL(triggered()), - displayPopup, SLOT(close())); - VMBLOGSTRING2( "VmbxQtUiHandler::showVmbxQueryDialog:connect ok %d", - ret ) - // Sets the "Back"-action/button - HbAction* cancelAction = new HbAction(tr("Cancel")); - displayPopup->setSecondaryAction(cancelAction); - ret = connect(okAction, SIGNAL(triggered()), - displayPopup, SLOT(close())); - VMBLOGSTRING2( "VmbxQtUiHandler::showVmbxQueryDialog:connect cancel %d", - ret ) - VMBLOGSTRING( "VmbxQtUiHandler::ShowVmbxQueryDialog to show" ) - HbAction* result = displayPopup->exec(); - if( okAction == result ) { + // Set HbLineEdit Content + iQueryDialog->lineEdit()->setText(aNumber); // default text + iQueryDialog->lineEdit()->setFocus(); // Enable the VKB + iQueryDialog->lineEdit()->setMaxLength(KVmbxPhoneCharMaxLength); + HbEditorInterface inputMode(iQueryDialog->lineEdit()); + inputMode.setFilter(HbPhoneNumberFilter::instance()); + bool ret = connect(iQueryDialog->lineEdit(), SIGNAL(textChanged(QString)), + this, SLOT(updatePrimaryAction(QString))); + VMBLOGSTRING2( "VmbxQtUiHandler::showVmbxQueryDialog connect textChanged %d", ret) + DialogWaiter waiter; + iQueryDialog->open(&waiter, SLOT(done(HbAction *))); + HbAction *result = waiter.wait(); + if (result == iQueryDialog->primaryAction()) { VMBLOGSTRING( "VmbxQtUiHandler::showVmbxQueryDialog select OK" ) // asign OK KEY value aResult = KErrNone; - aNumber = lineEdit->text(); - VMBLOGSTRING2( "VmbxQtUiHandler::showVmbxQueryDialog number = %s", - aNumber.utf16() ) + aNumber = iQueryDialog->lineEdit()->text(); } else { aResult = KErrCancel; } - delete val; - val = 0; - delete displayPopup; - displayPopup = 0; + delete iQueryDialog; + iQueryDialog = 0; VMBLOGSTRING2("VmbxQtUiHandler::showVmbxQueryDialog aResult = %d", aResult) VMBLOGSTRING("VmbxQtUiHandler::showVmbxQueryDialog Exit") } @@ -148,7 +161,7 @@ // ---------------------------------------------------------------------------- // void VmbxQtUiHandler::showDefineSelectionDialog( - TVmbxType& aType, int& aResult) + TVmbxType &aType, int &aResult) { VMBLOGSTRING("VmbxQtUiHandler::showDefineSelectionDialog") HbDialog* defineListDialog = new HbDialog(); @@ -156,31 +169,33 @@ defineListDialog->setTimeout(HbDialog::NoTimeout); defineListDialog->setModal(true); - // Set heading widget - defineListDialog->setHeadingWidget(new HbLabel(tr("Define number:"))); + // Set heading widget,"Define number:" + defineListDialog->setHeadingWidget(new HbLabel( + hbTrId("txt_vmbx_title_select_mailbox"))); // Create a define list HbListWidget *list = new HbListWidget(); - list->addItem(tr("Voice Mailbox")); - list->addItem(tr("Video Mailbox")); + //Voice Mailbox + list->addItem(hbTrId("txt_vmbx_list_voice_mailbox")); + //Video Mailbox + list->addItem(hbTrId("txt_vmbx_list_video_mailbox")); // Set content widget defineListDialog->setContentWidget(list); - HbAction* okAction = new HbAction(tr("Ok")); - // Sets the "OK"-action/button - defineListDialog->setPrimaryAction(okAction); - // Sets the "Back"-action/button - HbAction* cancelAction = new HbAction(tr("Cancel")); + // Sets the "Cancel"-action/button + HbAction *cancelAction = new HbAction(hbTrId( + "txt_common_button_cancel")); defineListDialog->setSecondaryAction(cancelAction); - connect(list, SIGNAL(activated(HbListWidgetItem*)), + connect(list, SIGNAL(activated(HbListWidgetItem *)), defineListDialog, SLOT(close())); - HbAction* result = defineListDialog->exec(); - + DialogWaiter waiter; + defineListDialog->open(&waiter, SLOT(done(HbAction *))); + HbAction *result = waiter.wait(); if (cancelAction == result){ aType = EVmbxNone; aResult = KErrCancel; } else { - // OK or single click items + // Select one item aResult = KErrNone; int currentItem = list->row(list->currentItem()); VMBLOGSTRING2("VmbxQtUiHandler::showDefineSelectionDialog:\ @@ -198,75 +213,179 @@ defineListDialog = 0; VMBLOGSTRING("VmbxQtUiHandler::showDefineSelectionDialog Exit") } + // ---------------------------------------------------------------------------- -// VmbxQtUiHandler::ShowInformationNote +// VmbxQtUiHandler::showCallSelectionDialog +// (show call selection dialog). +// ---------------------------------------------------------------------------- +// +void VmbxQtUiHandler::showCallSelectionDialog( + const QList entryList, + TVoiceMailboxParams ¶ms, int &result ) +{ + VMBLOGSTRING("VmbxQtUiHandler::showCallSelectionDialog") + int count = entryList.count(); + VMBLOGSTRING("VmbxQtUiHandler::showCallSelectionDialog new before") + HbDialog* callListDialog = new HbDialog(); + VMBLOGSTRING("VmbxQtUiHandler::showCallSelectionDialog new after") + callListDialog->setDismissPolicy(HbDialog::NoDismiss); + callListDialog->setTimeout(HbDialog::NoTimeout); + callListDialog->setModal(true); + // Set heading widget,"select mailbox" + callListDialog->setHeadingWidget(new HbLabel( + hbTrId("txt_vmbx_title_select_mailbox"))); + // Create a call list + HbListWidget *list = new HbListWidget(); + // Set content widget + callListDialog->setContentWidget(list); + + QList paramsList; + TVoiceMailboxParams entryParams; + for (int i = 0; i < count; i++) { + TVmbxType vmbxType = entryList[i]->VoiceMailboxType(); + entryParams.iType = vmbxType; + entryParams.iServiceId = entryList[i]->ServiceId(); + paramsList.append(entryParams); + switch (vmbxType) { + case EVmbxVoice: + { + list->addItem(hbTrId("txt_vmbx_list_voice_mailbox")); + break; + } + case EVmbxVideo: + { + list->addItem(hbTrId("txt_vmbx_list_video_mailbox")); + break; + } + case EVmbxVoip: + { + // Get name + TPtrC vmbxName( KNullDesC ); + int voipRes = entryList[i]->GetVmbxName(vmbxName); + VMBLOGSTRING2( "VmbxQtUiHandler::showCallSelectionDialogL\ + : voipRes=%I", voipRes ); + if (KErrNone == voipRes) { + QString voipName; + if (vmbxName.Length() > 0) { + voipName=QString::fromUtf16( + vmbxName.Ptr(), vmbxName.Length()); + // add voip item + list->addItem(voipName); + } + } + break; + } + default: + break; + } + } + // Sets the "Cancel"-action/button + HbAction *cancelAction = new HbAction(hbTrId( + "txt_common_button_cancel_toolbar")); + callListDialog->setSecondaryAction(cancelAction); + + connect(list, SIGNAL(activated(HbListWidgetItem *)), + callListDialog, SLOT(close())); + DialogWaiter waiter; + callListDialog->open(&waiter, SLOT(done(HbAction *))); + HbAction *action = waiter.wait(); + if (cancelAction == action){ + params.iType = EVmbxNone; + params.iServiceId = KVmbxServiceIdNone; + result = KErrCancel; + } else { + // Select one item + result = KErrNone; + int currentItem = list->row(list->currentItem()); + VMBLOGSTRING2("VmbxQtUiHandler::showCallSelectionDialog:\ + currentItem %d", currentItem) + params.iType = paramsList[currentItem].iType; + params.iServiceId = paramsList[currentItem].iServiceId; + } + VMBLOGSTRING2("VmbxQtUiHandler::showCallSelectionDialog: params.iType %d", + params.iType) + VMBLOGSTRING2("VmbxQtUiHandler::showCallSelectionDialog: result%d", + result) + delete callListDialog; + callListDialog = 0; + VMBLOGSTRING("VmbxQtUiHandler::showCallSelectionDialog Exit") +} + +// ---------------------------------------------------------------------------- +// VmbxQtUiHandler::showInformationNote // (show information note). // ---------------------------------------------------------------------------- // -void VmbxQtUiHandler::showInformationNote(int aNoteType) +void VmbxQtUiHandler::showInformationNote(const TVmbxNoteType aType) { VMBLOGSTRING("VmbxQtUiHandler::showInformationNote") QString noteText; - QString iconName; - VMBLOGSTRING2("VmbxQtUiHandler::~showInformationNote type =%d", aNoteType) - switch (aNoteType) { + VMBLOGSTRING2("VmbxQtUiHandler::showInformationNote type =%d", aType) + switch (aType) { case EInvalidNumber: - noteText = tr("Invalid phone number."); - iconName = "note_error"; + // Need to comfirm with ui designer + noteText = hbTrId("Invalid phone number."); + break; + case ENotAllowUserEditing: + //User not allow to edit. + noteText = hbTrId("Number not provisioned"); break; case ESavedToPhoneMemory: - noteText = tr("Voice mailbox number saved to Phone memory."); - iconName = "note_info"; - break; - case ESavedToSimMemory: - noteText = tr("Voice mailbox number saved to Sim card."); - iconName = "note_info"; + case ESavedToSimMemory: + //Voice mailbox number saved to Phone memory. + noteText = hbTrId("txt_vmbx_dpopinfo_voice_mailbox_number_saved"); break; case EVideoNumberSaved: - noteText = tr("Video call mailbox saved."); - iconName = "note_info"; + //Video call mailbox saved. + noteText = hbTrId("txt_vmbx_dpopinfo_video_mailbox_number_saved"); + break; + case EDefineVoiceNumber: + //Define voice mailbox. + noteText = hbTrId("txt_vmbx_dpopinfo_define_voice_mailbox_number"); + break; + case EDefineVideoNumber: + //Define video mailbox. + noteText = hbTrId("txt_vmbx_dpopinfo_define_video_mailbox_number"); break; default: VMBLOGSTRING("VmbxQtUiHandler::ShowInformationNote default") break; } - - HbMessageBox *msgBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); + HbMessageBox *msgBox = 0; + if (EInvalidNumber == aType) { + msgBox = new HbMessageBox(HbMessageBox::MessageTypeWarning); + } else { + msgBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); + } msgBox->setText(noteText); - msgBox->setIcon(HbIcon(iconName)); - msgBox->exec(); + msgBox->removeAction(msgBox->primaryAction()); + DialogWaiter waiter; + msgBox->open(&waiter, SLOT(done(HbAction *))); + waiter.wait(); delete msgBox; - VMBLOGSTRING("VmbxQtUiHandler::~ShowInformationNote Exit") - + msgBox = 0; + VMBLOGSTRING("VmbxQtUiHandler::showInformationNote Exit") } // ---------------------------------------------------------------------------- -// VmbxQtUiHandler::ShowSaveEmptyNote +// VmbxQtUiHandler::updatePrimaryAction // (show information note). // ---------------------------------------------------------------------------- // -void VmbxQtUiHandler::showSaveEmptyNote(const TVmbxType& aType) +void VmbxQtUiHandler::updatePrimaryAction(const QString &aInput) { - VMBLOGSTRING("VmbxQtUiHandler::~showSaveEmptyNote") - QString noteText; - VMBLOGSTRING2("VmbxQtUiHandler::~showSaveEmptyNote type = %d", aType) - switch (aType) { - case EVmbxVoice: - noteText = tr("Voice mailbox number not defined."); - break; - case EVmbxVideo: - noteText = tr("Video mailbox number not defined."); - break; - default: - VMBLOGSTRING("VmbxQtUiHandler::ShowSaveEmptyNote default") - break; - } - HbMessageBox *msgBox = new HbMessageBox(HbMessageBox::MessageTypeInformation); - msgBox->setText(noteText); - msgBox->setIcon(HbIcon("note_error")); - msgBox->exec(); - delete msgBox; - VMBLOGSTRING("VmbxQtUiHandler::~ShowSaveEmptyNote Exit") + HbAction *ok = iQueryDialog->primaryAction(); + if (aInput.isEmpty() || aInput.contains(QRegExp("\\d\\d\\d"))){ + if (!ok->isEnabled()){ + ok->setEnabled(true); + VMBLOGSTRING("VmbxQtUiHandler::updatePrimaryAction enable OK") + } + }else{ + if (ok->isEnabled()){ + ok->setEnabled(false); + VMBLOGSTRING("VmbxQtUiHandler::updatePrimaryAction disable OK") + } + } } //End of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/src/vmbxuihandler.cpp --- a/vmbx/vmbxengine/src/vmbxuihandler.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/src/vmbxuihandler.cpp Fri May 14 16:24:46 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" @@ -18,6 +18,8 @@ // qt #include +#include +#include #include "vmbxqtuihandler.h" #include "voicemailboxdefsinternal.h" @@ -42,12 +44,18 @@ return handler; } +// ---------------------------------------------------------------------------- +// CVmbxUiHandler::ConstructL +// (Constructor). +// ---------------------------------------------------------------------------- +// void CVmbxUiHandler::ConstructL() { VMBLOGSTRING( "CVmbxUiHandler::ConstructL" ) iHandler = new VmbxQtUiHandler; VMBLOGSTRING( "CVmbxUiHandler::ConstructL Exit" ) } + // ---------------------------------------------------------------------------- // CVmbxUiHandler::CVmbxUiHandler // (Constructor). @@ -77,7 +85,6 @@ // ---------------------------------------------------------------------------- // void CVmbxUiHandler::ShowVmbxQueryDialog(const TVmbxType& aType, - const TVmbxQueryMode& aMode, TDes& aNumber, TInt& aResult) { VMBLOGSTRING( "CVmbxUiHandler::ShowVmbxQueryDialog" ) @@ -86,7 +93,8 @@ { vmbxNumber=QString::fromUtf16(aNumber.Ptr(), aNumber.Length()); } - iHandler->showVmbxQueryDialog( aType, aMode, vmbxNumber, aResult ); + QT_TRYCATCH_LEAVING( + iHandler->showVmbxQueryDialog( aType, vmbxNumber, aResult )); aNumber = vmbxNumber.utf16(); VMBLOGSTRING2( "CVmbxUiHandler::ShowVmbxQueryDialog:\ aNumber = %S", &aNumber ); @@ -103,7 +111,7 @@ TInt& aResult ) { VMBLOGSTRING( "CVmbxUiHandler::ShowDefineSelectionDialog" ) - iHandler->showDefineSelectionDialog( aType, aResult ); + QT_TRYCATCH_LEAVING(iHandler->showDefineSelectionDialog( aType, aResult )); VMBLOGSTRING2( "CVmbxUiHandler::ShowDefineSelectionDialog:\ aType = %d", aType ); VMBLOGSTRING2( "CVmbxUiHandler::ShowDefineSelectionDialog:\ @@ -111,72 +119,56 @@ VMBLOGSTRING( "CVmbxUiHandler::ShowDefineSelectionDialog Exit" ) } + // ---------------------------------------------------------------------------- -// CVmbxUiHandler::ShowSaveToPhoneNote +// CVmbxUiHandler::ShowCallSelectionDialogL +// (Show query dialog). // ---------------------------------------------------------------------------- // -void CVmbxUiHandler::ShowSaveToPhoneNote() +void CVmbxUiHandler::ShowCallSelectionDialogL( + const RPointerArray& aArray, + TVoiceMailboxParams& aParams, TInt& aResult ) { - VMBLOGSTRING( "CVmbxUiHandler::ShowSaveToPhoneNote" ) - iHandler->showInformationNote( ESavedToPhoneMemory ); - VMBLOGSTRING( "CVmbxUiHandler::ShowSaveToPhoneNote Exit" ) + VMBLOGSTRING( "CVmbxUiHandler::ShowCallSelectionDialogL" ) + TInt count = aArray.Count(); + VMBLOGSTRING2("CVmbxUiHandler::showCallSelectionDialogL count = %d", count) + if (count < 1) + { + VMBLOGSTRING("CVmbxUiHandler::showCallSelectionDialogL leave<=") + User::Leave(KErrArgument); + } + QList entryList; + for ( int i = 0; i < aArray.Count(); i++ ) + { + entryList.append(aArray[i]); + } + QT_TRYCATCH_LEAVING( + iHandler->showCallSelectionDialog( entryList, aParams, aResult )); + VMBLOGSTRING2( "CVmbxUiHandler::ShowCallSelectionDialogL:\ + aResult = %d", aResult ); + VMBLOGSTRING( "CVmbxUiHandler::ShowCallSelectionDialogL" ) } // ---------------------------------------------------------------------------- -// CVmbxUiHandler::ShowSaveToSimNote -// ---------------------------------------------------------------------------- -// -void CVmbxUiHandler::ShowSaveToSimNote() -{ - VMBLOGSTRING( "CVmbxUiHandler::ShowSaveToSimNote" ) - iHandler->showInformationNote( ESavedToSimMemory ); - VMBLOGSTRING( "CVmbxUiHandler::ShowSaveToSimNote Exit" ) -} - -// ---------------------------------------------------------------------------- -// CVmbxUiHandler::ShowVideoSavedNote +// CVmbxUiHandler::ShowInformationdNote // ---------------------------------------------------------------------------- // -void CVmbxUiHandler::ShowVideoSavedNote() +void CVmbxUiHandler::ShowInformationdNoteL(const TVmbxNoteType aType) { - VMBLOGSTRING( "CVmbxUiHandler::ShowVideoSavedNote" ) - iHandler->showInformationNote( EVideoNumberSaved ); - VMBLOGSTRING( "CVmbxUiHandler::ShowVideoSavedNote Exit" ) -} - -// ---------------------------------------------------------------------------- -// CVmbxUiHandler::ShowInvalidNumberNote -// ---------------------------------------------------------------------------- -// - -void CVmbxUiHandler::ShowInvalidNumberNote() -{ - VMBLOGSTRING( "CVmbxUiHandler::ShowInvalidNumberNote" ) - iHandler->showInformationNote( EInvalidNumber ); - VMBLOGSTRING( "CVmbxUiHandler::ShowInvalidNumberNote Exit" ) + VMBLOGSTRING( "CVmbxUiHandler::ShowInformationdNoteL" ) + QT_TRYCATCH_LEAVING(iHandler->showInformationNote(aType)); + VMBLOGSTRING( "CVmbxUiHandler::ShowInformationdNoteL Exit" ) } // ---------------------------------------------------------------------------- // CVmbxUiHandler::ShowInvalidWarningNote // ---------------------------------------------------------------------------- // - -void CVmbxUiHandler::ShowInvalidWarningNote() +void CVmbxUiHandler::ShowInvalidWarningNoteL() { - VMBLOGSTRING( "CVmbxUiHandler::ShowInvalidWarningNote" ) - iHandler->showInformationNote( EInvalidNumber ); - VMBLOGSTRING( "CVmbxUiHandler::ShowInvalidWarningNote Exit" ) -} - -// ---------------------------------------------------------------------------- -// CVmbxUiHandler::ShowSaveEmptyNote -// ---------------------------------------------------------------------------- -// -void CVmbxUiHandler::ShowSaveEmptyNote( const TVmbxType& aType ) -{ - VMBLOGSTRING( "CVmbxUiHandler::ShowSaveEmptyNote" ) - iHandler->showSaveEmptyNote( aType ); - VMBLOGSTRING( "CVmbxUiHandler::ShowSaveEmptyNote Exit" ) + VMBLOGSTRING( "CVmbxUiHandler::ShowInvalidWarningNoteL" ) + QT_TRYCATCH_LEAVING(iHandler->showInformationNote( EInvalidNumber )); + VMBLOGSTRING( "CVmbxUiHandler::ShowInvalidWarningNoteL Exit" ) } //End of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/src/vmbxuiutilities.cpp --- a/vmbx/vmbxengine/src/vmbxuiutilities.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/src/vmbxuiutilities.cpp Fri May 14 16:24:46 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" @@ -134,7 +134,7 @@ // --------------------------------------------------------------------------- // void CVmbxUiUtilities::ShowQueryDialogL( const TVmbxType& aType, - const TVmbxQueryMode& aMode, + const TVmbxQueryMode& /*aMode*/, TDes& aNumber, TInt& aResult ) { VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowQueryDialogL =>" ); @@ -149,84 +149,35 @@ aNumber = %S", &aNumber ); // to show dialog via qt part VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowQueryDialogL to show qt" ); - iUiHandler->ShowVmbxQueryDialog( aType, aMode, aNumber, aResult ); + iUiHandler->ShowVmbxQueryDialog( aType, aNumber, aResult ); VMBLOGSTRING2( "VMBX: CVmbxUiUtilities::ShowQueryDialogL: out\ aNumber = %S", &aNumber ); VMBLOGSTRING2( "VMBX: CVmbxUiUtilities::ShowQueryDialogL: aResult=%I <=", aResult ); } - -// --------------------------------------------------------------------------- -// VmbxUtilities::ShowSaveEmptyNoteL -// Show dialog when save empty data -// --------------------------------------------------------------------------- -// -void CVmbxUiUtilities::ShowSaveEmptyNoteL( const TVmbxType& aType ) - { - VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowSaveEmptyNoteL =>" ); - if ( EVmbxVoice != aType && EVmbxVideo != aType ) - { - User::Leave( KErrNotSupported ); - } - iUiHandler->ShowSaveEmptyNote( aType ); - VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowSaveEmptyNoteL <=" ); - } - // --------------------------------------------------------------------------- // VmbxUtilities::ShowInvalidWarningDialogL -// Check the characters +// // --------------------------------------------------------------------------- // void CVmbxUiUtilities::ShowInvalidWarningDialogL() { VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowInvalidWarningDialogL =>" ); - //TODO comment out the following code to avoid crash, to be tested - //and uncommented - //iUiHandler->ShowInvalidWarningNote(); + iUiHandler->ShowInformationdNoteL( EInvalidNumber ); VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowInvalidWarningDialogL <=" ); } // --------------------------------------------------------------------------- -// VmbxUtilities::ShowSaveToPhoneNote -// Check the characters -// --------------------------------------------------------------------------- +// VmbxUtilities::ShowInformationdNote // -void CVmbxUiUtilities::ShowSaveToPhoneNote() - { - VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowSaveToPhoneConfirmDialog =>" ); - //TODO comment out the following code to avoid crash, to be tested - //and uncommented - //iUiHandler->ShowSaveToPhoneNote(); - VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowSaveToPhoneConfirmDialog <=" ); - } - -// --------------------------------------------------------------------------- -// VmbxUtilities::ShowSaveToSimConfirmDialog -// Check the characters // --------------------------------------------------------------------------- // -void CVmbxUiUtilities::ShowSaveToSimNote() +void CVmbxUiUtilities::ShowInformationdNoteL(const TVmbxNoteType aType ) { - VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowSaveToSimNote =>" ); - //TODO comment out the following code to avoid crash, to be tested - //and uncommented - //iUiHandler->ShowSaveToSimNote(); - VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowSaveToSimNote <=" ); - } - -// --------------------------------------------------------------------------- -// VmbxUtilities::ShowVideoSaveConfirmDialog -// Check the characters -// --------------------------------------------------------------------------- -// -void CVmbxUiUtilities::ShowVideoSavedNote() - { - VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowVideoSavedNote =>" ); - //TODO comment out the following code to avoid crash, to be tested - //and uncommented - //iUiHandler->ShowVideoSavedNote(); - VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowVideoSavedNote <=" ); + VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowInformationdNoteL =>" ); + iUiHandler->ShowInformationdNoteL( aType ); + VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowInformationdNoteL <=" ); } // --------------------------------------------------------------------------- @@ -234,7 +185,7 @@ // Show define number in selection list // --------------------------------------------------------------------------- // -void CVmbxUiUtilities::ShowDefineSelectionDialogL( TVmbxType& aType, +void CVmbxUiUtilities::ShowDefineSelectionDialog( TVmbxType& aType, TInt& aResult ) { VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowDefineSelectionDialogL =>" ); @@ -245,7 +196,7 @@ } // --------------------------------------------------------------------------- -// VmbxUtilities::ShowCallSelectionDialog +// VmbxUtilities::ShowCallSelectionDialogL // Show call number in selection list // --------------------------------------------------------------------------- // @@ -254,11 +205,13 @@ TVoiceMailboxParams& aParams, TInt& aResult ) { - VMBLOGSTRING( - "VMBX: CVmbxUiUtilities::ShowCallSelectionDialog EMPTY IMPLEMENTATION! =>" - ); - // TODO: not supported yet, to be implemented. - VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowCallSelectionDialog <=" ); + VMBLOGSTRING("VMBX: CVmbxUiUtilities::ShowCallSelectionDialogL =>"); + if ( aArray.Count() < 1 ) + { + User::Leave(KErrArgument); + } + iUiHandler->ShowCallSelectionDialogL( aArray, aParams, aResult ); + VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowCallSelectionDialogL <=" ); } // --------------------------------------------------------------------------- @@ -286,16 +239,15 @@ */ // -------------------------------------------------------------------------- -// CVmbxUiUtilities::ShowErrorDialogL +// CVmbxUiUtilities::ShowNotAllowedEditingDialog // -------------------------------------------------------------------------- // -void CVmbxUiUtilities::ShowErrorDialogL() +void CVmbxUiUtilities::ShowNotAllowedEditingDialogL() { - VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowErrorDialogL =>" ); - //TODO comment out the following code to avoid crash, to be tested - //and uncommented - iUiHandler->ShowInvalidNumberNote();// temporary dialog - VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowErrorDialogL <=" ); + VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowNotAllowedEditingDialogL =>" ); + // Information user can't edit. + iUiHandler->ShowInformationdNoteL( ENotAllowUserEditing ); + VMBLOGSTRING( "VMBX: CVmbxUiUtilities::ShowNotAllowedEditingDialogL <=" ); } // ----------------------------------------------------------------------------- @@ -304,11 +256,12 @@ // ----------------------------------------------------------------------------- // void CVmbxUiUtilities::FetchNumberFromPhonebook2L( - TDes& aPhoneNumber ) + TDes& /*aPhoneNumber*/ ) { VMBLOGSTRING( "VMBX: CVmbxUiUtilities::FetchNumberFromPhonebook2L =>" ); /* TODO: Later remove this or replace with some Qt Phonebook API */ VMBLOGSTRING( "VMBX: CVmbxUiUtilities::FetchNumberFromPhonebook2L <=" ); } + // End of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/src/vmbxutilities.cpp --- a/vmbx/vmbxengine/src/vmbxutilities.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/src/vmbxutilities.cpp Fri May 14 16:24:46 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" @@ -24,15 +24,13 @@ #include "vmbxcenrephandler.h" #include "vmbxemergencycall.h" #include "vmbxutilities.h" +#include "voicemailboxdefsinternal.h" // CONSTANTS const TInt KVmbxPhoneNumMinLength = 2; const TInt KVmbxPhoneNumMaxLength = 40; -const TInt KVmbxPhoneCharMaxLength = 48; _LIT( KAllowedTelNumChars, "0123456789" ); -_LIT( KAllowedDtmfChars, "0123456789+pwPW" ); -_LIT( KAllowedSSChars, "*+0123456789#" ); // ============================ MEMBER FUNCTIONS ============================= @@ -54,22 +52,19 @@ lexer.SkipSpace(); TChar current = lexer.Peek(); // If no SS code then consider this is valid and return true. - if ( '#' == current || '*' == current ) + if ( '*' == current ) { // check whether accord ss regulation, - result = ValidateSsNum( lexer ); + lexer.Inc(); // Skip first * } - else - { - result = ValidateTelNum( lexer ); - // If zero length then consider as valid and return value of - // result, If not the end of the string, check if it's DTMF numbers - if ( !lexer.Eos() && result ) - { - result = ValdateDtmfPart( lexer ); - } - } + result = ValidateTelNum( lexer ); + // If zero length then consider as valid and return value of + // result, If not the end of the string, check if it's DTMF numbers + if ( !lexer.Eos() && result ) + { + result = ValdateDtmfPart( lexer ); } + } VMBLOGSTRING2( "VMBX: VmbxUtilities::IsValidPhoneNumber: result = %d<=", result ); return result; @@ -169,61 +164,6 @@ } // ----------------------------------------------------------------------------- -// VmbxUtilities::ValidateSSfix -// Skips over SS code if it exists. -// ----------------------------------------------------------------------------- -// -TBool VmbxUtilities::ValidateSsNum( TLex& aLexer ) - { - VMBLOGSTRING( "VMBX: VmbxUtilities::ValidateSsNum: =>" ); - //The procedure always starts with *, #, **, ## or *# and is finished by #. - // Each part within the procedure is separated by *. - - TBool result( EFalse ); - // Get and skip the first '#' or '*' separator - TChar current = aLexer.Get(); - - current = aLexer.Peek(); - - if ( '#' == current || '*' == current ) - { - aLexer.Inc(); // Skip the second '#' or '*' separator - } - // Define another string which aready skip the prefix '*' or - // '#', the sring to judge the string whether end of '#' and - // valid - TLex nextLexer( aLexer ); - TChar nextChar = nextLexer.Peek(); - TBool invalidCharFound( EFalse ); - while ( !nextLexer.Eos() && !invalidCharFound ) - { - nextChar = nextLexer.Get(); - VMBLOGSTRING2( "VMBX: VmbxUtilities::ValidateTelNum:\ - nextChar %S", &nextChar ); - // Check the string valid or invalid for SS string - if ( KErrNotFound == KAllowedSSChars().Locate( nextChar ) ) - { - invalidCharFound = ETrue; - } - } - - // Check if the string end of '#' and check if it's validate ss code. - if ( nextLexer.Eos() && ( '#' == nextChar ) && !invalidCharFound ) - { - result = ETrue; - if ( result && !aLexer.Eos() ) - { - // It already skip prefix and - // Check SC(Service Code) length,it should be more than 2 digits - result = ValidateTelNum( aLexer ); - } - } - VMBLOGSTRING2( "VMBX: VmbxUtilities::ValidateSsNum: result = %d<=", - result ); - return result; - } - -// ----------------------------------------------------------------------------- // VmbxUtilities::ValidateTelNum // Parses string until end or invalid tel number character is found. // Check number length. @@ -261,14 +201,13 @@ VMBLOGSTRING2( "VMBX: VmbxUtilities::ValidateTelNum:\ telNumDigits %d", telNumDigits ); - - if ( KVmbxPhoneNumMinLength > telNumDigits - || KVmbxPhoneNumMaxLength < telNumDigits - || invalidCharFound ) + // digitlength <3 or digit length>40, invalid telnumber + if ( KVmbxPhoneNumMinLength >= telNumDigits + || KVmbxPhoneNumMaxLength < telNumDigits + ) { result = EFalse; } - VMBLOGSTRING2( "VMBX: VmbxUtilities::ValidateTelNum:\ result %d<=", result ); return result; @@ -287,44 +226,17 @@ // the second part of the string a DTMF special character (p, w or +), // the last third part is an actual DTMF tone string, which is sent to the // remote end. - TBool result( ETrue ); - TLex lexer( aLexer ); - TInt telNumDigitsBeforeDtmf( 0 ); - TBool isDtmfNumberDiscover( EFalse ); - TBool invalidCharFound( EFalse ); + TBool result( EFalse ); // check the second part of the string - while ( !lexer.Eos() && !invalidCharFound ) + const TChar nextChar = aLexer.Peek(); + // Check DTMF number discover or not + if ( 'p' == nextChar || 'P' == nextChar + || 'w'== nextChar || 'W' == nextChar || '+' == nextChar ) { - const TChar nextChar = aLexer.Peek(); - // Check valid DTMF chars - if ( KErrNotFound == KAllowedDtmfChars().Locate( lexer.Get() ) ) - { - invalidCharFound = ETrue; - } - else - { - // Check DTMF number discover or not - if ( 'p' == nextChar || 'P'== nextChar - || 'w'== nextChar || 'w'== nextChar ) - { - isDtmfNumberDiscover = ETrue; - } - // Telnumber count without '+' before 'p' or 'w' - if ( '+' != aLexer.Peek() && !isDtmfNumberDiscover ) - { - telNumDigitsBeforeDtmf++; - } - aLexer.Inc(); - } - VMBLOGSTRING2( "VMBX: VmbxUtilities::ValdateDtmfPart:\ - telNumDigitsBeforeDtmf %d", telNumDigitsBeforeDtmf ); - } - - if ( KVmbxPhoneNumMinLength > telNumDigitsBeforeDtmf - || KVmbxPhoneNumMaxLength < telNumDigitsBeforeDtmf - || invalidCharFound ) - { - result = EFalse; + // After DTMF char, is tone string, there is no specfic rule about tone string, + // so just do a simple check. + result = ETrue; + VMBLOGSTRING( "VMBX: VmbxUtilities::ValdateDtmfPart DtmfNumberDiscover" ); } VMBLOGSTRING2( "VMBX: VmbxUtilities::ValdateDtmfPart: result = %d<=", result ); diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/src/vmbxvoipengine.cpp --- a/vmbx/vmbxengine/src/vmbxvoipengine.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/src/vmbxvoipengine.cpp Fri May 14 16:24:46 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" @@ -166,14 +166,11 @@ // ---------------------------------------------------------------------------- // TBool CVmbxVoIpEngine::CheckConfiguration( - const TVoiceMailboxParams& /*aParams*/, const TInt aFlags ) + const TVoiceMailboxParams& aParams, const TInt aFlags ) { VMBLOGSTRING( "VMBX: CVmbxVoIpEngine::CheckConfiguration: =>" ); - TBool result( ETrue ); - if ( EVmbxChangeNbrNotAllowedOnUi & aFlags ) - { - result = EFalse; - } + TBool result( EFalse ); + result = CVmbxEngineBase::CheckConfiguration(aParams, aFlags); VMBLOGSTRING2( "VMBX: CVmbxVoIpEngine::CheckConfiguration: result%I <=", result ); return result; diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/src/vmspshandler.cpp --- a/vmbx/vmbxengine/src/vmspshandler.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/src/vmspshandler.cpp Fri May 14 16:24:46 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-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" @@ -407,6 +407,8 @@ // void CVmSPSHandler::HandleError( TInt aError ) { + // Avoid warning + aError = aError; VMBLOGSTRING2( "VMBX: CVmSPSHandler::HandleError: aError %d", aError ); } diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/src/voicemailboximpl.cpp --- a/vmbx/vmbxengine/src/voicemailboximpl.cpp Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/src/voicemailboximpl.cpp Fri May 14 16:24:46 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" @@ -30,6 +30,11 @@ #include "vmbxcenrephandler.h" #include "voicemailboximpl.h" +// phone application uid +//const TInt KPhoneApplicationUid = 0x100058B3; +// Temp! using contropannel vmbxcp plugin uid for testing +const TInt KPhoneApplicationUid = 0x20025FD9; + // ============================ MEMBER FUNCTIONS ============================= // --------------------------------------------------------------------------- @@ -395,7 +400,7 @@ CVmbxEngineBase* vmbxBox( NULL ); iVmbxFactory->CreateEngineL( vmbxBox, aEntry.VoiceMailboxType() ); CleanupStack::PushL( vmbxBox ); - if ( vmbxBox->CheckConfiguration( params, EVmbxChangeNbrNotAllowedOnUi ) ) + if ( vmbxBox->CheckConfiguration( params, EVmbxChangeNbrAllowedOnUi ) ) { vmbxBox->SaveL( aEntry ); } @@ -419,7 +424,7 @@ CVmbxEngineBase* vmbxBox( NULL ); iVmbxFactory->CreateEngineL( vmbxBox, aParams.iType ); CleanupStack::PushL( vmbxBox ); - if ( vmbxBox->CheckConfiguration( aParams, EVmbxChangeNbrNotAllowedOnUi ) ) + if ( vmbxBox->CheckConfiguration( aParams, EVmbxChangeNbrAllowedOnUi ) ) { CVoiceMailboxEntry* entry = CVoiceMailboxEntry::NewLC(); entry->SetVoiceMailboxType( aParams.iType ); @@ -430,8 +435,7 @@ } else { - // show error note - iUiUtilities->ShowErrorDialogL(); + CheckNumberProvisionedL( aParams ); } CleanupStack::PopAndDestroy( vmbxBox ); VMBLOGSTRING( "VMBX: CVoiceMailboxImpl::QueryNewEntryL <=" ); @@ -449,7 +453,7 @@ CVmbxEngineBase* vmbxBox( NULL ); iVmbxFactory->CreateEngineL( vmbxBox, aParams.iType ); CleanupStack::PushL( vmbxBox ); - if ( vmbxBox->CheckConfiguration( aParams, EVmbxChangeNbrNotAllowedOnUi ) ) + if ( vmbxBox->CheckConfiguration( aParams, EVmbxChangeNbrAllowedOnUi ) ) { CVoiceMailboxEntry* entry( NULL ); GetStoredEntryL( aParams, entry ); @@ -460,8 +464,7 @@ } else { - // show error note - iUiUtilities->ShowErrorDialogL(); + CheckNumberProvisionedL( aParams ); } CleanupStack::PopAndDestroy( vmbxBox ); VMBLOGSTRING( "VMBX: CVoiceMailboxImpl::QueryChangeEntryL <=" ); @@ -541,7 +544,7 @@ if ( VmbxUtilities::VideoSupported() ) { // query to be defined type - iUiUtilities->ShowDefineSelectionDialogL( aParams.iType, result ); + iUiUtilities->ShowDefineSelectionDialog( aParams.iType, result ); // if result is KErrNone(but result should be also KErrNotFound ), // it means user have seclected the defined type; // else user cancel to select the type, so should return result value @@ -556,7 +559,7 @@ } } - CleanupStack::PopAndDestroy(); //item + CleanupStack::PopAndDestroy( &array ); //item VMBLOGSTRING2( "VMBX: CVoiceMailboxImpl::QueryVmbxTypeL: result%I", result ); User::LeaveIfError( result ); @@ -858,4 +861,44 @@ return *iCenRepHandler; } +// --------------------------------------------------------------------------- +// CVoiceMailboxImpl::CheckNumberProvisionedL +// +// --------------------------------------------------------------------------- +// +void CVoiceMailboxImpl::CheckNumberProvisionedL( + const TVoiceMailboxParams& aParams ) + { + VMBLOGSTRING( "VMBX: CVoiceMailboxImpl::CheckNumberProvisionedL =>" ); + if ( ( EVmbxVoice == aParams.iType + && EVmbxSimMemory == iCenRepHandler->StoreType() ) + || ( EVmbxVideo == aParams.iType ) ) + { + // get current active process + RProcess curProcess; + TInt curProcessId( curProcess.SecureId().iId ); + VMBLOGSTRING2( "VMBX: CVoiceMailboxImpl::CheckNumberProvisionedL \ + Get cur process id: curProcessId = %I", curProcessId ); + // User press 1+send key or long press 1 + if ( KPhoneApplicationUid == curProcessId ) + { + RPointerArray array; + TCleanupItem item( CleanupRPointerArray, &array ); + CleanupStack::PushL( item ); + GetDefinedEntriesL( array ); + // Only operator has the possibility to configure device, + // user is not allowed to edit the voice mail numbers + if ( array.Count() < 1 ) + { + // show not allowed user editing dialog + iUiUtilities->ShowNotAllowedEditingDialogL(); + } + CleanupStack::PopAndDestroy( &array ); //item + } + } + // User don't have access to edit cs voice or video number + User::Leave( KErrAccessDenied ); + VMBLOGSTRING( "VMBX: CVoiceMailboxImpl::CheckNumberProvisionedL <=" ); + } + // End of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/tsrc/ut_vmbxengine/inc/ut_pbkstore.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/tsrc/ut_vmbxengine/inc/ut_pbkstore.h Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,49 @@ +/* +* 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: +* +*/ +#ifndef UT_PBKSTORE_H +#define UT_PBKSTORE_H + +#include + +class CVmbxPbkStore; + +class Ut_PbkStore : public QObject +{ + Q_OBJECT + +public: + Ut_PbkStore(); + virtual ~Ut_PbkStore(); + +private slots: + void testCreateAndDelete(); + void testIsWritable(); + void testPhoneBookType(); + // Can not handle AO in Current UT desing + //void testWrite(); + void testPhonebookStore(); + //void testGetL(); + +private: + void createPbk(); + void deletePbk(); + +private: + CVmbxPbkStore *mPbk; +}; + +#endif // UT_PBKSTORE_H diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/tsrc/ut_vmbxengine/inc/ut_simhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/tsrc/ut_vmbxengine/inc/ut_simhandler.h Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,49 @@ +/* +* 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: +* +*/ +#ifndef UT_SIMHANDLER_H +#define UT_SIMHANDLER_H + +#include + +class CVmbxSimHandler; + +class Ut_SimHandler : public QObject +{ + Q_OBJECT + +public: + Ut_SimHandler(); + virtual ~Ut_SimHandler(); + +private slots: + void testCreateAndDelete(); + //void testGetL(); + //void testSave(); + void testIsWritable(); + void testNotifyStoreEvent(); + void testPhoneBookType(); + void testCancelAsyncRequest(); + +private: + void createSim(); + void deleteSim(); + +private: + CVmbxSimHandler *mSim; +}; + +#endif // UT_SIMHANDLER_H diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/tsrc/ut_vmbxengine/inc/ut_vmbxengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/tsrc/ut_vmbxengine/inc/ut_vmbxengine.h Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 20 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 class for CVmbxPbkStore +* +*/ + +#ifndef UT_VMBXENGINE_H +#define UT_VMBXENGINE_H + +#include + +class CVoiceMailbox; +class CVoiceMailboxEntry; + +class Ut_VmbxEngine : public QObject +{ + Q_OBJECT + +public: + Ut_VmbxEngine(); + virtual ~Ut_VmbxEngine(); + +private slots: + + // Test New and Delete Api + void testVmbxApi(); + void testEntryApi(); + + // CVoiceMailbox test code + void testGetStoredEntry(); + void testSaveEntry(); + void testQueryNewEntry(); + void testQueryChangeEntry(); + void testQueryVmbxType(); + //void testNotifyVmbxNumberChangeL(); + //void NotifyVmbxNumberChangeCancel(); + void testCheckConfiguration(); + void testGetServiceIds(); + void testSaveProvisionedEntry(); + + // CVoiceMailboxEntry test code + void testType(); + void testName(); + void testServiceId(); + void testLineType(); + void testNumber(); + void testBrandId(); + void testUsingMemoryLocation(); + void testReset(); + +private: + // create and delete Api + void createVmbxApi(); + void createEntryApi(); + void deleteVmbxApi(); + void deleteEntryApi(); +private: + CVoiceMailbox *mVmbx; + CVoiceMailboxEntry *mEntry; +}; + +#endif // UT_VMBXENGINE_H diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/tsrc/ut_vmbxengine/src/cenrep_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/tsrc/ut_vmbxengine/src/cenrep_mock.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,69 @@ +/* +* 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 "voicemailboxdomaincrkeys.h" +#include "voicemailboxprivatecrkeys.h" + +_LIT(KStringValue, "123"); + +// TODO: Add a new class named Ut_Utility to config all CR key +// to simulate 3 different images +CRepository* CRepository::NewL(TUid /*aRepositoryUid*/) +{ + CRepository *self = new (ELeave) CRepository(); + return self; +} + +CRepository::~CRepository() +{ + +} + +TInt CRepository::Get(TUint32 aKey, TInt& aValue) +{ + if (KVideoMbxSupport == aKey){ + aValue = 1; + qDebug("KVideoMbxSupport 1"); + } else if (KVmbxNoSimWriting == aKey){ + aValue = 0; + qDebug("KVmbxNoSimWriting 0"); + } else if (KVmbxUiCaps == aKey){ + aValue = 0; + qDebug("KVmbxUiCaps 1"); + } else { + aValue = 0; + qDebug("default 0"); + } + + return KErrNone; +} +TInt CRepository::Set(TUint32 /*aKey*/, TInt /*aValue*/) +{ + return KErrNone; +} + +TInt CRepository::Get(TUint32 /*aKey*/, TDes16& aValue) +{ + aValue.Append(KStringValue); + return KErrNone; +} + +TInt CRepository::Set(TUint32 /*aKey*/, const TDesC16& /*aValue*/) +{ + return KErrNone; +} diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/tsrc/ut_vmbxengine/src/etel_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/tsrc/ut_vmbxengine/src/etel_mock.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,196 @@ +/* +* 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 + +RPhone::RPhone() +{ +} + +void RPhone::ConstructL() +{ +} + +TInt RPhone::Open(RTelServer& /*aSession*/,const TDesC& /*aName*/) +{ + return KErrNone; +} + +void RPhone::Close() +{ +} + +void RPhone::Destruct() +{ +} + +RMobilePhone::RMobilePhone() +{ +} + +void RMobilePhone::ConstructL() +{ +} + +RMobilePhone::TMultimodeType::TMultimodeType() +{ +} + +TInt RMobilePhone::TMultimodeType::ExtensionId() const +{ + return 0; +} + +void RMobilePhone::GetMailboxNumbers( + TRequestStatus& aReqStatus, + TDes8& aMailBox) const +{ + RMobilePhone::TMobilePhoneVoicemailIdsV3 info; + RMobilePhone::TMobilePhoneVoicemailIdsV3Pckg infoPckg(info); + info.iVoice = 1; + aMailBox.Copy(infoPckg); + TRequestStatus* tmp = &aReqStatus; + User::RequestComplete(tmp, KErrNone); + qDebug("RMobilePhoneStore::GetMailboxNumbers mock"); +} + +RMobilePhone::TMobilePhoneVoicemailIdsV3::TMobilePhoneVoicemailIdsV3() + : iVoice(0), + iData(0), + iFax(0), + iOther(0) +{ +} + +void RMobilePhone::Destruct() +{ +} + +TInt RMobilePhone::GetIccAccessCaps(TUint32& /*aCaps*/) const +{ + return KErrNone; +} + +RTelServer::RTelServer() +{ +} + +TInt RTelServer::Connect(TInt /*aMessageSlots*/) +{ + return KErrNone; +} + +TInt RTelServer::LoadPhoneModule(const TDesC& /*aFileName*/) const +{ + return KErrNone; +} + +TInt RTelServer::SetExtendedErrorGranularity( + const TErrorGranularity /*aGranularity*/) const +{ + return KErrNone; +} + +TInt RTelServer::GetPhoneInfo( + const TInt /*aIndex*/, TPhoneInfo& /*aInfo*/) const +{ + return KErrNone; +} + +RMobilePhoneStore::RMobilePhoneStore() +{ +} + +void RMobilePhoneStore::GetInfo( + TRequestStatus& aReqStatus, TDes8& aInfo) const +{ + RMobilePhoneBookStore::TMobilePhoneBookInfoV1 info; + info.iCaps = 0x10000000; + RMobilePhoneBookStore::TMobilePhoneBookInfoV1Pckg pckgInfo( info ); + aInfo.Copy( pckgInfo ); + TRequestStatus* tmp = &aReqStatus; + User::RequestComplete(tmp, KErrNone); + qDebug("RMobilePhoneStore::GetInfo mock"); +} + +RMobilePhoneBookStore::RMobilePhoneBookStore() +{ +} + +TInt RMobilePhoneBookStore::Open( + RMobilePhone& /*aPhone*/, const TDesC& /*aStore*/) +{ + return KErrNone; +} + +RMobilePhoneStore::TMobilePhoneStoreInfoV1::TMobilePhoneStoreInfoV1() + :iType(RMobilePhoneStore::EPhoneStoreTypeUnknown), + iTotalEntries(0), + iUsedEntries(0), + iCaps(0), + iName(0) +{ +} + +RMobilePhoneBookStore::TMobilePhoneBookInfoV1::TMobilePhoneBookInfoV1() + :iMaxNumLength(0), + iMaxTextLength(0), + iLocation(RMobilePhoneBookStore::ELocationUnknown), + iChangeCounter(0), + iIdentity(0) +{ +} + +void RMobilePhoneBookStore::Close() +{ +} + +void RMobilePhoneBookStore::Read( + TRequestStatus& aReqStatus, TInt /*aIndex*/, + TInt /*aNumSlots*/, TDes8& /*aPBData*/) const +{ + TRequestStatus* tmp = &aReqStatus; + User::RequestComplete(tmp, KErrNone); +} + +void RMobilePhoneBookStore::Write( + TRequestStatus& aReqStatus, + const TDesC8& /*aPBData*/, TInt& /*aIndex*/) const +{ + TRequestStatus* tmp = &aReqStatus; + User::RequestComplete(tmp, KErrNone); +} + +void RMobilePhoneStore::NotifyStoreEvent( + TRequestStatus& aReqStatus, + TUint32& /*aEvent*/, TInt& /*aIndex*/) const +{ + TRequestStatus* tmp = &aReqStatus; + User::RequestComplete(tmp, KErrNone); +} + +RTelSubSessionBase::RTelSubSessionBase() +{ +} + +void RTelSubSessionBase::CancelAsyncRequest(TInt /*aReqToCancel*/) const +{ +// refers to ut_ussd +} + diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/tsrc/ut_vmbxengine/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/tsrc/ut_vmbxengine/src/main.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,60 @@ +/* +* 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 "ut_vmbxengine.h" +#include "ut_pbkstore.h" +#include "ut_simhandler.h" + +int main(int argc, char *argv[]) +{ + qDebug("main() IN"); + CTrapCleanup* cleanup = CTrapCleanup::New(); + QApplication app(argc, argv); + + qDebug("testing start..."); + + // API tester + Ut_VmbxEngine tc1; + char *pass[3]; + pass[0] = argv[0]; + pass[1] = "-o"; + pass[2] = "c:\\logs\\vmbx\\ut_vmbxengine.txt"; + int result = -1; + result = QTest::qExec(&tc1, 3, pass); + qDebug("ut_vmbxengine result=%d", result); + + Ut_PbkStore tc2; + pass[2] = "c:\\logs\\vmbx\\ut_pbkstore.txt"; + result = QTest::qExec(&tc2, 3, pass); + qDebug("Ut_PbkStore result=%d", result); + + // SIM can not be handled in Emulator. + // Root cause: CVmbxSimHandler::ConstructL() +// Ut_SimHandler tc3; +// pass[2] = "c:\\logs\\vmbx\\ut_simhandler.txt"; +// result = QTest::qExec(&tc3, 3, pass); +// qDebug("Ut_SimHandler result=%d", result); + + qDebug("testing end..."); + qDebug("main() OUT"); + delete cleanup; + cleanup = NULL; + return result; +} + diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/tsrc/ut_vmbxengine/src/mpbutil_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/tsrc/ut_vmbxengine/src/mpbutil_mock.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,78 @@ +/* +* 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 + +CPhoneBookBuffer::CPhoneBookBuffer():iMonitor(NULL,0,0) +{ +} + +void CPhoneBookBuffer::Set(TDes8* /*aData*/){} + +TInt CPhoneBookBuffer::AddNewEntryTag() +{ return 0; } + +TInt CPhoneBookBuffer::AddNewNumberTag() +{ return 0; } + +TInt CPhoneBookBuffer::PutTagAndValue(TUint8 /*aTagValue*/, TUint8 /*aInteger*/) +{ return 0; } + +TInt CPhoneBookBuffer::PutTagAndValue(TUint8 /*aTagValue*/, TUint16 /*aInteger*/) +{ return 0; } + +TInt CPhoneBookBuffer::PutTagAndValue(TUint8 /*aTagValue*/, TUint32 /*aInteger*/) +{ return 0; } + +TInt CPhoneBookBuffer::PutTagAndValue(TUint8 /*aTagValue*/, const TDesC8 &/*aData*/) +{ return 0; } + +TInt CPhoneBookBuffer::PutTagAndValue(TUint8 /*aTagValue*/, const TDesC16 &/*aData*/) +{ return 0; } + +TInt CPhoneBookBuffer::RemovePartialEntry() +{ return 0; } + +void CPhoneBookBuffer::StartRead(){} + +TInt CPhoneBookBuffer::GetTagAndType(TUint8 &/*aTagValue*/, TPhBkTagType &/*aDataType*/) +{ return 0; } + +TInt CPhoneBookBuffer::GetValue(TUint8 &/*aInteger*/) +{ return 0; } + +TInt CPhoneBookBuffer::GetValue(TUint16 &/*aInteger*/) +{ return 0; } + +TInt CPhoneBookBuffer::GetValue(TUint32 &/*aInteger*/) +{ return 0; } + +TInt CPhoneBookBuffer::GetValue(TPtrC8 &/*aData*/) +{ return 0; } + +TInt CPhoneBookBuffer::GetValue(TPtrC16 &/*aData*/) +{ return 0; } + +void CPhoneBookBuffer::SkipValue(TPhBkTagType /*aDataType*/){} + +TInt CPhoneBookBuffer::BufferLength() +{ return 0; } + +TInt CPhoneBookBuffer::RemainingReadLength() +{ return 0; } diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/tsrc/ut_vmbxengine/src/qtuihandler_mock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/tsrc/ut_vmbxengine/src/qtuihandler_mock.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,59 @@ +/* +* 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 "vmbxqtuihandler.h" + +VmbxQtUiHandler::VmbxQtUiHandler(QObject* parent): QObject(parent) +{ + qDebug("mock VmbxQtUiHandler"); +} + +VmbxQtUiHandler::~VmbxQtUiHandler() +{ + qDebug("mock ~VmbxQtUiHandler"); +} + + +void VmbxQtUiHandler::showVmbxQueryDialog(const TVmbxType& /*aType*/, + QString& /*aNumber*/, int& aResult) +{ + qDebug("mock showVmbxQueryDialog"); + aResult = KErrNone; +} + + +void VmbxQtUiHandler::showDefineSelectionDialog( + TVmbxType& /*aType*/, int& aResult) +{ + qDebug("mock showDefineSelectionDialog"); + // Make sure no leave in CVoiceMailboxImpl::QueryVmbxTypeL( + aResult = KErrNotFound; +} + +void VmbxQtUiHandler::showInformationNote(const TVmbxNoteType /*aType*/) +{ + qDebug("mock showInformationNote"); +} + +void VmbxQtUiHandler::showCallSelectionDialog( + const QList /*entryList*/, + TVoiceMailboxParams &/*params*/, int &/*result*/ ) +{ + qDebug("mock showCallSelectionDialogL"); +} + +//End of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/tsrc/ut_vmbxengine/src/ut_pbkstore.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/tsrc/ut_vmbxengine/src/ut_pbkstore.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,105 @@ +/* +* 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 "vmbxpbkstore.h" +#include "ut_pbkstore.h" + +Ut_PbkStore::Ut_PbkStore():mPbk(NULL) +{ + createPbk(); +} + +Ut_PbkStore::~Ut_PbkStore() +{ + deletePbk(); +} + +void Ut_PbkStore::testCreateAndDelete() +{ + createPbk(); + deletePbk(); +} + +void Ut_PbkStore::testIsWritable() +{ + createPbk(); + QCOMPARE(mPbk->IsWritable(), 1); + deletePbk(); +} +void Ut_PbkStore::testPhoneBookType() +{ + createPbk(); + QCOMPARE(mPbk->PhoneBookType(), EMBDNPhoneBook); + deletePbk(); +} + +/* +void Ut_PbkStore::testWrite() +{ + createPbk(); + CVoiceMailboxEntry *entry = NULL; + TInt err = KErrNotFound; + + TRAP(err, entry = CVoiceMailboxEntry::NewL()); + qDebug("CVoiceMailboxEntry::NewL %d", err); + err = mPbk->Write(*entry); + qDebug("Write err %d", err); + QCOMPARE(err, KErrNone); + + delete entry; + entry = NULL; + deletePbk(); +} +*/ +void Ut_PbkStore::testPhonebookStore() +{ + createPbk(); + mPbk->PhonebookStore(); + deletePbk(); +} +/* +void Ut_PbkStore::testGetL() +{ + createPbk(); + TInt err = KErrNotFound; + CVoiceMailboxEntry *entry = NULL; + + TRAP(err, entry = CVoiceMailboxEntry::NewL()); + qDebug("CVoiceMailboxEntry::NewL %d", err); + mPbk->GetL(*entry); + + delete entry; + entry = NULL; + deletePbk(); +} +*/ +void Ut_PbkStore::createPbk() +{ + if (!mPbk){ + TRAPD(err, mPbk = CVmbxPbkStore::NewL()); + QVERIFY(mPbk); + qDebug("Create CVmbxPbkStore", err); + } +} + +void Ut_PbkStore::deletePbk() +{ + delete mPbk; + mPbk = NULL; + qDebug("Delete CVmbxPbkStore"); +} diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/tsrc/ut_vmbxengine/src/ut_simhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/tsrc/ut_vmbxengine/src/ut_simhandler.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,114 @@ +/* +* 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 "vmbxsimhandler.h" +#include "ut_simhandler.h" + +Ut_SimHandler::Ut_SimHandler():mSim(NULL) +{ + createSim(); +} + +Ut_SimHandler::~Ut_SimHandler() +{ + deleteSim(); +} + +void Ut_SimHandler::testCreateAndDelete() +{ + createSim(); + deleteSim(); +} + +//void Ut_SimHandler::testGetL() +//{ +// createSim(); +// TInt err = KErrNotFound; +// CVoiceMailboxEntry *entry = NULL; +// +// TRAP(err, entry = CVoiceMailboxEntry::NewL()); +// qDebug("CVoiceMailboxEntry::NewL %d", err); +// mSim->GetL(*entry); +// +// delete entry; +// entry = NULL; +// deleteSim(); +//} +// +//void Ut_SimHandler::testSave() +//{ +// createSim(); +// +// TInt err = KErrNotFound; +// CVoiceMailboxEntry *entry = NULL; +// +// TRAP(err, entry = CVoiceMailboxEntry::NewL()); +// qDebug("CVoiceMailboxEntry::NewL %d", err); +// QCOMPARE(mSim->Save(*entry), KErrNone); +// +// deleteSim(); +//} + +void Ut_SimHandler::testIsWritable() +{ + createSim(); + QCOMPARE(mSim->IsWritable(), 1); + deleteSim(); +} + +void Ut_SimHandler::testNotifyStoreEvent() +{ + createSim(); + TRequestStatus status; + TUint32 event; + TInt index; + mSim->NotifyStoreEvent(status, event, index); + deleteSim(); +} + + +void Ut_SimHandler::testPhoneBookType() +{ + createSim(); + QCOMPARE(mSim->PhoneBookType(), EMBDNPhoneBook); + deleteSim(); +} + +void Ut_SimHandler::testCancelAsyncRequest() +{ + createSim(); + TInt req = -1; + mSim->CancelAsyncRequest(req); + deleteSim(); +} + +void Ut_SimHandler::createSim() +{ + if (!mSim){ + TRAPD(err, mSim = CVmbxSimHandler::NewL()); + QVERIFY(mSim); + qDebug("Create CVmbxSimHandler", err); + } +} + +void Ut_SimHandler::deleteSim() +{ + delete mSim; + mSim = NULL; + qDebug("Delete CVmbxSimHandler"); +} diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/tsrc/ut_vmbxengine/src/ut_vmbxengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmbx/vmbxengine/tsrc/ut_vmbxengine/src/ut_vmbxengine.cpp Fri May 14 16:24:46 2010 +0300 @@ -0,0 +1,455 @@ +/* +* 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 Ut_VmbxEngine class +* +*/ + +#include +#include +#include +#include + +#include "ut_vmbxengine.h" + +_LIT(KNumber, "987654321"); +_LIT(KName, "Name"); +_LIT8(KBrandId, "Brand Id"); + +Ut_VmbxEngine::Ut_VmbxEngine(): mVmbx(NULL),mEntry(NULL) +{ + qDebug("Ut_VmbxEngine"); +} + +// ----------------------------------------------------------------------------- +// Ut_VmbxEngine::~Ut_VmbxEngine +// ----------------------------------------------------------------------------- +Ut_VmbxEngine::~Ut_VmbxEngine() +{ + delete mVmbx; + mVmbx = NULL; + delete mEntry; + mEntry = NULL; + qDebug("~Ut_VmbxEngine"); +} + +// Test API +void Ut_VmbxEngine::testVmbxApi() +{ + createVmbxApi(); + deleteVmbxApi(); +} + +void Ut_VmbxEngine::testEntryApi() +{ + createEntryApi(); + deleteEntryApi(); +} + +// Test Vmbx start +void Ut_VmbxEngine::testGetStoredEntry() +{ + createVmbxApi(); + + TVoiceMailboxParams params; + params.iType = EVmbxVoice; + CVoiceMailboxEntry *tmpEntry = NULL; + + QCOMPARE(mVmbx->GetStoredEntry(params, tmpEntry), KErrNone); + qDebug("Get entry"); + if (tmpEntry){ + delete tmpEntry; + tmpEntry = NULL; + qDebug("delete tmp entry pointer"); + } + + // Save a entry first, get and compare after that + createEntryApi(); + mEntry->SetVoiceMailboxType(EVmbxVoice); + mEntry->SetVmbxNumber(KNumber); + qDebug("Set type"); + QCOMPARE(mVmbx->SaveEntry(*mEntry), KErrNone); + qDebug("Save entry"); + deleteEntryApi(); + + params.iType = EVmbxVoice; + mVmbx->GetStoredEntry(params, tmpEntry); + qDebug("Get entry"); + if (tmpEntry){ + QCOMPARE(tmpEntry->VoiceMailboxType(), EVmbxVoice); + delete tmpEntry; + tmpEntry = NULL; + qDebug("delete tmp entry pointer"); + } + + deleteVmbxApi(); +} + +void Ut_VmbxEngine::testSaveEntry() +{ + createVmbxApi(); + + // Set some attributes to the new empty entry and save it + createEntryApi(); + mEntry->SetVoiceMailboxType(EVmbxVoice); + mEntry->SetUsingMemoryLocation(EVmbxPhoneMemory); + mEntry->SetVmbxNumber(KNumber); + qDebug("Set type & location"); + QCOMPARE(mVmbx->SaveEntry(*mEntry), KErrNone); + qDebug("Save entry"); + deleteEntryApi(); + + TVoiceMailboxParams params; + params.iType = EVmbxVoice; + CVoiceMailboxEntry *tmpEntry = NULL;; + mVmbx->GetStoredEntry(params, tmpEntry); + qDebug("Get entry"); + if (tmpEntry){ + QCOMPARE(tmpEntry->VoiceMailboxType(), EVmbxVoice); + qDebug("Verify type"); + QCOMPARE(tmpEntry->UsingMemoryLocation(), EVmbxPhoneMemory); + qDebug("Verify location"); + delete tmpEntry; + tmpEntry = NULL; + } + deleteVmbxApi(); +} + +void Ut_VmbxEngine::testQueryNewEntry() +{ + createVmbxApi(); + CVoiceMailboxEntry *tmpEntry = NULL; + TVoiceMailboxParams params; + + // Query a new voice entry + // Mock the CRepository + params.iType = EVmbxVoice; + QCOMPARE(mVmbx->QueryNewEntry(params, tmpEntry), KErrNone); + QVERIFY(tmpEntry); + QCOMPARE(tmpEntry->VoiceMailboxType(), EVmbxVoice); + delete tmpEntry; + tmpEntry = NULL; + + /* + // Query a new Video entry + params.iType = EVmbxVideo; + QCOMPARE(mVmbx->QueryNewEntry(params, tmpEntry), KErrNone); + QVERIFY(tmpEntry); + QCOMPARE(tmpEntry->VoiceMailboxType(), EVmbxVideo); + delete tmpEntry; + tmpEntry = NULL; + + // Query a new voice entry + params.iType = EVmbxVoip; + QCOMPARE(mVmbx->QueryNewEntry(params, tmpEntry), KErrNone); + QVERIFY(tmpEntry); + QCOMPARE(tmpEntry->VoiceMailboxType(), EVmbxVoip); + delete tmpEntry; + tmpEntry = NULL; + + // Query a unknown entry + params.iType = EVmbxNone; + QCOMPARE(mVmbx->QueryNewEntry(params, tmpEntry), KErrNone); + QVERIFY(tmpEntry); + QCOMPARE(tmpEntry->VoiceMailboxType(), EVmbxNone); + delete tmpEntry; + tmpEntry = NULL; + */ + deleteVmbxApi(); + +} + +void Ut_VmbxEngine::testQueryChangeEntry() +{ + createVmbxApi(); + + CVoiceMailboxEntry *tmpEntry = NULL;; + TVoiceMailboxParams params; + params.iType = EVmbxVoice; + // Always get KErrNotFound, Check why. + //QCOMPARE(mVmbx->QueryChangeEntry(params, tmpEntry), KErrNone); + mVmbx->QueryChangeEntry(params, tmpEntry); + //QVERIFY(tmpEntry); + delete tmpEntry; + tmpEntry = NULL; + + deleteVmbxApi(); +} + +void Ut_VmbxEngine::testQueryVmbxType() +{ + createVmbxApi(); + + // Save a entry first + CVoiceMailboxEntry *tmpEntry = NULL; + TVoiceMailboxParams params; + params.iType = EVmbxVoice; + QCOMPARE(mVmbx->QueryNewEntry(params, tmpEntry), KErrNone); + tmpEntry->SetVoiceMailboxType(EVmbxVoice); + tmpEntry->SetVmbxNumber(KNumber); + QCOMPARE(mVmbx->SaveEntry(*tmpEntry), KErrNone); + delete tmpEntry; + tmpEntry = NULL; + + // Query and compare vmbx type after saving + mVmbx->QueryVmbxType(params); + + deleteVmbxApi(); +} + +// TODO: Add 2 public test cases for notification, mock observer frist. +//void testNotifyVmbxNumberChangeL(); +//void NotifyVmbxNumberChangeCancel(); + +void Ut_VmbxEngine::testGetServiceIds() +{ + createVmbxApi(); + /* + // Save a entry first + createEntryApi(); + TServiceId idExp(10); + mEntry->SetServiceId(idExp); + mEntry->SetVoiceMailboxType(EVmbxVoip); + QCOMPARE(mVmbx->SaveEntry(*mEntry), KErrNone); + deleteEntryApi(); + + // Query and compare vmbx type after saving + RIdArray ids; + QCOMPARE(mVmbx->GetServiceIds(ids), KErrNone); + TServiceId idAct = ids[0]; + QCOMPARE(idAct, idExp); + */ + deleteVmbxApi(); +} + +void Ut_VmbxEngine::testCheckConfiguration() +{ + createVmbxApi(); + TVoiceMailboxParams params; + params.iType = EVmbxVoice; + TBool result = mVmbx->CheckConfiguration( + params, EVmbxChangeNbrAllowedOnUi); + if (!result) { + QEXPECT_FAIL("","voice not allowed changed", Continue); + } + params.iType = EVmbxVideo; + result = mVmbx->CheckConfiguration( + params,EVmbxChangeNbrAllowedOnUi); + if (!result) { + QEXPECT_FAIL("","video not allowed changed", Continue); + } + params.iType = EVmbxVoip; + result = mVmbx->CheckConfiguration( + params,EVmbxChangeNbrAllowedOnUi); + if (result) { + QFAIL ("voip failed"); + } + deleteVmbxApi(); +} + +void Ut_VmbxEngine::testSaveProvisionedEntry() +{ + createVmbxApi(); + // Voice + createEntryApi(); + mEntry->SetVoiceMailboxType(EVmbxVoice); + mEntry->SetVmbxNumber(KNumber); + QCOMPARE(mVmbx->SaveProvisionedEntry(*mEntry), KErrNone); + deleteEntryApi(); + + // Video + createEntryApi(); + mEntry->SetVoiceMailboxType(EVmbxVideo); + mEntry->SetVmbxNumber(KNumber); + QCOMPARE(mVmbx->SaveProvisionedEntry(*mEntry), KErrNone); + deleteEntryApi(); + + deleteVmbxApi(); +} +// Test Vmbx end + + +// Test Entry start +void Ut_VmbxEngine::testType() +{ + createEntryApi(); + mEntry->SetVoiceMailboxType(EVmbxNone); + QCOMPARE(mEntry->VoiceMailboxType(), EVmbxNone); + + mEntry->SetVoiceMailboxType(EVmbxVoice); + QCOMPARE(mEntry->VoiceMailboxType(), EVmbxVoice); + + mEntry->SetVoiceMailboxType(EVmbxVideo); + QCOMPARE(mEntry->VoiceMailboxType(), EVmbxVideo); + + deleteEntryApi(); +} + +void Ut_VmbxEngine::testName() +{ + createEntryApi(); + + // Valid string + TPtrC nameIn(KName); + mEntry->SetVmbxName(nameIn); + TPtrC nameOut(KNullDesC); + mEntry->GetVmbxName(nameOut); + QCOMPARE(nameOut, nameIn); + + // Invalid string +// HBufC *name = HBufC::NewLC(KVmbxMaxNumberLength+1); +// QCOMPARE(mEntry->SetVmbxName(name->Des()), KErrArgument); +// CleanupStack::PopAndDestroy(name); + + deleteEntryApi(); +} + +void Ut_VmbxEngine::testServiceId() +{ + createEntryApi(); + + TServiceId idIn(10); + mEntry->SetServiceId(idIn); + QCOMPARE(mEntry->ServiceId(), idIn); + + deleteEntryApi(); +} + +void Ut_VmbxEngine::testLineType() +{ + createEntryApi(); + + // Als is disable in TB10.1 + /* + mEntry->SetVmbxAlsLineType(EVmbxAlsLineDefault); + QCOMPARE(mEntry->VmbxAlsLineType(), EVmbxAlsLineDefault); + + mEntry->SetVmbxAlsLineType(EVmbxAlsLine1); + QCOMPARE(mEntry->VmbxAlsLineType(), EVmbxAlsLine1); + + mEntry->SetVmbxAlsLineType(EVmbxAlsLine2); + QCOMPARE(mEntry->VmbxAlsLineType(), EVmbxAlsLine2); + */ + deleteEntryApi(); +} + +void Ut_VmbxEngine::testNumber() +{ + createEntryApi(); + + // Valid number + TPtrC numberIn(KNumber); + mEntry->SetVmbxNumber(numberIn); + TPtrC numberOut(KNullDesC); + mEntry->GetVmbxNumber(numberOut); + QCOMPARE(numberOut, numberIn); + + // Invalid number +// HBufC *number = HBufC::NewLC(KVmbxMaxNumberLength+1); +// QCOMPARE(mEntry->SetVmbxNumber(number->Des()), KErrArgument); +// CleanupStack::PopAndDestroy(number); + + deleteEntryApi(); +} + +void Ut_VmbxEngine::testBrandId() +{ + createEntryApi(); + + // Valid braind id + TPtrC8 brandIn(KBrandId); + QCOMPARE(mEntry->SetBrandId(brandIn), KErrNone); + + TPtrC8 brandOut(KNullDesC8); + QCOMPARE(mEntry->GetBrandId(brandOut), KErrNone); + + if (brandOut.Compare(brandIn)){ + QFAIL("Fail to Set/Get BrandId"); + } + + // Invalid Brand Id +// HBufC8 *invalid = HBufC8::NewLC(KVmbxMaxNumberLength+1); +// QCOMPARE(mEntry->SetBrandId(invalid->Des()), KErrArgument); +// CleanupStack::PopAndDestroy(invalid); + + deleteEntryApi(); +} + +void Ut_VmbxEngine::testUsingMemoryLocation() +{ + createEntryApi(); + + mEntry->SetUsingMemoryLocation(EVmbxPhoneMemory); + QCOMPARE(mEntry->UsingMemoryLocation(), EVmbxPhoneMemory); + + mEntry->SetUsingMemoryLocation(EVmbxSimMemory); + QCOMPARE(mEntry->UsingMemoryLocation(), EVmbxSimMemory); + + deleteEntryApi(); +} + +void Ut_VmbxEngine::testReset() +{ + createEntryApi(); + + mEntry->Reset(); + QCOMPARE(mEntry->ServiceId(), KVmbxServiceIdNone); + QCOMPARE(mEntry->VoiceMailboxType(), EVmbxNone); + QCOMPARE(mEntry->VmbxAlsLineType(), EVmbxAlsLineDefault); + + TPtrC8 brand(KNullDesC8); + QCOMPARE(mEntry->GetBrandId(brand), KErrNotFound); + + TPtrC name; + QCOMPARE(mEntry->GetVmbxName(name), KErrNotFound); + + TPtrC number; + QCOMPARE(mEntry->GetVmbxNumber(number), KErrNotFound); + + QCOMPARE(mEntry->UsingMemoryLocation(), EVmbxSimMemory); + + deleteEntryApi(); +} +// Test Entry end + +// Private function: create 2 data member +void Ut_VmbxEngine::createVmbxApi() +{ + if (!mVmbx){ + TRAPD( err, mVmbx = CVoiceMailbox::NewL()); + QVERIFY(mVmbx); + qDebug("Create vmbx api TRAP: %d", err); + } +} +void Ut_VmbxEngine::deleteVmbxApi() +{ + delete mVmbx; + mVmbx = NULL; + qDebug("Delete vmbx api"); +} +void Ut_VmbxEngine::createEntryApi() +{ + if (!mEntry){ + TRAPD( err, mEntry = CVoiceMailboxEntry::NewL()); + QVERIFY(mEntry); + qDebug("Create entry Api TRAP: %d", err); + } +} + +void Ut_VmbxEngine::deleteEntryApi() +{ + delete mEntry; + mEntry = NULL; + qDebug("Delete entry api"); +} +// End of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/tsrc/ut_vmbxengine/ut_vmbxengine.pro --- a/vmbx/vmbxengine/tsrc/ut_vmbxengine/ut_vmbxengine.pro Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/tsrc/ut_vmbxengine/ut_vmbxengine.pro Fri May 14 16:24:46 2010 +0300 @@ -15,49 +15,109 @@ # TEMPLATE = app -TARGET = -DEPENDPATH += . -INCLUDEPATH += . +TARGET = ut_vmbxengine +TARGET.EPOCALLOWDLLDATA = 1 + CONFIG += hb CONFIG += qtestlib +DEPENDPATH += . + +INCLUDEPATH += . +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE +HEADERS += \epoc32\include\platform\mw\cvoicemailbox.h +HEADERS += \epoc32\include\platform\mw\cvoicemailboxentry.h + +INCLUDEPATH += ..\..\inc + +HEADERS += $$PUBLIC_HEADERS + symbian: { TARGET.CAPABILITY = CAP_GENERAL_DLL } -symbian { - INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ - /epoc32/include/mw/QtTest \ - ../../inc - - LIBS += -lvmbxengine.dll\ - -lflogger.dll - TARGET.CAPABILITY = ALL -TCB -} +# Code subject to test +SOURCES += ..\..\src\vmbxuihandler.cpp +# It is mocked by qtuihandler_mock.cpp, remove the real one +#SOURCES += ..\..\src\vmbxqtuihandler.cpp +SOURCES += ..\..\src\voicemailboximpl.cpp +SOURCES += ..\..\src\vmbxpbkstore.cpp +SOURCES += ..\..\src\vmbxetelconnection.cpp +SOURCES += ..\..\src\vmbxsimhandler.cpp +SOURCES += ..\..\src\vmbxcenrephandler.cpp +SOURCES += ..\..\src\vmbxutilities.cpp +SOURCES += ..\..\src\vmbxenginefactory.cpp +SOURCES += ..\..\src\vmbxenginebase.cpp +SOURCES += ..\..\src\vmbxcsvoiceengine.cpp +SOURCES += ..\..\src\vmbxcsvideoengine.cpp +SOURCES += ..\..\src\vmbxvoipengine.cpp +SOURCES += ..\..\src\vmbxemergencycall.cpp +SOURCES += ..\..\src\vmbxuiutilities.cpp +SOURCES += ..\..\src\vmbxcenrepobserver.cpp +SOURCES += ..\..\src\vmbxsimstoreobserver.cpp +SOURCES += ..\..\src\vmbxsatrefreshobserver.cpp +SOURCES += ..\..\src\vmbxobserver.cpp +SOURCES += ..\..\src\vmbshandler.cpp +SOURCES += ..\..\src\vmspshandler.cpp +SOURCES += ..\..\src\vmsettingsuiiconfileprovider.cpp +SOURCES += ..\..\src\cvoicemailbox.cpp +SOURCES += ..\..\src\cvoicemailboxentry.cpp -# Input -HEADERS += $$PUBLIC_HEADERS -HEADERS += ut_vmbxengine.h -SOURCES += ut_vmbxengine.cpp\ - ..\..\src\vmbxuihandler.cpp\ - ..\..\src\vmbxqtuihandler.cpp\ - ..\..\src\voicemailboximpl.cpp\ - ..\..\src\vmbxpbkstore.cpp\ - ..\..\src\vmbxetelconnection.cpp\ - ..\..\src\vmbxsimhandler.cpp\ - ..\..\src\vmbxcenrephandler.cpp\ - ..\..\src\vmbxutilities.cpp\ - ..\..\src\vmbxenginefactory.cpp\ - ..\..\src\vmbxenginebase.cpp\ - ..\..\src\vmbxcsvoiceengine.cpp\ - ..\..\src\vmbxcsvideoengine.cpp\ - ..\..\src\vmbxvoipengine.cpp\ - ..\..\src\vmbxemergencycall.cpp\ - ..\..\src\vmbxuiutilities.cpp\ - ..\..\src\vmbxcenrepobserver.cpp\ - ..\..\src\vmbxsimstoreobserver.cpp\ - ..\..\src\vmbxsatrefreshobserver.cpp\ - ..\..\src\vmbxobserver.cpp\ - ..\..\src\vmbshandler.cpp\ - ..\..\src\vmspshandler.cpp\ - ..\..\src\vmsettingsuiiconfileprovider.cpp +HEADERS += ..\..\inc\vmbxuihandler.h +HEADERS += ..\..\inc\vmbxqtuihandler.h +HEADERS += ..\..\inc\voicemailboximpl.h +HEADERS += ..\..\inc\vmbxpbkstore.h +HEADERS += ..\..\inc\vmbxetelconnection.h +HEADERS += ..\..\inc\vmbxsimhandler.h +HEADERS += ..\..\inc\vmbxcenrephandler.h +HEADERS += ..\..\inc\vmbxutilities.h +HEADERS += ..\..\inc\vmbxenginefactory.h +HEADERS += ..\..\inc\vmbxenginebase.h +HEADERS += ..\..\inc\vmbxcsvoiceengine.h +HEADERS += ..\..\inc\vmbxcsvideoengine.h +HEADERS += ..\..\inc\vmbxvoipengine.h +HEADERS += ..\..\inc\vmbxemergencycall.h +HEADERS += ..\..\inc\vmbxuiutilities.h +HEADERS += ..\..\inc\vmbxcenrepobserver.h +HEADERS += ..\..\inc\vmbxsimstoreobserver.h +HEADERS += ..\..\inc\vmbxsatrefreshobserver.h +HEADERS += ..\..\inc\vmbxobserver.h +HEADERS += ..\..\inc\vmbshandler.h +HEADERS += ..\..\inc\vmspshandler.h +HEADERS += ..\..\inc\vmsettingsuiiconfileprovider.h + +HEADERS += ..\..\inc\mvmbxcenrephandler.h +HEADERS += ..\..\inc\mvmbxcenrepobserver.h +HEADERS += ..\..\inc\mvmbxchangeobserver.h +HEADERS += ..\..\inc\mvmbxresourceprovider.h +HEADERS += ..\..\inc\mvmbxsatrefreshobserver.h +HEADERS += ..\..\inc\mvmbxservicenotify.h +HEADERS += ..\..\inc\mvmbxsimstoreobserver.h +HEADERS += ..\..\inc\mvmbxuihandler.h +HEADERS += ..\..\inc\mvmbxuiutilities.h + +# Test code +HEADERS += inc\ut_vmbxengine.h +HEADERS += inc\ut_pbkstore.h +HEADERS += inc\ut_simhandler.h + +SOURCES += src\ut_vmbxengine.cpp +SOURCES += src\ut_pbkstore.cpp +SOURCES += src\ut_simhandler.cpp +SOURCES += src\main.cpp + +# Mock class +SOURCES += src\etel_mock.cpp +SOURCES += src\mpbutil_mock.cpp +SOURCES += src\qtuihandler_mock.cpp +SOURCES += src\cenrep_mock.cpp + +LIBS += -lflogger.dll +LIBS += -lfeatmgr.dll +LIBS += -lcenrepnotifhandler.dll +LIBS += -lphoneclient.dll +LIBS += -lsssettings.dll +LIBS += -lsatclient.dll +LIBS += -lserviceprovidersettings.dll + +#End of files \ No newline at end of file diff -r d7fc66ccd6fb -r e44a8c097b15 vmbx/vmbxengine/vmbxengine.pro --- a/vmbx/vmbxengine/vmbxengine.pro Mon May 03 13:01:45 2010 +0300 +++ b/vmbx/vmbxengine/vmbxengine.pro Fri May 14 16:24:46 2010 +0300 @@ -22,14 +22,16 @@ HEADERS += $$PUBLIC_HEADERS CONFIG += hb +MOC_DIR = moc symbian: { TARGET.CAPABILITY = CAP_GENERAL_DLL TARGET.EPOCALLOWDLLDATA = 1 TARGET.UID3=0x1000590F INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ - ../../inc \ - ./inc + $$MOC_DIR \ + ../../inc \ + ./inc LIBS += -lcentralrepository.dll \ -lcenrepnotifhandler.dll \ @@ -76,7 +78,8 @@ inc/voicemailboxdefsinternal.h \ inc/voicemailboxdomaincrkeys.h \ inc/voicemailboximpl.h \ - inc/voicemailboxprivatecrkeys.h + inc/voicemailboxprivatecrkeys.h \ + inc/dialogwaiter.h SOURCES += src/vmbxcenrepobserver.cpp \ src/vmbxcsvoiceengine.cpp \ @@ -101,7 +104,8 @@ src/vmbxetelconnection.cpp \ src/vmbxenginefactory.cpp \ src/vmbxenginebase.cpp \ - src/vmbxemergencycall.cpp + src/vmbxemergencycall.cpp \ + src/dialogwaiter.cpp defFiles = \ "$${LITERAL_HASH}ifdef WINS" \ @@ -118,7 +122,9 @@ "rom/backup_registration.xml /epoc32/release/winscw/udeb/z/private/100058F5/backup_registration.xml" \ "rom/backup_registration.xml /epoc32/release/winscw/urel/z/private/100058F5/backup_registration.xml" \ "rom/vmbxengine_stub.sis /epoc32/data/z/system/install/vmbxengine_stub.sis" \ - "rom/vmbxengine.iby CORE_MW_LAYER_IBY_EXPORT_PATH(vmbxengine.iby)" - + "rom/vmbxengine.iby CORE_MW_LAYER_IBY_EXPORT_PATH(vmbxengine.iby)" \ + "rom/vmbxresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(vmbxresources.iby)" +TRANSLATIONS = vmbx.ts + }