examples/Telephony/ETel3rdPartyExample/Shared/TelephonyISVExamples.cpp

00001 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 //
00015 
00016 
00017 #include "TelephonyISVExamples.h"
00018 #include "CMainMenu.h"
00019 
00023 void MainL(CConsoleBase& aConsole)
00024         {
00025         CMainMenu* menu = CMainMenu::NewLC(aConsole);
00026         menu->Start();
00027         
00028         // Start the active scheduler
00029         CActiveScheduler::Start();
00030         CleanupStack::PopAndDestroy(menu);
00031         }
00032 
00036 void ConsoleMainL()
00037         {
00038         // Get a console
00039         CConsoleBase* aConsole = Console::NewL(_L("Telephony ISV API Example"),
00040                                                TSize(KConsFullScreen,
00041                                                KConsFullScreen));
00042         CleanupStack::PushL(aConsole);
00043         CActiveScheduler* sched = new(ELeave) CActiveScheduler();
00044         
00045         // Push the active scheduler object onto the cleanup stack.
00046         CleanupStack::PushL(sched);
00047         
00048         // Install active scheduler
00049         CActiveScheduler::Install(sched);
00050 
00051         // Call function
00052         MainL(*aConsole);
00053 
00054         aConsole->Printf(_L("[ Press any key to end ]"));
00055         aConsole->Getch();
00056         
00057         // Finished with console
00058         CleanupStack::PopAndDestroy(sched);
00059         CleanupStack::PopAndDestroy(aConsole);
00060         }
00061 
00065 GLDEF_C TInt E32Main()
00066         {
00067         __UHEAP_MARK;
00068         CTrapCleanup* cleanupStack = CTrapCleanup::New();
00069         TRAPD(error, ConsoleMainL());
00070         __ASSERT_ALWAYS(!error, User::Panic(_L("Console main error\n"), error));
00071         delete cleanupStack;
00072         __UHEAP_MARKEND;
00073         return KErrNone;
00074         }
00075 

Generated by  doxygen 1.6.2