Nokia N97 SDK
Example Applications Guide

CContAppUi Class Reference

#include <ccontappui.h>

Inheritance diagram for CContAppUi:

List of all members.

Detailed Description

Application UI class. Provides support for the following features:

Definition at line 37 of file ccontappui.h.


Public Member Functions

void  ConstructL ()
virtual  ~CContAppUi ()

Private Member Functions

void  DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane)
void  HandleCommandL (TInt aCommand)
void  HandleResourceChangeL (TInt aType)
virtual TKeyResponse  HandleKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)
void  UpdateTitleL (TInt aResourceId)

Private Attributes

CContContainer *  iAppContainer


Constructor & Destructor Documentation

CContAppUi::~CContAppUi (   )  [virtual]
 

Destructor Destructor is always virtual

Definition at line 53 of file ccontappui.cpp.

References iAppContainer.

00054     {
00055     if ( iAppContainer )
00056         {
00057         RemoveFromStack( iAppContainer );
00058         delete iAppContainer;
00059         }
00060    }


Member Function Documentation

void CContAppUi::ConstructL (   ) 
 

Default constructor

Definition at line 37 of file ccontappui.cpp.

References CContContainer::ConstructL(), and iAppContainer.

00038     {
00039     BaseConstructL(EAknEnableSkin);
00040 
00041     iAppContainer = new (ELeave) CContContainer;
00042     iAppContainer->SetMopParent( this );
00043     iAppContainer->ConstructL( ClientRect() );
00044     AddToStackL( iAppContainer );
00045     }

void CContAppUi::DynInitMenuPaneL (  TInt  aResourceId,
CEikMenuPane *  aMenuPane
)  [private]
 

From MEikMenuObserver

Parameters:
aResourceId  Resource ID identifying the menu pane to initialise
aMenuPane  The in-memory representation of the menu pane.

Definition at line 70 of file ccontappui.cpp.

00072     {
00073 
00074     }

void CContAppUi::HandleCommandL (  TInt  aCommand  )  [private]
 

From CEikAppUi, takes care of command handling

Parameters:
aCommand  command to be handled

Definition at line 92 of file ccontappui.cpp.

References CContContainer::AddContactToGrpL(), CContContainer::AddNewContactDlgL(), CContContainer::CanAddContactToGroupL(), CContContainer::CreateContactGroupL(), CContContainer::CreateContactTemplateL(), CContContainer::DeleteContactDlgL(), CContContainer::DeleteContactGroupL(), CContContainer::EditContactDlgL(), CContContainer::GetSelectedContactL(), iAppContainer, CContContainer::IfContactDbSelected(), CContContainer::OpenDefaultDatabaseL(), CContContainer::ShowContactGroupsL(), CContContainer::ShowContactsL(), and UpdateTitleL().

