#include <mw/cemailaccounts.h>
class CEmailAccounts : public CBase |
Creates, loads, saves and deletes email (IMAP, POP, and SMTP) accounts.
An account encapsulates:
Settings for a messaging service. There is a different type of settings class for each of the email protocols (CImPop3Settings, CImImap4Settings, CImSmtpSettings).
IAP (Internet account) settings for accessing the service.
The class has a family of functions for each protocol to create, get, and delete accounts:
Create<protocol>AccountL
Get<protocol>AccountL
Get<protocol>AccountsL
Delete<protocol>AccountL
where <protocol> is either POP, IMAP, or SMTP. The Create and Get functions don't directly return settings objects, but only account identifiers.
Account identifiers are passed to the following functions to save and load the service and IAP settings for that account:
Load<protocol>SettingsL
Save<protocol>SettingsL
Load<protocol>IapSettingsL
Save<protocol>IapSettingsL
For SMTP only, there is a concept of a default account (as a client program may want to send an email, and not care which account is used.) SetDefaultSmtpAccountL(), DefaultSmtpAccountL() and DeleteDefaultSmtpAccountL() are used to handle this.
Note that an account is associated with a service entry in the message store, but account information itself is stored in the central repository.
IMPORT_C TImapAccount | CreateImapAccountL | ( | const TDesC & | aAccountName, |
const CImImap4Settings & | aImapSettings, | |||
const CImIAPPreferences & | aImapIAP, | |||
TBool | aReadOnly | |||
) |
Creates an IMAP Account:
1. Creates an IMAP service entry in the message store
2. Creates settings in CenRep with values from the supplied objects
3. Returns an IMAP account ID
Parameters | |
---|---|
aAccountName | Account Name |
aImapSettings | IMAP Service Settings |
aImapIAP | IMAP IAP preferences |
aReadOnly | Specify ETrue if it is a read-only account Note: Read-only accounts should not be modified, however we don't enforce it. |
Leave Codes | |
---|---|
IMPORT_C TImapAccount | CreateImapAccountL | ( | const TDesC & | aAccountName, |
const CImImap4Settings & | aImapSettings, | |||
const CImIAPPreferences & | aImapIAP, | |||
const CImapSyncDownloadRules & | aSyncDownloadRules, | |||
TBool | aReadOnly | |||
) |
Creates an IMAP Account:
1. Creates an IMAP service entry in the message store
2. Creates settings in CenRep with values from the supplied objects
3. Returns an IMAP account ID
Parameters | |
---|---|
aAccountName | Account Name |
aImapSettings | IMAP Service Settings |
aImapIAP | IMAP IAP preferences |
aSyncDownloadRules | IMAP synchronisation download rules |
aReadOnly | Specify ETrue if it is a read-only account Note: Read-only accounts should not be modified, however we don't enforce it. |
IMPORT_C TPopAccount | CreatePopAccountL | ( | const TDesC & | aAccountName, |
const CImPop3Settings & | aPopSettings, | |||
const CImIAPPreferences & | aPopIAP, | |||
TBool | aReadOnly | |||
) |
Creates a POP Account:
1. Creates a POP service entry in the message store
2. Creates settings in CenRep with values from the supplied objects
3. Returns a POP account ID
Parameters | |
---|---|
aAccountName | Account Name |
aPopSettings | POP Service Settings |
aPopIAP | POP IAP preferences |
aReadOnly | Specify ETrue if it is a read-only account. Note: Read-only accounts should not be modified, however we don't enforce it. |
Leave Codes | |
---|---|
IMPORT_C TSmtpAccount | CreateSmtpAccountL | ( | TPopAccount & | aPopAccount, |
const CImSmtpSettings & | aSmtpSettings, | |||
const CImIAPPreferences & | aSmtpIAP, | |||
TBool | aReadOnly | |||
) |
Creates a SMTP Account:
1. Creates a SMTP service entry in the message store
2. Creates settings in CenRep with values from the supplied objects
3. Relates this account with the supplied POP account
4. Returns a SMTP account ID
Parameters | |
---|---|
aPopAccount | POP Account Id |
aSmtpSettings | SMTP Service Settings |
aSmtpIAP | SMTP IAP preferences |
aReadOnly | Specify ETrue if it is a read-only account Note: Read-only accounts should not be modified, however we don't enforce it. |
Leave Codes | |
---|---|
IMPORT_C TSmtpAccount | CreateSmtpAccountL | ( | TImapAccount & | aImapAccount, |
const CImSmtpSettings & | aSmtpSettings, | |||
const CImIAPPreferences & | aSmtpIAP, | |||
TBool | aReadOnly | |||
) |
Creates a SMTP Account:
1. Creates a SMTP service entry in the message store
2. Creates settings in CenRep with values from the supplied objects
3. Relates this account with the supplied IMAP account
4. Returns a SMTP account ID
Parameters | |
---|---|
aImapAccount | IMAP account ID |
aSmtpSettings | SMTP Service Settings |
aSmtpIAP | SMTP IAP preferences |
aReadOnly | Specify ETrue if it is a read-only account Note: Read-only accounts should not be modified, however we don't enforce it. |
Leave Codes | |
---|---|
IMPORT_C TSmtpAccount | CreateSmtpAccountL | ( | const TDesC & | aAccountName, |
const CImSmtpSettings & | aSmtpSettings, | |||
const CImIAPPreferences & | aSmtpIAP, | |||
TBool | aReadOnly | |||
) |
Creates an SMTP Account:
1. Creates an SMTP service entry in the message store
2. Creates settings in CenRep with values from the supplied objects
3. Returns an SMTP account ID
Parameters | |
---|---|
aAccountName | Account Name |
aSmtpSettings | SMTP Service Setting |
aSmtpIAP | SMTP IAP preferences |
aReadOnly | Specify ETrue if it is a read-only account Note: Read-only accounts should not be modified, however we don't enforce it. |
Leave Codes | |
---|---|
IMPORT_C TSmtpMobilityAccount | CreateSmtpMobilityAccountL | ( | const TDesC & | aAccountName, |
const RArrayIAP & | aIapList, | |||
const TSmtpAccount & | aSmtpAccount, | |||
const CImSmtpMobilitySettings & | aSettings, | |||
TBool | aReadOnly | |||
) |
Creates a SMTP mobility account.
An SMTP mobility account allows different send settings to be used by SMTP accounts depending on what access point is being used by the SMTP connection. When using this API to create a SMTP mobility account, a list of IAPs and a set of settings are specified. The SMTP account which owns the SMTP mobility account is also specified. A SMTP account can own multiple SMTP mobility accounts. When a connection is made for a SMTP account, its associated list of SMTP mobility accounts is examined to see if any of them have an IAP list which contains the IAP that the connection is using. If so, the settings for that SMTP mobility account will be used to send emails. If an SMTP account has no associated SMTP mobility accounts, or there is no SMTP mobility account with a matching IAP, then the settings for the SMTP account are used when sending emails.
Parameters | |
---|---|
aAccountName | Account name |
aIapList | List of IAPs that will use the account settings |
aSmtpAccount | The SMTP account to add the mobility account to |
aSettings | Settings to use for the account |
aReadOnly | Flag to indicate if account is read only. Note that while read only accounts should not be modified, we do not enforce this. |
IMPORT_C TSmtpMobilityAccount | CreateSmtpMobilityAccountL | ( | const TDesC & | aAccountName, |
const RArrayIAP & | aIapList, | |||
const TSmtpAccount & | aSmtpAccount, | |||
const TSmtpAccount & | aLinkedSmtpAccount, | |||
TBool | aReadOnly | |||
) |
Creates a SMTP mobility account using settings from an SMTP account.
An SMTP mobility account allows different send settings to be used by SMTP accounts depending on what access point is being used by the SMTP connection. When using this API to create a SMTP mobility account, a list of IAPs and a linked SMTP account are specified. The settings for the SMTP mobility account are then taken from that linked SMTP account. The SMTP account which owns the SMTP mobility account is also specified. A SMTP account can own multiple SMTP mobility accounts. When a connection is made for a SMTP account, its associated list of SMTP mobility accounts is examined to see if any of them have an IAP list which contains the IAP that the connection is using. If so, the settings for that SMTP mobility account will be used to send emails. If an SMTP account has no associated SMTP mobility accounts, or there is no SMTP mobility account with a matching IAP, then the settings for the SMTP account are used when sending emails. Note that a SMTP mobility account created in this way will always have the same settings as the linked SMTP account. If the settings for the linked SMTP account change then the settings for the SMTP mobility account also change to match them. It is not possible to update the settings for a SMTP mobility account created in this way other than through changing the settings for the linked SMTP account.
Parameters | |
---|---|
aAccountName | Account name |
aIapList | List of IAPs that will use the account settings |
aSmtpAccount | The SMTP account to add the mobility account to |
aLinkedSmtpAccount | SMTP account to get settings from |
aReadOnly | Flag to indicate if account is read only. Note that while read only accounts should not be modified, we do not enforce this. |
Leave Codes | |
---|---|
KErrArgument | Attempted to add to an SMTP account which is the same as the linked SMTP account |
IMPORT_C TInt | DefaultSmtpAccountL | ( | TSmtpAccount & | aAccount | ) |
Returns the default SMTP account.
Parameters | |
---|---|
aAccount | Default account ID |
IMPORT_C void | DeleteDefaultSmtpAccountL | ( | ) |
Deletes the default SMTP account information from repository.
IMPORT_C void | DeleteImapAccountL | ( | const TImapAccount & | aAccount | ) |
Deletes the specified IMAP account.
Parameters | |
---|---|
aAccount | IMAP account ID |
IMPORT_C void | DeleteImapTransportBufferSizesL | ( | ) |
Deletes all the IMAP transport buffer sizes
IMPORT_C void | DeletePopAccountL | ( | const TPopAccount & | aAccount | ) |
Deletes the specified POP account.
Parameters | |
---|---|
aAccount | POP account ID |
IMPORT_C void | DeleteSmtpAccountL | ( | const TSmtpAccount & | aAccount | ) |
Deletes the specified SMTP account.
Parameters | |
---|---|
aAccount | SMTP account ID |
Leave Codes | |
---|---|
KErrNotFound | Account specified is a SMTP mobility account |
IMPORT_C void | DeleteSmtpMobilityAccountL | ( | const TSmtpMobilityAccount & | aAccount | ) |
Deletes the specified SMTP bearer mobility account
Parameters | |
---|---|
aAccount | SMTP mobility account |
Leave Codes | |
---|---|
KErrNotFound | Specified account is not a SMTP mobility account |
IMPORT_C void | GetImapAccountL | ( | TMsvId | aServiceId, |
TImapAccount & | aAccount | |||
) |
Gets a IMAP account ID for the specified service.
Parameters | |
---|---|
aServiceId | Service ID |
aAccount | IMAP account ID |
IMPORT_C void | GetImapAccountsL | ( | RArray< TImapAccount > & | aAccounts | ) |
Gets a list of IMAP account IDs that exists in the current message store.
Parameters | |
---|---|
aAccounts | On return, an array of IMAP account IDs |
IMPORT_C void | GetPopAccountL | ( | TMsvId | aServiceId, |
TPopAccount & | aAccount | |||
) |
Gets a POP account ID for the specified service.
Parameters | |
---|---|
aServiceId | Service ID |
aAccount | POP account ID |
IMPORT_C void | GetPopAccountsL | ( | RArray< TPopAccount > & | aAccounts | ) |
Gets a list of POP account IDs that exists in the current message store.
Parameters | |
---|---|
aAccounts | On return, an array of POP account IDs |
IMPORT_C void | GetSmtpAccountL | ( | TMsvId | aServiceId, |
TSmtpAccount & | aAccount | |||
) |
Gets a SMTP account ID for the specified service.
Parameters | |
---|---|
aServiceId | Service ID |
aAccount | SMTP account ID |
IMPORT_C void | GetSmtpAccountL | ( | TSmtpAccountId | aAccountId, |
TSmtpAccount & | aAccount | |||
) |
Gets a SMTP account for the specified account ID.
Parameters | |
---|---|
aAccountId | Account ID |
aAccount | Stores account details |
Leave Codes | |
---|---|
KErrNotFound | Account ID specifies a SMTP mobility account |
IMPORT_C void | GetSmtpAccountsL | ( | RArray< TSmtpAccount > & | aAccounts | ) |
Gets a list of SMTP account IDs that exists in the current message store.
Parameters | |
---|---|
aAccounts | On return, an array of SMTP account IDs |
IMPORT_C void | GetSmtpMobilityAccountsL | ( | const TSmtpAccount & | aSmtpAccount, |
RArray< TSmtpMobilityAccount > & | aAccounts | |||
) |
Get a list of SMTP mobility accounts for a given SMTP account
Parameters | |
---|---|
aSmtpAccount | SMTP account |
aAccounts | Stores the list of SMTP mobility accounts |
IMPORT_C void | GetSmtpMobilityAccountsL | ( | RArray< TSmtpMobilityAccount > & | aAccounts | ) |
Get a list of all SMTP mobility accounts in the repository
Parameters | |
---|---|
aAccounts | Stores the list of SMTP mobility accounts |
IMPORT_C TBool | IsAccountReadOnlyL | ( | const TPopAccount & | aAccount | ) |
Checks if the account is read-only
Parameters | |
---|---|
aAccount | POP account Id |
IMPORT_C TBool | IsAccountReadOnlyL | ( | const TImapAccount & | aAccount | ) |
Checks if the account is read-only
Parameters | |
---|---|
aAccount | IMAP account Id |
IMPORT_C TBool | IsAccountReadOnlyL | ( | const TSmtpAccount & | aAccount | ) |
Checks if the account is read-only
Parameters | |
---|---|
aAccount | SMTP account Id |
IMPORT_C TBool | IsAccountReadOnlyL | ( | const TSmtpMobilityAccount & | aAccount | ) |
Checks if SMTP mobility account is read only
Parameters | |
---|---|
aAccount | SMTP mobility account |
IMPORT_C void | LoadImapIapSettingsL | ( | const TImapAccount & | aAccount, |
CImIAPPreferences & | aIAP | |||
) |
Loads IMAP IAP settings for the specified account.
Parameters | |
---|---|
aAccount | IMAP account ID |
aIAP | IMAP IAP Pref settings |
IMPORT_C void | LoadImapSettingsL | ( | const TImapAccount & | aAccount, |
CImImap4Settings & | aImapSettings | |||
) |
Loads IMAP service settings for the specified account.
Parameters | |
---|---|
aAccount | IMAP account ID |
aImapSettings | IMAP service settings |
IMPORT_C void | LoadImapSyncDownloadRulesL | ( | const TImapAccount & | aAccount, |
CImapSyncDownloadRules & | aRules | |||
) |
Loads IMAP synchronisation download rules
Parameters | |
---|---|
aAccount | IMAP account ID |
aRules | Synchronisation download rules |
IMPORT_C void | LoadImapTransportBufferSizesL | ( | CImapTransportBufferSizes & | aBufferSizes | ) |
Loads IMAP transport buffer sizes
Parameters | |
---|---|
aBufferSizes | Transport buffer sizes |
IMPORT_C void | LoadPopIapSettingsL | ( | const TPopAccount & | aAccount, |
CImIAPPreferences & | aIAP | |||
) |
Loads POP IAP settings for the specified account.
Parameters | |
---|---|
aAccount | POP account ID |
aIAP | POP IAP Pref settings |
IMPORT_C void | LoadPopSettingsL | ( | const TPopAccount & | aAccount, |
CImPop3Settings & | aPopSettings | |||
) |
Loads POP service settings for the specified account.
Parameters | |
---|---|
aAccount | POP account ID |
aPopSettings | POP service settings |
IMPORT_C void | LoadSmtpIapSettingsL | ( | const TSmtpAccount & | aAccount, |
CImIAPPreferences & | aIAP | |||
) |
Loads SMTP IAP settings for the specified account.
Parameters | |
---|---|
aAccount | SMTP account ID |
aIAP | SMTP IAP Pref settings |
IMPORT_C void | LoadSmtpMobilityAccountIapListL | ( | const TSmtpMobilityAccount & | aAccount, |
RArrayIAP & | aIapList | |||
) |
Loads the IAP list associated with a specified SMTP mobility account
Parameters | |
---|---|
aAccount | SMTP mobility account |
aIapList | Stores the IAP list |
IMPORT_C void | LoadSmtpMobilitySettingsL | ( | const TSmtpMobilityAccount & | aAccount, |
CImSmtpMobilitySettings & | aSettings | |||
) |
Loads SMTP mobility account settings
Parameters | |
---|---|
aAccount | SMTP mobility account |
aSettings | SMTP mobility account settings |
Leave Codes | |
---|---|
KErrNotFound | Specified account is not a SMTP mobility account |
IMPORT_C TBool | LoadSmtpMobilitySettingsL | ( | TSmtpAccountId & | aSmtpAccountId, |
TUint32 | aIap, | |||
CImSmtpMobilitySettings & | aSettings | |||
) |
Loads SMTP mobility account settings for a given SMTP account and IAP
Parameters | |
---|---|
aSmtpAccountId | SMTP account ID |
aIap | IAP |
aSettings | SMTP mobility account settings |
IMPORT_C void | LoadSmtpSettingsL | ( | const TSmtpAccount & | aAccount, |
CImSmtpSettings & | aSmtpSettings | |||
) |
Loads SMTP service settings for the specified account.
Parameters | |
---|---|
aAccount | SMTP account ID |
aSmtpSettings | SMTP service settings |
Leave Codes | |
---|---|
KErrNotFound | Account specified is a SMTP mobility account |
IMPORT_C CEmailAccounts * | NewL | ( | ) | [static] |
Allocates and constructs an Email accounts object.
Initialises all member data to their default values.
IMPORT_C CEmailAccounts * | NewLC | ( | ) | [static] |
Allocates and constructs an Email accounts object.
Initialises all member data to their default values.
IMPORT_C void | PopulateDefaultImapSettingsL | ( | CImImap4Settings & | aImapSettings, |
CImIAPPreferences & | aImapIap | |||
) |
Populates the supplied setting objects with default values.
Parameters | |
---|---|
aImapSettings | IMAP Service Setting |
aImapIap | IMAP IAP preferences |
IMPORT_C void | PopulateDefaultPopSettingsL | ( | CImPop3Settings & | aPopSettings, |
CImIAPPreferences & | aPopIap | |||
) |
Populates the supplied setting objects with default values.
Parameters | |
---|---|
aPopSettings | POP Service Setting |
aPopIap | POP IAP preferences |
IMPORT_C void | PopulateDefaultSmtpMobilitySettingsL | ( | CImSmtpMobilitySettings & | aSettings | ) |
Populates the supplied settings object with default values
Parameters | |
---|---|
aSettings | SMTP mobility account settings |
IMPORT_C void | PopulateDefaultSmtpSettingsL | ( | CImSmtpSettings & | aSmtpSettings, |
CImIAPPreferences & | aSmtpIap | |||
) |
Populates the supplied setting objects with default values.
Parameters | |
---|---|
aSmtpSettings | SMTP Service Settings |
aSmtpIap | SMTP IAP preferences |
IMPORT_C void | SaveImapIapSettingsL | ( | const TImapAccount & | aAccount, |
const CImIAPPreferences & | aIAP | |||
) |
Saves IMAP IAP settings for the specified account.
Parameters | |
---|---|
aAccount | IMAP account ID, if the account name is zero-length, the account name is not updated |
aIAP | IMAP IAP Pref settings |
IMPORT_C void | SaveImapSettingsL | ( | const TImapAccount & | aAccount, |
const CImImap4Settings & | aImapSettings | |||
) |
Saves IMAP service settings for the specified account.
Parameters | |
---|---|
aAccount | IMAP account ID, if the account name is zero-length, the account name is not updated |
aImapSettings | IMAP service settings |
IMPORT_C void | SaveImapSyncDownloadRulesL | ( | const TImapAccount & | aAccount, |
const CImapSyncDownloadRules & | aRules | |||
) |
Saves IMAP synchronisation download rules
Parameters | |
---|---|
aAccount | IMAP account ID |
aRules | Synchronisation download rules |
IMPORT_C void | SaveImapTransportBufferSizesL | ( | const CImapTransportBufferSizes & | aBufferSizes | ) |
Saves IMAP transport buffer sizes
Parameters | |
---|---|
aBufferSizes | Transport buffer sizes |
IMPORT_C void | SavePopIapSettingsL | ( | const TPopAccount & | aAccount, |
const CImIAPPreferences & | aIAP | |||
) |
Saves POP IAP settings for the specified account.
Parameters | |
---|---|
aAccount | POP account ID, if the account name is zero-length, the account name is not updated |
aIAP | POP IAP Pref settings |
IMPORT_C void | SavePopSettingsL | ( | const TPopAccount & | aAccount, |
const CImPop3Settings & | aPopSettings | |||
) |
Saves POP service settings for the specified account.
Parameters | |
---|---|
aAccount | POP account ID, if the account name is zero-length, the account name is not updated |
aPopSettings | POP service settings |
IMPORT_C void | SaveSmtpIapSettingsL | ( | const TSmtpAccount & | aAccount, |
const CImIAPPreferences & | aIAP | |||
) |
Saves SMTP IAP settings for the specified account.
Parameters | |
---|---|
aAccount | SMTP account ID, if the account name is zero-length, the account name is not updated |
aIAP | SMTP IAP Pref settings |
IMPORT_C void | SaveSmtpMobilityAccountIapListL | ( | const TSmtpMobilityAccount & | aAccount, |
const RArrayIAP & | aIapList | |||
) |
Sets the IAP list for a SMTP mobility account
Parameters | |
---|---|
aAccount | SMTP mobility account |
aIapList | IAP list to save |
Leave Codes | |
---|---|
KErrArgument | No entries or too many entries in the IAP list |
IMPORT_C void | SaveSmtpMobilitySettingsL | ( | const TSmtpMobilityAccount & | aAccount, |
const CImSmtpMobilitySettings & | aSettings | |||
) |
Saves the settings for a SMTP mobility account
Parameters | |
---|---|
aAccount | SMTP mobility account |
aSettings | Settings to save |
Leave Codes | |
---|---|
KErrNotFound | Specified account is not a SMTP mobility account |
KErrNotSupported | SMTP mobility account uses settings of a linked SMTP account and changing the settings is not supported |
IMPORT_C void | SaveSmtpSettingsL | ( | const TSmtpAccount & | aAccount, |
const CImSmtpSettings & | aSmtpSettings | |||
) |
Saves SMTP service settings for the specified account.
Parameters | |
---|---|
aAccount | SMTP account ID, if the account name is zero-length, the account name is not updated |
aSmtpSettings | SMTP service settings |
IMPORT_C void | SetDefaultSmtpAccountL | ( | const TSmtpAccount & | aAccount | ) |
Sets the default smtp account.
Parameters | |
---|---|
aAccount | Account ID to set as default |