本文整理汇总了C++中CEmailAccounts类的典型用法代码示例。如果您正苦于以下问题:C++ CEmailAccounts类的具体用法?C++ CEmailAccounts怎么用?C++ CEmailAccounts使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CEmailAccounts类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetSettingsL
LOCAL_C void ResetSettingsL(TBool aSecureSocket)
{
_LIT(KSmtpServer, "smtp.demon.co.uk");
_LIT(KSmtpEmailAlias, "SMTP STARTTLS");
_LIT(KSmtpEmailAddress, "<[email protected]>");
// Overwrite the setings with test code one. Don't want the default settings.
CImSmtpSettings* settings = new(ELeave) CImSmtpSettings();
CleanupStack::PushL(settings);
CEmailAccounts* accounts = CEmailAccounts::NewLC();
TSmtpAccount smtpAccountId;
accounts->GetSmtpAccountL(smtpService,smtpAccountId);
accounts->LoadSmtpSettingsL(smtpAccountId, *settings);
settings->SetServerAddressL(KSmtpServer);
settings->SetEmailAliasL(KSmtpEmailAlias);
settings->SetEmailAddressL(KSmtpEmailAddress);
settings->SetReplyToAddressL(KSmtpEmailAddress);
settings->SetBodyEncoding(EMsgOutboxMIME);
settings->SetReceiptAddressL(KSmtpEmailAddress);
settings->SetSecureSockets(aSecureSocket);
settings->SetPort(25);
accounts->SaveSmtpSettingsL(smtpAccountId, *settings);
CleanupStack::PopAndDestroy(2, settings); //settings, store/accounts
}
示例2: TestCase
/**
Function : ExecuteActionL
Description : Entry point for the this test action in the test framework
@internalTechnology
@param : none
@return : void
@pre none
@post none
*/
void CMtfTestActionGetPopAccountInArray::ExecuteActionL()
{
TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionGetPopAccountInArray);
TInt indexNumber = ObtainValueParameterL<TInt>(TestCase(), ActionParameters().Parameter(0));
CEmailAccounts* accounts = CEmailAccounts::NewLC();
RArray<TPopAccount> accountArray;
CleanupClosePushL(accountArray);
accounts->GetPopAccountsL(accountArray);
// make sure we're not out of range
if (indexNumber >= 0 && indexNumber < accountArray.Count())
{
TPopAccount id = accountArray[indexNumber];
StoreParameterL<TPopAccount>( TestCase(), id, ActionParameters().Parameter(1));
}
else
{
TestCase().ERR_PRINTF1(_L("Index is out of range!"));
TestCase().SetTestStepResult(EFail);
}
CleanupStack::PopAndDestroy( 2, accounts );
TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionGetPopAccountInArray);
TestCase().ActionCompletedL(*this);
}
示例3: doTestStepL
/**
doTestStepL()
Reads the POP account name from the ini file. If ALL string is mentioned in the .ini file
it deletes all the IMAP accounts, Else deletes the IMAP account whose name is
mentioned in the ini file
@return
Returns the test step result
*/
TVerdict CT_MsgDeletePopAccount::doTestStepL()
{
INFO_PRINTF1(_L("Test Step: Delete Pop Account"));
TPtrC popAccountName;
// Read Pop Account Name from ini file
if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
{
ERR_PRINTF1(_L("Account name not specified"));
SetTestStepResult(EFail);
}
else
{
CEmailAccounts* account = CEmailAccounts::NewLC();
RArray<TPopAccount> arrayPop3Accounts;
CleanupClosePushL(arrayPop3Accounts);
account->GetPopAccountsL(arrayPop3Accounts);
TInt count=arrayPop3Accounts.Count();
TBuf<12> temp(popAccountName);
temp.UpperCase(); // Making case insensitive
if(temp.CompareC(_L("ALL")) == 0)
{
INFO_PRINTF2(_L("Deleting all accounts. Total = %d"), count);
for(TInt i=0; i<count; i++)
{
TPopAccount id = arrayPop3Accounts[i];
account->DeletePopAccountL(id);
}
}
else
{
TBool deleteFlag = EFalse;
for(TInt i = 0; i < count; i++)
{
if(popAccountName.CompareC(arrayPop3Accounts[i].iPopAccountName) == 0)
{
account->DeletePopAccountL(arrayPop3Accounts[i]);
// Just ensure that if we try to delete it again we hopefuly get an error
// or can see that it has been deleted.
arrayPop3Accounts.Remove(i);
deleteFlag = ETrue;
break;
}
}
if(deleteFlag)
{
INFO_PRINTF2(_L("Pop acount \" %S \" deleted"), &popAccountName);
}
else
{
ERR_PRINTF2(_L("Pop acount \" %S \" not found"), &popAccountName);
SetTestStepResult(EFail);
User::Leave(KErrNotFound);
}
}
CleanupStack::PopAndDestroy(2, account); //arrayPop3Accounts,account
}
return TestStepResult();
}
示例4: doTestStepL
/**
doTestStepL()
Reads the expected count from the ini file.
Obtains the count of the POP accounts created and compares against the expected number.
@return
Returns the test step result.
*/
TVerdict CT_MsgVerifyPopAccountsCount::doTestStepL()
{
INFO_PRINTF1(_L("Test Step: Verify Pop Accounts Count"));
TInt expectedCount = -1;
if(!GetIntFromConfig(ConfigSection(), KExpectedCount, expectedCount) && expectedCount < 0)
{
ERR_PRINTF1(_L("ExpectedCount is not Specified or < 0"));
SetTestStepResult(EFail);
}
else
{
CEmailAccounts *account = CEmailAccounts::NewLC();
RArray<TPopAccount> arrayPopAccounts;
account->GetPopAccountsL(arrayPopAccounts);
TInt count = arrayPopAccounts.Count();
CleanupStack::PopAndDestroy(account);
arrayPopAccounts.Reset();
if (count != expectedCount)
{
ERR_PRINTF3(_L("Number of POP accounts do not match ! expected = %d actual = %d"),
expectedCount, count);
SetTestStepResult(EFail);
}
else
{
INFO_PRINTF2(_L("Number of POP accounts matched value = %d !"), expectedCount);
}
}
return TestStepResult();
}
示例5: OverwriteSmtpSettingsL
LOCAL_C void OverwriteSmtpSettingsL(TBool aRequestReceipt)
{
testUtils->iMsvEntry->SetEntryL(smtpService);
//overwrite the setings with test code one. Don't want the default settings.
CEmailAccounts* accounts = CEmailAccounts::NewLC();
CImSmtpSettings* settings = new(ELeave) CImSmtpSettings();
CleanupStack::PushL(settings);
settings->Reset();
_LIT(KSmtpServer, "msg6");
// globel address for msg6 is fe80::2c0:4fff:fe84:61f7
// link local address fe80::1111:1111:dead:beef
settings->SetServerAddressL(KSmtpServer);
settings->SetEmailAliasL(_L("SMTP_IPV6 Test"));
_LIT(KSmtpEmailAddress, "<[email protected]>");
settings->SetEmailAddressL(KSmtpEmailAddress);
settings->SetReplyToAddressL(KSmtpEmailAddress);
settings->SetBodyEncoding(EMsgOutboxMIME);
settings->SetReceiptAddressL(KSmtpEmailAddress);
settings->SetRequestReceipts(aRequestReceipt);
settings->SetPort(25);
TSmtpAccount smtpAccountId;
accounts->GetSmtpAccountL(smtpService, smtpAccountId);
accounts->SaveSmtpSettingsL(smtpAccountId, *settings);
CleanupStack::PopAndDestroy(2); //settings, store/account
CTestTimer* timer = CTestTimer::NewL();
timer->After(5000000);
CActiveScheduler::Start();
delete timer;
}
示例6: ChangeSyncLimitL
void CTestImapSyncManager::ChangeSyncLimitL(TInt limit)
{
CEmailAccounts* newaccount = CEmailAccounts::NewLC();
iTestUtils->GoClientSideL();
newaccount->GetImapAccountL(iServiceId, iImapAccount);
newaccount->LoadImapSettingsL(iImapAccount, *iImapSettings1);
iImapSettings1->SetInboxSynchronisationLimit(limit);
iImapSettings1->SetMailboxSynchronisationLimit(limit);
newaccount->SaveImapSettingsL(iImapAccount, *iImapSettings1);
CleanupStack::PopAndDestroy(newaccount);
iTestUtils->GoServerSideL();
iTestUtils->InstantiateImapServerMtmL();
iImapServerMtm=(CImap4ServerMtm*)iTestUtils->iImapServerMtm;
iEntry = iTestUtils->iServerEntry;
// load the new impsettings...
iImapSettings = CImapSettings::NewL(*iEntry);
iImapSettings->LoadSettingsL(iServiceId);
delete iSel;
iSel = new (ELeave) CMsvEntrySelection;
}
示例7: INFO_PRINTF1
/**
Function : doTestStepL
Description : Change the IMAP4 Subscribe and Synchronise settings of a test case through the .ini file
@return : TVerdict - Test step result
*/
TVerdict CT_MsgChangeImap4SubAndSyncSettings::doTestStepL()
{
INFO_PRINTF1(_L("Test Step : ChangeImap4SubAndSyncSettings"));
if(ReadIni())
{
CEmailAccounts* accounts = CEmailAccounts::NewL();
CleanupStack::PushL(accounts);
CImImap4Settings *imapSettings = new (ELeave) CImImap4Settings;
CleanupStack::PushL(imapSettings);
TImapAccount imapAccountId;
CT_MsgUtilsCentralRepository::GetImapAccountL((TDes&)iImapAccountName,imapAccountId);
accounts->LoadImapSettingsL(imapAccountId,*imapSettings);
TFolderSubscribeType setFolderSubscribeType = CT_MsgUtilsEnumConverter::ConvertDesToTFolderSubscribeType(iImapSubscribeMethod);
imapSettings->SetSubscribe(setFolderSubscribeType);
TFolderSyncType setFolderSyncType = CT_MsgUtilsEnumConverter::ConvertDesToTFolderSyncType(iImapSynchroniseMethod);
imapSettings->SetSynchronise(setFolderSyncType);
accounts->SaveImapSettingsL(imapAccountId,*imapSettings);
CleanupStack::PopAndDestroy(2,accounts); // imapSettings,accounts
}
return TestStepResult();
}
示例8: TestCase
/**
Function : ExecuteActionL
Description : Entry point for the this test action in the test framework
@internalTechnology
@param : none
@return : void
@pre none
@post none
*/
void CMtfTestActionCountImapAccountsInArray::ExecuteActionL()
{
TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionCountImapAccountsInArray);
TInt numberToMatch = ObtainValueParameterL<TInt>(TestCase(), ActionParameters().Parameter(0));
CEmailAccounts *account = CEmailAccounts::NewLC();
RArray<TImapAccount> arrayImapAccounts;
account->GetImapAccountsL(arrayImapAccounts);
TInt count = arrayImapAccounts.Count();
CleanupStack::PopAndDestroy(account);
arrayImapAccounts.Reset();
if (count != numberToMatch)
{
// failed
TestCase().ERR_PRINTF3(_L("Number of IMAP accounts do not match ! expected = %d actual = %d"),
numberToMatch, count );
TestCase().SetTestStepResult(EFail);
}
TestCase().INFO_PRINTF2(_L("Number of IMAP accounts matched value = %d !"), numberToMatch );
TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionCountImapAccountsInArray);
TestCase().ActionCompletedL(*this);
}
示例9: ChangeDefaultServiceL
/**
Sets the default SMTP service.
@param aService
The default service
*/
EXPORT_C void CSmtpClientMtm::ChangeDefaultServiceL(const TMsvId& aService)
{
CEmailAccounts* account = CEmailAccounts::NewLC();
TSmtpAccount id;
account->GetSmtpAccountL(aService, id);
account->SetDefaultSmtpAccountL(id);
CleanupStack::PopAndDestroy(account);
}
示例10: LoadSettingsL
void CMtfTestActionGetPopAccountSettings::LoadSettingsL(CEmailAccounts& aAccounts, const TPopAccount& aAccount, CImPop3Settings& aPopSettings, CImIAPPreferences& aPopIapSettings, CImSmtpSettings& aSmtpSettings, CImIAPPreferences& aSmtpIapSettings)
{
aAccounts.LoadPopSettingsL(aAccount, aPopSettings);
aAccounts.LoadPopIapSettingsL(aAccount, aPopIapSettings);
TSmtpAccount smtpAccount;
aAccounts.GetSmtpAccountL(aAccount.iSmtpService, smtpAccount);
aAccounts.LoadSmtpSettingsL(smtpAccount, aSmtpSettings);
aAccounts.LoadSmtpIapSettingsL(smtpAccount, aSmtpIapSettings);
}
示例11: new
/**
Function : MoveAsyncImap4CommandL
Description : This function retrieves the download limits set
@param : aCommand The Imap command to be executed.
aImapServiceId The Imap service Id
aMailSelection The selection object
aDownloadLimits The download limts set.
@return : none
*/
void CT_MsgImapMoveAsyncFunction::MoveAsyncImap4CommandL( TImap4Cmds aCommand,
CMsvEntrySelection& aMailSelection, TMsvId aImapServiceId , TBool aDownloadLimits, TMsvId afolderId)
{
// Loads the Imap account settings and saves the download limits
CEmailAccounts* emailAccounts = CEmailAccounts::NewLC();
CImImap4Settings* imapSettings = new(ELeave) CImImap4Settings();
CleanupStack::PushL(imapSettings);
TImapAccount imapAccount;
emailAccounts->GetImapAccountL(aImapServiceId, imapAccount);
emailAccounts->LoadImapSettingsL(imapAccount, *imapSettings);
// If full download limts are set load it onto the the account
CT_MsgActive& active=Active();
if(aDownloadLimits)
{
TImImap4GetMailInfo imapFullinfo;
imapFullinfo.iDestinationFolder = afolderId;
imapFullinfo.iGetMailBodyParts = imapSettings->GetMailOptions();
imapFullinfo.iMaxEmailSize = imapSettings->MaxEmailSize();
// Package of the download limits
TPckgBuf<TImImap4GetMailInfo> fullPack(imapFullinfo);
iSharedDataIMAP.iMtm->SwitchCurrentEntryL(aImapServiceId);
// Moves asynchronous IMAP4-specific operation
iOperation = iSharedDataIMAP.iMtm->InvokeAsyncFunctionL(aCommand,aMailSelection, fullPack, active.iStatus);
}
// If partial download limts are set load it onto the the account
else
{
TImImap4GetPartialMailInfo imapPartialinfo;
imapPartialinfo.iAttachmentSizeLimit = imapSettings->AttachmentSizeLimit();
imapPartialinfo.iBodyTextSizeLimit = imapSettings->BodyTextSizeLimit();
imapPartialinfo.iDestinationFolder = afolderId;
imapPartialinfo.iPartialMailOptions = imapSettings->PartialMailOptions();
imapPartialinfo.iTotalSizeLimit = imapSettings->MaxEmailSize();
// Package of the download limits
TPckgBuf<TImImap4GetPartialMailInfo> partialPack(imapPartialinfo);
// Switches the cuurent context on to the IMAP service ID
iSharedDataIMAP.iMtm->SwitchCurrentEntryL(aImapServiceId);
// Moves asynchronous IMAP4-specific operation
iOperation = iSharedDataIMAP.iMtm->InvokeAsyncFunctionL(aCommand,aMailSelection, partialPack, active.iStatus);
}
active.Activate();
CActiveScheduler::Start();
User::LeaveIfError(active.Result());
CleanupStack::PopAndDestroy(2,emailAccounts); // imapSettings,emailAccounts
}
示例12: _L
void CTestImapSyncManager::SetupL()
{
TInt err;
err=User::LoadPhysicalDevice(PDD_NAME);
if (err!=KErrNone && err!=KErrAlreadyExists)
User::Leave(err);
err=User::LoadLogicalDevice(LDD_NAME);
if (err!=KErrNone && err!=KErrAlreadyExists)
User::Leave(err);
iTestUtils = CEmailTestUtils::NewL(test);
iTestUtils->ClearEmailAccountsL( );
iTestUtils->CreateAllTestDirectories( );
iTestUtils->FileSession( ).SetSessionPath( _L( "C:\\" ) );
iActiveWaiter = new(ELeave)CActiveWaiter();
iTestUtils->GoServerSideL();
iTestUtils->DeleteImapServiceL();
iTestUtils->GoClientSideL();
CEmailAccounts* account = CEmailAccounts::NewLC();
iImapSettings1 = new(ELeave) CImImap4Settings();
CImIAPPreferences* imapIAP = CImIAPPreferences::NewLC();
account->PopulateDefaultImapSettingsL(*iImapSettings1, *imapIAP);
iImapSettings1->SetServerAddressL(KImapServer);
iImapSettings1->SetLoginNameL(iTestUtils->MachineName());
iImapSettings1->SetPasswordL(iTestUtils->MachineName());
iImapSettings1->SetPort(143);
iImapSettings1->SetImapIdle(ETrue);
iImapSettings1->SetSubscribe(EUpdateRemote);
iImapSettings1->SetSynchronise(EUseRemote);
iImapSettings1->SetInboxSynchronisationLimit(KSyncLimit);
iImapSettings1->SetMailboxSynchronisationLimit(KSyncLimit);
_LIT(KTxtAccountName, "testAccount");
iImapAccount = account->CreateImapAccountL(KTxtAccountName, *iImapSettings1, *imapIAP, EFalse);
CleanupStack::PopAndDestroy(2, account); // imapIAP, account
iTestUtils->GoServerSideL();
iEntry = iTestUtils->iServerEntry;
iServiceId = iImapAccount.iImapService;
iTestUtils->InstantiateImapServerMtmL();
iImapServerMtm=(CImap4ServerMtm*)iTestUtils->iImapServerMtm;
iEntry = iTestUtils->iServerEntry;
iImapSettings = CImapSettings::NewL(*iEntry);
iImapSettings->LoadSettingsL(iServiceId);
iSel = new (ELeave) CMsvEntrySelection;
}
示例13: LoadAccountSettingsL
/**
LoadAccountSettingsL()
This function loads the IMAP and SMTP settings object from the IMAP account given
@param aEmailAccount
An object of type CEmailAccounts
@param aAccount
An object of type TPopAccount
@param aPopSettings
An object of type CImPop3Settings
@param aPopIapSettings
An object of type CImIAPPreferences
@param aSmtpSettings
An object of type CImSmtpSettings
@param aSmtpIapSettings
An object of type CImIAPPreferences
@return : void
*/
void CT_MsgComparePopSettings::LoadAccountSettingsL(CEmailAccounts& aEmailAccount, const TPopAccount& aAccount, CImPop3Settings& aPopSettings,
CImIAPPreferences& aPopIapSettings,CImSmtpSettings& aSmtpSettings, CImIAPPreferences& aSmtpIapSettings)
{
aEmailAccount.LoadPopSettingsL(aAccount, aPopSettings);
aEmailAccount.LoadPopIapSettingsL(aAccount, aPopIapSettings);
TSmtpAccount smtpAccount;
aEmailAccount.GetSmtpAccountL(aAccount.iSmtpService, smtpAccount);
aEmailAccount.LoadSmtpSettingsL(smtpAccount, aSmtpSettings);
aEmailAccount.LoadSmtpIapSettingsL(smtpAccount, aSmtpIapSettings);
}
示例14: __ASSERT_DEBUG
EXPORT_C void CSmtpClientMtm::RestoreSettingsL()
/** Loads into the object's cache the service settings from the Central Repository
for the current entry. */
{
__ASSERT_DEBUG(iMsvEntry->Entry().iType.iUid==KUidMsvServiceEntryValue, gPanic(ESmtcMTMNotAServiceEntry));
CEmailAccounts* account = CEmailAccounts::NewLC();
TSmtpAccount id;
account->GetSmtpAccountL(iMsvEntry->Entry().Id(), id);
account->LoadSmtpSettingsL(id, *iImSmtpSettings);
CleanupStack::PopAndDestroy(account);
}
示例15: CreateServiceAndAccountL
void CTestUTCSort::CreateServiceAndAccountL()
{
CEmailAccounts* accounts = CEmailAccounts::NewL();
CleanupStack::PushL(accounts);
CImSmtpSettings* settings=new(ELeave) CImSmtpSettings();
CleanupStack::PushL(settings);
CImIAPPreferences* smtpIAP = CImIAPPreferences::NewLC();
TSmtpAccount smtpAccountId=accounts->CreateSmtpAccountL(_L("SMTP"),*settings, *smtpIAP, EFalse);
CleanupStack::PopAndDestroy(smtpIAP);
CleanupStack::PopAndDestroy(settings);
CleanupStack::PopAndDestroy(accounts);
}