diff -r f742655b05bf -r d38647835c2e convergedconnectionhandler/cchclientapi/cchuinotif/src/cchuinotifiermain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/convergedconnectionhandler/cchclientapi/cchuinotif/src/cchuinotifiermain.cpp Wed Sep 01 12:29:57 2010 +0100 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2008-2008 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: Implements notifier creation, required for notifier fw. +* +*/ + + +#include +#include + +#include "cchuinotifierimpl.h" + +const TInt KCchUiNotifierArrayIncrement = 10; + + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Instantiate notifiers. +// --------------------------------------------------------------------------- +// +LOCAL_C void CreateCchUiNotifiersL( + CArrayPtrFlat* aNotifiers ) + { + __ASSERT_ALWAYS( aNotifiers, User::Leave( KErrArgument ) ); + CCCHUiNotifierImpl* notifierImpl = + CCCHUiNotifierImpl::NewL(); + CleanupStack::PushL( notifierImpl ); + aNotifiers->AppendL( notifierImpl ); + CleanupStack::Pop( notifierImpl ); + } + +// --------------------------------------------------------------------------- +// Creates a notifiers array. +// --------------------------------------------------------------------------- +// +EXPORT_C CArrayPtr* NotifierArray() + { + CArrayPtrFlat* notifiers = NULL; + + TRAPD(err, notifiers = + new (ELeave)CArrayPtrFlat( + KCchUiNotifierArrayIncrement )); + + if ( err == KErrNone ) + { + if( notifiers ) + { + TRAPD( err2, CreateCchUiNotifiersL( notifiers )); + if( err2 ) + { + TInt count = notifiers->Count(); + while(count--) + (*notifiers)[count]->Release(); + delete notifiers; + notifiers = NULL; + } + } + } + else + { + } + + return notifiers; + } + + +