messagingappbase/mce/src/MceMainViewListView.cpp
branchRCL_3
changeset 17 caea42e26caa
parent 2 0bf1d54f37d9
child 22 52d61119153d
equal deleted inserted replaced
9:1d7827e39b52 17:caea42e26caa
   109     iSession( aSession ),
   109     iSession( aSession ),
   110     iSessionHolder( aSessionHolder ),
   110     iSessionHolder( aSessionHolder ),
   111     iBitmapResolver( aBitmapResolver ),
   111     iBitmapResolver( aBitmapResolver ),
   112     iSelectedIndex( KErrNotFound ),
   112     iSelectedIndex( KErrNotFound ),
   113     iTopItemIndex( 0 ),
   113     iTopItemIndex( 0 ),
   114     iSelectionFolderId( KMsvNullIndexEntryId ),
   114     iSelectionFolderId( KMsvNullIndexEntryId ), 
   115 		iSelectableEmail(EFalse), 
       
   116 		iEmailClientIntegration(EFalse),
   115 		iEmailClientIntegration(EFalse),
       
   116 		iSelectableEmail(EFalse),
   117 		iEmailFramework(EFalse)
   117 		iEmailFramework(EFalse)
   118     {
   118     {
   119     iSessionHolder.AddClient();
   119     iSessionHolder.AddClient();
   120     }
   120     }
   121 
   121 
   230         if ( !iEmptyListContainer  )
   230         if ( !iEmptyListContainer  )
   231             {
   231             {
   232             iEmptyListContainer = CMceMainViewEmptyListContainer::NewL( ClientRect() );
   232             iEmptyListContainer = CMceMainViewEmptyListContainer::NewL( ClientRect() );
   233             AppUi()->AddToStackL(*this,iEmptyListContainer);
   233             AppUi()->AddToStackL(*this,iEmptyListContainer);
   234             MCELOGGER_WRITE_TIMESTAMP("Main view: Empty container activated at ");
   234             MCELOGGER_WRITE_TIMESTAMP("Main view: Empty container activated at ");
       
   235             CEikStatusPane* sp = StatusPane();
       
   236             sp->DrawNow();
   235             }
   237             }
   236         if ( aCustomMessageId.iUid == KMceShowMail )
   238         if ( aCustomMessageId.iUid == KMceShowMail )
   237             {
   239             {
   238             iPerformOperationAfterMsgStart = KMceShowMail;
   240             iPerformOperationAfterMsgStart = KMceShowMail;
   239             }
   241             }
   487             iMceUi->CloseConnectionWithListQueryL();
   489             iMceUi->CloseConnectionWithListQueryL();
   488             }
   490             }
   489             break;
   491             break;
   490         case EAknCmdHideInBackground:
   492         case EAknCmdHideInBackground:
   491             break;
   493             break;
       
   494         case EMceDefaultConversationsView:
       
   495             if ( SetMceDefaultViewL(EMceConversationview) )
       
   496                 {
       
   497                 ShowConfirmationNoteL(R_DEFAULTVIEW_CONVERSATION_SELECTED);  
       
   498                 }
       
   499              break;
       
   500              
       
   501         case EMceDefaultInboxView:     
       
   502             if ( SetMceDefaultViewL(EMceInboxview) )
       
   503                 {
       
   504                 ShowConfirmationNoteL(R_DEFAULTVIEW_INBOX_SELECTED);
       
   505                 }
       
   506              break;
   492         case EMceCmdSettings:
   507         case EMceCmdSettings:
   493 		    {
   508 		    {
   494 		    if (( iEmailClientIntegration )&&(!iEmailFramework))
   509 		    if (( iEmailClientIntegration )&&(!iEmailFramework))
   495 		        {
   510 		        {
   496 		        // these have to be updated here because when a mailbox setup wizard is launched
   511 		        // these have to be updated here because when a mailbox setup wizard is launched
   776 				iAiwServiceHandler->InitializeMenuPaneL( *aMenuPane, aResourceId,
   791 				iAiwServiceHandler->InitializeMenuPaneL( *aMenuPane, aResourceId,
   777 				EMceCmdFirstSyncmlAiwCommand, iAiwServiceHandler->InParamListL());
   792 				EMceCmdFirstSyncmlAiwCommand, iAiwServiceHandler->InParamListL());
   778     			}
   793     			}
   779     		}
   794     		}
   780     	}
   795     	}
   781         
   796     if ( aResourceId == R_MCE_DEFAULT_VIEW_SUBMENU )
       
   797        {
       
   798        TInt defaultview = KErrGeneral;
       
   799        defaultview = GetMceDefaultViewL();
       
   800        if(defaultview == EMceInboxview )
       
   801            {
       
   802            aMenuPane->SetItemButtonState( EMceDefaultInboxView,
       
   803                     EEikMenuItemSymbolOn );
       
   804            }
       
   805        if(defaultview == EMceConversationview )
       
   806            {
       
   807            aMenuPane->SetItemButtonState( EMceDefaultConversationsView,
       
   808                     EEikMenuItemSymbolOn );
       
   809            }
       
   810        }
       
   811   
   782     iMceUi->DynInitMenuPaneL( aResourceId, aMenuPane );
   812     iMceUi->DynInitMenuPaneL( aResourceId, aMenuPane );
   783     }
   813     }
   784 
   814 
   785 
   815 
   786 // ----------------------------------------------------
   816 // ----------------------------------------------------
  1102         {
  1132         {
  1103         iMsgListContainer->SetRect(ClientRect());
  1133         iMsgListContainer->SetRect(ClientRect());
  1104         }
  1134         }
  1105     }
  1135     }
  1106 
  1136 
       
  1137 // ---------------------------------------------------------
       
  1138 // CConversationListView::ShowInformationNoteL
       
  1139 // Shows a note to the user if the default view selection was successful
       
  1140 // ---------------------------------------------------------
       
  1141 //
       
  1142 void CMceMainViewListView::ShowConfirmationNoteL(TInt aResourceID)
       
  1143     {
       
  1144     HBufC* prompt = NULL;           
       
  1145     prompt = StringLoader::LoadLC( aResourceID, iCoeEnv );             
       
  1146     CAknQueryDialog* dlg = CAknQueryDialog::NewL();
       
  1147     dlg->ExecuteLD( R_MCE_OK_EMPTY_CONFIRMATION, prompt->Des() );          
       
  1148     CleanupStack::PopAndDestroy( prompt );   
       
  1149     }
       
  1150 
       
  1151 // ---------------------------------------------------------
       
  1152 // CMceMainViewListView::SetMceDefaultViewL
       
  1153 // Sets the central repository for the default view activation when 
       
  1154 // a new message arrives
       
  1155 // ---------------------------------------------------------
       
  1156 //
       
  1157 TBool CMceMainViewListView::SetMceDefaultViewL(TBool aVal)
       
  1158     {
       
  1159     CRepository* repository = NULL;
       
  1160     TRAPD( ret, repository = CRepository::NewL(KCRUidMuiuSettings) );
       
  1161     if ( ret == KErrNone )
       
  1162        {
       
  1163        CleanupStack::PushL( repository );
       
  1164        repository->Set(KMuiuMceDefaultView,aVal);
       
  1165        CleanupStack::PopAndDestroy( repository );
       
  1166        return ETrue;
       
  1167        }
       
  1168     else
       
  1169         {
       
  1170         return EFalse;
       
  1171         }
       
  1172     }
       
  1173 // ---------------------------------------------------------
       
  1174 // CMceMainViewListView::GetMceDefaultViewL
       
  1175 // Get the central repository value of the current default view 
       
  1176 // ---------------------------------------------------------
       
  1177 //
       
  1178 TInt CMceMainViewListView::GetMceDefaultViewL()
       
  1179     {
       
  1180     CRepository* repository = NULL;
       
  1181     TInt keyvalue;
       
  1182     TRAPD( ret, repository = CRepository::NewL(KCRUidMuiuSettings) );
       
  1183     if ( ret == KErrNone )
       
  1184        {
       
  1185        CleanupStack::PushL( repository );
       
  1186        repository->Get(KMuiuMceDefaultView,keyvalue);
       
  1187        CleanupStack::PopAndDestroy( repository );
       
  1188        return keyvalue;
       
  1189        }
       
  1190     else
       
  1191        {
       
  1192        return KErrNotFound;
       
  1193        }
       
  1194     }
  1107 //  End of File
  1195 //  End of File