S60 3rd Edition SDK for Symbian OS
Example Applications Guide

IsvTelCallAppView.cpp

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

© Nokia 2006

Back to top