S60 3rd Edition SDK for Symbian OS
Example Applications Guide

CIsvTelInfoAppContainer Class Reference

#include <IsvTelInfoAppContainer.h>

List of all members.

Public Member Functions

 CIsvTelInfoAppContainer (CIsvTelInfoAppView *aView)
void ConstructL (const TRect &aRect)
virtual ~CIsvTelInfoAppContainer ()
void SetTextToLabelL (TInt aResourceId)
void DisplayFormL (TInt aResourceId, TInt aPageId)
void BringToForeGroundL ()

Private Types

enum  TIsvTelInfoAppComponentControls { EIsvTelInfoAppComponentLabel }

Private Member Functions

void CreateLabelL ()
TKeyResponse OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)
void SizeChanged ()
TInt CountComponentControls () const
CCoeControl * ComponentControl (TInt aIndex) const
void Draw (const TRect &aRect) const

Private Attributes

CIsvTelInfoAppView * iView
CEikLabel * iLabel


Detailed Description

CIsvTelInfoAppContainer container control class.

Definition at line 31 of file IsvTelInfoAppContainer.h.


Constructor & Destructor Documentation

CIsvTelInfoAppContainer::CIsvTelInfoAppContainer (  CIsvTelInfoAppView *  aView  ) 
 

Overload constructor.

Parameters:
aView Pointer to view class object.

Definition at line 43 of file IsvTelInfoAppContainer.cpp.

00045 :   iView( aView ),
00046     iLabel( NULL )
00047     {
00048     }

CIsvTelInfoAppContainer::~CIsvTelInfoAppContainer (   )  [virtual]
 

Destructor.

Definition at line 72 of file IsvTelInfoAppContainer.cpp.

References iLabel.

00073     {
00074     delete iLabel;
00075     }


Member Function Documentation

void CIsvTelInfoAppContainer::ConstructL (  const TRect &  aRect  ) 
 

EPOC constructor.

Parameters:
aRect Frame rectangle for container.

Definition at line 55 of file IsvTelInfoAppContainer.cpp.

References CreateLabelL().

00056     {
00057     // Creates window.
00058     CreateWindowL();
00059 
00060     // Creates label object.
00061     CreateLabelL();
00062 
00063     SetRect( aRect ); // Sets rectangle of frame.
00064     ActivateL(); // Activates the window. (Ready to draw)
00065     }

void CIsvTelInfoAppContainer::SetTextToLabelL (  TInt  aResourceId  ) 
 

Sets text from a resource to a label

Parameters:
aResourceId 

Definition at line 82 of file IsvTelInfoAppContainer.cpp.

References iLabel.

00083     {
00084     TBuf<KIsvTelInfoAppMessageBufLength> messageString( NULL );
00085     iCoeEnv->ReadResource( messageString, aResourceId );
00086     iLabel->SetTextL( messageString );
00087     }

void CIsvTelInfoAppContainer::DisplayFormL (  TInt  aResourceId,
TInt  aPageId
) 
 

Creates and executes the form

Parameters:
aResourceId,Id of resource for the form
aPageId,Id of the Page to start with

Definition at line 94 of file IsvTelInfoAppContainer.cpp.

References CIsvTelInfoAppDlg::ExecuteLD(), CIsvTelInfoAppView::GetTitlePaneL(), iView, CIsvTelInfoAppDlg::NewL(), CIsvTelInfoAppDlg::SetContainer(), CIsvTelInfoAppDlg::SetDlgPage(), and CIsvTelInfoAppDlg::SetTitlePane().

00097     {
00098     CIsvTelInfoAppDlg* form = CIsvTelInfoAppDlg::NewL();
00099     form->SetTitlePane(iView->GetTitlePaneL());
00100     form->SetContainer(this);
00101     form->SetDlgPage(aPageId);
00102     form->ExecuteLD( aResourceId );
00103     }

void CIsvTelInfoAppContainer::CreateLabelL (   )  [private]
 

Creates the label object.

Definition at line 120 of file IsvTelInfoAppContainer.cpp.

References iLabel, and SetTextToLabelL().

00121     {
00122     if ( !iLabel )
00123         {
00124         iLabel = new( ELeave ) CEikLabel;
00125         iLabel->SetContainerWindowL( *this );
00126         iLabel->SetAlignment( EHCenterVCenter );
00127 #ifdef __AVKON_APAC__
00128         iLabel->SetFont( ApacPlain16() );
00129 #else
00130         iLabel->SetFont( LatinBold19() );
00131 #endif
00132         }
00133     SetTextToLabelL( R_ISVTELINFOAPP_TEXT_LABEL_TITLE );
00134     }

TKeyResponse CIsvTelInfoAppContainer::OfferKeyEventL (  const TKeyEvent &  aKeyEvent,
TEventCode  aType
)  [private]
 

From CCoeControl, OfferKeyEventL. Handles the key events.

Returns:
if key-event is consumed, EKeyWasConsumed. Else EKeyWasNotConsumed
Parameters:
aKeyEvent Key event
aType Type of key event (EEventKey, EEventKeyUp or EEventKeyDown)

Definition at line 142 of file IsvTelInfoAppContainer.cpp.

00145     {
00146     if ( aType != EEventKey ) // Is not key event?
00147         {
00148         return EKeyWasNotConsumed;
00149         }
00150     switch ( aKeyEvent.iCode ) // The code of key event is...
00151         {
00152         default:
00153             return EKeyWasNotConsumed;
00154         }
00155     }

void CIsvTelInfoAppContainer::SizeChanged (   )  [private]
 

From CCoeControl, SizeChanged.

Definition at line 162 of file IsvTelInfoAppContainer.cpp.

References iLabel.

00163     {
00164     iLabel->SetRect( Rect() );
00165     }

TInt CIsvTelInfoAppContainer::CountComponentControls (   )  const [private]
 

From CCoeControl, CountComponentControls. Returns number of component.

Returns:
Number of controls

Definition at line 172 of file IsvTelInfoAppContainer.cpp.

00173     {
00174     // returns nbr of controls inside this container
00175     return KIsvTelInfoAppCountComponent;
00176     }

CCoeControl * CIsvTelInfoAppContainer::ComponentControl (  TInt  aIndex  )  const [private]
 

From CCoeControl, ComponentControl. Returns pointer to particular component.

Returns:
Pointer to Control's component control, identified by index
Parameters:
aIndex Index of the control

Definition at line 183 of file IsvTelInfoAppContainer.cpp.

References iLabel.

00184     {
00185     switch ( aIndex ) // Component is...
00186         {
00187         case EIsvTelInfoAppComponentLabel: // Label object.
00188             return iLabel;
00189         default: // Exception : returns NULL value.
00190             return NULL;
00191         }
00192     }

void CIsvTelInfoAppContainer::Draw (  const TRect &  aRect  )  const [private]
 

From CCoeControl, Draw.

Parameters:
aRect Region of the control to be (re)drawn.

Definition at line 199 of file IsvTelInfoAppContainer.cpp.

00200     {
00201     CWindowGc& gc = SystemGc();
00202     gc.SetPenStyle( CGraphicsContext::ENullPen );
00203     gc.SetBrushColor( ISVINFOAPP_BACKGROUND_COLOR );
00204     gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
00205     gc.DrawRect( aRect );
00206     }


© Nokia 2006

Back to top