ipsservices/ipssossettings/src/ipssetuifoldersubscription.cpp
branchRCL_3
changeset 13 8592a65ad3fb
parent 8 e1b6206813b4
equal deleted inserted replaced
12:4ce476e64c59 13:8592a65ad3fb
   177 // ----------------------------------------------------------------------------
   177 // ----------------------------------------------------------------------------
   178 //
   178 //
   179 void CIpsSetUiSubscriptionDialog::PreLayoutDynInitL()
   179 void CIpsSetUiSubscriptionDialog::PreLayoutDynInitL()
   180     {
   180     {
   181     FUNC_LOG;
   181     FUNC_LOG;
   182     // <cmail>
   182 
   183     
       
   184     /*TBool refreshed = EFalse;
       
   185     CAknQueryDialog* confDialog = CAknQueryDialog::NewL();
       
   186     if( confDialog->ExecuteLD( R_IPS_SET_CONNECT_FOR_UPDATE ) )
       
   187         {
       
   188         refreshed = ETrue;
       
   189         CreateOperationL( EIpsSetUiRefreshFolderList );
       
   190         }
       
   191 	
       
   192     if( refreshed )
       
   193         {
       
   194         iFolderListArray->RefreshFolderListArrayL();
       
   195         }*/
       
   196     // </cmail>
       
   197     CEikColumnListBox* listBox =
   183     CEikColumnListBox* listBox =
   198         static_cast< CEikColumnListBox* >( Control( EIpsSetUiIdFolderListBox ) );
   184         static_cast< CEikColumnListBox* >( Control( EIpsSetUiIdFolderListBox ) );
   199 
   185 
   200     listBox->SetListBoxObserver( this );
   186     listBox->SetListBoxObserver( this );
   201 
   187 
   259     TInt aResourceId,
   245     TInt aResourceId,
   260     CEikMenuPane* aMenuPane )
   246     CEikMenuPane* aMenuPane )
   261     {
   247     {
   262     FUNC_LOG;
   248     FUNC_LOG;
   263     TMsvId folderId = CurrentFolder();
   249     TMsvId folderId = CurrentFolder();
   264     if ( folderId == KErrNotFound )
   250     TInt flags = static_cast<CEikColumnListBox*>( 
       
   251             Control( EIpsSetUiIdFolderListBox ) )->ItemDrawer()->Flags(); 
       
   252     TBool bSelectionVisible( (flags & CListItemDrawer::EPaintedSelection )
       
   253           && !( flags & CListItemDrawer::EDisableHighlight ) );
       
   254 
       
   255     if ( folderId == KErrNotFound || !bSelectionVisible )
   265         {
   256         {
   266         if ( aResourceId == R_IPS_SET_SETTINGS_SUBSCRIBE_MENUPANE )
   257         if ( aResourceId == R_IPS_SET_SETTINGS_SUBSCRIBE_MENUPANE )
   267             {
   258             {
   268     	    if (FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ))
   259     	    if (FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ))
   269     		   {
   260     		   {
   323 // ----------------------------------------------------------------------------
   314 // ----------------------------------------------------------------------------
   324 // CIpsSetUiSubscriptionDialog::HandleSessionEventL
   315 // CIpsSetUiSubscriptionDialog::HandleSessionEventL
   325 // ----------------------------------------------------------------------------
   316 // ----------------------------------------------------------------------------
   326 //
   317 //
   327 void CIpsSetUiSubscriptionDialog::HandleSessionEventL(TMsvSessionEvent aEvent,
   318 void CIpsSetUiSubscriptionDialog::HandleSessionEventL(TMsvSessionEvent aEvent,
   328                     TAny* aArg1, TAny* /*aArg2*/, TAny* /*aArg3*/)
   319                     TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
   329     {
   320     {
   330     FUNC_LOG;
   321     FUNC_LOG;
   331     if(aEvent!=EMsvEntriesChanged)
   322     if(aEvent!=EMsvEntriesChanged)
   332         return;
   323         return;
   333 
   324     static_cast<CEikColumnListBox*>(
   334     CMsvEntrySelection& sel=*static_cast<CMsvEntrySelection*>(aArg1);
   325         Control(EIpsSetUiIdFolderListBox))->DrawDeferred();
   335     if(sel.Find(CurrentFolder())!=KErrNotFound)
       
   336         {
       
   337         CEikColumnListBox* listBox = static_cast<CEikColumnListBox*>(
       
   338                                             Control(EIpsSetUiIdFolderListBox));
       
   339         listBox->DrawNow();
       
   340         }
       
   341     }
   326     }
   342 
   327 
   343 // ----------------------------------------------------------------------------
   328 // ----------------------------------------------------------------------------
   344 // CIpsSetUiSubscriptionDialog::OkToExitL
   329 // CIpsSetUiSubscriptionDialog::OkToExitL
   345 // ----------------------------------------------------------------------------
   330 // ----------------------------------------------------------------------------
   366     	case EAknSoftkeyClose:
   351     	case EAknSoftkeyClose:
   367     		exit = ETrue;
   352     		exit = ETrue;
   368     		break;
   353     		break;
   369 
   354 
   370     	case EIpsSetUiFolderOpenFolder:
   355     	case EIpsSetUiFolderOpenFolder:
   371     		// open folder which has subfolders...
   356     		// open folder which has subfolders.- no need to change the list now
   372     		iContextEntry->SetEntryL( CurrentFolder() );
   357     		iContextEntry->SetEntryL( CurrentFolder() );
   373     		if ( ContextHasChildFolders() )
   358             break;
   374     			{
       
   375     			iOpenedFolderId = CurrentFolder();
       
   376     			iFolderListArray->ChangEIpsSetUiFolderL( CurrentFolder() );
       
   377     			if ( listBox->Model()->NumberOfItems() )
       
   378     				{
       
   379     				listBox->SetTopItemIndex( 0 );
       
   380     				listBox->SetCurrentItemIndex( 0 );
       
   381     				}
       
   382     			if ( oldCount > listBox->Model()->NumberOfItems() )
       
   383     				{
       
   384     				listBox->HandleItemRemovalL();
       
   385     				}
       
   386     			else
       
   387     				{
       
   388     				listBox->HandleItemAdditionL();
       
   389     				}
       
   390     			}
       
   391     		break;
       
   392 
   359 
   393     	case EIpsSetUiRefreshFolderList:
   360     	case EIpsSetUiRefreshFolderList:
   394     		// Always after successfull update go to root view,
   361     		// Always after successfull update go to root view,
   395     		// no matter where in the folder tree we are
   362     		// no matter where in the folder tree we are
   396     		iContextEntry->SetEntryL( iServiceId );
   363     		iContextEntry->SetEntryL( iServiceId );
   495 		CEikColumnListBox* listBox =
   462 		CEikColumnListBox* listBox =
   496 			static_cast<CEikColumnListBox*>(
   463 			static_cast<CEikColumnListBox*>(
   497 				Control( EIpsSetUiIdFolderListBox ) );
   464 				Control( EIpsSetUiIdFolderListBox ) );
   498 		iContextEntry->SetEntryL( CurrentFolder() );
   465 		iContextEntry->SetEntryL( CurrentFolder() );
   499 
   466 
   500 		if ( listBox->Model()->NumberOfItems() &&
   467         if ( listBox->Model()->NumberOfItems() )
   501 			 ContextHasChildFolders() )
       
   502 			{
       
   503 			//if has childs, open folder
       
   504 			OkToExitL( EIpsSetUiFolderOpenFolder );
       
   505 			}
       
   506 		else
       
   507 			{
   468 			{
   508 			//if not, change subs state of the folder
   469 			//if not, change subs state of the folder
   509 			const TMsvEmailEntry emailEntry( iContextEntry->Entry() );
   470 			const TMsvEmailEntry emailEntry( iContextEntry->Entry() );
   510 
   471 
   511 			if ( IpsSetUtils::IsInbox( iSession, emailEntry ) )
   472 			if ( IpsSetUtils::IsInbox( iSession, emailEntry ) )
  1075 // ----------------------------------------------------------------------------
  1036 // ----------------------------------------------------------------------------
  1076 //
  1037 //
  1077 TInt CIpsSetUiSubscriptionDialog::GetResourceForMiddlekey()
  1038 TInt CIpsSetUiSubscriptionDialog::GetResourceForMiddlekey()
  1078     {
  1039     {
  1079     FUNC_LOG;
  1040     FUNC_LOG;
  1080 //#ifdef MSK
       
  1081     TInt resource = KErrNotFound;
  1041     TInt resource = KErrNotFound;
  1082         
  1042         
  1083         switch( CheckMSKState() )
  1043         switch( CheckMSKState() )
  1084             {
  1044             {
  1085             case EIpsSetUiFolderOpenFolder:
  1045             case EIpsSetUiFolderOpenFolder:
  1095                 resource = KErrNotFound;
  1055                 resource = KErrNotFound;
  1096                 break;
  1056                 break;
  1097             }
  1057             }
  1098     
  1058     
  1099     return resource;
  1059     return resource;
  1100 /*
       
  1101 #else
       
  1102     return KErrNotFound;
       
  1103 #endif        
       
  1104 */    
       
  1105     }
  1060     }
  1106 
  1061 
  1107 //<cmail>
  1062 //<cmail>
  1108 // ----------------------------------------------------------------------------
  1063 // ----------------------------------------------------------------------------
  1109 // CIpsSetUiSubscriptionDialog::HandleAsyncRequestCompletedL
  1064 // CIpsSetUiSubscriptionDialog::HandleAsyncRequestCompletedL