|
||
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.) CEmailAccounts::SetDefaultSmtpAccountL(const TSmtpAccount &)
, CEmailAccounts::DefaultSmtpAccountL(TSmtpAccount &)
and CEmailAccounts::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(const TDesC &,const CImImap4Settings &,const CImIAPPreferences &,TBool)
Creates an IMAP Account:CreatePopAccountL(const TDesC &,const CImPop3Settings &,const CImIAPPreferences &,TBool)
Creates a POP Account:CreateSmtpAccountL(TImapAccount &,const CImSmtpSettings &,const CImIAPPreferences &,TBool)
Creates a SMTP Account:CreateSmtpAccountL(TPopAccount &,const CImSmtpSettings &,const CImIAPPreferences &,TBool)
Creates a SMTP Account:CreateSmtpAccountL(const TDesC &,const CImSmtpSettings &,const CImIAPPreferences &,TBool)
Creates an SMTP Account:DefaultSmtpAccountL(TSmtpAccount &)
Returns the default SMTP account.DeleteDefaultSmtpAccountL()
Deletes the default SMTP account information from repository. DeleteImapAccountL(const TImapAccount &)
Deletes the specified IMAP account.DeletePopAccountL(const TPopAccount &)
Deletes the specified POP account.DeleteSmtpAccountL(const TSmtpAccount &)
Deletes the specified SMTP account.GetImapAccountL(TMsvId,TImapAccount &)
Gets a IMAP account ID for the specified service.GetImapAccountsL(RArray< TImapAccount > &)
Gets a list of IMAP account IDs that exists in the current message store.GetPopAccountL(TMsvId,TPopAccount &)
Gets a POP account ID for the specified service.GetPopAccountsL(RArray< TPopAccount > &)
Gets a list of POP account IDs that exists in the current message store.GetSmtpAccountL(TMsvId,TSmtpAccount &)
Gets a SMTP account ID for the specified service.GetSmtpAccountsL(RArray< TSmtpAccount > &)
Gets a list of SMTP account IDs that exists in the current message store.HandleSessionEventL(TMsvSessionEvent,TAny *,TAny *,TAny *)
Indicates an event has occurred.IsAccountReadOnlyL(const TImapAccount &)
Checks if the account is read-onlyIsAccountReadOnlyL(const TPopAccount &)
Checks if the account is read-onlyIsAccountReadOnlyL(const TSmtpAccount &)
Checks if the account is read-onlyLoadImapIapSettingsL(const TImapAccount &,CImIAPPreferences &)
Loads IMAP IAP settings for the specified account.LoadImapSettingsL(const TImapAccount &,CImImap4Settings &)
Loads IMAP service settings for the specified account.LoadPopIapSettingsL(const TPopAccount &,CImIAPPreferences &)
Loads POP IAP settings for the specified account.LoadPopSettingsL(const TPopAccount &,CImPop3Settings &)
Loads POP service settings for the specified account.LoadSmtpIapSettingsL(const TSmtpAccount &,CImIAPPreferences &)
Loads SMTP IAP settings for the specified account.LoadSmtpSettingsL(const TSmtpAccount &,CImSmtpSettings &)
Loads SMTP service settings for the specified account.NewL()
Allocates and constructs an Email accounts object.NewLC()
Allocates and constructs an Email accounts object.PopulateDefaultImapSettingsL(CImImap4Settings &,CImIAPPreferences &)
Populates the supplied setting objects with default values.PopulateDefaultPopSettingsL(CImPop3Settings &,CImIAPPreferences &)
Populates the supplied setting objects with default values.PopulateDefaultSmtpSettingsL(CImSmtpSettings &,CImIAPPreferences &)
Populates the supplied setting objects with default values.SaveImapIapSettingsL(const TImapAccount &,const CImIAPPreferences &)
Saves IMAP IAP settings for the specified account.SaveImapSettingsL(const TImapAccount &,const CImImap4Settings &)
Saves IMAP service settings for the specified account.SavePopIapSettingsL(const TPopAccount &,const CImIAPPreferences &)
Saves POP IAP settings for the specified account.SavePopSettingsL(const TPopAccount &,const CImPop3Settings &)
Saves POP service settings for the specified account.SaveSmtpIapSettingsL(const TSmtpAccount &,const CImIAPPreferences &)
Saves SMTP IAP settings for the specified account.SaveSmtpSettingsL(const TSmtpAccount &,const CImSmtpSettings &)
Saves SMTP service settings for the specified account.SetDefaultSmtpAccountL(const TSmtpAccount &)
Sets the default smtp account.~CEmailAccounts()
Destructor. Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...Inherited from MMsvSessionObserver
:
EMsvCloseSession
The client should immediately close the session with the Message Server. EMsvCorruptedIndexRebuilding
The Message Server has started to rebuild its index after it has been corrupted.EMsvCorruptedIndexRebuilt
The Message Server index had been corrupted and had to be rebuilt.EMsvEntriesChanged
One or more index entries have been changed.EMsvEntriesCreated
One or more entries have been created.EMsvEntriesDeleted
One or more entries have been deleted.EMsvEntriesMoved
One or more entries have been moved.EMsvGeneralError
Something has happening in the server, but this client was unable to retrieve th...EMsvMediaAvailable
The disk containing the Message Store is available again.EMsvMediaChanged
The Message Server has automatically changed the index location to use the inter...EMsvMediaIncorrect
An incorrect disk is inserted.EMsvMediaUnavailable
The media (disk) containing the Message Server index has been removed.EMsvMtmGroupDeInstalled
A MTM has been uninstalled.EMsvMtmGroupInstalled
A new MTM has been installed.EMsvServerFailedToStart
Received after a client has used CMsvSession::OpenAsyncL(MMsvSessionObserver &am...EMsvServerReady
Received after a client has used CMsvSession::OpenAsyncL(MMsvSessionObserver &am...EMsvServerTerminated
The Message Server has been terminated.TMsvSessionEvent
Session event type.IMPORT_C static CEmailAccounts* NewL();
Allocates and constructs an Email accounts object.
Initialises all member data to their default values.
|
IMPORT_C static 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.
|