00001 /* 00002 * Copyright © 2008 Nokia Corporation. 00003 */ 00004 00005 00006 // INCLUDE FILES 00007 #include "CalendarAPIexampleAppUi.h" 00008 #include "CalendarAPIexampleSearchView.h" 00009 #include "CalendarAPIexampleEntryView.h" 00010 #include "CalendarAPIexampleEntriesView.h" 00011 00012 #include "CalendarAPIexampleEngine.h" 00013 #include "CalendarAPIexampleDocument.h" 00014 #include "CalendarAPIexample.pan" 00015 00016 #include <avkon.hrh> 00017 00018 // ================= MEMBER FUNCTIONS ======================= 00019 // 00020 // ---------------------------------------------------------- 00021 // CCalendarAPIexampleAppUi::ConstructL() 00022 // 00023 // ---------------------------------------------------------- 00024 // 00025 void CCalendarAPIexampleAppUi::ConstructL() 00026 { 00027 BaseConstructL(EAknEnableSkin | EAknTouchCompatible | EAknSingleClickCompatible); 00028 00029 iEngine = CCalendarAPIexampleEngine::NewL(*this); 00030 00031 iSearchView = CCalendarAPIexampleSearchView::NewL(*iEngine); 00032 AddViewL( iSearchView ); // transfer ownership to AppUi 00033 00034 iEntryView = CCalendarAPIexampleEntryView::NewL(*iEngine); 00035 AddViewL( iEntryView ); // transfer ownership to AppUi 00036 00037 iEntriesView = CCalendarAPIexampleEntriesView::NewL(*iEngine); 00038 AddViewL( iEntriesView ); // transfer ownership to AppUi 00039 00040 ActivateView(iSearchView->Id()); 00041 } 00042 00043 // ---------------------------------------------------- 00044 // CCalendarAPIexampleAppUi::~CCalendarAPIexampleAppUi() 00045 // Destructor 00046 // Frees reserved resources 00047 // ---------------------------------------------------- 00048 // 00049 CCalendarAPIexampleAppUi::~CCalendarAPIexampleAppUi() 00050 { 00051 delete iEngine; 00052 iEngine=NULL; 00053 } 00054 00055 // ---------------------------------------------------- 00056 // CCalendarAPIexampleAppUi::HandleCommandL(TInt aCommand) 00057 // takes care of command handling 00058 // ---------------------------------------------------- 00059 // 00060 void CCalendarAPIexampleAppUi::HandleCommandL(TInt aCommand) 00061 { 00062 switch ( aCommand ) 00063 { 00064 case EAknSoftkeyBack: 00065 case EEikCmdExit: 00066 { 00067 Exit(); 00068 break; 00069 } 00070 default: 00071 break; 00072 } 00073 } 00074 00075 void CCalendarAPIexampleAppUi::ActivateView(TUid aViewId) 00076 { 00077 TRAPD(err,ActivateLocalViewL(aViewId) ); 00078 if( err ) 00079 { 00080 Panic(EViewError); 00081 } 00082 } 00083 00084 // End of File
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.