connectionutilities/ConnectionDialogs/cconndlg/src/NewIapDialog.cpp
author Simon Howkins <simonh@symbian.org>
Thu, 18 Nov 2010 15:05:52 +0000
branchRCL_3
changeset 76 40780c2f3a6b
parent 0 5a93021fdf25
permissions -rw-r--r--
Adjusted to avoid exports, etc, from a top-level bld.inf

/*
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Implementation of class CNewIapDialog.
*
*/



// INCLUDE FILES
#include "NewIapDialog.h"
#include "ConnDlgPlugin.h"
#include "ExpiryTimer.h"

#include <uikon/eiksrvui.h>
#include <StringLoader.h>

#include <CConnDlgPlugin.rsg>


// CONST DECLARATIONS

#if defined(_DEBUG)
_LIT( KErrNullPointer, "NULL pointer" );
#endif


// ================= MEMBER FUNCTIONS =======================
//
// ---------------------------------------------------------
// CNewIapDialog::CNewIapDialog
// ---------------------------------------------------------
//
CNewIapDialog::CNewIapDialog( CConnDlgNewIapPlugin* aPlugin, TBool& aConnect,
                              const TNewIapConnectionPrefs& aPrefs )
: iPlugin( aPlugin ),
  iConnect( aConnect ),
  iPrefs( aPrefs )
    {
    }


// ---------------------------------------------------------
// CNewIapDialog::~CNewIapDialog
// ---------------------------------------------------------
//
CNewIapDialog::~CNewIapDialog()
    {
    STATIC_CAST( CEikServAppUi*, 
                CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse );
    delete iExpiryTimer;
    }

// ---------------------------------------------------------
// CNewIapDialog::PreLayoutDynInitL
// ---------------------------------------------------------
//
void CNewIapDialog::PreLayoutDynInitL()
    {
    CAknQueryDialog::PreLayoutDynInitL();

    STATIC_CAST( CEikServAppUi*, 
                CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue );

    // New connection name
    HBufC *msg = StringLoader::LoadL( R_CONNDLG_NEW_CONNECTION_ATTEMPT, 
                                      iPrefs.iName );
    CleanupStack::PushL( msg );
    SetPromptL( msg->Des() );
    CleanupStack::PopAndDestroy( msg );
    
    iExpiryTimer = CExpiryTimer::NewL( *this );
    iExpiryTimer->Start();
    }


// ---------------------------------------------------------
// CNewIapDialog::OkToExitL
// ---------------------------------------------------------
//
TBool CNewIapDialog::OkToExitL( TInt aButtonId )
    {
    iConnect = EFalse;
    if ( aButtonId == EAknSoftkeyYes || aButtonId == EAknSoftkeyDone || 
         aButtonId == EAknSoftkeyOk )
        {
        iConnect = ETrue;
        }

    __ASSERT_DEBUG( iPlugin, User::Panic( KErrNullPointer, KErrNone ) );
    iPlugin->CompleteL( KErrNone );

    return( ETrue );
    }

void CNewIapDialog::HandleTimedOut()
    {
    TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) );
    }

// End of File