locationtriggering/lbtmgmtui/src/lbtmgmtpluginview.cpp
branchRCL_3
changeset 4 42de37ce7ce4
parent 0 667063e416a2
equal deleted inserted replaced
1:788b770ce3ae 4:42de37ce7ce4
   152     
   152     
   153     // Create the Location Triggering engine instance
   153     // Create the Location Triggering engine instance
   154     iEngine = CLbtMgmtPluginEngine::NewL( *this );
   154     iEngine = CLbtMgmtPluginEngine::NewL( *this );
   155     
   155     
   156     // Create new Container 
   156     // Create new Container 
   157     iContainer = CLbtMgmtPluginContainer::NewL( ClientRect(),
   157     iContainer = CLbtMgmtPluginContainer::NewL(ClientRect(), *iEngine, *this,
   158                                                    *iEngine,
   158             this);
   159                                                    *this );
   159     iContainer->SetMopParent(this);
   160     iContainer->SetMopParent( this );
   160     AppUi()->AddToViewStackL(*this, iContainer);
   161     AppUi()->AddToViewStackL( *this, iContainer );
   161     MenuBar()->SetContextMenuTitleResourceId(R_LBTMGMTPLUGIN_CONTEXTMENUBAR);
   162     
   162 
   163     SetCba( R_LBTMGMTPLUGIN_CBA_CHANGE );
   163     SetCba(R_LBTMGMTPLUGIN_CBA_CHANGE);
   164     }
   164     }
   165 
   165 
   166 // ---------------------------------------------------------------------------
   166 // ---------------------------------------------------------------------------
   167 // void CLocationSystemUiView::DoDeactivate
   167 // void CLocationSystemUiView::DoDeactivate
   168 //
   168 //
   201 //  
   201 //  
   202 void CLbtMgmtPluginView::HandleCommandL(TInt aCommand)   
   202 void CLbtMgmtPluginView::HandleCommandL(TInt aCommand)   
   203     {
   203     {
   204     switch( aCommand )
   204     switch( aCommand )
   205         {
   205         {
       
   206         case ELbtMgmtShowCSMenu:
       
   207             if (CLbtMgmtPluginEngine::EActiveTriggers
       
   208                     == iContainer->GetFocussedItem())
       
   209                 {
       
   210                 iContainer->ShowContextMenuL();
       
   211                 }
       
   212             break;
   206         case ELbtMgmtChange:
   213         case ELbtMgmtChange:
   207         case ELbtMgmtMSKChange:
   214         case ELbtMgmtMSKChange:
   208     		{
   215     		{
   209     		SettingsChangeL(aCommand);   		
   216     		SettingsChangeL(aCommand);   		
   210           	break;
   217           	break;
   211           	}
   218       	}
       
   219   	  case ELbtMgmtMSKInfo:
       
   220   	  	break;
   212         case ELbtMgmtInfo:
   221         case ELbtMgmtInfo:
   213         case ELbtMgmtMSKInfo:
   222               	{
   214         	{
       
   215 			iEngine->ShowInfoDialogL();
   223 			iEngine->ShowInfoDialogL();
   216         	break;
   224         	break;
   217         	}
   225         	}
   218         case ELbtMgmtClearAll:
   226         case ELbtMgmtClearAll:
   219     		{
   227     		{
   238             }
   246             }
   239         default:
   247         default:
   240             {
   248             {
   241             // Un-handled commands are to be passed to the 
   249             // Un-handled commands are to be passed to the 
   242             // App UI
   250             // App UI
   243             AppUi()->HandleCommandL( aCommand );
   251             AppUi()->HandleCommandL(aCommand);
   244             break;  
   252             break;
   245             }
   253             }
   246         }
       
   247     }
       
   248     
       
   249 // -----------------------------------------------------------------------------
       
   250 // CLbtMgmtPluginView::DynInitMenuPaneL
       
   251 // -----------------------------------------------------------------------------
       
   252 //
       
   253 void CLbtMgmtPluginView::DynInitMenuPaneL( TInt          aResourceId, 
       
   254                                               CEikMenuPane* aMenuPane )
       
   255     {
       
   256     if ( aResourceId == R_LBTMGMTPLUGIN_MENU )
       
   257         {
       
   258         User::LeaveIfNull( aMenuPane );
       
   259         //Handle Help Feature
       
   260 
       
   261         //Context sensitive menu items
       
   262         if( CLbtMgmtPluginEngine::EActiveTriggers == iContainer->GetFocussedItem() )
       
   263         	{
       
   264         	aMenuPane->SetItemDimmed( ELbtMgmtChange, ETrue );
       
   265         	if( iEngine->ActiveTriggers() )
       
   266         	    {
       
   267         	    aMenuPane->SetItemDimmed( ELbtMgmtClearAll, EFalse );  			            
       
   268         	    aMenuPane->SetItemDimmed( ELbtMgmtInfo, EFalse );
       
   269         	    }
       
   270         	else
       
   271         	    {
       
   272         	    aMenuPane->SetItemDimmed( ELbtMgmtClearAll, ETrue );                          
       
   273         	     aMenuPane->SetItemDimmed( ELbtMgmtInfo, ETrue );
       
   274         	    }
       
   275         	}
       
   276         else
       
   277         	{
       
   278 			aMenuPane->SetItemDimmed( ELbtMgmtChange, EFalse );  
       
   279 			 aMenuPane->SetItemDimmed( ELbtMgmtClearAll, ETrue ); 
       
   280 			aMenuPane->SetItemDimmed( ELbtMgmtInfo, ETrue );
       
   281         	}
       
   282         }
   254         }
   283     }   
   255     }   
   284 
   256 
   285 // -----------------------------------------------------------------------------
   257 // -----------------------------------------------------------------------------
   286 // CLbtMgmtPluginView::SetCba
   258 // CLbtMgmtPluginView::SetCba
   426             break;
   398             break;
   427             }
   399             }
   428         case CLbtMgmtPluginEngine::EActiveTriggers:
   400         case CLbtMgmtPluginEngine::EActiveTriggers:
   429             {
   401             {
   430 			// If condition is added for any pointer event from container
   402 			// If condition is added for any pointer event from container
   431             if( iEngine->ActiveTriggers() )
       
   432             		iEngine->ShowInfoDialogL();
       
   433             break;
   403             break;
   434             }
   404             }
   435         default:
   405         default:
   436             {
   406             {
   437             // Element not found
   407             // Element not found
   497     CleanupStack::PopAndDestroy( tmpName );
   467     CleanupStack::PopAndDestroy( tmpName );
   498     
   468     
   499     //If leave occurs before this, close is called automatically when the thread exits.
   469     //If leave occurs before this, close is called automatically when the thread exits.
   500     fsSession.Close();
   470     fsSession.Close();
   501     }
   471     }
       
   472 
       
   473 // ---------------------------------------------------------------------------
       
   474 // CLbtMgmtPluginView :: GetLbtMgmtPluginEngine
       
   475 // 
       
   476 // 
       
   477 // ---------------------------------------------------------------------------
       
   478 //
       
   479 CLbtMgmtPluginEngine* CLbtMgmtPluginView::GetLbtMgmtPluginEngine()
       
   480     {
       
   481     return iEngine;
       
   482     }