S60 3rd Edition SDK for Symbian OS
Example Applications Guide

SatelliteReferenceAppUi.cpp

00001 /*
00002 * ==============================================================================
00003 *  Name        : SatelliteReferenceAppUi
00004 *  Part of     : Satellite Reference App
00005 *  Interface   : 
00006 *  Description : 
00007 *  Version     : 
00008 *
00009 *  Copyright (c) 2005-2006 Nokia Corporation.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia Corporation.
00013 * ==============================================================================
00014 */
00015 
00016 // INCLUDE FILES
00017 #include "SatelliteReferenceAppUi.h"
00018 #include "SatelliteReferenceContainer.h" 
00019 #include <SatelliteReference.rsg>
00020 #include "SatelliteReference.hrh"
00021 #include <StringLoader.h>
00022 
00023 #include <avkon.hrh>
00024 
00025 // ================= MEMBER FUNCTIONS =======================
00026 //
00027 // ----------------------------------------------------------
00028 // CSatelliteReferenceAppUi::ConstructL()
00029 // ----------------------------------------------------------
00030 //
00031 void CSatelliteReferenceAppUi::ConstructL()
00032     {
00033     BaseConstructL();
00034     iAppContainer = new (ELeave) CSatelliteReferenceContainer;
00035     iAppContainer->SetMopParent(this);
00036     iAppContainer->ConstructL( ClientRect(), this);
00037     AddToStackL( iAppContainer );
00038     }
00039 
00040 // ----------------------------------------------------
00041 // CSatelliteReferenceAppUi::~CSatelliteReferenceAppUi()
00042 // Destructor
00043 // Frees reserved resources
00044 // ----------------------------------------------------
00045 //
00046 CSatelliteReferenceAppUi::~CSatelliteReferenceAppUi()
00047     {
00048     if (iAppContainer)
00049         {
00050         RemoveFromStack( iAppContainer );
00051         delete iAppContainer;
00052         }
00053    }
00054 
00055 // ------------------------------------------------------------------------------
00056 //  CSatelliteReferenceAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
00057 //  This function is called by the EIKON framework just before it displays
00058 //  a menu pane. Its default implementation is empty, and by overriding it,
00059 //  the application can set the state of menu items dynamically according
00060 //  to the state of application data.
00061 // ------------------------------------------------------------------------------
00062 //
00063 void CSatelliteReferenceAppUi::DynInitMenuPaneL(
00064     TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
00065     {
00066     }
00067 
00068 // ----------------------------------------------------
00069 // CSatelliteReferenceAppUi::HandleKeyEventL(
00070 //     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
00071 // ----------------------------------------------------
00072 //
00073 TKeyResponse CSatelliteReferenceAppUi::HandleKeyEventL(
00074     const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
00075     {
00076     return EKeyWasNotConsumed;
00077     }
00078     
00079 // ------------------------------------------------------------------
00080 // CSatelliteReferenceAppUi::HandleForegroundEventL(TBool aForeground)
00081 // ------------------------------------------------------------------
00082 //
00083 void CSatelliteReferenceAppUi::HandleForegroundEventL(TBool aForeground)
00084         {
00085         if(iSatelliteInfo)      
00086                 {
00087                 iSatelliteInfo->HandleForegroundEventL(aForeground);                    
00088                 }
00089         }
00090 
00091 // ----------------------------------------------------
00092 // CSatelliteReferenceAppUi::HandleCommandL(TInt aCommand)
00093 // ----------------------------------------------------
00094 //
00095 void CSatelliteReferenceAppUi::HandleCommandL(TInt aCommand)
00096     {
00097     switch ( aCommand )
00098         {
00099         case EAknSoftkeyBack:
00100         case EEikCmdExit:
00101             {
00102             Exit();
00103             break;
00104             }
00105             
00106         case ESatelliteInfoCmd:
00107                 {
00108                 HBufC* srvName = StringLoader::LoadLC( 
00109                                       R_SATREF_SERVICE_RULE_NAME, 
00110                                       CEikonEnv::Static() );
00111                 // Creating instance of CSatelliteInfo
00112                 iSatelliteInfo = CSatelliteInfoUI::NewL();
00113                 
00114                 // ExecuteLD displays the satellite dialog.
00115                 // The dialog display satellite ID's along with 
00116                 // their signal strengths depicted using bar's.
00117                 iSatelliteInfo->ExecuteLD(*srvName);
00118                 
00119                 CleanupStack::PopAndDestroy(srvName); //srvName
00120                 iSatelliteInfo = NULL;
00121                 break;
00122                 }        
00123                         
00124         default:
00125                 {
00126                 break;
00127                 }            
00128         }
00129     }
00130 
00131 // End of File  

© Nokia 2006

Back to top