diff -r 41a7f70b3818 -r 5266b1f337bd phoneengine/PhoneCntFinder/src/CPhoneCntNumberParser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phoneengine/PhoneCntFinder/src/CPhoneCntNumberParser.cpp Wed Sep 01 12:30:10 2010 +0100 @@ -0,0 +1,93 @@ +/* +* 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: This class loads contact model phone number parser DLL. +* +*/ + + +// INCLUDES +#include "CPhoneCntNumberParser.h" +#include +#include + +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCntNumberParser::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCntNumberParser* CCntNumberParser::NewL() + { + CCntNumberParser* self = new (ELeave) CCntNumberParser(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// Destructor +CCntNumberParser::~CCntNumberParser() + { + delete iParser; + REComSession::FinalClose(); + } + +// ----------------------------------------------------------------------------- +// CCntNumberParser::CCntNumberParser +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CContactPhoneNumberParser* + CCntNumberParser::CntPhoneNumberParser() const + { + return iParser; + } + +// ----------------------------------------------------------------------------- +// CCntNumberParser::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCntNumberParser::ConstructL() + { + RImplInfoPtrArray implInfoArray; + CleanupResetAndDestroyPushL( implInfoArray ); + REComSession::ListImplementationsL( KUidEcomCntPhoneNumberParserInterface, + implInfoArray ); + // Load the first implementation found for KUidEcomCntPhoneNumberParserInterface + const TInt count = implInfoArray.Count(); + __ASSERT_ALWAYS( count > 0, User::Leave( KErrNotFound ) ); + const TUid firstImplementationFound = implInfoArray[0]->ImplementationUid(); + iParser = reinterpret_cast + ( CContactEcomPhoneNumberParser::NewL( firstImplementationFound ) ); + CleanupStack::PopAndDestroy( &implInfoArray ); + } + +// ----------------------------------------------------------------------------- +// CCntNumberParser::CCntNumberParser +// C++ constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCntNumberParser::CCntNumberParser() + { + } + +// End of file