|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
#include <LandmarksView.h>
Public Member Functions | |
| ~CLandmarksView () | |
| TUid | Id () const |
| void | HandleCommandL (TInt aCommand) |
| void | DoActivateL (const TVwsViewId &aPrevViewId, TUid aCustomMessageId, const TDesC8 &aCustomMessage) |
| void | DoDeactivate () |
| void | DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane) |
Static Public Member Functions | |
| static CLandmarksView * | NewLC (CAknNavigationDecorator *aNaviDecorator, CLandmarksApplicationEngine &aEngine) |
Private Member Functions | |
| CLandmarksView (CAknNavigationDecorator *aNaviDecorator, CLandmarksApplicationEngine &aEngine) | |
| void | ConstructL () |
| void | AddLandmarkL (TBool aUseCurrentLocation) |
Private Attributes | |
| CLandmarksContainer * | iContainer |
| The container containing the graphical components of the view. | |
| CLandmarksApplicationEngine & | iEngine |
| The application engine used for modifying categories. | |
| CAknNavigationDecorator * | iNaviDecorator |
| Decorates the navi pane (with navigation arrows etc). | |
Definition at line 33 of file LandmarksView.h.
|
|
Destructor. Definition at line 71 of file LandmarksView.cpp. References iContainer. 00072 { 00073 delete iContainer; 00074 }
|
|
||||||||||||
|
C++ constructor.
Definition at line 35 of file LandmarksView.cpp. 00038 : iEngine(aEngine), 00039 iNaviDecorator(aNaviDecorator) 00040 { 00041 // No implementation required 00042 }
|
|
||||||||||||
|
Two-phased constructor.
Definition at line 59 of file LandmarksView.cpp. References CLandmarksView(). 00062 { 00063 CLandmarksView* self = new (ELeave) CLandmarksView( 00064 aNaviDecorator, aEngine); 00065 CleanupStack::PushL(self); 00066 self->ConstructL(); 00067 return self; 00068 }
|
|
|
Id Identity of this view to the system.
Definition at line 82 of file LandmarksView.cpp.
|
|
|
HandleCommandL handles user menu selections.
Definition at line 93 of file LandmarksView.cpp. References AddLandmarkL(), CLandmarksContainer::CurrentLandmark(), CLandmarksContainer::DeleteLandmarkL(), and iContainer. 00094 { 00095 switch (aCommand) 00096 { 00097 case ELandmarksAddCurrent: 00098 AddLandmarkL(ETrue); // use current location 00099 break; 00100 00101 case ELandmarksAddBlank: 00102 AddLandmarkL(EFalse); // create blank 00103 break; 00104 00105 case ELandmarksDelete: 00106 iContainer->DeleteLandmarkL(); 00107 break; 00108 00109 case ELandmarksOpen: 00110 { 00111 TPckgC<TPosLmItemId> lmId(iContainer->CurrentLandmark()); 00112 00113 AppUi()->ActivateLocalViewL( 00114 TUid::Uid(ELandmarksInfoViewId), 00115 TUid::Uid(ELandmarksViewInfoById), 00116 lmId); 00117 break; 00118 } 00119 00120 default: 00121 AppUi()->HandleCommandL(aCommand); 00122 break; 00123 } 00124 }
|
|
||||||||||||||||
|
DoActivateL is responsible for activating this view.
Definition at line 132 of file LandmarksView.cpp. References CLandmarksContainer::ConstructL(), iContainer, Id(), iEngine, iNaviDecorator, and CLandmarksApplicationEngine::NotifyViewActivated(). 00136 { 00137 if (!iContainer) 00138 { 00139 iContainer = new (ELeave) CLandmarksContainer( 00140 *this, iEngine, iNaviDecorator); 00141 iContainer->SetMopParent(this); 00142 iContainer->ConstructL(ClientRect()); 00143 } 00144 00145 // Enable receiving of keyboard events. 00146 AppUi()->AddToStackL(*this, iContainer); 00147 00148 // Make view visible. 00149 iContainer->MakeVisible(ETrue); 00150 00151 // Notify that this view is active 00152 iEngine.NotifyViewActivated(Id(), ETrue); 00153 }
|
|
|
DoDeactivate is responsible for deactivating this view. Definition at line 161 of file LandmarksView.cpp. References iContainer, Id(), iEngine, and CLandmarksApplicationEngine::NotifyViewActivated(). 00162 { 00163 // Hide view. 00164 iContainer->MakeVisible(EFalse); 00165 00166 // Notify that this view is inactive 00167 iEngine.NotifyViewActivated(Id(), EFalse); 00168 00169 // Disable receiving keyboard events. 00170 AppUi()->RemoveFromStack(iContainer); 00171 }
|
|
||||||||||||
|
DynInitMenuPaneL initializes the menu pane before it is displayed.
Definition at line 179 of file LandmarksView.cpp. References iContainer, and CLandmarksContainerBase::IsItemSelected(). 00182 { 00183 CAknView::DynInitMenuPaneL(aResourceId, aMenuPane); 00184 if (aResourceId == R_LMREFAPP_MENU) 00185 { 00186 // If no landmark is selected we need to hide some command options. 00187 TBool isListEmpty = !iContainer->IsItemSelected(); 00188 aMenuPane->SetItemDimmed(ELandmarksDelete, isListEmpty); 00189 aMenuPane->SetItemDimmed(ELandmarksOpen, isListEmpty); 00190 } 00191 }
|
|
|
By default Symbian 2nd phase constructor is private. Definition at line 49 of file LandmarksView.cpp.
|
|
|
Launches a landmark edit dialog and adds a landmark to the database.
Definition at line 199 of file LandmarksView.cpp. References CLandmarksApplicationEngine::AddLandmarkL(), iContainer, iEngine, CLandmarksContainer::MakeNaviPaneVisibleL(), and CLandmarksEditDialog::NewLC(). 00200 { 00201 // Create new landmark 00202 CPosLandmark* newLandmark = CPosLandmark::NewLC(); 00203 00204 // Create edit dialog 00205 TBool isEdited(EFalse); 00206 CLandmarksEditDialog* editDialog = CLandmarksEditDialog::NewLC( 00207 *newLandmark, aUseCurrentLocation, isEdited, iEngine); 00208 00209 // Remove tabs from this view 00210 iContainer->MakeNaviPaneVisibleL(EFalse); 00211 00212 // Dialog must not leave without restoring tab group. Must be trapped. 00213 TRAPD(err, editDialog->ExecuteLD(R_LMREFAPP_EDIT_DIALOG)); 00214 00215 // Restore tabs to this view 00216 iContainer->MakeNaviPaneVisibleL(ETrue); 00217 00218 User::LeaveIfError(err); 00219 CleanupStack::Pop(editDialog); 00220 00221 if (isEdited) 00222 { 00223 iEngine.AddLandmarkL(*newLandmark); 00224 } 00225 00226 CleanupStack::PopAndDestroy(newLandmark); 00227 }
|
|
© Nokia 2006 |