examples/SFExamples/symbian_os_communications_programming_book_v2/chapter8/receivingmessages/SummaryScreen.cpp

00001 // 
00002 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
00003 // All rights reserved.
00004 // This component and the accompanying materials are made available
00005 // under the terms of the License "Eclipse Public License v1.0"
00006 // which accompanies this distribution, and is available
00007 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00008 // 
00009 // Initial Contributors:
00010 // Nokia Corporation - initial contribution.
00011 // 
00012 // Contributors:
00013 // 
00014 // Description:
00015 // 
00016 
00017 
00018 #include "CMessageSummaryGenerator.h"
00019 #include "CMessageSummaryEngine.h"
00020 #include "CSummaryScreenUI.h"
00021 #include "SummaryScreenLog.h"
00022 
00023 _LIT(KSummaryScreenText,"Summary Screen");
00024 _LIT(KFormatFailed,"failed: leave code=%d");
00025 _LIT(KTxtOK,"ok");
00026 _LIT(KTxtPressAnyKey," [press any key]");
00027 
00028 static CConsoleBase* console;
00029 
00030 LOCAL_C void startUiL(); // Initialize with cleanup stack, then start the UI
00031 
00032 GLDEF_C TInt E32Main() // Main function called by E32
00033     {
00034         __UHEAP_MARK;
00035         CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack
00036         TRAPD(error,startUiL()); // more initialization, then do example
00037         __ASSERT_ALWAYS(!error,User::Panic(KSummaryScreenText,error));
00038         delete cleanup; // destroy clean-up stack
00039         __UHEAP_MARKEND;
00040         return 0; // and return
00041     }
00042 
00043 LOCAL_C void startUiL() // initialize and call example code under cleanup stack
00044     {
00045         LOG(">> startUiL()");
00046         console=Console::NewL(KSummaryScreenText,TSize(KConsFullScreen,KConsFullScreen));
00047         CleanupStack::PushL(console);
00048 
00049         CActiveScheduler scheduler;
00050         CActiveScheduler::Install(&scheduler);
00051         
00052         CSummaryScreenUI* summaryScreen = CSummaryScreenUI::NewLC(*console);
00053 
00054         summaryScreen->StartL();
00055 
00056         CleanupStack::Pop(summaryScreen);
00057 
00058         console->Printf(KTxtPressAnyKey);
00059         console->Getch(); // get and ignore character
00060         CleanupStack::PopAndDestroy(); // close console
00061         LOG("<< startUiL()");
00062     }

Generated by  doxygen 1.6.2