S60 3rd Edition SDK for Symbian OS
Example Applications Guide

CMessagingAppUi Class Reference

#include <MessagingAppui.h>

List of all members.

Public Member Functions

void ConstructL ()
 ~CMessagingAppUi ()
void HandleResourceChangeL (TInt aType)

Private Member Functions

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

Private Attributes

CMessagingContainer * iAppContainer
CSendUi * iSendUi


Detailed Description

Application UI class. Provides support for the following features:

Definition at line 35 of file MessagingAppui.h.


Constructor & Destructor Documentation

CMessagingAppUi::~CMessagingAppUi (   ) 
 

Destructor.

Definition at line 47 of file MessagingAppui.cpp.

References iAppContainer, and iSendUi.

00048     {
00049     if ( iAppContainer )
00050         {
00051         RemoveFromStack( iAppContainer );
00052         delete iAppContainer;
00053                 iAppContainer = NULL;
00054         }
00055     if ( iSendUi )
00056             {
00057             delete iSendUi;
00058             iSendUi = NULL;
00059             }
00060     }


Member Function Documentation

void CMessagingAppUi::ConstructL (   ) 
 

Symbian default constructor.

Definition at line 32 of file MessagingAppui.cpp.

References iAppContainer, iSendUi, and CMessagingContainer::NewL().

00033     {
00034     BaseConstructL( CAknAppUi::EAknEnableSkin );
00035     iAppContainer = CMessagingContainer::NewL( ClientRect() );
00036     iAppContainer->SetMopParent( this );
00037     AddToStackL( iAppContainer );    
00038     iSendUi = CSendUi::NewL();    
00039     }

void CMessagingAppUi::HandleResourceChangeL (  TInt  aType  ) 
 

HandleResourceChangeL() Called by framework when layout is changed.

Parameters:
aType the type of resources that have changed

Definition at line 145 of file MessagingAppui.cpp.

References iAppContainer.

00146     {
00147     CAknAppUi::HandleResourceChangeL( aType );
00148     if ( aType==KEikDynamicLayoutVariantSwitch )
00149         {
00150         iAppContainer->SetRect( ClientRect() );
00151         }
00152     }

void CMessagingAppUi::CreateAndSendMessageL (  const TUid  aServiceUid  )  [private]
 

CreateAndSendMessageL() Launches a message editor using CSendUi

Parameters:
aServiceUid the type of message that will be created

Definition at line 131 of file MessagingAppui.cpp.

References iSendUi.

00132         {
00133         // create empty message
00134         CMessageData*  message = CMessageData::NewLC(); 
00135         // start message editor through SendUI
00136         iSendUi->CreateAndSendMessageL( aServiceUid, message, KNullUid );
00137         CleanupStack::PopAndDestroy( message );
00138         }

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

From CEikAppUi, takes care of command handling.

Parameters:
aCommand command to be handled

Definition at line 91 of file MessagingAppui.cpp.

References CreateAndSendMessageL().

00092     {
00093     switch ( aCommand )
00094         {
00095         case EAknSoftkeyExit:
00096         case EEikCmdExit:
00097             {
00098             Exit();
00099             break;
00100             }        
00101         case EMessagingCmdCreateSMS:
00102                 {
00103                 // create and send SMS
00104                 CreateAndSendMessageL( KSenduiMtmSmsUid );
00105                 break;  
00106                 }
00107         case EMessagingCmdCreateMMS:
00108                 {
00109                 // create and send MMS
00110                 CreateAndSendMessageL( KSenduiMtmMmsUid );
00111                 break;  
00112                 }
00113         case EMessagingCmdCreateEmail:
00114                 {
00115                 // create and send email
00116                 CreateAndSendMessageL( KSenduiMtmSmtpUid );     
00117                 break;  
00118                 }       
00119         default:
00120             break;      
00121         }
00122     }

TKeyResponse CMessagingAppUi::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 MessagingAppui.cpp.

00082     {
00083     return EKeyWasNotConsumed;
00084     }


Member Data Documentation

CMessagingContainer* CMessagingAppUi::iAppContainer [private]
 

Container object

Definition at line 91 of file MessagingAppui.h.

CSendUi* CMessagingAppUi::iSendUi [private]
 

SendUI object

Definition at line 96 of file MessagingAppui.h.


© Nokia 2006

Back to top