S60 3rd Edition SDK for Symbian OS
Example Applications Guide

IsvTelInfoAppView.cpp

00001 /*
00002 * ==============================================================================
00003 *  Name        : IsvTelInfoAppView.cpp
00004 *  Part of     : IsvTelInfoApp
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 <avkon.hrh>
00018 #include <akntitle.h>
00019 #include <aknviewappui.h>
00020 #include <IsvTelInfoApp.rsg>
00021 
00022 #include <eikmfne.h>
00023 #include <eikedwin.h>
00024 #include <eikcapc.h>
00025 
00026 #include "IsvTelInfoApp.hrh"
00027 #include "IsvTelInfoAppView.h"
00028 #include "IsvTelInfoAppContainer.h"
00029 
00030 // CONSTANTS
00031 const TUid KViewId = { 1 }; // UID of view
00032 
00033 // ================= MEMBER FUNCTIONS =========================================
00034 
00035 // ----------------------------------------------------------------------------
00036 // CIsvTelInfoAppView::CIsvTelInfoAppView()
00037 // Default constructor.
00038 // ----------------------------------------------------------------------------
00039 //
00040 CIsvTelInfoAppView::CIsvTelInfoAppView()
00041     :   iContainer( NULL )
00042     {
00043     }
00044 
00045 // ----------------------------------------------------------------------------
00046 // void CIsvTelInfoAppView::ConstructL()
00047 // A Second phase constructor
00048 // ----------------------------------------------------------------------------
00049 //
00050 void CIsvTelInfoAppView::ConstructL()
00051     {
00052     BaseConstructL( R_ISVTELINFOAPP_VIEW );
00053     iContainer = new( ELeave ) CIsvTelInfoAppContainer( this );
00054     }
00055 
00056 // ----------------------------------------------------------------------------
00057 // CIsvTelInfoAppView::~CIsvTelInfoAppView()
00058 // Destructor.
00059 // ----------------------------------------------------------------------------
00060 //
00061 CIsvTelInfoAppView::~CIsvTelInfoAppView()
00062     {
00063     // Deletes the container class object.
00064     if ( iContainer )
00065         {
00066         // Removes container from view control stack.
00067         AppUi()->RemoveFromStack( iContainer );
00068         }
00069     delete iContainer;
00070     }
00071 
00072 // ----------------------------------------------------------------------------
00073 // TUid CIsvTelInfoAppView::Id()
00074 // Returns ID of view.
00075 // ----------------------------------------------------------------------------
00076 //
00077 TUid CIsvTelInfoAppView::Id() const
00078     {
00079     return KViewId;
00080     }
00081 
00082 // ----------------------------------------------------------------------------
00083 // void CIsvTelInfoAppView::HandleCommandL( TInt )
00084 // Handles the commands.
00085 // ----------------------------------------------------------------------------
00086 //
00087 void CIsvTelInfoAppView::HandleCommandL( TInt aCommand )
00088     {
00089     switch ( aCommand )
00090         {
00091         /*case EAknSoftkeyBack and EAknCmdExitare handled by the AppUi class.*/        
00092         case EIsvTelInfoAppCmdLaunchPhOps:
00093             iContainer->DisplayFormL( R_ISVTELINFOAPP_NAVIPANE_DIALOG,
00094                 EIsvTelInfoAppPageCtrlIdPagePhoneInfo);
00095             break;
00096         default:
00097             break;
00098         }
00099     }
00100 
00101 // ----------------------------------------------------------------------------
00102 // CAknTitlePane* CIsvTelInfoAppView::GetTitlePaneL(void)
00103 // ----------------------------------------------------------------------------
00104 //
00105 CAknTitlePane* CIsvTelInfoAppView::GetTitlePaneL(void)
00106     {
00107     CAknTitlePane* titlePane = STATIC_CAST(
00108     CAknTitlePane*,
00109     StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
00110 
00111     return(titlePane);
00112     }
00113 
00114 // ----------------------------------------------------------------------------
00115 // void CIsvTelInfoAppView::DoActivateL( const TVwsViewId&, TUid, const TDesC8& )
00116 // Creates container class object.
00117 // ----------------------------------------------------------------------------
00118 //
00119 void CIsvTelInfoAppView::DoActivateL(
00120     const TVwsViewId& /*aPrevViewId*/,
00121     TUid /*aCustomMessageId*/,
00122     const TDesC8& /*aCustomMessage*/ )
00123     {
00124     // Creates container object.
00125     if ( iContainer )
00126         {
00127         iContainer->SetMopParent(this);
00128         iContainer->ConstructL( ClientRect() );
00129         // Adds container to view control stack.
00130         AppUi()->AddToStackL( *this, iContainer );
00131         }
00132     }
00133 
00134 // ----------------------------------------------------------------------------
00135 // void CIsvTelInfoAppView::DoDeactivate()
00136 // Deletes container class object.
00137 // ----------------------------------------------------------------------------
00138 //
00139 void CIsvTelInfoAppView::DoDeactivate()
00140     {
00141     // Deletes the container class object.
00142     if ( iContainer )
00143         {
00144         // Removes container from view control stack.
00145         AppUi()->RemoveFromStack( iContainer );
00146         delete iContainer;
00147         iContainer = NULL;
00148         }
00149     }
00150 
00151 // End of File

© Nokia 2006

Back to top