Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <SMTCMTM.H>
Link against: imcm.lib

Class CSmtpClientMtm

class CSmtpClientMtm : public CBaseMtm;

Description

SMTP client MTM interface.

Most of the functions in this class are implementations of the virtual functions defined by the base class CBaseMtm.

Derivation

Members

Defined in CSmtpClientMtm:

Inherited from CBase:

Inherited from CBaseMtm:

Inherited from MMsvEntryObserver:


Member functions


SaveMessageL()

virtual void SaveMessageL();

Description

Commits cached changes to the current message context to the storage controlled by the Message Server.


LoadMessageL()

virtual void LoadMessageL();

Description

Loads the cache with the message data for the current context.


StoreSettingsL()

IMPORT_C void StoreSettingsL();

Description

Stores the current service settings from the object's cache in to the Central Repository for the current entry.

The current entry must be a service.


RestoreSettingsL()

IMPORT_C void RestoreSettingsL();

Description

Loads into the object's cache the service settings from the Central Repository for the current entry.


ReplyL(TMsvId,TMsvPartList,TRequestStatus &)

virtual CMsvOperation* ReplyL(TMsvId aReplyEntryId, TMsvPartList aPartlist, TRequestStatus &aCompletionStatus);

Description

Creates a reply message to the current message context.

Parameters

TMsvId aReplyEntryId

The entry to which to assign the reply

TMsvPartList aPartlist

Defines the parts that are to be copied from the original message into the reply

TRequestStatus &aCompletionStatus

The request status to be completed when the operation has finished

Return value

CMsvOperation *

If successful, this is an asynchronously completing reply operation. If failed, this is a completed operation, with status set to the relevant error code.


ForwardL(TMsvId,TMsvPartList,TRequestStatus &)

virtual CMsvOperation* ForwardL(TMsvId aForwardEntryId, TMsvPartList aPartList, TRequestStatus &aCompletionStatus);

Description

Creates a forwarded message from the current message context.

Parameters

TMsvId aForwardEntryId

The entry to which to assign the forwarded message

TMsvPartList aPartList

Defines the parts that are to be copied from the original message into the forwarded message

TRequestStatus &aCompletionStatus

The request status to be completed when the operation has finished

Return value

CMsvOperation *

If successful, this is an asynchronously completing forward message operation. If failed, this is a completed operation, with status set to the relevant error code.


ValidateMessage(TMsvPartList)

virtual TMsvPartList ValidateMessage(TMsvPartList aPartList);

Description

Validates the current message context.

The addresses for the message are checked to be well-formed email addresses.

Parameters

TMsvPartList aPartList

Indicates the message parts for which validation is requested

Return value

TMsvPartList

If valid, KErrNone If invalid, identifies the invalid part(s). The error value is the bitmask of the TMsvPartList IDs for each invalid part


Find(const TDesC &,TMsvPartList)

virtual TMsvPartList Find(const TDesC &aTextToFind, TMsvPartList aPartList);

Description

Searches the specified message part(s) for the plain-text version of the text to be found.

Parameters

const TDesC16 &aTextToFind

The plain-text version of the text to be found.

TMsvPartList aPartList

Indicates the message parts which should be searched.

Return value

TMsvPartList

If the text was not found, or searching is unsupported, 0. If the text was found, a bitmask of the TMsvPartList IDs for each part in which the text was present.


AddAddresseeL(const TDesC &)

virtual void AddAddresseeL(const TDesC &aRealAddress);

Description

Adds an addressee for the current context.

Parameters

const TDesC16 &aRealAddress

String representing an address to be added to the list for the current message


AddAddresseeL(const TDesC &,const TDesC &)

virtual void AddAddresseeL(const TDesC &aRealAddress, const TDesC &aAlias);

Description

Adds an addressee with an alias for the current context.

Parameters

const TDesC16 &aRealAddress

String representing an address to be added to the list for the current message

const TDesC16 &aAlias

Alias information


AddAddresseeL(TMsvRecipientType,const TDesC &)

virtual void AddAddresseeL(TMsvRecipientType aType, const TDesC &aRealAddress);

Description

Parameters

TMsvRecipientType aType

const TDesC16 &aRealAddress


AddAddresseeL(TMsvRecipientType,const TDesC &,const TDesC &)

virtual void AddAddresseeL(TMsvRecipientType aType, const TDesC &aRealAddress, const TDesC &aAlias);

Description

Parameters

TMsvRecipientType aType

const TDesC16 &aRealAddress

const TDesC16 &aAlias


RemoveAddressee(TInt)

virtual void RemoveAddressee(TInt aIndex);

Description

Removes an address from the current address list.

Parameters

TInt aIndex

Index of address to be removed


SetSettingsL(const CImSmtpSettings &)

IMPORT_C void SetSettingsL(const CImSmtpSettings &aSettings);

Description

Copies the specified service settings to the cached service settings.

Parameters

const CImSmtpSettings &aSettings

New service settings


Settings()const

IMPORT_C const CImSmtpSettings& Settings() const;

Description

Gets the current cached service settings.

Return value

const CImSmtpSettings &

The current cached service settings


SetSubjectL(const TDesC &)

IMPORT_C virtual void SetSubjectL(const TDesC &aSubject);

Description

Sets the message context's subject text.

Parameters

const TDesC16 &aSubject

Subject text


SubjectL()const

IMPORT_C virtual const TPtrC SubjectL() const;

Description

Gets the message context's subject text.

Return value

const TPtrC16

Subject text


QueryCapability(TUid,TInt &)

