CSmtpClientMtm Class Reference

#include <mw/smtcmtm.h>

class CSmtpClientMtm
Public Member Functions
~CSmtpClientMtm()
voidAddAddresseeL(const TDesC &)
voidAddAddresseeL(const TDesC &, const TDesC &)
voidAddAddresseeL(TMsvRecipientType, const TDesC &)
voidAddAddresseeL(TMsvRecipientType, const TDesC &, const TDesC &)
virtual IMPORT_C voidAddAttachmentL(const TDesC &, const TDesC8 &, TUint, TRequestStatus &)
virtual IMPORT_C voidAddAttachmentL(RFile &, const TDesC8 &, TUint, TRequestStatus &)
virtual IMPORT_C voidAddEntryAsAttachmentL(TMsvId, TRequestStatus &)
virtual IMPORT_C voidAddLinkedAttachmentL(const TDesC &, const TDesC8 &, TUint, TRequestStatus &)
IMPORT_C voidCancelAttachmentOperation()
virtual IMPORT_C voidChangeDefaultServiceL(const TMsvId &)
virtual IMPORT_C voidCreateAttachmentL(const TDesC &, RFile &, const TDesC8 &, TUint, TRequestStatus &)
virtual IMPORT_C voidCreateMessageL(TMsvId)
virtual IMPORT_C TMsvIdDefaultServiceL()
TMsvPartListFind(const TDesC &, TMsvPartList)
CMsvOperation *ForwardL(TMsvId, TMsvPartList, TRequestStatus &)
CMsvOperation *InvokeAsyncFunctionL(TInt, const CMsvEntrySelection &, TDes8 &, TRequestStatus &)
voidInvokeSyncFunctionL(TInt, const CMsvEntrySelection &, TDes8 &)
voidLoadMessageL()
IMPORT_C CSmtpClientMtm *NewL(CRegisteredMtmDll &, CMsvSession &)
TInt QueryCapability(TUid, TInt &)
voidRemoveAddressee(TInt)
virtual IMPORT_C voidRemoveDefaultServiceL()
CMsvOperation *ReplyL(TMsvId, TMsvPartList, TRequestStatus &)
IMPORT_C voidRestoreSettingsL()
voidSaveMessageL()
IMPORT_C voidSetSettingsL(const CImSmtpSettings &)
IMPORT_C voidSetSubjectL(const TDesC &)
IMPORT_C const CImSmtpSettings &Settings()
IMPORT_C voidStoreSettingsL()
IMPORT_C const TPtrCSubjectL()
TMsvPartListValidateMessage(TMsvPartList)
Protected Member Functions
CSmtpClientMtm(CRegisteredMtmDll &, CMsvSession &)
voidConstructL()
voidContextEntrySwitched()

Detailed Description

SMTP client MTM interface.

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

Constructor & Destructor Documentation

CSmtpClientMtm ( CRegisteredMtmDll &, CMsvSession & )

CSmtpClientMtm(CRegisteredMtmDll &aRegisteredMtmDll,
CMsvSession &aMsvSession
)[protected]

~CSmtpClientMtm ( )

~CSmtpClientMtm()

Destructor.

Member Function Documentation

AddAddresseeL ( const TDesC & )

voidAddAddresseeL(const TDesC &aRealAddress)

Adds an addressee for the current context.

Parameters
aRealAddressString representing an address to be added to the list for the current message

AddAddresseeL ( const TDesC &, const TDesC & )

voidAddAddresseeL(const TDesC &aRealAddress,
const TDesC &aAlias
)

Adds an addressee with an alias for the current context.

Parameters
aRealAddressString representing an address to be added to the list for the current message
aAliasAlias information

AddAddresseeL ( TMsvRecipientType, const TDesC & )

voidAddAddresseeL(TMsvRecipientTypeaType,
const TDesC &aRealAddress
)

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

voidAddAddresseeL(TMsvRecipientTypeaType,
const TDesC &aRealAddress,
const TDesC &aAlias
)

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

IMPORT_C voidAddAttachmentL(const TDesC &aFilePath,
const TDesC8 &aMimeType,
TUintaCharset,
TRequestStatus &aStatus
)[virtual]

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

IMPORT_C voidAddAttachmentL(RFile &aFile,
const TDesC8 &aMimeType,
TUintaCharset,
TRequestStatus &aStatus
)[virtual]

AddEntryAsAttachmentL ( TMsvId, TRequestStatus & )

IMPORT_C voidAddEntryAsAttachmentL(TMsvIdaAttachmentId,
TRequestStatus &aStatus
)[virtual]

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

IMPORT_C voidAddLinkedAttachmentL(const TDesC &aFilePath,
const TDesC8 &aMimeType,
TUintaCharset,
TRequestStatus &aStatus
)[virtual]

CancelAttachmentOperation ( )

IMPORT_C voidCancelAttachmentOperation()

Cancels the current attachment operation.

ChangeDefaultServiceL ( const TMsvId & )

IMPORT_C voidChangeDefaultServiceL(const TMsvId &aService)[virtual]

Sets the default SMTP service.

Parameters
aServiceThe default service

ConstructL ( )

voidConstructL()[protected]

ContextEntrySwitched ( )

voidContextEntrySwitched()[protected]

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

