|
Nokia N97 SDK Example Applications Guide |
#include <MyViewView.h>
Inheritance diagram for CMyViewView:

Definition at line 38 of file MyViewView.h.
Public Member Functions |
|
| void | ConstructL (CAknTabGroup *) |
| ~CMyViewView () | |
| TUid | Id () const |
| void | HandleCommandL (TInt aCommand) |
| void | HandleClientRectChange () |
Private Member Functions |
|
| void | DoActivateL (const TVwsViewId &aPrevViewId, TUid aCustomMessageId, const TDesC8 &aCustomMessage) |
| void | DoDeactivate () |
Private Attributes |
|
| CMyViewContainer * | iContainer |
| CAknTabGroup * | iTabGroup |
|
|
Destructor. Definition at line 47 of file MyViewView.cpp. References iContainer. 00048 { 00049 if ( iContainer ) 00050 { 00051 AppUi()->RemoveFromViewStack( *this, iContainer ); 00052 } 00053 00054 delete iContainer; 00055 }
|
|
|
EPOC default constructor. Definition at line 35 of file MyViewView.cpp. References iTabGroup. 00036 { 00037 // construct R_MYVIEW_VIEW1 resources 00038 BaseConstructL( R_MYVIEW_VIEW1 ); 00039 iTabGroup=aTabGroup; 00040 }
|
|
|
Return Uid Definition at line 62 of file MyViewView.cpp.
|
|
|
Handle Commands Definition at line 73 of file MyViewView.cpp. References iTabGroup. 00074 { 00075 switch ( aCommand ) 00076 { 00077 case EAknSoftkeyOk: 00078 { 00079 iEikonEnv->InfoMsg( _L("view1 ok") ); 00080 break; 00081 } 00082 case EAknSoftkeyExit: 00083 { 00084 AppUi()->HandleCommandL(EEikCmdExit); 00085 break; 00086 } 00087 00088 case EMyViewCmdView1Cmd1: 00089 { 00090 // Update the correct tab in the navipane. 00091 // View Management System does not adjust the navi pane tabs. 00092 iTabGroup->SetActiveTabByIndex(1); 00093 00094 // Switch to view 2 00095 AppUi()->ActivateLocalViewL(KView2Id); 00096 break; 00097 } 00098 case EMyViewCmdView1Cmd2: 00099 { 00100 // Update the correct tab in the navipane. 00101 // View Management System does not adjust the navi pane tabs. 00102 iTabGroup->SetActiveTabByIndex(1); 00103 00104 // Switch to view 2 and send a message Uid. Message is set to null. 00105 const TUid KCustomMessageUid= { 2 }; // MessageUid to send 00106 AppUi()->ActivateLocalViewL(KView2Id, KCustomMessageUid, KNullDesC8); 00107 break; 00108 } 00109 case EMyViewCmdView1Cmd3: 00110 { 00111 // Update the correct tab in the navipane. 00112 // View Management System does not adjust the navi pane tabs. 00113 iTabGroup->SetActiveTabByIndex(1); 00114 00115 // Switch to view 2 and send a message Uid and a message 00116 const TUid KCustomMessageUid= { 2 }; // MessageUid to send 00117 // Construct a message to send 00118 TBuf8<255> customMessage; 00119 customMessage.Copy(_L8("Some data here")); 00120 AppUi()->ActivateLocalViewL(KView2Id, KCustomMessageUid, customMessage); 00121 break; 00122 } 00123 00124 default: 00125 { 00126 AppUi()->HandleCommandL( aCommand ); 00127 break; 00128 } 00129 } 00130 }
|
|
|
Handle Size changes Definition at line 136 of file MyViewView.cpp. References iContainer. 00137 { 00138 if ( iContainer ) 00139 { 00140 iContainer->SetRect( ClientRect() ); 00141 } 00142 }
|
|
||||||||||||||||
|
From AknView, Activates view Definition at line 154 of file MyViewView.cpp. References CMyViewContainer::ConstructL(), and iContainer. 00157 { 00158 if (!iContainer) 00159 { 00160 iContainer = new (ELeave) CMyViewContainer; 00161 iContainer->SetMopParent(this); 00162 iContainer->ConstructL( ClientRect() ); 00163 AppUi()->AddToStackL( *this, iContainer ); 00164 } 00165 00166 // Message handling would take place here. 00167 }
|
|
|
From AknView, Deactivates view Definition at line 175 of file MyViewView.cpp. References iContainer. 00176 { 00177 if ( iContainer ) 00178 { 00179 AppUi()->RemoveFromViewStack( *this, iContainer ); 00180 } 00181 00182 delete iContainer; 00183 iContainer = NULL; 00184 }
|
|
© Nokia 2009 |