Nokia N97 SDK
Example Applications Guide

CAnimationAppUi Class Reference

#include <animationappui.h>

Inheritance diagram for CAnimationAppUi:

List of all members.

Detailed Description

CAnimationAppUi application UI class. An instance of class CAnimationAppUi is the UserInterface part of the AVKON application framework for the Animation example application.

Definition at line 45 of file animationappui.h.


Public Member Functions

  CAnimationAppUi (RWsSession &aSession)
virtual  ~CAnimationAppUi ()
void  HandleCommandL (TInt aCommand)
void  HandleResourceChangeL (TInt aType)

Private Member Functions

void  ConstructL ()
void  SetupClientDllL ()
void  SetupImageCommanderL ()

Private Attributes

CAnimationAppView *  iAppView
RClientDll  iClientDll
RImageCommander  iClientCommander


Constructor & Destructor Documentation

CAnimationAppUi::CAnimationAppUi (  RWsSession &  aSession  ) 
 

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

Parameters:
aSession  the window server session to use.

Definition at line 37 of file animationappui.cpp.

00038     : CAknAppUi(),                                // Base class constructor
00039       iClientDll( aSession ),                     // Animation client dll
00040       iClientCommander( iClientDll )              // Animation client object
00041     {
00042     // No implementation required
00043     }

CAnimationAppUi::~CAnimationAppUi (   )  [virtual]
 

~CAnimationAppUi. Virtual Destructor.

Definition at line 103 of file animationappui.cpp.

References iAppView, iClientCommander, and iClientDll.

00104     {
00105     // remove the application view from the stack
00106     RemoveFromStack( iAppView );
00107 
00108     // Close the animation object
00109     iClientCommander.Close ();
00110 
00111     // Close the animation server
00112     iClientDll.Close();
00113 
00114     // Delete and NULL the application view
00115     delete iAppView;
00116     iAppView = NULL;
00117     }


Member Function Documentation

void CAnimationAppUi::HandleCommandL (  TInt  aCommand  ) 
 

From CEikAppUi, HandleCommandL. Takes care of command handling.

Parameters:
aCommand  The enumerated code for the option selected.

Definition at line 124 of file animationappui.cpp.

References iClientCommander, and RImageCommander::ImageCommand().

00125     {
00126     switch( aCommand )
00127         {
00128     // Exit the application
00129     case EEikCmdExit:
00130     case EAknSoftkeyExit:
00131         Exit();
00132         break;
00133 
00134     // Ask the animation to do something, in this case, reset
00135     case EEikCmdReset:
00136         iClientCommander.ImageCommand( RImageCommander::KAnimationReset );
00137         break;
00138 
00139     default:
00140         break;
00141         }
00142     }

void CAnimationAppUi::HandleResourceChangeL (  TInt  aType  ) 
 

From CEikAppUi, HandleResourceChangeL. Handles resource changes.

Parameters:
aType  Resource change type to be handled

Definition at line 150 of file animationappui.cpp.

References CAnimationAppView::HandleResolutionChange(), iAppView, iClientCommander, and RImageCommander::ImageCommand().

00151     {
00152     CAknAppUi::HandleResourceChangeL( aType );
00153     if  ( aType == KEikDynamicLayoutVariantSwitch )
00154         {
00155         iAppView->HandleResolutionChange( ClientRect() );
00156         iClientCommander.ImageCommand( RImageCommander::KResolutionChange );
00157         }
00158     }

void CAnimationAppUi::ConstructL (   )  [private]
 

ConstructL. 2nd phase constructor.

Definition at line 50 of file animationappui.cpp.

References iAppView, CAnimationAppView::NewL(), SetupClientDllL(), and SetupImageCommanderL().

00051     {
00052     // Perform the base class construction
00053     BaseConstructL(EAknEnableSkin);
00054 
00055     // Create an application view
00056     iAppView = CAnimationAppView::NewL( ClientRect() );
00057 
00058     // Allow the appview to receive keyboard input
00059     AddToStackL( iAppView );
00060 
00061     // Initialise the RClientDll class
00062     SetupClientDllL();
00063 
00064     // Initialise the RImageCommander class
00065     SetupImageCommanderL();
00066     }

void CAnimationAppUi::SetupClientDllL (   )  [private]
 

SetupClientDllL. Setup the animation client Dll.

Definition at line 73 of file animationappui.cpp.

References iClientDll.

Referenced by ConstructL().

00074     {
00075     // Create the server dll filename
00076     TFileName serverDllFilename( KServerDllFilename );
00077 
00078     // Load the animation server, if an error occurs then
00079     // let higher level handle the problem
00080     User::LeaveIfError( iClientDll.Load( serverDllFilename ) );
00081     }

void CAnimationAppUi::SetupImageCommanderL (   )  [private]
 

SetupImageCommanderL. Setup the animation image commander.

Definition at line 88 of file animationappui.cpp.

References iAppView, iClientCommander, and RImageCommander::ImageConstruct().

Referenced by ConstructL().

00089     {
00090     // Tell client to construct a server side object
00091     TBuf8<1> params( TInt8( 0 ) );
00092     RWindowBase* windowBase = iAppView->DrawableWindow();
00093     iClientCommander.ImageConstruct( *windowBase, 
00094                                      RImageCommander::KAnimationSquare, 
00095                                      params );
00096     }


Member Data Documentation

CAnimationAppView* CAnimationAppUi::iAppView [private]
 

iAppView The application view Owned by CAnimationAppUi object.

Definition at line 108 of file animationappui.h.

Referenced by ConstructL(), HandleResourceChangeL(), SetupImageCommanderL(), and ~CAnimationAppUi().

RClientDll CAnimationAppUi::iClientDll [private]
 

iClientDll Animation client dll.

Definition at line 117 of file animationappui.h.

Referenced by SetupClientDllL(), and ~CAnimationAppUi().

RImageCommander CAnimationAppUi::iClientCommander [private]
 

iClientCommander Controls an animation image object.

Definition at line 123 of file animationappui.h.

Referenced by HandleCommandL(), HandleResourceChangeL(), SetupImageCommanderL(), and ~CAnimationAppUi().


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

© Nokia 2009

Back to top