Nokia N97 SDK
Example Applications Guide

CLocalizationAppView Class Reference

Inheritance diagram for CLocalizationAppView:

List of all members.

Detailed Description

Definition at line 28 of file localizationappview.h.


Public Member Functions

virtual  ~CLocalizationAppView ()
void  DrawImage (CFbsBitmap *aImage)
void  Draw (const TRect &aRect) const
virtual void  SizeChanged ()

Static Public Member Functions

static CLocalizationAppView *  NewL (const TRect &aRect)
static CLocalizationAppView *  NewLC (const TRect &aRect)

Private Member Functions

void  ConstructL (const TRect &aRect)
  CLocalizationAppView ()

Private Attributes

CFbsBitmap *  iImage


Constructor & Destructor Documentation

CLocalizationAppView::~CLocalizationAppView (   )  [virtual]
 

~CLocalizationAppView Virtual Destructor.

Definition at line 83 of file localizationappview.cpp.

References iImage.

00084     {
00085     // No implementation required
00086     delete iImage;
00087     }

CLocalizationAppView::CLocalizationAppView (   )  [private]
 

CLocalizationAppView. C++ default constructor.

Definition at line 71 of file localizationappview.cpp.

00072 : iImage(0)
00073     {
00074     // No implementation required
00075     }


Member Function Documentation

CLocalizationAppView * CLocalizationAppView::NewL (  const TRect &  aRect  )  [static]
 

NewL. Two-phased constructor. Create a CLocalizationAppView object, which will draw itself to aRect.

Parameters:
aRect  The rectangle this view will be drawn to.
Returns:
a pointer to the created instance of CLocalizationAppView.

Definition at line 29 of file localizationappview.cpp.

References NewLC().

Referenced by CLocalizationAppUi::ConstructL().

00030     {
00031     CLocalizationAppView* self = CLocalizationAppView::NewLC( aRect );
00032     CleanupStack::Pop( self );
00033     return self;
00034     }

CLocalizationAppView * CLocalizationAppView::NewLC (  const TRect &  aRect  )  [static]
 

NewLC. Two-phased constructor. Create a CLocalizationAppView object, which will draw itself to aRect.

Parameters:
aRect  Rectangle this view will be drawn to.
Returns:
A pointer to the created instance of CLocalizationAppView.

Definition at line 41 of file localizationappview.cpp.

References ConstructL().

Referenced by NewL().

00042     {
00043     CLocalizationAppView* self = new ( ELeave ) CLocalizationAppView;
00044     CleanupStack::PushL( self );
00045     self->ConstructL( aRect );
00046     return self;
00047     }

void CLocalizationAppView::DrawImage (  CFbsBitmap *  aImage  ) 
 

DrawImage Draw image to screen

Parameters:
aImage  the image to be drawn

Definition at line 95 of file localizationappview.cpp.

References iImage.

Referenced by CLocalizationAppUi::HandleCommandL().

00096     {
00097     delete iImage;
00098     iImage = aImage;
00099     DrawNow();
00100     }

void CLocalizationAppView::Draw (  const TRect &  aRect  )  const
 

From CCoeControl, Draw Draw this CLocalizationAppView to the screen.

Parameters:
aRect  the rectangle of this view that needs updating

Definition at line 107 of file localizationappview.cpp.

References iImage.

00108     {
00109     // Get the standard graphics context
00110     CWindowGc& gc = SystemGc();
00111 
00112     // Gets the control's extent
00113     TRect drawRect( Rect());
00114     
00115     // Clears the screen
00116     gc.Clear( drawRect );
00117     
00118     if(iImage)
00119         {
00120         // Show the bitmap double size and centered to screen
00121         TInt scrWidth = Rect().Width();
00122         TInt scrHeight = Rect().Height();
00123         TInt bmpWidth = iImage->SizeInPixels().iWidth;
00124         TInt bmpHeight = iImage->SizeInPixels().iHeight;
00125         TInt aX = ( scrWidth - bmpWidth * 2 ) / 2;
00126         TInt aY = ( scrHeight - bmpHeight * 2 ) / 2;
00127         TInt bX = aX + bmpWidth * 2;
00128         TInt bY = aY + bmpHeight * 2;
00129         
00130         drawRect.SetRect( aX, aY, bX, bY );
00131         gc.DrawBitmap ( drawRect, iImage );
00132         }
00133         }

void CLocalizationAppView::SizeChanged (   )  [virtual]
 

From CoeControl, SizeChanged. Called by framework when the view size is changed.

Definition at line 140 of file localizationappview.cpp.

00141     {  
00142     DrawNow();
00143     }

void CLocalizationAppView::ConstructL (  const TRect &  aRect  )  [private]
 

ConstructL 2nd phase constructor. Perform the second phase construction of a CLocalizationAppView object.

Parameters:
aRect  The rectangle this view will be drawn to.

Definition at line 54 of file localizationappview.cpp.

Referenced by NewLC().

00055     {
00056     // Create a window for this application view
00057     CreateWindowL();
00058 
00059     // Set the windows size
00060     SetRect( aRect );
00061 
00062     // Activate the window, which makes it ready to be drawn
00063     ActivateL();
00064     }


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

© Nokia 2009

Back to top