S60 5th Edition SDK
Example Applications Guide

CCSAsyncAppView Class Reference

#include <csasyncappview.h>

Inheritance diagram for CCSAsyncAppView:

List of all members.

Detailed Description

CCSAsyncAppView An instance of the Application View object for the CSAsync example application.

Definition at line 32 of file csasyncappview.h.

Public Member Functions

virtual ~CCSAsyncAppView ()
void Draw (const TRect &aRect) const

Static Public Member Functions

static CCSAsyncAppViewNewL (const TRect &aRect, CCSAsyncDocument &aDocument)
static CCSAsyncAppViewNewLC (const TRect &aRect, CCSAsyncDocument &aDocument)

Private Member Functions

 CCSAsyncAppView (CCSAsyncDocument &aDocument)
void ConstructL (const TRect &aRect)

Private Attributes

CCSAsyncDocumentiDocument


Constructor & Destructor Documentation

CCSAsyncAppView::~CCSAsyncAppView  )  [virtual]
 

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

Definition at line 87 of file csasyncappview.cpp.

00088     {
00089     // No implementation required
00090     }

CCSAsyncAppView::CCSAsyncAppView CCSAsyncDocument aDocument  )  [private]
 

CCSAsyncAppView. C++ default constructor. Performs the first phase of two phase construction.

Parameters:
aDocument The document to read time data from.

Definition at line 76 of file csasyncappview.cpp.

Referenced by NewLC().

00077 : iDocument( aDocument )
00078     {
00079     // No implementation required
00080     }


Member Function Documentation

CCSAsyncAppView * CCSAsyncAppView::NewL const TRect &  aRect,
CCSAsyncDocument aDocument
[static]
 

NewL. Two-phased constructor. Creates a CCSAsyncAppView object, which will draw itself to aRect.

Parameters:
aRect The rectangle this view will be drawn to.
aDocument The document to read time data from.
Returns:
A pointer to the created instance of CCSAsyncAppView.

Definition at line 32 of file csasyncappview.cpp.

References NewLC().

Referenced by CCSAsyncAppUi::ConstructL().

00034     {
00035     CCSAsyncAppView* self = CCSAsyncAppView::NewLC( aRect, aDocument );
00036     CleanupStack::Pop( self );
00037     return self;
00038     }

CCSAsyncAppView * CCSAsyncAppView::NewLC const TRect &  aRect,
CCSAsyncDocument aDocument
[static]
 

NewLC. Two-phased constructor. Creates a CCSAsyncAppView object, which will draw itself to aRect.

Parameters:
aRect The rectangle this view will be drawn to.
aDocument The document to read time data from.
Returns:
A pointer to the created instance of CCSAsyncAppView.

Definition at line 45 of file csasyncappview.cpp.

References CCSAsyncAppView().

Referenced by NewL().

00047     {
00048     CCSAsyncAppView* self = new ( ELeave ) CCSAsyncAppView( aDocument );
00049     CleanupStack::PushL( self );
00050     self->ConstructL( aRect );
00051     return self;
00052     }

void CCSAsyncAppView::Draw const TRect &  aRect  )  const
 

From CCoeControl, Draw. Draws this CCSAsyncAppView to the screen.

Parameters:
aRect The rectangle of this view that needs updating.

Definition at line 97 of file csasyncappview.cpp.

References iDocument, and CCSAsyncDocument::Time().

00098     {
00099 
00100     // Clear the screen
00101     CWindowGc& gc = SystemGc();
00102     gc.Clear( Rect() );
00103 
00104     TBuf<30> des;
00105     const TTime& time = iDocument.Time();
00106 
00107     // Read time format string from AVKON resource
00108     HBufC* timeFormatString = iEikonEnv->AllocReadResourceLC(R_QTN_TIME_LONG);
00109     // It would also be possible to define your own format string instead, 
00110     // for example like this:
00111     // _LIT( KHoursMinsSecs, "%-B%:0%J%:1%T%:2%S%:3%+B" );
00112 
00113     TRAPD( err, time.FormatL( des, *timeFormatString ) );
00114     CleanupStack::PopAndDestroy(); // timeFormatString
00115 
00116     if ( err == KErrNone )
00117         {
00118         const CFont* font = iEikonEnv->NormalFont();
00119         gc.UseFont( font );
00120         gc.DrawText( des, TPoint( 10,20 ) );
00121         }
00122     }

void CCSAsyncAppView::ConstructL const TRect &  aRect  )  [private]
 

ConstructL. Performs the second phase construction of a CCSAsyncAppView object.

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

Definition at line 59 of file csasyncappview.cpp.

00060     {
00061     // Create a window for this application view
00062     CreateWindowL();
00063 
00064     // Set the windows size
00065     SetRect( aRect );
00066 
00067     // Activate the window, which makes it ready to be drawn
00068     ActivateL();
00069     }


Member Data Documentation

CCSAsyncDocument& CCSAsyncAppView::iDocument [private]
 

iDocument, the application document.

Definition at line 96 of file csasyncappview.h.

Referenced by Draw().


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

© Nokia 2009

Back to top