00093     {
00094     switch ( aCommand )
00095         {
00096         // flowtrough
00097         case EAknSoftkeyExit:
00098         case EEikCmdExit:
00099             Exit();
00100             break;
00101                 case EContactsDefaultDB:
00102             iAppContainer->OpenDefaultDatabaseL();
00103             if ( iAppContainer->IfContactDbSelected() )
00104                 {
00105                 UpdateTitleL( R_CONTACTS_DEFAULT_DB );
00106                 }
00107             else
00108                 {
00109                 UpdateTitleL( R_CONTACTS_NO_DB );
00110                 }
00111             break;
00112                 case EContactsCreateTemplate:
00113             iAppContainer->CreateContactTemplateL();
00114             break;
00115                 case EContactsCreateContact:
00116             iAppContainer->AddNewContactDlgL();
00117             break;
00118                 case EContactsDeleteContact:
00119             iAppContainer->DeleteContactDlgL();
00120             break;
00121                 case EContactsEditContact:
00122             iAppContainer->EditContactDlgL();
00123             break;
00124                 case EContactsSelectGrp:
00125             if ( !iAppContainer->CanAddContactToGroupL() )
00126                 {
00127                 return;
00128                 }
00129             iAppContainer->GetSelectedContactL();
00130             CEikonEnv::Static()->AppUiFactory()->
00131                 MenuBar()->SetMenuTitleResourceId( R_CONTACTS_SELECT_GRP_MENUBAR );
00132             break;
00133                 case EContactsAddContactToGrp:
00134             iAppContainer->AddContactToGrpL();
00135             // Show contact on the listbox
00136             iAppContainer->ShowContactsL();
00137             // Change menu
00138             CEikonEnv::Static()->AppUiFactory()->
00139                 MenuBar()->SetMenuTitleResourceId( R_CONTACTS_CONTACTS_MENUBAR );
00140             break;
00141                 case EContactsCancelSelectGrp:
00142             iAppContainer->ShowContactsL();
00143             // Change menu back to original
00144             CEikonEnv::Static()->AppUiFactory()->
00145                 MenuBar()->SetMenuTitleResourceId( R_CONTACTS_CONTACTS_MENUBAR );
00146             break;
00147                 case EContactsShowContacts:
00148             iAppContainer->ShowContactsL();
00149             CEikonEnv::Static()->AppUiFactory()->
00150                 MenuBar()->SetMenuTitleResourceId( R_CONTACTS_CONTACTS_MENUBAR );
00151             break;
00152                 case EContactsShowGroups:
00153             {
00154             iAppContainer->ShowContactGroupsL();
00155             CEikonEnv::Static()->AppUiFactory()->
00156                 MenuBar()->SetMenuTitleResourceId( R_CONTACTS_GROUPS_MENUBAR );
00157             }
00158             break;
00159                 case EContactsCreateContactGroup:
00160             iAppContainer->CreateContactGroupL();
00161             break;
00162                 case EContactsDeleteContactGroup:
00163             iAppContainer->DeleteContactGroupL();
00164             break;
00165         default:
00166             break;
00167         }
00168     }

void CContAppUi::HandleResourceChangeL (  TInt  aType  )  [private]
 

From CEikAppUi, HandleResourceChangeL. Handles resource changes.

Parameters:
aType  Resource change type to be handled

Definition at line 191 of file ccontappui.cpp.

References iAppContainer.

00192     {
00193     CAknAppUi::HandleResourceChangeL( aType );
00194     if  ( aType == KEikDynamicLayoutVariantSwitch )
00195         {
00196         iAppContainer->SetRect( ClientRect() );
00197         }
00198     }

TKeyResponse CContAppUi::HandleKeyEventL (  const TKeyEvent &  aKeyEvent,
TEventCode  aType
)  [private, virtual]
 

From CEikAppUi, handles key events

Parameters:
aKeyEvent  Event to handled.
aType  Type of the key event
Returns:
Response code (EKeyWasConsumed, EKeyWasNotConsumed)

Definition at line 81 of file ccontappui.cpp.

00083     {
00084     return EKeyWasNotConsumed;
00085     }

void CContAppUi::UpdateTitleL (  TInt  aResourceId  )  [private]
 

UpdateTitleL The method updates title text

Parameters:
aResourceId  Resource ID for text

Definition at line 175 of file ccontappui.cpp.

Referenced by HandleCommandL().

00176     {
00177     HBufC* textResource = StringLoader::LoadLC( aResourceId );
00178 
00179     CAknTitlePane* titlePane = STATIC_CAST( CAknTitlePane*,
00180             StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
00181 
00182     titlePane->SetTextL( textResource->Des());
00183     CleanupStack::PopAndDestroy( textResource );
00184     }


Member Data Documentation

CContContainer* CContAppUi::iAppContainer [private]
 

iAppContainer the container class Owned by CContAppUi object, instantiated in ConstructL, deleted in destructor

Definition at line 97 of file ccontappui.h.

Referenced by ConstructL(), HandleCommandL(), HandleResourceChangeL(), and ~CContAppUi().


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

© Nokia 2009

Back to top