S60 3rd Edition SDK for Symbian OS
Example Applications Guide

CRegistrationView Class Reference

#include <RegistrationView.h>

List of all members.

Public Member Functions

virtual ~CRegistrationView ()
void SizeChanged ()
TBool ValidateInput ()
TUid Id () const
void HandleCommandL (TInt aCommand)

Static Public Member Functions

static CRegistrationView * NewL ()
static CRegistrationView * NewLC ()

Private Member Functions

 CRegistrationView ()
void ConstructL ()
void DoActivateL (const TVwsViewId &aPrevViewId, TUid aCustomMessageId, const TDesC8 &aCustomMessage)
void DoDeactivate ()

Private Attributes

CRegistrationListbox * iListbox
TRegistrationItemdata iItemData


Detailed Description

CRegistrationView view class.

Definition at line 42 of file RegistrationView.h.


Constructor & Destructor Documentation

CRegistrationView::~CRegistrationView (   )  [virtual]
 

~CRegistrationView Virtual Destructor.

Definition at line 85 of file RegistrationView.cpp.

References iListbox.

00086     {
00087     if ( iListbox )
00088         {
00089         AppUi()->RemoveFromStack( iListbox );
00090         }
00091 
00092     delete iListbox;
00093     }

CRegistrationView::CRegistrationView (   )  [private]
 

CRegistrationView C++ default constructor.

Definition at line 75 of file RegistrationView.cpp.

00076     {
00077     // No implementation required
00078     }


Member Function Documentation

CRegistrationView * CRegistrationView::NewL (   )  [static]
 

NewL Two-phased constructor. Create a CRegistrationView 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 CRegistrationView.

Definition at line 27 of file RegistrationView.cpp.

References NewLC().

00028     {
00029     CRegistrationView* self = CRegistrationView::NewLC();
00030     CleanupStack::Pop( self );
00031     return self;
00032     }

CRegistrationView * CRegistrationView::NewLC (   )  [static]
 

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

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

Definition at line 39 of file RegistrationView.cpp.

References ConstructL().

00040     {
00041     CRegistrationView* self = new ( ELeave ) CRegistrationView;
00042     CleanupStack::PushL( self );
00043     self->ConstructL();
00044     return self;
00045     }

void CRegistrationView::SizeChanged (   ) 
 

SizeChanged Creates Listbox Called by AppUi when the view size is changed.

Definition at line 133 of file RegistrationView.cpp.

References iListbox.

00134   {
00135   iListbox->SetRect( ClientRect() );
00136   }

TBool CRegistrationView::ValidateInput (   ) 
 

ValidateInput Checks validity of input.

Returns:
ETrue if input is valid and EFalse if not valid

Definition at line 164 of file RegistrationView.cpp.

References TRegistrationItemdata::iEmail, and iItemData.

00165     {
00166     _LIT( KAt, "@" );
00167     TBool isValid = EFalse;
00168     TBuf<KMaxEmailLength> iEmailEnd;
00169     
00170     //Searching for @ character. 
00171         // Returns index of character if found. Returns KErrNotFound if not found.
00172     TInt index  = iItemData.iEmail.Find( KAt );
00173     if( KErrNotFound != index )
00174         {
00175             if ( iItemData.iEmail.Length() > ++index )
00176                 {
00177                 // iEmailEnd contains email address from @ to end.
00178                 iEmailEnd = iItemData.iEmail.MidTPtr( index );
00179             
00180                 // Search for @ is performed again.
00181                 if ( iEmailEnd.Find(KAt) == KErrNotFound )
00182                     {
00183                     isValid = ETrue;
00184                     }
00185             }
00186         else
00187             {
00188             isValid = ETrue;
00189             }
00190         }
00191      return isValid;
00192      }  

TUid CRegistrationView::Id (   )  const
 

Id Returns the ID of view.

Returns:
The ID of view.

Definition at line 101 of file RegistrationView.cpp.

00102     {
00103     return KViewId;
00104     }

void CRegistrationView::HandleCommandL (  TInt  aCommand  ) 
 

HandleCommandL. handles the commands. if the command is command which is require to display outline-screen, the command is reported to container class.

Parameters:
aCommand Command to be handled.

Definition at line 111 of file RegistrationView.cpp.

00112     {
00113 
00114     switch ( aCommand )
00115         {
00116         case EAknCmdExit:
00117         case EAknSoftkeyBack:
00118             {
00119             AppUi()->ProcessCommandL( EAknCmdExit );
00120             break;
00121             }
00122         
00123         default:
00124             break;
00125         }
00126     }

void CRegistrationView::ConstructL (   )  [private]
 

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

Definition at line 53 of file RegistrationView.cpp.

References iItemData, iListbox, and CRegistrationListbox::SetData().

00054     {
00055     BaseConstructL();
00056         
00057     iListbox = new ( ELeave ) CRegistrationListbox;
00058     iListbox->SetData( &iItemData );
00059     iListbox->SetMopParent( this );
00060     iListbox->ConstructFromResourceL( R_REGISTRATION_SETTING_ITEM_LIST );
00061 
00062     AppUi()->AddToStackL( *this, iListbox );
00063     iListbox->MakeVisible( ETrue );
00064     iListbox->SetRect( ClientRect() );
00065     iListbox->ActivateL();
00066     iListbox->DrawNow();
00067     
00068     }

void CRegistrationView::DoActivateL (  const TVwsViewId &  aPrevViewId,
TUid  aCustomMessageId,
const TDesC8 &  aCustomMessage
)  [private]
 

DoActivateL. Creates the Container class object.

Parameters:
aPrevViewId aPrevViewId is not used.
aCustomMessageId aCustomMessageId is not used.
aCustomMessage aCustomMessage is not used.

Definition at line 142 of file RegistrationView.cpp.

00145     {
00146     // No implementation required
00147     }

void CRegistrationView::DoDeactivate (   )  [private]
 

DoDeactivate. Deletes the Container class object.

Definition at line 153 of file RegistrationView.cpp.

00154     {
00155     // No implementation required
00156     }


© Nokia 2006

Back to top