virtual TInt QueryCapability(TUid aCapability, TInt &aResponse);

Description

Queries if the MTM supports a particular capability, specified by a UID.

Parameters

TUid aCapability

UID of capability to be queried

TInt &aResponse

Response value. The format of the response varies according to the capability.

Return value

TInt

KErrNone: aCapability is a recognised value and a response is returned KErrNotSupported: aCapability is not a recognised value


InvokeSyncFunctionL(TInt,const CMsvEntrySelection &,TDes8 &)

virtual void InvokeSyncFunctionL(TInt aFunctionId, const CMsvEntrySelection &aSelection, TDes8 &aParameter);

Description

Invokes a synchronous SMTP-specific operation.

Parameters

TInt aFunctionId

Specifies which operation to perform. The only valid ID is KSMTPMTMIsConnected.

const CMsvEntrySelection &aSelection

A selection of messages for the operation.

TDes8 &aParameter

Not used


InvokeAsyncFunctionL(TInt,const CMsvEntrySelection &,TDes8 &,TRequestStatus &)

virtual CMsvOperation* InvokeAsyncFunctionL(TInt aFunctionId, const CMsvEntrySelection &aSelection, TDes8 &aParameter, TRequestStatus &aCompletionStatus);

Description

Invokes asynchronous SMTP-specific operations.

Parameters

TInt aFunctionId

Specifies which operation to perform e.g. connect, copy new mail etc. The specific operations are defined by the TSmtpCmds enumeration.

const CMsvEntrySelection &aSelection

A selection of messages that need to be copied/moved to a local folder. The first entry in this selection MUST be the service.

TDes8 &aParameter

Not used

TRequestStatus &aCompletionStatus

The status when the operation completes.

Return value

CMsvOperation *

If successful, this is an asynchronously completing operation. If failed, this is a completed operation, with status set to the relevant error code.

Leave codes

KErrNotFound

The selection of email to be moved or copied is empty

KErrNotSupported

The specified operation is not recognised

See also:


AddAttachmentL(const TDesC &,const TDesC8 &,TUint,TRequestStatus &)

IMPORT_C virtual void AddAttachmentL(const TDesC &aFilePath, const TDesC8 &aMimeType, TUint aCharset, TRequestStatus &aStatus);

Description

Parameters

const TDesC16 &aFilePath

const TDesC8 &aMimeType

TUint aCharset

TRequestStatus &aStatus


AddAttachmentL(RFile &,const TDesC8 &,TUint,TRequestStatus &)

IMPORT_C virtual void AddAttachmentL(RFile &aFile, const TDesC8 &aMimeType, TUint aCharset, TRequestStatus &aStatus);

Description

Parameters

RFile &aFile

const TDesC8 &aMimeType

TUint aCharset

TRequestStatus &aStatus


AddLinkedAttachmentL(const TDesC &,const TDesC8 &,TUint,TRequestStatus &)

IMPORT_C virtual void AddLinkedAttachmentL(const TDesC &aFilePath, const TDesC8 &aMimeType, TUint aCharset, TRequestStatus &aStatus);

Description

Parameters

const TDesC16 &aFilePath

const TDesC8 &aMimeType

TUint aCharset

TRequestStatus &aStatus


AddEntryAsAttachmentL(TMsvId,TRequestStatus &)

IMPORT_C virtual void AddEntryAsAttachmentL(TMsvId aAttachmentId, TRequestStatus &aStatus);

Description

Parameters

TMsvId aAttachmentId

TRequestStatus &aStatus


CreateAttachmentL(const TDesC &,RFile &,const TDesC8 &,TUint,TRequestStatus &)

IMPORT_C virtual void CreateAttachmentL(const TDesC &aFileName, RFile &aAttachmentFile, const TDesC8 &aMimeType, TUint aCharset, TRequestStatus &aStatus);

Description

Parameters

const TDesC16 &aFileName

RFile &aAttachmentFile

const TDesC8 &aMimeType

TUint aCharset

TRequestStatus &aStatus


CreateMessageL(TMsvId)

IMPORT_C virtual void CreateMessageL(TMsvId aServiceId);

Description

Creates a new message entry as a child of the current context.

Parameters

TMsvId aServiceId

ID of the service to own the entry.


DefaultServiceL()const

IMPORT_C virtual TMsvId DefaultServiceL() const;

Description

Gets the default SMTP service.

KErrNotFound If default service setting does not exist.

Return value

TMsvId

The default service

Leave codes


RemoveDefaultServiceL()

IMPORT_C virtual void RemoveDefaultServiceL();

Description

Removes the default SMTP service.


ChangeDefaultServiceL(const TMsvId &)

IMPORT_C virtual void ChangeDefaultServiceL(const TMsvId &aService);

Description

Sets the default SMTP service.

Parameters

const TMsvId &aService

The default service


CancelAttachmentOperation()

IMPORT_C virtual void CancelAttachmentOperation();

Description

Cancels the current attachment operation.


ContextEntrySwitched()

protected: virtual void ContextEntrySwitched();

Description

Called by the base class functions CBaseMtm::SwitchCurrentEntryL(TMsvId) and CBaseMtm::SetCurrentEntryL(CMsvEntry *) when the context is changed to another entry.

Client applications do not use this function. It is relevant only to implementers of derived classes.

Requirements:

An implementation should clear:

1. address data stored in iAddresseeList

2. any caches of MTM-specific entry data relating to a previous context. For example, if the implementation has a private buffer storing a message subject, for access through Subject(), this buffer should be cleared.