diff -r 6ca72c0fe49a -r a941bc465d9f wvuing/IMPSConnectionUI/ConnectionSrc/IMPSPresenceLoginDetailValidator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wvuing/IMPSConnectionUI/ConnectionSrc/IMPSPresenceLoginDetailValidator.cpp Wed Sep 01 12:31:13 2010 +0100 @@ -0,0 +1,70 @@ +/* +* 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: IMPS Presence login detail validator +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include "IMPSPresenceLoginDetailValidator.h" +#include "CnUiIMPSIdValidator.h" +#include "IMPSCommonUiDebugPrint.h" + +// ================= MEMBER FUNCTIONS ======================= +// ----------------------------------------------------------------------------- +// IMPSPresenceLoginDetailValidator::ValidWVLoginIdL() +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool IMPSPresenceLoginDetailValidator::ValidWVLoginIdL( const TDesC& aWvId ) + { + IMPSCUI_DP( D_IMPSCUI_LIT( "IMPSPresenceLoginDetailValidator::ValidWVLoginIdL() [%S]" ), &aWvId ); + return CnUiIMPSIdValidator::ValidLoginIdL( aWvId ); + } + + +// ----------------------------------------------------------------------------- +// IMPSPresenceLoginDetailValidator::ValidWVLoginIAPL() +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool IMPSPresenceLoginDetailValidator::ValidWVLoginIAPL( TUint32 aIAP ) + { + IMPSCUI_DP( D_IMPSCUI_LIT( "IMPSPresenceLoginDetailValidator::ValidWVLoginIAPL() [%d]" ), aIAP ); + + CCommsDatabase* commsDb = CCommsDatabase::NewL( EDatabaseTypeIAP ); + CleanupStack::PushL( commsDb ); + CApUtils* apUtils = CApUtils::NewLC( *commsDb ); + + TBool isValid = EFalse; + TBool exits = EFalse; + + //apUtils->IAPExistsL might leave if aIAP doesn't exist. + //we want return this existence status as TBool, so a TRAP here. + TRAPD( err, ( exits = apUtils->IAPExistsL( aIAP ) ) ) + if ( ( err == KErrNone ) && exits ) + { + isValid = ETrue; + } + + CleanupStack::PopAndDestroy( 2 ); // apUtils, commsDb + return isValid; + } + + +// End of File + + + +