200 DEBUG1( CLmkByLmView::HandleCommandL markedcount=%d,markedCount ); |
198 DEBUG1( CLmkByLmView::HandleCommandL markedcount=%d,markedCount ); |
201 |
199 |
202 if (markedCount > 0 && aCommand == ELmkCmdOpenLm |
200 if (markedCount > 0 && aCommand == ELmkCmdOpenLm |
203 && !iContainer->IsEditorOpened()) |
201 && !iContainer->IsEditorOpened()) |
204 { |
202 { |
205 DEBUG( CLmkByLmView::HandleCommandL ELmkCmdOpenLm showing c menu); |
|
206 if (MenuBar()) |
203 if (MenuBar()) |
207 { |
204 { |
208 MenuBar()->SetContextMenuTitleResourceId(R_LMK_OK_MENUBAR); |
205 MenuBar()->SetContextMenuTitleResourceId(R_LMK_OK_MENUBAR); |
209 MenuBar()->TryDisplayContextMenuBarL(); |
206 MenuBar()->TryDisplayContextMenuBarL(); |
210 } |
207 } |
211 } |
208 } |
212 else if (aCommand == ELmkCmdOpenLm |
209 else if (aCommand == ELmkCmdOpenLm |
213 && !iContainer->IsEditorOpened()) |
210 && !iContainer->IsEditorOpened()) |
214 { |
211 { |
215 DEBUG( CLmkByLmView::HandleCommandL ELmkCmdOpenLm ); |
|
216 iContainer->SelectorImpl().ProcessCommandL(aCommand); |
212 iContainer->SelectorImpl().ProcessCommandL(aCommand); |
217 iContainer->SetEditorOpenedBool(ETrue); |
213 iContainer->SetEditorOpenedBool(ETrue); |
218 } |
214 } |
219 else |
215 else |
220 { |
216 { |
221 DEBUG( CLmkByLmView::HandleCommandL ProcessCommandL aCommand ); |
|
222 iContainer->SelectorImpl().ProcessCommandL(aCommand); |
217 iContainer->SelectorImpl().ProcessCommandL(aCommand); |
223 } |
218 } |
224 // Set pointer event handling ETrue |
219 // Set pointer event handling ETrue |
225 iContainer->SetHandlePointerEventBool(ETrue); |
220 iContainer->SetHandlePointerEventBool(ETrue); |
226 break; |
221 break; |
227 } |
222 } |
228 default: |
223 default: |
229 { |
224 { |
230 DEBUG( CLmkByLmView::HandleCommandL default ); |
|
231 (static_cast<CLmkAppUi*> (AppUi()))->HandleCommandL(aCommand); |
225 (static_cast<CLmkAppUi*> (AppUi()))->HandleCommandL(aCommand); |
232 break; |
226 break; |
233 } |
227 } |
234 } |
228 } |
235 DEBUG ( CLmkByLmView::HandleCommandL End ); |
229 DEBUG ( CLmkByLmView::HandleCommandL End ); |
236 } |
230 } |
237 |
231 |
238 // --------------------------------------------------------- |
232 // --------------------------------------------------------- |
239 // CLmkByLmView::DynInitMenuPaneL |
233 // CLmkByLmView::DynInitMenuPaneL |
240 // --------------------------------------------------------- |
234 // --------------------------------------------------------- |
254 DEBUG1( CLmkByLmView::DynInitMenuPaneL markedCount=%d,markedCount ); |
248 DEBUG1( CLmkByLmView::DynInitMenuPaneL markedCount=%d,markedCount ); |
255 DEBUG1( CLmkByLmView::DynInitMenuPaneL visibleCount=%d,visibleCount ); |
249 DEBUG1( CLmkByLmView::DynInitMenuPaneL visibleCount=%d,visibleCount ); |
256 |
250 |
257 switch (aResourceId) |
251 switch (aResourceId) |
258 { |
252 { |
259 case R_LMK_APP_CALL_SUBMENU: |
|
260 { |
|
261 // Initialise the call UI AIW menu via selector |
|
262 selector.AttachToAIWMenuL(R_LMK_APP_CALL_SUBMENU, |
|
263 R_LMK_APP_AIW_INTEREST); |
|
264 selector.InitializeMenuPaneL(*aMenuPane, aResourceId); |
|
265 selector.AttachInterestL(R_LMK_APP_AIW_INTEREST); |
|
266 break; |
|
267 } |
|
268 case R_LMK_BYLM_MENU1: |
253 case R_LMK_BYLM_MENU1: |
269 { |
254 { |
|
255 //always dimmed |
|
256 aMenuPane->SetItemDimmed(ERemoveFromCat, ETrue); |
270 aMenuPane->SetItemDimmed(ELmkCmdSendDummy, ETrue); |
257 aMenuPane->SetItemDimmed(ELmkCmdSendDummy, ETrue); |
271 aMenuPane->SetItemDimmed(ELmkAppMenuAiwId, ETrue); |
258 |
272 aMenuPane->SetItemDimmed(ELmkCmdGoToUrl, ETrue); |
259 // Send menu is handled by the sender: |
|
260 if ( FeatureManager::FeatureSupported( KFeatureIdLandmarksConverter ) ) |
|
261 { |
|
262 iLmkSender.DisplaySendMenuL( *aMenuPane, visibleCount ); |
|
263 if( visibleCount > 0 ) |
|
264 { |
|
265 TInt pos( 0 ); |
|
266 aMenuPane->ItemAndPos( ELmkCmdSend, pos ); |
|
267 if( pos > 0 ) |
|
268 { |
|
269 aMenuPane->SetItemDimmed(ELmkCmdSend,EFalse ); |
|
270 aMenuPane->SetItemSpecific(ELmkCmdSend,ETrue); |
|
271 } |
|
272 } |
|
273 } |
273 |
274 |
274 /* |
275 /* |
275 If multiple landmarks are selected then we have to dim |
276 If multiple landmarks are selected then we have to dim |
276 Navigate To option. |
277 Navigate To option. |
277 if only one landmark is in focus then we have to dim |
278 if only one landmark is in focus then we have to dim |
342 aMenuPane->SetItemDimmed(navigateToCmd, EFalse); |
343 aMenuPane->SetItemDimmed(navigateToCmd, EFalse); |
343 aMenuPane->SetItemSpecific(navigateToCmd, ETrue); |
344 aMenuPane->SetItemSpecific(navigateToCmd, ETrue); |
344 } |
345 } |
345 break; |
346 break; |
346 } |
347 } |
347 case R_LMK_BYLM_MENU2: |
|
348 { |
|
349 //always dimmed |
|
350 aMenuPane->SetItemDimmed(ELmkCmdChangeIcon, ETrue); |
|
351 aMenuPane->SetItemDimmed(ERemoveFromCat, ETrue); |
|
352 break; |
|
353 } |
|
354 case R_LMK_OK_MENU: |
348 case R_LMK_OK_MENU: |
355 { |
349 { |
356 DEBUG( CLmkByLmView::DynInitMenuPaneL R_LMK_OK_MENU ); |
350 DEBUG( CLmkByLmView::DynInitMenuPaneL R_LMK_OK_MENU ); |
357 // Let send ui add the send menu if MTMs are available: |
351 // Let send ui add the send menu if MTMs are available: |
358 if (FeatureManager::FeatureSupported(KFeatureIdLandmarksConverter)) |
352 if (FeatureManager::FeatureSupported(KFeatureIdLandmarksConverter)) |
431 |
425 |
432 #ifdef RD_SCALABLE_UI_V2 |
426 #ifdef RD_SCALABLE_UI_V2 |
433 //for touch event |
427 //for touch event |
434 iContainer->SetListBoxObserver(this); |
428 iContainer->SetListBoxObserver(this); |
435 #endif//RD_SCALABLE_UI_V2 |
429 #endif//RD_SCALABLE_UI_V2 |
436 // Attach CAll UI base service Interest |
|
437 selector.AttachInterestL(R_LMK_APP_AIW_INTEREST); |
|
438 if (!iListMemento) |
430 if (!iListMemento) |
439 { // Memento not created yet, create it now: |
431 { // Memento not created yet, create it now: |
440 iListMemento = selector.MementoL(); |
432 iListMemento = selector.MementoL(); |
441 } |
433 } |
442 selector.SetMemento(*iListMemento); |
434 selector.SetMemento(*iListMemento); |
601 RPointerArray<CPosLandmark> lmkArray; |
593 RPointerArray<CPosLandmark> lmkArray; |
602 switch (aServiceCommand) |
594 switch (aServiceCommand) |
603 { |
595 { |
604 case KAiwCmdMnNavigateTo: |
596 case KAiwCmdMnNavigateTo: |
605 { |
597 { |
606 iContainer->GetSelectedLandmarksL(lmkArray); |
598 if (iContainer->GetSelectedLandmarksL(lmkArray) == KErrNone) |
607 CleanupStack::PushL(TCleanupItem(CleanupArray, &lmkArray)); |
599 { |
608 iMapNavInterface->NavigateToLandmarkL(lmkArray[0], aMenuCommand); |
600 CleanupStack::PushL(TCleanupItem(CleanupArray, &lmkArray)); |
609 CleanupStack::PopAndDestroy(); // lmkArray |
601 iMapNavInterface->NavigateToLandmarkL(lmkArray[0], |
|
602 aMenuCommand); |
|
603 CleanupStack::PopAndDestroy(); // lmkArray |
|
604 } |
610 break; |
605 break; |
611 } |
606 } |
612 case KAiwCmdMnShowMap: |
607 case KAiwCmdMnShowMap: |
613 { |
608 { |
614 TInt retval = iContainer->GetSelectedLandmarksL(lmkArray); |
609 if (iContainer->GetSelectedLandmarksL(lmkArray) == KErrNone) |
615 CleanupStack::PushL(TCleanupItem(CleanupArray, &lmkArray)); |
610 { |
616 iMapNavInterface->ShowLandmarksOnMapL(lmkArray, aMenuCommand, |
611 CleanupStack::PushL(TCleanupItem(CleanupArray, &lmkArray)); |
617 CLmkMapNavigationInterface::EByLmkView); |
612 iMapNavInterface->ShowLandmarksOnMapL(lmkArray, aMenuCommand, |
618 CleanupStack::PopAndDestroy(); // lmkArray |
613 CLmkMapNavigationInterface::EByLmkView); |
|
614 CleanupStack::PopAndDestroy(); // lmkArray |
|
615 } |
619 break; |
616 break; |
620 } |
617 } |
621 case KAiwCmdMnSelectFromMap: |
618 case KAiwCmdMnSelectFromMap: |
622 { |
619 { |
623 iMapNavInterface->SetObserver(&iContainer->SelectorImpl()); |
620 iMapNavInterface->SetObserver(&iContainer->SelectorImpl()); |
624 iMapNavInterface->GetLandmarkFromMapL(aMenuCommand); |
621 iMapNavInterface->GetLandmarkFromMapL(aMenuCommand); |
625 break; |
622 break; |
626 } |
623 } |
627 case KAiwCmdCall: |
|
628 { |
|
629 // Handle AIW specific service commands |
|
630 CLmkAppSelectorImplBase& selector = iContainer->SelectorImpl(); |
|
631 if (selector.ListVisibleItemCount() > 0) |
|
632 { |
|
633 selector.ExecuteAIWCallCmdL(aMenuCommand); |
|
634 } |
|
635 break; |
|
636 } |
|
637 default: |
624 default: |
638 { |
625 { |
639 result = EFalse; |
626 result = EFalse; |
640 break; |
627 break; |
641 } |
628 } |