Location:
cemailaccounts.h
Link against: imcm.lib
class CEmailAccounts : public CBase, public MMsvSessionObserver;
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.
MMsvSessionObserver
- Provides the interface for notification of events from a Message Server session
CBase
- Base class for all classes to be instantiated on the heap
CEmailAccounts
- Creates, loads, saves and deletes email (IMAP, POP, and SMTP) accounts
Defined in CEmailAccounts
:
CreateImapAccountL()
, CreatePopAccountL()
, CreateSmtpAccountL()
, CreateSmtpAccountL()
, CreateSmtpAccountL()
, DefaultSmtpAccountL()
, DeleteDefaultSmtpAccountL()
, DeleteImapAccountL()
, DeletePopAccountL()
, DeleteSmtpAccountL()
, GetImapAccountL()
, GetImapAccountsL()
, GetPopAccountL()
, GetPopAccountsL()
, GetSmtpAccountL()
, GetSmtpAccountsL()
, HandleSessionEventL()
, IsAccountReadOnlyL()
, IsAccountReadOnlyL()
, IsAccountReadOnlyL()
, LoadImapIapSettingsL()
, LoadImapSettingsL()
, LoadPopIapSettingsL()
, LoadPopSettingsL()
, LoadSmtpIapSettingsL()
, LoadSmtpSettingsL()
, NewL()
, NewLC()
, PopulateDefaultImapSettingsL()
, PopulateDefaultPopSettingsL()
, PopulateDefaultSmtpSettingsL()
, SaveImapIapSettingsL()
, SaveImapSettingsL()
, SavePopIapSettingsL()
, SavePopSettingsL()
, SaveSmtpIapSettingsL()
, SaveSmtpSettingsL()
, SetDefaultSmtpAccountL()
, ~CEmailAccounts()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
Inherited from MMsvSessionObserver
:
EMsvCloseSession
,
EMsvCorruptedIndexRebuilding
,
EMsvCorruptedIndexRebuilt
,
EMsvEntriesChanged
,
EMsvEntriesCreated
,
EMsvEntriesDeleted
,
EMsvEntriesMoved
,
EMsvGeneralError
,
EMsvMediaAvailable
,
EMsvMediaChanged
,
EMsvMediaIncorrect
,
EMsvMediaUnavailable
,
EMsvMtmGroupDeInstalled
,
EMsvMtmGroupInstalled
,
EMsvServerFailedToStart
,
EMsvServerReady
,
EMsvServerTerminated
,
TMsvSessionEvent
static IMPORT_C CEmailAccounts *NewL();
Allocates and constructs an Email accounts object.
Initialises all member data to their default values.
|
static IMPORT_C CEmailAccounts *NewLC();
Allocates and constructs an Email accounts object.
Initialises all member data to their default values.
|
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
KErrOverflow if the account name is longer than 256 characters. KErrArgument if settings fields contained non-ascii printable characters.
|
|
|
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
KErrOverflow if the account name is longer than 256 characters. KErrArgument if settings fields contained non-ascii printable characters.
|
|
|
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
KErrArgument if settings fields contained non-ascii printable characters.
|
|
|
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
KErrArgument if settings fields contained non-ascii printable characters.
|
|
|
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
KErrOverflow if the account name is longer than 256 characters. KErrArgument if settings fields contained non-ascii printable characters.
|
|
|
IMPORT_C void GetPopAccountsL(RArray< TPopAccount > &aAccounts);
Gets a list of POP account IDs that exists in the current message store.
|
IMPORT_C void GetPopAccountL(TMsvId aServiceId, TPopAccount &aAccount);
Gets a POP account ID for the specified service.
|
IMPORT_C void DeletePopAccountL(const TPopAccount &aAccount);
Deletes the specified POP account.
|
IMPORT_C void GetImapAccountsL(RArray< TImapAccount > &aAccounts);
Gets a list of IMAP account IDs that exists in the current message store.
|
IMPORT_C void GetImapAccountL(TMsvId aServiceId, TImapAccount &aAccount);
Gets a IMAP account ID for the specified service.
|
IMPORT_C void DeleteImapAccountL(const TImapAccount &aAccount);
Deletes the specified IMAP account.
|
IMPORT_C void GetSmtpAccountsL(RArray< TSmtpAccount > &aAccounts);
Gets a list of SMTP account IDs that exists in the current message store.
|
IMPORT_C void GetSmtpAccountL(TMsvId aServiceId, TSmtpAccount &aAccount);
Gets a SMTP account ID for the specified service.
|
IMPORT_C void DeleteSmtpAccountL(const TSmtpAccount &aAccount);
Deletes the specified SMTP account.
|
IMPORT_C void DeleteDefaultSmtpAccountL();
Deletes the default SMTP account information from repository.
IMPORT_C void PopulateDefaultPopSettingsL(CImPop3Settings &aPopSettings, CImIAPPreferences &aPopIap);
Populates the supplied setting objects with default values.
|
IMPORT_C void PopulateDefaultImapSettingsL(CImImap4Settings &aImapSettings, CImIAPPreferences &aImapIap);
Populates the supplied setting objects with default values.
|
IMPORT_C void PopulateDefaultSmtpSettingsL(CImSmtpSettings &aSmtpSettings, CImIAPPreferences &aSmtpIap);
Populates the supplied setting objects with default values.
|
IMPORT_C TInt DefaultSmtpAccountL(TSmtpAccount &aAccount);
Returns the default SMTP account.
|
|
IMPORT_C void SetDefaultSmtpAccountL(const TSmtpAccount &aAccount);
Sets the default smtp account.
|
IMPORT_C void LoadPopSettingsL(const TPopAccount &aAccount, CImPop3Settings &aPopSettings);
Loads POP service settings for the specified account.
|
IMPORT_C void LoadPopIapSettingsL(const TPopAccount &aAccount, CImIAPPreferences &aIAP);
Loads POP IAP settings for the specified account.
|
IMPORT_C void LoadImapSettingsL(const TImapAccount &aAccount, CImImap4Settings &aImapSettings);
Loads IMAP service settings for the specified account.
|
IMPORT_C void LoadImapIapSettingsL(const TImapAccount &aAccount, CImIAPPreferences &aIAP);
Loads IMAP IAP settings for the specified account.
|
IMPORT_C void LoadSmtpSettingsL(const TSmtpAccount &aAccount, CImSmtpSettings &aSmtpSettings);
Loads SMTP service settings for the specified account.
|
IMPORT_C void LoadSmtpIapSettingsL(const TSmtpAccount &aAccount, CImIAPPreferences &aIAP);
Loads SMTP IAP settings for the specified account.
|
IMPORT_C void SavePopSettingsL(const TPopAccount &aAccount, const CImPop3Settings &aPopSettings);
Saves POP service settings for the specified account.
|
IMPORT_C void SavePopIapSettingsL(const TPopAccount &aAccount, const CImIAPPreferences &aIAP);
Saves POP IAP settings for the specified account.
|
IMPORT_C void SaveImapSettingsL(const TImapAccount &aAccount, const CImImap4Settings &aImapSettings);
Saves IMAP service settings for the specified account.
|
IMPORT_C void SaveImapIapSettingsL(const TImapAccount &aAccount, const CImIAPPreferences &aIAP);
Saves IMAP IAP settings for the specified account.
|
IMPORT_C void SaveSmtpSettingsL(const TSmtpAccount &aAccount, const CImSmtpSettings &aSmtpSettings);
Saves SMTP service settings for the specified account.
|
IMPORT_C void SaveSmtpIapSettingsL(const TSmtpAccount &aAccount, const CImIAPPreferences &aIAP);
Saves SMTP IAP settings for the specified account.
|
IMPORT_C TBool IsAccountReadOnlyL(const TPopAccount &aAccount);
Checks if the account is read-only
|
|
IMPORT_C TBool IsAccountReadOnlyL(const TImapAccount &aAccount);
Checks if the account is read-only
|
|
IMPORT_C TBool IsAccountReadOnlyL(const TSmtpAccount &aAccount);
Checks if the account is read-only
|
|
private: virtual void HandleSessionEventL(TMsvSessionEvent, TAny *, TAny *, TAny *);
Indicates an event has occurred.
The type of event is indicated by the value of aEvent. The interpretation of the TAny arguments depends on this type.
For most event types, the action that is taken, for example, updating the display, is client-specific. All clients though should respond to EMsvCloseSession and EMsvServerTerminated events.
|