email/pop3andsmtpmtm/clientmtms/src/cemailaccounts.cpp
branchRCL_3
changeset 29 7e4e4bcc75b6
parent 0 72b543305e3a
child 57 ebe688cedc25
equal deleted inserted replaced
28:fbb813aef148 29:7e4e4bcc75b6
   807 @param	aAccounts
   807 @param	aAccounts
   808 On return, an array of POP account IDs
   808 On return, an array of POP account IDs
   809 */ 
   809 */ 
   810 EXPORT_C void CEmailAccounts::GetPopAccountsL(RArray<TPopAccount>& aAccounts)
   810 EXPORT_C void CEmailAccounts::GetPopAccountsL(RArray<TPopAccount>& aAccounts)
   811 	{
   811 	{
       
   812     CleanupClosePushL( aAccounts );
   812 	aAccounts.Reset();
   813 	aAccounts.Reset();
   813 	CRepository& popRepository = PopRepositoryL();
   814 	CRepository& popRepository = PopRepositoryL();
   814 	
   815 	
   815 	// Get a list of pop accounts from CenRep
   816 	// Get a list of pop accounts from CenRep
   816 	RArray<TUint32> popAccountIds;	
   817 	RArray<TUint32> popAccountIds;	
   853 				aAccounts.AppendL(accountId);
   854 				aAccounts.AppendL(accountId);
   854 				}				
   855 				}				
   855 			}		
   856 			}		
   856 		}
   857 		}
   857 		
   858 		
   858 	CleanupStack::PopAndDestroy(3, &popAccountIds);				
   859 	CleanupStack::PopAndDestroy(3, &popAccountIds);
       
   860 	CleanupStack::Pop(&aAccounts); // aAccounts
   859 	}
   861 	}
   860 
   862 
   861 /**
   863 /**
   862 Gets a POP account ID for the specified service.
   864 Gets a POP account ID for the specified service.
   863 
   865 
   919 @param	aAccounts
   921 @param	aAccounts
   920 On return, an array of IMAP account IDs
   922 On return, an array of IMAP account IDs
   921 */    			
   923 */    			
   922 EXPORT_C void CEmailAccounts::GetImapAccountsL(RArray<TImapAccount>& aAccounts)
   924 EXPORT_C void CEmailAccounts::GetImapAccountsL(RArray<TImapAccount>& aAccounts)
   923 	{
   925 	{
       
   926     CleanupClosePushL( aAccounts );
   924 	aAccounts.Reset();
   927 	aAccounts.Reset();
   925 	CRepository& imapRepository = ImapRepositoryL();
   928 	CRepository& imapRepository = ImapRepositoryL();
   926 
   929 
   927 	// Get a list of imap accounts from CenRep
   930 	// Get a list of imap accounts from CenRep
   928 	RArray<TUint32> imapAccountIds;
   931 	RArray<TUint32> imapAccountIds;
   965 				aAccounts.AppendL(accountId);
   968 				aAccounts.AppendL(accountId);
   966 				}				
   969 				}				
   967 			}		
   970 			}		
   968 		}
   971 		}
   969 
   972 
   970 	CleanupStack::PopAndDestroy(3, &imapAccountIds);			
   973 	CleanupStack::PopAndDestroy(3, &imapAccountIds);	
       
   974 	CleanupStack::Pop(&aAccounts);  // aAccounts
   971 	}
   975 	}
   972 
   976 
   973 void CEmailAccounts::GetEmailServicesL(CMsvEntrySelection& aServices, TUid aMTMType, CMsvEntry& aMsvEntry)
   977 void CEmailAccounts::GetEmailServicesL(CMsvEntrySelection& aServices, TUid aMTMType, CMsvEntry& aMsvEntry)
   974 	{
   978 	{
   975 	aServices.Reset();
   979 	aServices.Reset();
  1055 @param	aAccounts
  1059 @param	aAccounts
  1056 On return, an array of SMTP account IDs
  1060 On return, an array of SMTP account IDs
  1057 */    			
  1061 */    			
  1058 EXPORT_C void CEmailAccounts::GetSmtpAccountsL(RArray<TSmtpAccount>& aAccounts)
  1062 EXPORT_C void CEmailAccounts::GetSmtpAccountsL(RArray<TSmtpAccount>& aAccounts)
  1059 	{
  1063 	{
       
  1064     CleanupClosePushL( aAccounts );
  1060 	aAccounts.Reset();
  1065 	aAccounts.Reset();
  1061 	CRepository& smtpRepository = SmtpRepositoryL();
  1066 	CRepository& smtpRepository = SmtpRepositoryL();
  1062 	
  1067 	
  1063 	// Get a list of smtp accounts from CenRep
  1068 	// Get a list of smtp accounts from CenRep
  1064 	RArray<TUint32> smtpAccountIds;
  1069 	RArray<TUint32> smtpAccountIds;
  1101 				aAccounts.AppendL(accountId);
  1106 				aAccounts.AppendL(accountId);
  1102 				}				
  1107 				}				
  1103 			}		
  1108 			}		
  1104 		}
  1109 		}
  1105 
  1110 
  1106 	CleanupStack::PopAndDestroy(3, &smtpAccountIds);				
  1111 	CleanupStack::PopAndDestroy(3, &smtpAccountIds);		
       
  1112 	CleanupStack::Pop(&aAccounts);  // aAccounts
  1107 	}
  1113 	}
  1108 
  1114 
  1109 /**
  1115 /**
  1110 Get a list of SMTP mobility accounts for a given SMTP account
  1116 Get a list of SMTP mobility accounts for a given SMTP account
  1111 
  1117 
  1114 
  1120 
  1115 @publishedPartner
  1121 @publishedPartner
  1116 */
  1122 */
  1117 EXPORT_C void CEmailAccounts::GetSmtpMobilityAccountsL(const TSmtpAccount& aSmtpAccount, RArray<TSmtpMobilityAccount>& aAccounts)
  1123 EXPORT_C void CEmailAccounts::GetSmtpMobilityAccountsL(const TSmtpAccount& aSmtpAccount, RArray<TSmtpMobilityAccount>& aAccounts)
  1118 	{
  1124 	{
       
  1125     CleanupClosePushL( aAccounts );
  1119 	aAccounts.Reset();
  1126 	aAccounts.Reset();
  1120 
  1127 
  1121 	CRepository& repository = SmtpRepositoryL();
  1128 	CRepository& repository = SmtpRepositoryL();
  1122 	TUint32 smtpAccRepId = aSmtpAccount.iSmtpAccountId << KShiftAccountId;
  1129 	TUint32 smtpAccRepId = aSmtpAccount.iSmtpAccountId << KShiftAccountId;
  1123 
  1130 
  1148 		}
  1155 		}
  1149 	else if (err != KErrNotFound)
  1156 	else if (err != KErrNotFound)
  1150 		{
  1157 		{
  1151 		User::Leave(err);
  1158 		User::Leave(err);
  1152 		}
  1159 		}
       
  1160 	
       
  1161 	CleanupStack::Pop(&aAccounts);  // aAccounts
  1153 	}
  1162 	}
  1154 
  1163 
  1155 /**
  1164 /**
  1156 Get a list of all SMTP mobility accounts in the repository
  1165 Get a list of all SMTP mobility accounts in the repository
  1157 
  1166 
  1159 
  1168 
  1160 @internalTechnology
  1169 @internalTechnology
  1161 */
  1170 */
  1162 EXPORT_C void CEmailAccounts::GetSmtpMobilityAccountsL(RArray<TSmtpMobilityAccount>& aAccounts)
  1171 EXPORT_C void CEmailAccounts::GetSmtpMobilityAccountsL(RArray<TSmtpMobilityAccount>& aAccounts)
  1163 	{
  1172 	{
       
  1173     CleanupClosePushL( aAccounts );
  1164 	aAccounts.Reset();
  1174 	aAccounts.Reset();
  1165 
  1175 
  1166 	CRepository& repository = SmtpRepositoryL();
  1176 	CRepository& repository = SmtpRepositoryL();
  1167 
  1177 
  1168 	RArray<TUint32> smtpAccountIds;
  1178 	RArray<TUint32> smtpAccountIds;
  1188 			aAccounts.AppendL(mobAccount);
  1198 			aAccounts.AppendL(mobAccount);
  1189 			}
  1199 			}
  1190 		}
  1200 		}
  1191 
  1201 
  1192 	CleanupStack::PopAndDestroy(&smtpAccountIds);
  1202 	CleanupStack::PopAndDestroy(&smtpAccountIds);
       
  1203 	CleanupStack::Pop(&aAccounts);  // aAccounts
  1193 	}
  1204 	}
  1194 
  1205 
  1195 /**
  1206 /**
  1196 Gets a SMTP account ID for the specified service.
  1207 Gets a SMTP account ID for the specified service.
  1197 
  1208