uiservicetab/vimpstui/src/cvimpstuitermsofusedialoghandler.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:33:36 +0100
branchRCL_3
changeset 23 9a48e301e94b
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 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:  Dialogue handler for TOU
*
*/


#include "cvimpstuitermsofusedialoghandler.h"
#include "cvimpstuitermsofusedlg.h"

#include "cvimpstsettingsstore.h"
#include <vimpstuires.rsg>
#include <avkon.hrh>
#include "uiservicetabtracer.h"




    
// ======== MEMBER FUNCTIONS ========

// ---------------------------------------------------------------------------
// CVIMPSTUiTermsOfUseDialogHandler::HandleTermsOfUseDialogLD
// ---------------------------------------------------------------------------
//
TInt CVIMPSTUiTermsOfUseDialogHandler::HandleTermsOfUseDialogLD(    
        MVIMPSTSettingsStore& aSettingsStore,
        const TDesC& /*aUserName*/,
        TInt& aServiceId,
        HBufC* aToUMsg/* = NULL*/)
    {   
	TRACER_AUTO;
    // Show Terms of Use, return KErrCancel if user does not accept them,
    // otherwise continue
    if ( !DisplayTermsOfUseAndQueryLD(aToUMsg) )
        {
        // User canceled ToU query, login cancelled
        // note is already shown inside DisplayTermsOfUseAndQueryL
        // method, just return KErrCancel
        //CleanupStack::PopAndDestroy(tmpSap);
        return KErrCancel;
        }
    else
        {
        TInt touOff =1;
        aSettingsStore.SetL(aServiceId, ETOUDlgOff, touOff ); 
        }
    return KErrNone;
    }

// -----------------------------------------------------------------------------
// CVIMPSTUiTermsOfUseDialogHandler::DisplayTermsOfUseAndQueryLD()
// -----------------------------------------------------------------------------
//
TBool CVIMPSTUiTermsOfUseDialogHandler::DisplayTermsOfUseAndQueryLD(HBufC* aToUMsg/* = NULL*/)
    {
	TRACER_AUTO;
    TInt retVal = EAknSoftkeyCancel;    
    CVIMPSTUiTermsOfUseDlg* dlg = CVIMPSTUiTermsOfUseDlg::NewLC(  );
    dlg->SetToUMsgL(aToUMsg);
    retVal = dlg->RunDialogLD( R_CNUI_TERMS_OF_USE_DIALOG );
    CleanupStack::Pop(dlg);
    if ( retVal == EAknSoftkeyOk ||  retVal == EAknSoftkeyYes)
        {                
        return ETrue;
        }
    else 
        {    
        return EFalse;
        }
    }

//End of File