IMPORT_C voidCreateAttachmentL(const TDesC &aFileName,
RFile &aAttachmentFile,
const TDesC8 &aMimeType,
TUintaCharset,
TRequestStatus &aStatus
)[virtual]

CreateMessageL ( TMsvId )

IMPORT_C voidCreateMessageL(TMsvIdaServiceId)[virtual]

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

Parameters
aServiceIdID of the service to own the entry.

DefaultServiceL ( )

IMPORT_C TMsvIdDefaultServiceL()const [virtual]

Gets the default SMTP service.

KErrNotFound If default service setting does not exist.
Return Value
The default service
Leave Codes

Find ( const TDesC &, TMsvPartList )

TMsvPartListFind(const TDesC &aTextToFind,
TMsvPartListaPartList
)

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

Parameters
aTextToFindThe plain-text version of the text to be found.
aPartListIndicates the message parts which should be searched.
Return Value
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.

ForwardL ( TMsvId, TMsvPartList, TRequestStatus & )

CMsvOperation *ForwardL(TMsvIdaForwardEntryId,
TMsvPartListaPartList,
TRequestStatus &aCompletionStatus
)

Creates a forwarded message from the current message context.

Parameters
aForwardEntryIdThe entry to which to assign the forwarded message
aPartListDefines the parts that are to be copied from the original message into the forwarded message
aCompletionStatusThe request status to be completed when the operation has finished
Return Value
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.

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

CMsvOperation *InvokeAsyncFunctionL(TIntaFunctionId,
const CMsvEntrySelection &aSelection,
TDes8 &aParameter,
TRequestStatus &aCompletionStatus
)

Invokes asynchronous SMTP-specific operations.

See also: TSmtpCmds

Parameters
aFunctionIdSpecifies which operation to perform e.g. connect, copy new mail etc. The specific operations are defined by the TSmtpCmds enumeration.
aSelectionA selection of messages that need to be copied/moved to a local folder. The first entry in this selection MUST be the service.
aParameterNot used
aCompletionStatusThe status when the operation completes.
Return Value
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
KErrNotFoundThe selection of email to be moved or copied is empty
KErrNotSupportedThe specified operation is not recognised

InvokeSyncFunctionL ( TInt, const CMsvEntrySelection &, TDes8 & )

voidInvokeSyncFunctionL(TIntaFunctionId,
const CMsvEntrySelection &aSelection,
TDes8 &aParameter
)

Invokes a synchronous SMTP-specific operation.

Parameters
aFunctionIdSpecifies which operation to perform. The only valid ID is KSMTPMTMIsConnected.
aSelectionA selection of messages for the operation.
aParameterNot used

LoadMessageL ( )

voidLoadMessageL()

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

NewL ( CRegisteredMtmDll &, CMsvSession & )

IMPORT_C CSmtpClientMtm *NewL(CRegisteredMtmDll &aRegisteredMtmDll,
CMsvSession &aMsvSession
)[static]

QueryCapability ( TUid, TInt & )

TInt QueryCapability(TUidaCapability,
TInt &aResponse
)

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

Parameters
aCapabilityUID of capability to be queried
aResponseResponse value. The format of the response varies according to the capability.
Return Value
KErrNone: aCapability is a recognised value and a response is returned KErrNotSupported: aCapability is not a recognised value

RemoveAddressee ( TInt )

voidRemoveAddressee(TIntaIndex)

Removes an address from the current address list.

Parameters
aIndexIndex of address to be removed

RemoveDefaultServiceL ( )

IMPORT_C voidRemoveDefaultServiceL()[virtual]

Removes the default SMTP service.

ReplyL ( TMsvId, TMsvPartList, TRequestStatus & )

CMsvOperation *ReplyL(TMsvIdaReplyEntryId,
TMsvPartListaPartlist,
TRequestStatus &aCompletionStatus
)

Creates a reply message to the current message context.

Parameters
aReplyEntryIdThe entry to which to assign the reply
aPartlistDefines the parts that are to be copied from the original message into the reply
aCompletionStatusThe request status to be completed when the operation has finished
Return Value
If successful, this is an asynchronously completing reply operation. If failed, this is a completed operation, with status set to the relevant error code.

RestoreSettingsL ( )

IMPORT_C voidRestoreSettingsL()

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

SaveMessageL ( )

voidSaveMessageL()

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

SetSettingsL ( const CImSmtpSettings & )

IMPORT_C voidSetSettingsL(const CImSmtpSettings &aSettings)

Copies the specified service settings to the cached service settings.

Parameters
aSettingsNew service settings

SetSubjectL ( const TDesC & )

IMPORT_C voidSetSubjectL(const TDesC &aSubject)

Sets the message context's subject text.

Parameters
aSubjectSubject text

Settings ( )

IMPORT_C const CImSmtpSettings &Settings()const

Gets the current cached service settings.

Return Value
The current cached service settings

StoreSettingsL ( )

IMPORT_C voidStoreSettingsL()

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.

SubjectL ( )

IMPORT_C const TPtrCSubjectL()const

Gets the message context's subject text.

Return Value
Subject text

ValidateMessage ( TMsvPartList )

TMsvPartListValidateMessage(TMsvPartListaPartList)

Validates the current message context.

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

Parameters
aPartListIndicates the message parts for which validation is requested
Return Value
If valid, KErrNone If invalid, identifies the invalid part(s). The error value is the bitmask of the TMsvPartList IDs for each invalid part