|
1 /* |
|
2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Provides Landmarksui main view class methods. |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include <EPos_CPosLandmarkDatabase.h> |
|
20 #include <aknViewAppUi.h> |
|
21 #include <landmarks.rsg> |
|
22 #include <sendnorm.rsg> // R_SENDUI_MENU |
|
23 #include <eiktxlbx.h> |
|
24 #include <eikmenup.h> |
|
25 #include <featmgr.h> |
|
26 #include "landmarks.hrh" |
|
27 #include "CLmkByLmContainer.h" |
|
28 #include "CLmkAppSelectorImplBase.h" |
|
29 #include "MLmkListMemento.h" |
|
30 #include "CLmkAppUi.h" |
|
31 #include "CLmkByLmView.h" |
|
32 #include "CLmkSender.h" |
|
33 #include "Debug.h" |
|
34 #include "landmarks.hrh" |
|
35 #include "clmkmapnavigationinterface.h" |
|
36 #include "CLmkDocument.h" |
|
37 #include <StringLoader.h> |
|
38 |
|
39 // ================= LOCAL FUNCTIONS ======================= |
|
40 static void CleanupArray(TAny* aArray) |
|
41 { |
|
42 (static_cast<RPointerArray<CPosLandmark>*> (aArray))->ResetAndDestroy(); |
|
43 } |
|
44 |
|
45 // ================= MEMBER FUNCTIONS ======================= |
|
46 // ---------------------------------------------------------------------------- |
|
47 // CLmkByLmView::NewLC |
|
48 // Two-phased constructor. |
|
49 // ---------------------------------------------------------------------------- |
|
50 // |
|
51 CLmkByLmView* CLmkByLmView::NewLC(MLmkKeyProcessor& aKeyProcessor, |
|
52 CLmkSender& aLmkSender) |
|
53 { |
|
54 CLmkByLmView* self = new (ELeave) CLmkByLmView(aKeyProcessor, aLmkSender); |
|
55 CleanupStack::PushL(self); |
|
56 self->ConstructL(); |
|
57 return self; |
|
58 } |
|
59 |
|
60 // ---------------------------------------------------------------------------- |
|
61 // CLmkByLmView::CLmkByLmView |
|
62 // C++ default constructor can NOT contain any code, that |
|
63 // might leave. |
|
64 // ---------------------------------------------------------------------------- |
|
65 // |
|
66 CLmkByLmView::CLmkByLmView(MLmkKeyProcessor& aKeyProcessor, |
|
67 CLmkSender& aLmkSender) : |
|
68 CLmkBaseView(aKeyProcessor), iLmkSender(aLmkSender) |
|
69 { |
|
70 } |
|
71 |
|
72 // ---------------------------------------------------------------------------- |
|
73 // CLmkByLmView::ConstructL |
|
74 // Symbian 2nd phase constructor can leave. |
|
75 // ---------------------------------------------------------------------------- |
|
76 // |
|
77 void CLmkByLmView::ConstructL() |
|
78 { |
|
79 CLmkAppUi* lmkAppUi = static_cast<CLmkAppUi*> (AppUi()); |
|
80 if (iEikonEnv->StartedAsServerApp()) |
|
81 { |
|
82 BaseConstructL( R_LMK_BYLM_EMBEDDED_VIEW); |
|
83 isEmbeddedLaunch = ETrue; |
|
84 } |
|
85 else |
|
86 { |
|
87 BaseConstructL( R_LMK_BYLM_VIEW); |
|
88 } |
|
89 CPosLandmarkDatabase& db = lmkAppUi->Document().LmDbL(); |
|
90 iMapNavInterface = CLmkMapNavigationInterface::NewL(db); |
|
91 AttachAIWMenuInterestL(); |
|
92 } |
|
93 |
|
94 // ---------------------------------------------------------------------------- |
|
95 // CLmkByLmView::~CLmkByLmView |
|
96 // ---------------------------------------------------------------------------- |
|
97 // |
|
98 CLmkByLmView::~CLmkByLmView() |
|
99 { |
|
100 if (iContainer) |
|
101 { |
|
102 AppUi()->RemoveFromViewStack(*this, iContainer); |
|
103 } |
|
104 delete iContainer; |
|
105 delete iListMemento; |
|
106 } |
|
107 |
|
108 // ---------------------------------------------------------------------------- |
|
109 // CLmkByLmView::ProcessKeyEventL |
|
110 // ---------------------------------------------------------------------------- |
|
111 // |
|
112 TBool CLmkByLmView::ProcessKeyEventL(const TKeyEvent& aKeyEvent, |
|
113 TEventCode aType) |
|
114 { |
|
115 return CLmkBaseView::ProcessKeyEventL(aKeyEvent, aType); |
|
116 } |
|
117 |
|
118 // ---------------------------------------------------------------------------- |
|
119 // TUid CLmkByLmView::Id |
|
120 // ---------------------------------------------------------------------------- |
|
121 // |
|
122 TUid CLmkByLmView::Id() const |
|
123 { |
|
124 return TUid::Uid(ELmkByLmView); |
|
125 } |
|
126 |
|
127 // ---------------------------------------------------------------------------- |
|
128 // CLmkByLmView::AttachAIWMenuInterestL |
|
129 // ---------------------------------------------------------------------------- |
|
130 // |
|
131 void CLmkByLmView::AttachAIWMenuInterestL() |
|
132 { |
|
133 iMapNavInterface->AttachAIWInterestL(R_LMK_NEW_LANDMARK_SUBMENU, |
|
134 R_LMK_AIW_INTEREST_SELECTFROMMAP); |
|
135 iMapNavInterface->AttachAIWInterestL(R_LMK_BYLM_MENU1, |
|
136 R_LMK_AIW_INTEREST_SHOWONMAP); |
|
137 iMapNavInterface->AttachAIWInterestL(R_LMK_BYLM_MENU1, |
|
138 R_LMK_AIW_INTEREST_NAVIGATETO); |
|
139 } |
|
140 |
|
141 // ---------------------------------------------------------------------------- |
|
142 // CLmkByLmView::HandleCommandL |
|
143 // ---------------------------------------------------------------------------- |
|
144 // |
|
145 void CLmkByLmView::HandleCommandL(TInt aCommand) |
|
146 { |
|
147 DEBUG1( CLmkByLmView::HandleCommandL entered with aCommand=%d, aCommand); |
|
148 |
|
149 AknSelectionService::HandleMarkableListProcessCommandL(aCommand, |
|
150 &(iContainer->ListBox())); |
|
151 CLmkAppSelectorImplBase& selector = iContainer->SelectorImpl(); |
|
152 //first give a chance to M&N framework. |
|
153 TInt aiwCmd = iMapNavInterface->GetServiceCmdByMenuCmd(aCommand); |
|
154 if (KAiwCmdNone == aiwCmd) |
|
155 { |
|
156 aiwCmd = selector.ServiceCmdByMenuCmd(aCommand); |
|
157 } |
|
158 //Handle AIW command |
|
159 if (HandleAIWserviceCommandsL(aiwCmd, aCommand)) |
|
160 { |
|
161 iContainer->ListBox().ClearSelection(); |
|
162 EnableMskLabelL( ETrue); |
|
163 return; |
|
164 } |
|
165 switch (aCommand) |
|
166 { |
|
167 case ELmkCmdNewLmCurrentLocation: |
|
168 case ELmkCmdNewLmEmpty: |
|
169 case ELmkCmdEditLm: |
|
170 case ELmkCmdDeleteLm: |
|
171 case ELmkCmdChangeIcon: |
|
172 case ELmkCmdAddToCat: |
|
173 case ELmkCmdSendVia1: // These commands are used by SendUi |
|
174 case ELmkCmdSendVia2: |
|
175 case ELmkCmdSendVia3: |
|
176 case ELmkCmdSendVia4: |
|
177 case ELmkCmdSendVia5: |
|
178 case ELmkCmdSendVia6: |
|
179 case ELmkCmdSendVia7: |
|
180 case ELmkCmdSendVia8: |
|
181 case ELmkCmdSendVia9: |
|
182 case ELmkCmdSendVia10: |
|
183 case ELmkCmdSend: |
|
184 case ELmkCmdOpenLm: |
|
185 case EAknCmdMark: |
|
186 case EAknCmdUnmark: |
|
187 case EAknMarkAll: |
|
188 case EAknUnmarkAll: |
|
189 case ELmkCmdLaunchPositionSettings: |
|
190 { |
|
191 // Set pointer event handling EFalse, to handle the multiplt tap , |
|
192 // Second tap becomes a pointer event for container, which has to be ignored |
|
193 // fix for bug ECYU-7C24HQ |
|
194 iContainer->SetHandlePointerEventBool(EFalse); |
|
195 |
|
196 TInt markedCount( |
|
197 iContainer->SelectorImpl().ListMarkedItemCountL()); |
|
198 DEBUG1( CLmkByLmView::HandleCommandL markedcount=%d,markedCount ); |
|
199 |
|
200 if (markedCount > 0 && aCommand == ELmkCmdOpenLm |
|
201 && !iContainer->IsEditorOpened()) |
|
202 { |
|
203 if (MenuBar()) |
|
204 { |
|
205 MenuBar()->SetContextMenuTitleResourceId(R_LMK_OK_MENUBAR); |
|
206 MenuBar()->TryDisplayContextMenuBarL(); |
|
207 } |
|
208 } |
|
209 else if (aCommand == ELmkCmdOpenLm |
|
210 && !iContainer->IsEditorOpened()) |
|
211 { |
|
212 iContainer->SelectorImpl().ProcessCommandL(aCommand); |
|
213 iContainer->SetEditorOpenedBool(ETrue); |
|
214 } |
|
215 else |
|
216 { |
|
217 iContainer->SelectorImpl().ProcessCommandL(aCommand); |
|
218 } |
|
219 // Set pointer event handling ETrue |
|
220 iContainer->SetHandlePointerEventBool(ETrue); |
|
221 break; |
|
222 } |
|
223 default: |
|
224 { |
|
225 (static_cast<CLmkAppUi*> (AppUi()))->HandleCommandL(aCommand); |
|
226 break; |
|
227 } |
|
228 } |
|
229 DEBUG ( CLmkByLmView::HandleCommandL End ); |
|
230 } |
|
231 |
|
232 // --------------------------------------------------------- |
|
233 // CLmkByLmView::DynInitMenuPaneL |
|
234 // --------------------------------------------------------- |
|
235 // |
|
236 void CLmkByLmView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane) |
|
237 { |
|
238 DEBUG( CLmkByLmView::DynInitMenuPaneL entered ); |
|
239 iMapNavInterface->HandleMenuOperationL(aResourceId, aMenuPane, |
|
240 ELmkCmdMnNav); |
|
241 |
|
242 AknSelectionService::HandleMarkableListDynInitMenuPane(aResourceId, |
|
243 aMenuPane, &(iContainer->ListBox())); |
|
244 |
|
245 CLmkAppSelectorImplBase& selector = iContainer->SelectorImpl(); |
|
246 TInt markedCount(selector.ListMarkedItemCountL()); |
|
247 TInt visibleCount(selector.ListVisibleItemCount()); |
|
248 DEBUG1( CLmkByLmView::DynInitMenuPaneL markedCount=%d,markedCount ); |
|
249 DEBUG1( CLmkByLmView::DynInitMenuPaneL visibleCount=%d,visibleCount ); |
|
250 |
|
251 switch (aResourceId) |
|
252 { |
|
253 case R_LMK_BYLM_MENU1: |
|
254 { |
|
255 //always dimmed |
|
256 aMenuPane->SetItemDimmed(ERemoveFromCat, ETrue); |
|
257 aMenuPane->SetItemDimmed(ELmkCmdSendDummy, ETrue); |
|
258 |
|
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 } |
|
274 |
|
275 /* |
|
276 If multiple landmarks are selected then we have to dim |
|
277 Navigate To option. |
|
278 if only one landmark is in focus then we have to dim |
|
279 Navigate To & Show On Map options if the particular landmark |
|
280 does not either have address or coordinates. |
|
281 */ |
|
282 |
|
283 TBool isLandmarkDataEmpty = EFalse; |
|
284 if (visibleCount == 0) |
|
285 { |
|
286 isLandmarkDataEmpty = ETrue; |
|
287 } |
|
288 else |
|
289 { |
|
290 if (markedCount == 1 || markedCount == 0) |
|
291 { |
|
292 // Get the selected landmark and check if it is empty |
|
293 RPointerArray<CPosLandmark> lmkArray; |
|
294 TInt retVal = iContainer->GetSelectedLandmarksL(lmkArray); |
|
295 if (retVal != KErrNotFound) |
|
296 { |
|
297 CleanupStack::PushL(TCleanupItem(CleanupArray, |
|
298 &lmkArray)); |
|
299 isLandmarkDataEmpty |
|
300 = iContainer->IsLandmarkDataEmptyL( |
|
301 lmkArray[0]); |
|
302 CleanupStack::PopAndDestroy();// lmkArray |
|
303 } |
|
304 } |
|
305 } |
|
306 |
|
307 TInt showOnMapCmd = -1; |
|
308 TInt navigateToCmd = -1; |
|
309 |
|
310 TInt cnt = aMenuPane->NumberOfItemsInPane(); |
|
311 |
|
312 for (TInt i = 0; i < cnt; ++i) |
|
313 { |
|
314 CEikMenuPaneItem::SData& itemData = |
|
315 aMenuPane->ItemDataByIndexL(i); |
|
316 |
|
317 if (iMapNavInterface->GetServiceCmdByMenuCmd( |
|
318 itemData.iCommandId) == KAiwCmdMnShowMap) |
|
319 { |
|
320 showOnMapCmd = itemData.iCommandId; |
|
321 } |
|
322 if (iMapNavInterface->GetServiceCmdByMenuCmd( |
|
323 itemData.iCommandId) == KAiwCmdMnNavigateTo) |
|
324 { |
|
325 navigateToCmd = itemData.iCommandId; |
|
326 } |
|
327 } |
|
328 if (showOnMapCmd < 0 && navigateToCmd < 0) |
|
329 { |
|
330 break; |
|
331 } |
|
332 |
|
333 if (isLandmarkDataEmpty || markedCount > 1) |
|
334 { |
|
335 aMenuPane->SetItemDimmed(showOnMapCmd, ETrue); |
|
336 aMenuPane->SetItemDimmed(navigateToCmd, ETrue); |
|
337 } |
|
338 else |
|
339 { |
|
340 aMenuPane->SetItemDimmed(showOnMapCmd, EFalse); |
|
341 aMenuPane->SetItemSpecific(showOnMapCmd, ETrue); |
|
342 |
|
343 aMenuPane->SetItemDimmed(navigateToCmd, EFalse); |
|
344 aMenuPane->SetItemSpecific(navigateToCmd, ETrue); |
|
345 } |
|
346 break; |
|
347 } |
|
348 case R_LMK_OK_MENU: |
|
349 { |
|
350 DEBUG( CLmkByLmView::DynInitMenuPaneL R_LMK_OK_MENU ); |
|
351 // Let send ui add the send menu if MTMs are available: |
|
352 if (FeatureManager::FeatureSupported(KFeatureIdLandmarksConverter)) |
|
353 { |
|
354 iLmkSender.DisplaySendMenuL(*aMenuPane, visibleCount); |
|
355 } |
|
356 else |
|
357 { |
|
358 aMenuPane->SetItemDimmed(ELmkCmdSendDummy, ETrue); |
|
359 } |
|
360 if (visibleCount == 0) |
|
361 { |
|
362 aMenuPane->SetItemDimmed(ELmkCmdAddToCat, ETrue); |
|
363 aMenuPane->SetItemDimmed(ELmkCmdDeleteLm, ETrue); |
|
364 aMenuPane->SetItemDimmed(ELmkCmdNewLm, EFalse); |
|
365 } |
|
366 break; |
|
367 } |
|
368 case R_LMK_MAIN_MENU: |
|
369 { |
|
370 CLmkBaseView::HandleHelpFeature(aMenuPane); |
|
371 break; |
|
372 } |
|
373 case R_SENDUI_MENU: // Dynamically created send ui menu |
|
374 { |
|
375 if (FeatureManager::FeatureSupported(KFeatureIdLandmarksConverter)) |
|
376 { |
|
377 iLmkSender.DisplaySendCascadeMenuL(*aMenuPane); |
|
378 } |
|
379 break; |
|
380 } |
|
381 case R_LMK_NEW_LANDMARK_SUBMENU: |
|
382 { |
|
383 if (FeatureManager::FeatureSupported( |
|
384 KFeatureIdLocationFrameworkCore)) |
|
385 { |
|
386 aMenuPane->SetItemDimmed(ELmkCmdNewLmCurrentLocation, EFalse); |
|
387 } |
|
388 else |
|
389 { |
|
390 aMenuPane->SetItemDimmed(ELmkCmdNewLmCurrentLocation, ETrue); |
|
391 } |
|
392 |
|
393 if (iIsHideCoordinate) |
|
394 { |
|
395 aMenuPane->SetItemDimmed(ELmkCmdNewLmEmpty, ETrue); |
|
396 } |
|
397 else |
|
398 { |
|
399 aMenuPane->SetItemDimmed(ELmkCmdNewLmEmpty, EFalse); |
|
400 } |
|
401 break; |
|
402 } |
|
403 default: |
|
404 { |
|
405 break; |
|
406 } |
|
407 } |
|
408 DEBUG ( CLmkByLmView::DynInitMenuPaneL end ); |
|
409 } |
|
410 |
|
411 // ---------------------------------------------------------------------------- |
|
412 // CLmkByLmView::DoActivateL |
|
413 // ---------------------------------------------------------------------------- |
|
414 // |
|
415 void CLmkByLmView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, |
|
416 TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/) |
|
417 { |
|
418 DEBUG( CLmkByLmView::DoActivateL entered ); |
|
419 if (!iContainer) |
|
420 { |
|
421 iContainer |
|
422 = CLmkByLmContainer::NewL(*this, this, ClientRect(), *this); |
|
423 CLmkAppSelectorImplBase& selector = iContainer->SelectorImpl(); |
|
424 AppUi()->AddToStackL(*this, iContainer); |
|
425 |
|
426 #ifdef RD_SCALABLE_UI_V2 |
|
427 //for touch event |
|
428 iContainer->SetListBoxObserver(this); |
|
429 #endif//RD_SCALABLE_UI_V2 |
|
430 if (!iListMemento) |
|
431 { // Memento not created yet, create it now: |
|
432 iListMemento = selector.MementoL(); |
|
433 } |
|
434 selector.SetMemento(*iListMemento); |
|
435 selector.RestoreMemento(); |
|
436 EnableMskMenuL( EFalse); |
|
437 EnableMskLabelL(EFalse); |
|
438 } |
|
439 DEBUG ( CLmkByLmView::DoActivateL End ); |
|
440 } |
|
441 |
|
442 // ---------------------------------------------------------------------------- |
|
443 // CLmkByLmView::DoDeactivate |
|
444 // ---------------------------------------------------------------------------- |
|
445 // |
|
446 void CLmkByLmView::DoDeactivate() |
|
447 { |
|
448 if (iContainer) |
|
449 { |
|
450 iContainer->SelectorImpl().StoreMemento(); |
|
451 AppUi()->RemoveFromViewStack(*this, iContainer); |
|
452 } |
|
453 TRAP_IGNORE( EnableMskMenuL(EFalse)); |
|
454 TRAP_IGNORE( EnableMskLabelL(EFalse)); |
|
455 delete iContainer; |
|
456 iContainer = NULL; |
|
457 } |
|
458 |
|
459 // ---------------------------------------------------------------------------- |
|
460 // CLmkByLmView::Update() |
|
461 // ---------------------------------------------------------------------------- |
|
462 // |
|
463 void CLmkByLmView::Update() |
|
464 { |
|
465 iContainer->SetRect(ClientRect()); |
|
466 } |
|
467 |
|
468 // --------------------------------------------------------- |
|
469 // CLmkBaseView::EnableMskMenuL() |
|
470 // --------------------------------------------------------- |
|
471 // |
|
472 void CLmkByLmView::EnableMskMenuL(TBool aEnable) |
|
473 { |
|
474 CEikButtonGroupContainer* cbaGrp = Cba(); |
|
475 if (cbaGrp) |
|
476 { |
|
477 if (aEnable) |
|
478 { |
|
479 cbaGrp->RemoveCommandFromStack(KMskCommandPos, ELmkCmdOpenLm); |
|
480 TInt |
|
481 cbaRes = |
|
482 isEmbeddedLaunch |
|
483 ? R_LMK_SOFTKEYS_OPTIONS_BACK_CONTEXTOPTIONS |
|
484 : R_LMK_SOFTKEYS_OPTIONS_EXIT_CONTEXTOPTIONS; |
|
485 cbaGrp->SetCommandSetL(cbaRes); |
|
486 cbaGrp->MakeCommandVisible(EAknSoftkeyContextOptions, ETrue); |
|
487 if (MenuBar()) |
|
488 MenuBar()->SetContextMenuTitleResourceId(R_LMK_OK_MENUBAR); |
|
489 } |
|
490 else |
|
491 { |
|
492 cbaGrp->MakeCommandVisible(EAknSoftkeyContextOptions, EFalse); |
|
493 } |
|
494 } |
|
495 } |
|
496 |
|
497 // --------------------------------------------------------- |
|
498 // CLmkBaseView::EnableMskLabelL() |
|
499 // --------------------------------------------------------- |
|
500 // |
|
501 void CLmkByLmView::EnableMskLabelL(TBool aEnable) |
|
502 { |
|
503 |
|
504 CEikButtonGroupContainer* cbaGrp = Cba(); |
|
505 if (cbaGrp) |
|
506 { |
|
507 if (aEnable) |
|
508 { |
|
509 |
|
510 HBufC* mskOpenTxt = NULL; |
|
511 mskOpenTxt = StringLoader::LoadLC(R_LMK_MSK_OPEN, iEikonEnv); |
|
512 cbaGrp->RemoveCommandFromStack(KMskCommandPos, |
|
513 EAknSoftkeyContextOptions); |
|
514 cbaGrp->AddCommandToStackL(KMskCommandPos, ELmkCmdOpenLm, |
|
515 mskOpenTxt->Des()); |
|
516 cbaGrp->MakeCommandVisible(ELmkCmdOpenLm, ETrue); |
|
517 CleanupStack::PopAndDestroy(mskOpenTxt); |
|
518 } |
|
519 else |
|
520 { |
|
521 cbaGrp->MakeCommandVisible(ELmkCmdOpenLm, EFalse); |
|
522 } |
|
523 } |
|
524 } |
|
525 |
|
526 #ifdef RD_SCALABLE_UI_V2 |
|
527 // --------------------------------------------------------- |
|
528 // CLmkByLmView::HandleListBoxEventL() |
|
529 // --------------------------------------------------------- |
|
530 // |
|
531 void CLmkByLmView::HandleListBoxEventL(CEikListBox* /*aListBox*/, |
|
532 TListBoxEvent aEventType) |
|
533 { |
|
534 TLmkMskDispItem dispItem = iContainer->ResolveMskDisplayItem(); |
|
535 |
|
536 switch (aEventType) |
|
537 { |
|
538 //case EEventItemDoubleClicked: |
|
539 case EEventEmptyListClicked: |
|
540 case EEventItemSingleClicked: |
|
541 { |
|
542 if (dispItem == EContextMenu) |
|
543 { |
|
544 UpdateMskViewL(dispItem); |
|
545 CEikMenuBar* menubar = |
|
546 static_cast<CAknViewAppUi*> (iAvkonAppUi)->View( |
|
547 TUid::Uid(ELmkByLmView))->MenuBar(); |
|
548 if (menubar) |
|
549 { |
|
550 TRAPD( err, menubar->TryDisplayContextMenuBarL() ); |
|
551 User::LeaveIfError(err); |
|
552 } |
|
553 } |
|
554 else if (dispItem == ELabel) |
|
555 { |
|
556 UpdateMskViewL(dispItem); |
|
557 HandleCommandL(ELmkCmdOpenLm); |
|
558 } |
|
559 break; |
|
560 } |
|
561 |
|
562 //case EEventItemClicked: |
|
563 case EEventPanningStarted: |
|
564 case EEventPanningStopped: |
|
565 case EEventFlickStarted: |
|
566 case EEventFlickStopped: |
|
567 case EEventPenDownOnItem: |
|
568 case EEventItemDraggingActioned: |
|
569 { |
|
570 if (dispItem == EContextMenu) |
|
571 { |
|
572 UpdateMskViewL(dispItem); |
|
573 } |
|
574 else if (dispItem == ELabel) |
|
575 { |
|
576 UpdateMskViewL(dispItem); |
|
577 } |
|
578 break; |
|
579 } |
|
580 default: |
|
581 break; |
|
582 } |
|
583 } |
|
584 #endif//RD_SCALABLE_UI_V2 |
|
585 // --------------------------------------------------------- |
|
586 // CLmkByLmView::HandleAIWserviceCommandsL() |
|
587 // --------------------------------------------------------- |
|
588 // |
|
589 TBool CLmkByLmView::HandleAIWserviceCommandsL(TInt aServiceCommand, |
|
590 TInt aMenuCommand) |
|
591 { |
|
592 TBool result = ETrue; |
|
593 RPointerArray<CPosLandmark> lmkArray; |
|
594 switch (aServiceCommand) |
|
595 { |
|
596 case KAiwCmdMnNavigateTo: |
|
597 { |
|
598 if (iContainer->GetSelectedLandmarksL(lmkArray) == KErrNone) |
|
599 { |
|
600 CleanupStack::PushL(TCleanupItem(CleanupArray, &lmkArray)); |
|
601 iMapNavInterface->NavigateToLandmarkL(lmkArray[0], |
|
602 aMenuCommand); |
|
603 CleanupStack::PopAndDestroy(); // lmkArray |
|
604 } |
|
605 break; |
|
606 } |
|
607 case KAiwCmdMnShowMap: |
|
608 { |
|
609 if (iContainer->GetSelectedLandmarksL(lmkArray) == KErrNone) |
|
610 { |
|
611 CleanupStack::PushL(TCleanupItem(CleanupArray, &lmkArray)); |
|
612 iMapNavInterface->ShowLandmarksOnMapL(lmkArray, aMenuCommand, |
|
613 CLmkMapNavigationInterface::EByLmkView); |
|
614 CleanupStack::PopAndDestroy(); // lmkArray |
|
615 } |
|
616 break; |
|
617 } |
|
618 case KAiwCmdMnSelectFromMap: |
|
619 { |
|
620 iMapNavInterface->SetObserver(&iContainer->SelectorImpl()); |
|
621 iMapNavInterface->GetLandmarkFromMapL(aMenuCommand); |
|
622 break; |
|
623 } |
|
624 default: |
|
625 { |
|
626 result = EFalse; |
|
627 break; |
|
628 } |
|
629 } |
|
630 return result; |
|
631 } |
|
632 |
|
633 // End of File |