diff -r 13d7c31c74e0 -r b183ec05bd8c syncmlfw/syncmlnotifier/src/SyncMLNotifierMain.cpp --- a/syncmlfw/syncmlnotifier/src/SyncMLNotifierMain.cpp Thu Aug 19 10:44:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* 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: Methods for the SyncML Appserver starter notifier -* -*/ - - - -// INCLUDE FILES -#include - -// All provided notifiers -#include "SyncMLAppLaunchNotifier.h" -#include "SyncMLDlgNotifier.h" -#include "SyncMLFwUpdNotifier.h" - -#include "SyncMLNotifDebug.h" - -// CONSTANTS - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CleanupArray -// Deletes notifiers -// ----------------------------------------------------------------------------- -LOCAL_C void CleanupArray( TAny* aArray ) - { - FLOG(_L("[SmlNotif]\t CleanupArray()")); - - CArrayPtrFlat* - subjects = static_cast*>(aArray); - TInt lastInd = subjects->Count() - 1; - for ( TInt i = lastInd; i >= 0; i-- ) - { - subjects->At(i)->Release(); - } - delete subjects; - - FLOG(_L("[SmlNotif]\t CleanupArray() completed")); - } - -// ----------------------------------------------------------------------------- -// CreateSmlNotifiersL -// Instantiate notifiers -// ----------------------------------------------------------------------------- -LOCAL_C CArrayPtrFlat* CreateSmlNotifiersL() - { - FLOG(_L("[SmlNotif]\t CreateSmlNotifiersL")); - - CArrayPtrFlat* notifiers = - new ( ELeave ) CArrayPtrFlat - ( KSmlNotifierArrayIncrement ); - - CleanupStack::PushL( TCleanupItem( CleanupArray, notifiers ) ); - - CSyncMLAppLaunchNotifier* appLaunchNotifier = CSyncMLAppLaunchNotifier::NewL(); - CleanupStack::PushL( appLaunchNotifier ); - notifiers->AppendL( appLaunchNotifier ); - CleanupStack::Pop( appLaunchNotifier ); - - CSyncMLDlgNotifier* dlgNotifier = CSyncMLDlgNotifier::NewL( appLaunchNotifier ); - CleanupStack::PushL( dlgNotifier ); - notifiers->AppendL( dlgNotifier ); - CleanupStack::Pop( dlgNotifier ); - - CSyncMLFwUpdNotifier* fwUpdNotifier = CSyncMLFwUpdNotifier::NewL(); - CleanupStack::PushL( fwUpdNotifier ); - notifiers->AppendL( fwUpdNotifier ); - CleanupStack::Pop( fwUpdNotifier ); - - CleanupStack::Pop( notifiers ); - - FLOG(_L("[SmlNotif]\t CreateSmlNotifiersL completed")); - return notifiers; - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// NotifierArray -// Lib main entry point: Creates a notifiers array. -// ----------------------------------------------------------------------------- -EXPORT_C CArrayPtr* NotifierArray() - { - FLOG( _L("[SMLNOTIF]\t NotifierArray") ); - - CArrayPtrFlat* notifiers = NULL; - TRAPD( err, notifiers = CreateSmlNotifiersL() ); - - if( err != KErrNone ) - { - FTRACE(FPrint(_L("[SmlNotif]\t Notifier creation failure! Error code: %d"), err)); - err = KErrNone; - } - - FLOG(_L("[SmlNotif]\t NotifierArray completed")); - - return notifiers; - } - -// End of File