S60 5th Edition SDK
Example Applications Guide

CCSAsyncAppUi Class Reference

#include <csasyncappui.h>

Inheritance diagram for CCSAsyncAppUi:

MAsyncTimeObserver List of all members.

Detailed Description

CCSAsyncAppUi An instance of class CCSAsyncAppUi is the UserInterface part of the AVKON application framework for the CSAsync example application

Definition at line 34 of file csasyncappui.h.

Public Member Functions

 CCSAsyncAppUi ()
virtual ~CCSAsyncAppUi ()
void HandleCommandL (TInt aCommand)
void DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane)
void HandleTimeUpdate ()
virtual void HandleResourceChangeL (TInt aType)

Private Member Functions

void ConstructL ()
CCSAsyncDocumentAsyncDocument () const

Private Attributes

CCSAsyncAppViewiAppView


Constructor & Destructor Documentation

CCSAsyncAppUi::CCSAsyncAppUi  ) 
 

CCSAsyncAppUi. C++ default constructor. This needs to be public due to the way the framework constructs the AppUi.

Definition at line 35 of file csasyncappui.cpp.

00036     {
00037     // No implementation required
00038     }

CCSAsyncAppUi::~CCSAsyncAppUi  )  [virtual]
 

~CCSAsyncAppUi. Destructor. Destroys the object and release all memory objects.

Definition at line 59 of file csasyncappui.cpp.

References iAppView.

00060     {
00061     if ( iAppView )
00062         {
00063         iEikonEnv->RemoveFromStack( iAppView );
00064         delete iAppView;
00065         iAppView = NULL;
00066         }
00067     }


Member Function Documentation

void CCSAsyncAppUi::HandleCommandL TInt  aCommand  ) 
 

From CAknAppUi, HandleCommandL. Handles user menu selections.

Parameters:
aCommand The enumerated code for the option selected.

Definition at line 84 of file csasyncappui.cpp.

References AsyncDocument(), CCSAsyncDocument::StopClock(), and CCSAsyncDocument::UpdateTime().

00085     {
00086     switch( aCommand )
00087         {
00088         case EEikCmdExit:
00089         case EAknSoftkeyExit:
00090             Exit();
00091             break;
00092 
00093         case EStartClock:
00094             AsyncDocument()->UpdateTime();
00095             break;
00096 
00097         case EStopClock:
00098             AsyncDocument()->StopClock();
00099             break;
00100 
00101         default:
00102             break;
00103         }
00104     }

void CCSAsyncAppUi::DynInitMenuPaneL TInt  aResourceId,
CEikMenuPane *  aMenuPane
 

From CAknAppUi, DynInitMenuPaneL. Prepares the menu prior to display.

Parameters:
aResourceId The resource for the menu to be displayed.
aMenuPane The handle to the menu.

Definition at line 123 of file csasyncappui.cpp.

References AsyncDocument().

00125     {
00126     if ( aResourceId == R_CSASYNC_MENU )
00127         {
00128         if ( AsyncDocument()->ClockActive() )
00129             {
00130             aMenuPane->SetItemDimmed( EStartClock, ETrue );
00131             aMenuPane->SetItemDimmed( EStopClock, EFalse );
00132             }
00133         else
00134             {
00135             aMenuPane->SetItemDimmed( EStartClock, EFalse );
00136             aMenuPane->SetItemDimmed( EStopClock, ETrue );
00137             }
00138         }
00139     }

void CCSAsyncAppUi::HandleTimeUpdate  )  [virtual]
 

From MAsyncTimeObserver, HandleTimeUpdate. Handles updates to the time.

Implements MAsyncTimeObserver.

Definition at line 111 of file csasyncappui.cpp.

References iAppView.

00112     {
00113     __ASSERT_ALWAYS( iAppView, User::Panic ( KCSAsyncClient, 
00114                                              ECSAsyncProgram ) );
00115     iAppView->DrawNow();
00116     }

void CCSAsyncAppUi::HandleResourceChangeL TInt  aType  )  [virtual]
 

HandleResourceChangeL() Called by framework when layout is changed.

Parameters:
aType The type of resources that have changed.

Definition at line 146 of file csasyncappui.cpp.

References iAppView.

00147     {
00148     CAknAppUi::HandleResourceChangeL( aType );
00149 
00150     if ( aType==KEikDynamicLayoutVariantSwitch )
00151         {
00152         iAppView->SetRect( ClientRect() );
00153         }
00154     //Controls derived from CCoeControl, handled in container class
00155     iAppView->HandleResourceChange( aType );
00156     }

void CCSAsyncAppUi::ConstructL  )  [private]
 

ConstructL. 2nd phase constructor.

Definition at line 45 of file csasyncappui.cpp.

References AsyncDocument(), iAppView, and CCSAsyncAppView::NewL().

00046     {
00047     BaseConstructL();
00048 
00049     iAppView = CCSAsyncAppView::NewL( ClientRect(), *AsyncDocument() );
00050 
00051     AddToStackL( iAppView );
00052     }

CCSAsyncDocument * CCSAsyncAppUi::AsyncDocument  )  const [private]
 

AsyncDocument. Casts iDocument member from CAknAppUi to CCSAsyncDocument.

Definition at line 74 of file csasyncappui.cpp.

Referenced by ConstructL(), DynInitMenuPaneL(), and HandleCommandL().

00075     {
00076     return ( static_cast<CCSAsyncDocument*>( iDocument ) );
00077     }


Member Data Documentation

CCSAsyncAppView* CCSAsyncAppUi::iAppView [private]
 

iAppView, the application view. Owned by CCSAsyncAppUi object.

Definition at line 103 of file csasyncappui.h.

Referenced by ConstructL(), HandleResourceChangeL(), HandleTimeUpdate(), and ~CCSAsyncAppUi().


The documentation for this class was generated from the following files:

© Nokia 2009

Back to top