photosgallery/viewframework/commandhandlers/commandhandlermarking/src/glxcommandhandlermarking.cpp
branchRCL_3
changeset 47 f9e827349359
parent 22 2dac0fdba72b
equal deleted inserted replaced
35:420f6808bf21 47:f9e827349359
   488 // HandleItemAddedL
   488 // HandleItemAddedL
   489 // ---------------------------------------------------------------------------
   489 // ---------------------------------------------------------------------------
   490 void CGlxCommandHandlerMarking::HandleItemAddedL(TInt /*aStartIndex*/, 
   490 void CGlxCommandHandlerMarking::HandleItemAddedL(TInt /*aStartIndex*/, 
   491                                     TInt /*aEndIndex*/, MGlxMediaList* aList)
   491                                     TInt /*aEndIndex*/, MGlxMediaList* aList)
   492     {
   492     {
   493     if (aList->Count() > 0 && iUiUtility->GetGridToolBar())
   493     TRACER("CGlxCommandHandlerMarking::HandleItemAddedL");
   494         {
   494     // Check if toolbar is available.
   495         iUiUtility->GetGridToolBar()->SetItemDimmed(
   495     CAknToolbar* toolbar = iUiUtility->GetGridToolBar();
   496                 EGlxCmdStartMultipleMarking, EFalse, ETrue);
   496     if (aList->Count() > 0 && toolbar)
       
   497         {
       
   498         toolbar->SetItemDimmed(EGlxCmdStartMultipleMarking, EFalse, ETrue);
   497         }
   499         }
   498     }
   500     }
   499     
   501     
   500     
   502     
   501 // ---------------------------------------------------------------------------
   503 // ---------------------------------------------------------------------------
   511 // HandleItemRemoved
   513 // HandleItemRemoved
   512 // ---------------------------------------------------------------------------
   514 // ---------------------------------------------------------------------------
   513 void CGlxCommandHandlerMarking::HandleItemRemovedL(TInt /*aStartIndex*/, 
   515 void CGlxCommandHandlerMarking::HandleItemRemovedL(TInt /*aStartIndex*/, 
   514                                     TInt /*aEndIndex*/, MGlxMediaList* aList)
   516                                     TInt /*aEndIndex*/, MGlxMediaList* aList)
   515     {
   517     {
   516     if (aList->Count() == 0 && iUiUtility->GetGridToolBar())
   518     TRACER("CGlxCommandHandlerMarking::HandleItemRemovedL");
   517         {
   519     // Check if toolbar is available.
   518         iUiUtility->GetGridToolBar()->SetItemDimmed(
   520     CAknToolbar* toolbar = iUiUtility->GetGridToolBar();
   519                 EGlxCmdStartMultipleMarking, ETrue, ETrue);
   521     if (aList->Count() == 0 && toolbar)
       
   522         {
       
   523         toolbar->SetItemDimmed(EGlxCmdStartMultipleMarking, ETrue, ETrue);
   520         }
   524         }
   521     }
   525     }
   522 
   526 
   523 // ---------------------------------------------------------------------------
   527 // ---------------------------------------------------------------------------
   524 // HandleItemModifiedL
   528 // HandleItemModifiedL
   536     {
   540     {
   537 	TRACER("CGlxCommandHandlerMarking::HandleAttributesAvailableL");
   541 	TRACER("CGlxCommandHandlerMarking::HandleAttributesAvailableL");
   538 	
   542 	
   539 	if(!iUiUtility->IsPenSupported())
   543 	if(!iUiUtility->IsPenSupported())
   540 		{
   544 		{
   541 	    if( aItemIndex == aList->FocusIndex() && iMultipleMarking)
   545 		if (aItemIndex == aList->FocusIndex() && iMultipleMarking)
   542 	        {
   546 			{
   543 	        if(aList->Item(aItemIndex).IsStatic())
   547 			if (aList->Item(aItemIndex).IsStatic())
   544 	            {
   548 				{
   545 	            iScreenFurniture->ModifySoftkeyIdL(
   549 				iScreenFurniture->ModifySoftkeyIdL(
   546 	                    CEikButtonGroupContainer::EMiddleSoftkeyPosition, 
   550 						CEikButtonGroupContainer::EMiddleSoftkeyPosition,
   547 	                    EAknSoftkeyEmpty, 0, KGlxBlankString);    
   551 						EAknSoftkeyEmpty, 0, KGlxBlankString);
   548 	            }
   552 				}
   549 	        else
   553 			else
   550 	            {
   554 				{
   551 	            if (aList->IsSelected(aItemIndex))
   555 				if (aList->IsSelected(aItemIndex))
   552 	                {
   556 					{
   553 	                iScreenFurniture->ModifySoftkeyIdL(
   557 					iScreenFurniture->ModifySoftkeyIdL(
   554 	                        CEikButtonGroupContainer::EMiddleSoftkeyPosition, 
   558 							CEikButtonGroupContainer::EMiddleSoftkeyPosition,
   555 	                        EAknCmdUnmark, 0, *iMskTextUnMark);    
   559 							EAknCmdUnmark, 0, *iMskTextUnMark);
   556 	                }
   560 					}
   557 	            else
   561 				else
   558 	                {
   562 					{
   559 	                iScreenFurniture->ModifySoftkeyIdL(
   563 					iScreenFurniture->ModifySoftkeyIdL(
   560 	                        CEikButtonGroupContainer::EMiddleSoftkeyPosition, 
   564 							CEikButtonGroupContainer::EMiddleSoftkeyPosition,
   561 	                            EAknCmdMark, 0, *iMskTextMark);    
   565 							EAknCmdMark, 0, *iMskTextMark);
   562 	                }
   566 					}
   563 	            	}
   567 				}
   564 	        	}
       
   565 			}
   568 			}
       
   569 		}
   566     }
   570     }
   567 
   571 
   568 // ---------------------------------------------------------------------------
   572 // ---------------------------------------------------------------------------
   569 // HandleFocusChangedL
   573 // HandleFocusChangedL
   570 // ---------------------------------------------------------------------------
   574 // ---------------------------------------------------------------------------
   602                 // if need to go off end of list add count to end index
   606                 // if need to go off end of list add count to end index
   603                 // so we can iterate sequentally through items
   607                 // so we can iterate sequentally through items
   604                 if( aOldIndex < aNewIndex )
   608                 if( aOldIndex < aNewIndex )
   605                     {
   609                     {
   606                     endIdx += count;  
   610                     endIdx += count;  
   607 
       
   608                     }          
   611                     }          
   609                 }
   612                 }
   610                 break;
   613                 break;
   611             // do nothing if focus type is unknown
   614             // do nothing if focus type is unknown
   612             case NGlxListDefs::EUnknown:
   615             case NGlxListDefs::EUnknown:
   680     If in the multiple marking mode, and the item selected is the focussed 
   683     If in the multiple marking mode, and the item selected is the focussed 
   681     item, HandleItemSelected causes the left softkey to be updated to 
   684     item, HandleItemSelected causes the left softkey to be updated to 
   682     correspond to the marked state of the focussed item. If the item is 
   685     correspond to the marked state of the focussed item. If the item is 
   683     marked the softkey is changed to "Unmark" and vice versa.
   686     marked the softkey is changed to "Unmark" and vice versa.
   684     */
   687     */
   685     
   688     if (!iUiUtility->IsPenSupported())
   686 	if(!iUiUtility->IsPenSupported())
       
   687 		{
   689 		{
   688     	if( aIndex == aList->FocusIndex() )
   690 		if (aIndex == aList->FocusIndex())
   689         	{
   691 			{
   690         	// Update MSK
   692 			// Update MSK
   691         	iScreenFurniture->ModifySoftkeyIdL(
   693 			iScreenFurniture->ModifySoftkeyIdL(
   692                 CEikButtonGroupContainer::EMiddleSoftkeyPosition, EAknCmdUnmark, 0, *iMskTextUnMark);    
   694 					CEikButtonGroupContainer::EMiddleSoftkeyPosition,
   693 
   695 					EAknCmdUnmark, 0, *iMskTextUnMark);
   694         	} 
   696 			}
   695 		}
   697 		}
   696     }
   698     }
   697 
   699 
   698 // ---------------------------------------------------------------------------
   700 // ---------------------------------------------------------------------------
   699 // HandleMessageL
   701 // HandleMessageL