diff -r f15ac8e65a02 -r 779871d1e4f4 vtuis/videotelui/src/CVtUiActivateBtHfDialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vtuis/videotelui/src/CVtUiActivateBtHfDialog.cpp Wed Sep 01 12:29:12 2010 +0100 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2004-2006 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 CVtUiActivateBtHfDialog class. +* +*/ + + + +// INCLUDE FILES +#include "CVtUiActivateBtHfDialog.h" +#include "MVtUiEngineCommandManager.h" +#include +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CVtUiActivateBtHfDialog::CVtUiActivateBtHfDialog +// ----------------------------------------------------------------------------- +// +CVtUiActivateBtHfDialog::CVtUiActivateBtHfDialog( + CEikDialog** aSelfPtr, + TInt* aError, + MVtEngCommandHandler& aCommandHandler, + MVtUiEngineCommandManager& aCommandManager ) + : CAknWaitDialog( aSelfPtr ), + iCommandHandler( aCommandHandler ), + iCommandManager( aCommandManager ), + iError( aError ), + iAudioRouting( MVtEngAudio::EActivateBT ) + { + } + +// ----------------------------------------------------------------------------- +// CVtUiActivateBtHfDialog::~CVtUiActivateBtHfDialog +// ----------------------------------------------------------------------------- +// +CVtUiActivateBtHfDialog::~CVtUiActivateBtHfDialog() + { + if ( iError ) + { + *iError = KErrCancel; + iError = NULL; + } + + if ( iCommandPerformed ) + { + iCommandHandler.CancelCommand( KVtEngSetAudioRouting ); // ignore error + } + iCommandManager.RemoveObserver( *this ); + } + +// ----------------------------------------------------------------------------- +// CVtUiActivateBtHfDialog::ExecuteDialogLD +// ----------------------------------------------------------------------------- +// +void CVtUiActivateBtHfDialog::ExecuteDialogLD() + { + CleanupStack::PushL( this ); + iCommandManager.AddObserverL( *this ); + SetTone( CAknNoteDialog::ENoTone ); + CleanupStack::Pop( this ); + + ExecuteLD( R_VIDEOTELUI_BTHF_CONNECT_WAIT_NOTE ); + } + +// ----------------------------------------------------------------------------- +// CVtUiActivateBtHfDialog::PostLayoutDynInitL +// ----------------------------------------------------------------------------- +// +void CVtUiActivateBtHfDialog::PostLayoutDynInitL() + { + iCommandHandler.ExecuteL( KVtEngSetAudioRouting, &iAudioRouting ); + iCommandPerformed = ETrue; + + CAknWaitDialog::PostLayoutDynInitL(); + } + +// ----------------------------------------------------------------------------- +// CVtUiActivateBtHfDialog::HandleVTCommandPerformedL +// ----------------------------------------------------------------------------- +// +void CVtUiActivateBtHfDialog::HandleVTCommandPerformedL( + TVtEngCommandId aCommand, + const TInt aError ) + { + if ( aCommand == KVtEngSetAudioRouting ) + { + if ( iError ) + { + *iError = aError; + iError = NULL; + } + + ProcessFinishedL(); + } + } + +// End of File