CMmsClientMtm Class Reference

#include <app/mmsclient.h>

Link against: mmscli.lib

class CMmsClientMtm : public CBaseMtm

Inherits from

  • CMmsClientMtm
    Protected Attributes
    TInt iAccessPointCount
    CDesCArrayFlat *iAttributes
    TBool iFetchAll
    TBool iFetchOverride
    TInt32 iHomeMode
    TInt iMessageDrive
    CMmsHeaders *iMmsHeaders
    CMmsSettings *iMmsSettings
    CMsvSession &iOwnSession
    TInt32 iRoamingMode
    TMsvId iServiceId
    Public Member Functions
    virtual ~CMmsClientMtm()
    virtual voidAddAddresseeL(const TDesC &)
    virtual voidAddAddresseeL(const TDesC &, const TDesC &)
    virtual voidAddAddresseeL(TMsvRecipientType, const TDesC &)
    virtual voidAddAddresseeL(TMsvRecipientType, const TDesC &, const TDesC &)
    virtual voidAddAttachmentL(const TDesC &, const TDesC8 &, TUint, TRequestStatus &)
    virtual voidAddAttachmentL(RFile &, const TDesC8 &, TUint, TRequestStatus &)
    virtual voidAddAttributeL(const TDesC &, const TDesC &)
    virtual voidAddEntryAsAttachmentL(TMsvId, TRequestStatus &)
    virtual voidAddLinkedAttachmentL(const TDesC &, const TDesC8 &, TUint, TRequestStatus &)
    virtual voidBioTypeChangedL(TUid)
    CRichText &Body()
    const CRichText &Body()
    virtual voidCancelAttachmentOperation()
    virtual voidChangeDefaultServiceL(const TMsvId &)
    virtual voidCreateAttachment2L(CMsvStore &, RFile &, TDesC8 &, CMsvMimeHeaders &, CMsvAttachment *, TMsvAttachmentId &)
    virtual voidCreateAttachmentL(const TDesC &, RFile &, const TDesC8 &, TUint, TRequestStatus &)
    virtual voidCreateMessageL(TMsvId)
    virtual CMsvOperation *CreateNewEntryL(TMsvId, TRequestStatus &)
    virtual voidCreateServiceL()
    virtual voidCreateTextAttachmentL(CMsvStore &, TMsvAttachmentId &, const TDesC &, const TDesC &, TBool)
    virtual TMsvId DefaultServiceL()
    virtual voidDeleteAttribute(const TDesC &)
    virtual TTime DeliveryDate()
    virtual TInt DeliveryReport()
    virtual TTimeIntervalSeconds DeliveryTimeInterval()
    CMsvEntry &Entry()
    virtual TTime ExpiryDate()
    virtual TTimeIntervalSeconds ExpiryInterval()
    virtual CMsvOperation *FetchAllL(TRequestStatus &, TBool)
    virtual TMsvPartList Find(const TDesC &, TMsvPartList)
    virtual TBool FindAttribute(const TDesC &)
    virtual CMsvOperation *ForwardL(TMsvId, TMsvPartList, TRequestStatus &)
    virtual TPtrC GetAttributeL(const TDesC &)
    virtual voidGetMaximumImage(TInt &, TInt &)
    TBool HasContext()
    virtual CMsvOperation *InvokeAsyncFunctionL(TInt, const CMsvEntrySelection &, TDes8 &, TRequestStatus &)
    virtual voidInvokeSyncFunctionL(TInt, const CMsvEntrySelection &, TDes8 &)
    virtual voidLoadMessageL()
    virtual TInt MessageClass()
    virtual TPtrC8 MessageContentLocation()
    virtual TInt MessagePriority()
    virtual TTime MessageReceiveTime()
    virtual TMsvAttachmentId MessageRootAttachment()
    virtual TInt32 MessageSize()
    virtual TInt MessageTransferSize()
    virtual const CMmsSettings &MmsSettings()
    IMPORT_C CMmsClientMtm *NewL(CRegisteredMtmDll &, CMsvSession &)
    virtual TInt NumberOfPreviousSenders()
    virtual TPtrC PreviousSender(TInt)
    virtual TTime PreviousSendingDate(TInt)
    virtual TInt QueryCapability(TUid, TInt &)
    virtual TInt ReadReply()
    virtual voidRemoveAddressee(TInt)
    virtual voidRemoveDefaultServiceL()
    virtual CMsvOperation *ReplyL(TMsvId, TMsvPartList, TRequestStatus &)
    virtual voidResetAttributes()
    virtual TInt ResponseStatus()
    virtual TPtrC ResponseText()
    virtual voidRestoreFactorySettingsL(TMmsFactorySettingsLevel)
    virtual voidRestoreSettingsL()
    virtual voidSaveMessageL()
    virtual CMsvOperation *SendL(TRequestStatus &, const TTime)
    virtual CMsvOperation *SendL(CMsvEntrySelection &, TRequestStatus &, TTime)
    virtual CMsvOperation *SendReadReportL(TMsvId, TRequestStatus &, TMmsReadStatus)
    virtual const TPtrCSender()
    virtual TInt SenderVisibility()
    virtual TTime SendingDate()
    CMsvSession &Session()
    voidSetCurrentEntryL(CMsvEntry *)
    virtual voidSetDeliveryDate(TTime)
    virtual voidSetDeliveryReport(TMmsYesNo)
    virtual voidSetDeliveryTimeInterval(TTimeIntervalSeconds)
    virtual voidSetExpiryDate(TTime)
    virtual voidSetExpiryInterval(TTimeIntervalSeconds)
    virtual voidSetMaximumImage(TInt, TInt)
    virtual voidSetMessageClass(TMmsMessageClass)
    virtual voidSetMessageDescriptionL(const TDesC &)
    virtual voidSetMessagePriority(TMmsMessagePriority)
    virtual voidSetMessageRootL(const TMsvAttachmentId)
    virtual voidSetReadReply(TMmsYesNo)
    virtual voidSetSenderL(const TDesC &)
    virtual voidSetSenderVisibility(TMmsMessageSenderVisibility)
    virtual voidSetSettingsL(const CMmsSettings &)
    virtual voidSetSubjectL(const TDesC &)
    virtual voidStoreSettingsL()
    virtual const TPtrCSubjectL()
    voidSwitchCurrentEntryL(TMsvId)
    TUid Type()
    virtual TMsvPartList ValidateMessage(TMsvPartList)
    virtual TInt ValidateService(TMsvId)
    Protected Member Functions
    CMmsClientMtm(CRegisteredMtmDll &, CMsvSession &)
    voidConstructL()
    virtual voidContextEntrySwitched()
    voidHandleEntryEventL(TMsvEntryEvent, TAny *, TAny *, TAny *)
    CMsvEntrySelection *ListNotificationsInInboxL()
    Inherited Attributes
    CBaseMtm::iAddresseeList
    CBaseMtm::iCharFormatLayer
    CBaseMtm::iMsvEntry
    CBaseMtm::iParaFormatLayer
    Inherited Functions
    CBase::CBase()
    CBase::Delete(CBase *)
    CBase::operator new(TUint)
    CBase::operator new(TUint,TAny *)
    CBase::operator new(TUint,TLeave)
    CBase::operator new(TUint,TLeave,TUint)
    CBase::operator new(TUint,TUint)
    CBase::~CBase()
    CBaseMtm::AddresseeList()const
    CBaseMtm::CBaseMtm(CRegisteredMtmDll &,CMsvSession &)
    CBaseMtm::Extension_(TUint,TAny *&,TAny *)
    CBaseMtm::Filler1()
    CBaseMtm::Filler2()
    CBaseMtm::GetExtensionData()
    CBaseMtm::GetInterface(TUid)
    CBaseMtm::RestoreBodyL(CMsvStore &)
    CBaseMtm::SetExtensionData(TAny *)
    CBaseMtm::SetMessageCharacterSet(TUint)
    CBaseMtm::StoreBodyL(CMsvStore &)
    CBaseMtm::~CBaseMtm()

    Detailed Description

    Client Mtm for multimedia messaging subsystem.

    This class will be the interface to the UI component and other messaging component that might want to handle multimedia messages (For example SendAs interface).

    This class provides access to MMS specific headers in the message.

    Note: new functions are added as the last virtual functions in order not to to break the vtable

      // Example of getting access to this class:
    
      // Called by an application that implements
      // MMsvSessionObserver interface
    
      iSession = CMsvSession::OpenSyncL(*this);
      CleanupStack::PushL(iSession);
      iClientMtmRegistry = CClientMtmRegistry::NewL(*iSession);
      CleanupStack::PushL(iClientMtmRegistry);
      iMmsClient = (CMmsClientMtm *) iClientMtmRegistry->
                   NewMtmL(KUidMsgTypeMultimedia);
      CleanupStack::PushL(iMmsClient);
    
      // - do other initialization
    
      CleanupStack::Pop(3); //iSession, iClientMtmRegistry, iMmsClient
    
      // - call any public functions in CMmsClientMtm
    
      // When the application finishes,
      // it must delete the objects in reverse order:
      delete iMmsClient;
      delete iClientMtmRegistry;
      delete iSession;

    Member Attribute Documentation

    iAccessPointCount

    TInt iAccessPointCount[protected]

    iAttributes

    CDesCArrayFlat *iAttributes[protected]

    iFetchAll

    TBool iFetchAll[protected]

    iFetchOverride

    TBool iFetchOverride[protected]

    iHomeMode

    TInt32 iHomeMode[protected]

    iMessageDrive

    TInt iMessageDrive[protected]

    iMmsHeaders

    CMmsHeaders *iMmsHeaders[protected]

    iMmsSettings

    CMmsSettings *iMmsSettings[protected]

    iOwnSession

    CMsvSession &iOwnSession[protected]

    iRoamingMode

    TInt32 iRoamingMode[protected]

    iServiceId

    TMsvId iServiceId[protected]

    Constructor & Destructor Documentation

    CMmsClientMtm ( CRegisteredMtmDll &, CMsvSession & )

    CMmsClientMtm(CRegisteredMtmDll &aRegisteredMtmDll,
    CMsvSession &aSession
    )[protected]

    By default Symbian OS constructor is private.

    ParameterDescription
    aRegisteredMtmDllReference to Mtm Dll registry class
    aSessionReference to a Message Server session.

    ~CMmsClientMtm ( )

    ~CMmsClientMtm()[virtual]

    Destructor.

    Member Function Documentation

    AddAddresseeL ( const TDesC & )

    voidAddAddresseeL(const TDesC &aRealAddress)[virtual]

    New recipient list function is not virtual, and the base MTM implementation must always be used. The function is shown here for reference only:

    const CMsvRecipientList& AddresseeList() const; From CBaseMtm: Adds an addressee, cannot distiguish To, Cc, and Bcc.

    New addresses are handled as To type of addresses.

    ParameterDescription
    aRealAddressRecipient address without alias.

    AddAddresseeL ( const TDesC &, const TDesC & )

    voidAddAddresseeL(const TDesC &aRealAddress,
    const TDesC &aAlias
    )[virtual]

    From CBaseMtm: Adds an addressee, cannot distiguish To, Cc, and Bcc.

    New addresses are handled as To type of addresses.

    ParameterDescription
    aRealAddressRecipient address.
    aAliasDescriptive name for the recipient.

    AddAddresseeL ( TMsvRecipientType, const TDesC & )

    voidAddAddresseeL(TMsvRecipientTypeaType,
    const TDesC &aRealAddress
    )[virtual]

    From CBaseMtm: Adds a typed addressee (To, Cc or Bcc).

    ParameterDescription
    aTyperecipient type. Possible values:EMsvRecipientTo: Normal recipient.EMsvRecipientCc: Recipient of a carbon copy.EMsvRecipientBcc: Recipient of a blind carbon copy.
    aRealAddressAddress string without alias.

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

    voidAddAddresseeL(TMsvRecipientTypeaType,
    const TDesC &aRealAddress,
    const TDesC &aAlias
    )[virtual]

    From CBaseMtm: Adds a typed addressee (To, Cc or Bcc).

    ParameterDescription
    aTyperecipient type. Possible values:EMsvRecipientTo: Normal recipient.EMsvRecipientCc: Recipient of a carbon copy.EMsvRecipientBcc: Recipient of a blind carbon copy.
    aRealAddressAddress string without alias.
    aAliasDescriptive name for the recipient.

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

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

    From CBaseMtm: Add a file attachment to the current message entry.

    The attachment is referenced by its file path and is copied into the message store. This function needs an edit store for the current entry. The caller should not keep the store open. The store is committed and closed after each attachment operation. Only one asynchronous operation can be running at any one time.

    If the file is a plain text file with ucs-2 character set MMS Engine will convert the character set to utf-8 and create a text attachment using this character set. The original file is not affected. This must be done because MMS text attachments should be sent using utf-8 character set.

    leave
    System-wide error codes.
     TFileName attachmentFile( _L("c:\\pictures\\picture123.jpg") );
     TBufC8<20> mimeType = _L8( "image/jpeg" );
     TUint charset = 0; // no character set needed for images
    
     CMsvOperationActiveSchedulerWait* wait = 
         CMsvOperationActiveSchedulerWait::NewLC();
    
     iMmsClient->AddAttachmentL(
         attachmentFile,
         mimeType,
         charset,
         wait->iStatus);
    
     wait->Start();
    
     if ( wait->iStatus.Int() != KErrNone )
         { 
         // error handling, e.g. leave
         }
    
     CleanupStack::PopAndDestroy(); // wait
    
     // The attachment has been added, store has been committed, and attachment data
     // has been copied to the message store.
     // If the original file is now modified, it does not affect the attachment file 
     // in the message store any more.
    ParameterDescription
    aFilePathFull path specification of the attachment file.
    aMimeTypeMime type of the attachment file.
    aCharsetIANA MIBEnum of the character set of the attachment. If character set is not relevant for current attachment type, aCharset should be 0.
    aStatusThe request status to complete.

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

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

    From CBaseMtm: Add a file attachment to the current message entry.

    The attachment is referenced by an open file handle and is copied into the message store. This function needs an edit store for the current entry. The caller should not keep the store open. The store is committed and closed after each attachment operation.

    If the file is a plain text file with ucs-2 character set MMS Engine will convert the character set to utf-8 and create a text attachment using this character set. The original file is not affected. This must be done because MMS text attachments should be sent using utf-8 character set.

    Only one asynchronous operation can be running at any one time.
    leave
    System-wide error codes.
    The function closes the file handle when done. The caller must not attempt to close the file handle afterwards.
     TFileName attachmentFile( _L("c:\\private\\privatedir\\picture123.jpg") );
     RFile fileHandle;
     TBufC8<20> mimeType = _L8( "image/jpeg" );
     TUint charset = 0; // no character set needed for images
    
     fileHandle.Open( iFs, attachmentFile, EFileShareReadersOnly | EFileRead );
     CleanupClosePush(fileHandle);
    
     CMsvOperationActiveSchedulerWait* wait = 
         CMsvOperationActiveSchedulerWait::NewLC();
    
     iMmsClient->AddAttachmentL(
         fileHandle,
         mimeType,
         charset,
         wait->iStatus);
    
     wait->Start();
    
     if ( wait->iStatus.Int() != KErrNone )
         { 
         // error handling, e.g. leave
         }
    
     CleanupStack::PopAndDestroy(); // wait
     CleanupStack::Pop(); // file handle was closed if function did not leave
    ParameterDescription
    aFileAn open file handle for the file attachment. The handle is closed when the function completes.
    aMimeTypeMime type of the attachment file.
    aCharsetIANA MIBEnum of the character set of the attachment. If character set is not relevant for current attachment type, aCharset should be 0.
    aStatusThe request status to complete.

    AddAttributeL ( const TDesC &, const TDesC & )

    voidAddAttributeL(const TDesC &aName,
    const TDesC &aValue
    )[virtual]

    Add attribute to an attribute array (for the use of MMS UI only).

    No duplicates are allowed. If an attribute exists, its value is changed. The attributes and their values can be arbitrary strings. There are no restrictions. The purpose is to allow the UI to store some extra information with the message. The values of the attibutes are not included when the message is sent.
    leave
    KErrArgument if length of aName or aValue is 0.
    leave
    KErrNoMemory if memory runs out while adding the attribute.
    ParameterDescription
    aNameName of the attribute (case sensitive).
    aValueValue of the attribute.

    AddEntryAsAttachmentL ( TMsvId, TRequestStatus & )

    voidAddEntryAsAttachmentL(TMsvIdaAttachmentId,
    TRequestStatus &aStatus
    )[virtual]

    From CBaseMtm: Add a message entry as an attachment to the current message entry.

    Not supported. No Message attachments allowed in MMS.
    leave
    KErrNotSupported

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

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

    From CBaseMtm: Add a file attachment to the current message entry as a linked file.

    The attachment is referenced by its file path and is not copied into the message store. The attachment file is always used from its original location on disk indicated by the aFilePath parameter.

    This function needs an edit store for the current entry. The caller should not keep the store open. The store is committed and closed after each attachment operation. Only one asynchronous operation can be running at any one time.

    The file must be in some public directory so that MMS Engine can access the file when it is actually sent. If the file is a plain text attachment the character set cannot be converted to utf-8 as the original file cannot be changed. Text files should not be sent as linked attachmets unless the character set of the file is utf-8.

    leave
    System-wide error codes.
    ParameterDescription
    aFilePathFull path specification of the attachment file.
    aMimeTypeMime type of the attachment file.
    aCharsetIANA MIBEnum of the character set of the attachment. If character set is not relevant for current attachment type, aCharset should be 0.
    aStatusThe request status to complete.

    BioTypeChangedL ( TUid )

    voidBioTypeChangedL(TUidaBioTypeUid)[virtual]

    From CBaseMtm: Inform Client MTM about bio type change.

    This function does nothing.

    Body ( )

    CRichText &Body()[inline]

    Reimplemented from CBaseMtm::Body()

    From CBaseMtm: Get rich text body of the message.

    MMS does not support separate message body. Body is ignored. All MMS message parts are attachments.

    Returns: Rich text body from CBaseMtm.

    Body ( )

    const CRichText &Body()const [inline]

    Reimplemented from CBaseMtm::Body()const

    From CBaseMtm: Get rich text body.

    MMS does not support separate message body. Body is ignored. All MMS message parts are attachments.

    Returns: Rich text body from CBaseMtm.

    CancelAttachmentOperation ( )

    voidCancelAttachmentOperation()[virtual]

    From CBaseMtm: Cancel the current attachment operation.

    ChangeDefaultServiceL ( const TMsvId & )

    voidChangeDefaultServiceL(const TMsvId &aService)[virtual]

    From CBaseMtm: Change default service.

    Does nothing. Changing of default service not supported.

    ConstructL ( )

    voidConstructL()[protected]

    ContextEntrySwitched ( )

    voidContextEntrySwitched()[protected, virtual]

    From CBaseMtm: Called after the context of this instance has been changed to another entry.

    CreateAttachment2L ( CMsvStore &, RFile &, TDesC8 &, CMsvMimeHeaders &, CMsvAttachment *, TMsvAttachmentId & )

    voidCreateAttachment2L(CMsvStore &aStore,
    RFile &aFile,
    TDesC8 &aMimeType,
    CMsvMimeHeaders &aMimeHeaders,
    CMsvAttachment *aAttachmentInfo,
    TMsvAttachmentId &aAttaId
    )[virtual]

    Create attachment entry and copy specified file to message store.

    The user should call SaveMessageL after having added all attachments to update TMsvEntry of the message entry.

    Pre-condition
    A message entry must exist. It may be a new entry or an old entry to be edited.
    CMsvMimeHeaders structure must have been filled in advantage. The following values should be set:
    • Content type, for example image

    • Content subtype, for example jpeg

    • Character set IANA MIBEnum value, for example 106 (utf-8). Should be defined only if the content type is text.

    • Content-id if the presentation part refers to the attachments by content-ids.

    • Suggested filename (name only, no path), the name that should be used to store the attachment and used as suggested filename when sending the message. If the suggested filename is not set, the name of the attachment file will be used.

    • Content-location if the presentation part refers to the attachments by using content-location. The content-location string must contain only us-ascii characters.

    • X-type parameters (if needed). These are always handled as pairs of a parameter name and parameter value. A descriptor at an even idex in the array (0, 2, 4, ...) represents the parameter name and a descriptor at an odd index (1, 3, 5, ...) represents the parameter value. If a parameter has no value, it must be indicated by an empty descriptor. The X-type parameter array must always contain an even number of elements.

     // The following code shows a short example of how the attachement
     // creation proceeds.
    
     // Assume that the client entry is set to the message entry.
     // Attachments are added to the message entry one by one
     CMsvStore* store = iMmsClient->Entry().EditStoreL();
     CleanupStack::PushL(store);
    
     CMsvAttachment* attaInfo = NULL;
     TMsvAttachmentId attaId = 0;
    
     RFile attaFile;
     // Set filename of attachment
     TFileName name( _L("C:\\pictures\\picture123.jpg") );
    
     CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewL();
     CleanupStack::PushL( mimeHeaders );
    
     // Set values to mime headers
     mimeHeaders->SetContentTypeL( _L8( "image") );
     mimeHeaders->SetContentSubTypeL( _L8( "jpeg" ) );
    
     _LIT8(KMimeType, "image/jpeg");
     // CreateAttachment2L will set the content type to attachment Info
    
     // Open the attachment file for reading
     attaFile.Open( iFs, name, EFileShareReadersOnly | EFileRead );
     CleanupClosePushL(attaFile);
    
     attaInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
     // attaInfo ownerhip will be transferred to Attachment Manager.
     // It must not be pushed onto the cleanupStack before calling 
     // CreateAttachment2L.
    
     TMsvAttachmentId attaId = 0;
    
     iMmsClient->CreateAttachment2L(
         *store,   // edit store
         attaFile, // open file handle
         KMimeType, // combination type like image/jpeg
         *mimeHeaders,
         attaInfo,
         attaId);
     // Now Attachment Manager owns the attaInfo
     attaInfo = NULL;
    
     CleanupStack::PopAndDestroy(); // attaFile.Close()
     CleanupStack::PopAndDestroy(); // mimeHeaders
    
     // Several attachments can be added before committing the store
    
     // Store must be committed before it is destroyed
     store->CommitL();
     CleanupStack::PopAndDestroy(); // store
    ParameterDescription
    aStoreAn open edit store for the message entry. Caller must commit and close the store when ready. (Several attachments can be added before committing the store.)
    aFileOpen file handle, source of the attachment. Caller must close the file afterwards.
    aMimeTypeMime type (content type) of the attachmet in format type/subtype, for example image/jpeg.
    aMimeHeadersMime headers for the attachment. If the content type is not defined in aMimeHeaders, the function adds the mime type and subtype from aMimeType. Suggested filename in aMimeHeaders is used as attachment name.
    aAttachmentInfoAttachment into structure, must be initialized to CMsvAttachment::EMsvFile. If mime type is added into the attachment info, it must be of format type/subtype, for example image/jpeg. On return AttachmentInfo contains data about the attachment. Ownership of attachmentinfo is transferred to attachment manager, it must not be deleted by caller. It must not be put on cleanup stack either. MMS engine keeps it safe until the ownership has been transferred.
    aAttaIdAttachment id of the newly created attachment.

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

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

    From CBaseMtm: Create an attachment and return an open file handle for it.

    This function needs an edit store for the current entry. The caller should not keep the store open. The store is committed and closed after each attachment operation. Only one asynchronous operation can be running at any one time.

    leave
    System-wide error codes.
     TFileName attachmentFile( _L("picture123.jpg") );
     RFile fileHandle;
     TBufC8<20> mimeType = _L8( "image/jpeg" );
     TUint charset = 0; // no character set needed for images
    
     CMsvOperationActiveSchedulerWait* wait = 
         CMsvOperationActiveSchedulerWait::NewLC();
    
     iMmsClient->CreateAttachmentL(
         attachmentFile,
         fileHandle,
         mimeType,
         charset,
         wait->iStatus);
    
     wait->Start();
    
     // When the function returns, the store has been committed
    
     // The attachment file handle is now open for writing the attachment data
     CleanupClosePush(fileHandle);
    
     if ( wait->iStatus.Int() != KErrNone )
         { 
         // error handling, e.g. leave
         }
    
     // write file content to open handle
     // ... 
    
     CleanupStack::PopAndDestroy(); // close file handle
     CleanupStack::PopAndDestroy(); // wait
    ParameterDescription
    aFileNameSuggested filename.
    aAttachmentFileAn open file handle for read/write attachment file. The caller must close the handle.
    aMimeTypeMime type of the attachment file.
    aCharsetIANA MIBEnum of the character set of the attachment. If character set is not relevant for current attachment type, aCharset should be 0.
    aStatusThe request status to complete.

    CreateMessageL ( TMsvId )

    voidCreateMessageL(TMsvIdaServiceId)[virtual]

    From CBaseMtm: Create an empty entry as the child of the current context.

    Sets the new entry as current context. The entry will be invisible and under construction.

     // Context must be set to parent folder for CreateMessageL
     // This example creates the message to drafts folder
    
     TMsvId serviceId = iMmsClient->DefaultServiceL();
     iMmsClient->SwitchCurrentEntryL( KMsvDraftEntryId );
     iMmsClient->CreateMessageL( serviceId );
    
     // The message entry is invisible and in "In Preparation" state.
     // The context of CMmsClientMtm has now been switched to the new message entry.
     // The message entry is still completely empty.
     // Continue by adding data to the message
     // ...
    ParameterDescription
    aServiceIdService id for the new entry.

    CreateNewEntryL ( TMsvId, TRequestStatus & )

    CMsvOperation *CreateNewEntryL(TMsvIdaDestination,
    TRequestStatus &aCompletionStatus
    )[virtual]

    Create a new message entry.

    This function is suitable when the caller is an active object or the caller does not want to immediately change current context to the new message entry.

    If the caller is not an active object and the caller wants the context of CMmsClientMtm to be immediately set to the new entry, it is simpler to call CreateMessageL.

    See also: CMmsClientMtm::CreateMessageL

     // This example shows usage with a caller that is not an active object,
     // so a separate waiter is needed. If the caller is an active object,
     // the caller gives its own status to the function and continues 
     // execution in RunL function.
    
     CMsvOperation* myOperation = NULL;
     CMsvOperationActiveSchedulerWait* wait = 
         CMsvOperationActiveSchedulerWait::NewLC();
    
     // destinationId specifies the destination folder.
     myOperation = iMmsClient->CreateNewEntryL( destinationId, wait->iStatus );
    
     CleanupStack::PushL( myOperation );
    
     wait->Start();
    
     if ( wait->iStatus.Int() != KErrNone )
         { 
         // error handling, e.g. leave
         }
    
     // Get the message id
     TPckgBuf<TMsvId> pkg;
     pkg.Copy( myOperation->ProgressL() );
     TMsvId progress = pkg();
     CleanupStack::PopAndDestroy(2); // myOperation, wait;
    
     // Load the new message
     iMmsClient->SwitchCurrentEntryL( progress );
    
     // load the default values that were already intialized
     // when the message was created 
     iMmsClient->LoadMessageL();
     
     // continue adding data to the message
     // ...
    ParameterDescription
    aDestinationTarget folder.
    aCompletionStatusReference to the status of an active object. This status will contain the relevant error code when the operation completes.

    Returns: Pointer to a message server operation (active object). When the message has been created the progress information of the operation provides the id of the created message in an 8-bit package buffer. While the operation is in progress the package will contain a null id (KMsvNullIndexEntryId). If there is an error while creating the message the message will be deleted and the package will contain a null id.

    CreateServiceL ( )

    voidCreateServiceL()[virtual]

    Create new service entry.

    Context is set to the new service entry. Currently a maximum of one service is created, and further requests do not create a new service entry. DeprecatedOnly one MMS service is supported and it is automatically created. Use DefaultServiceL() to get the id for the default service.

    CreateTextAttachmentL ( CMsvStore &, TMsvAttachmentId &, const TDesC &, const TDesC &, TBool )

    voidCreateTextAttachmentL(CMsvStore &aStore,
    TMsvAttachmentId &aAttachmentId,
    const TDesC &aText,
    const TDesC &aFile,
    TBoolaConvertParagraphSeparator = ETrue
    )[virtual]

    Create a text/plain attachment.

    Creates a text attachment from text in a descriptor. Has option to convert all unicode paragraph separator marks to line feeds. Converts text from unicode (ucs-2) to utf-8 before storing it.

    Pre-condition
    A message entry must exist. It may be a new entry or an old entry to be edited.
     TFileName attachmentFile( _L("story.txt") );
    
     CMsvStore* store = iMmsClient->Entry().EditStoreL();
     CleanupStack::PushL(store);
     TMsvAttachmentId attaId = 0;
    
     TBufC<12> story = _L( "Hello world!" );
    
     iMmsClient->CreateTextAttachmentL(
         *store,
         attaId,
         story,
         attachmentFile,
         ETrue )
    
     // When the call returns the id of the attachment will be strored in attaId
    
     // caller must commit the store as several attachments could be added berore
     // committing the store.
     store->CommitL();
     CleanupStack::PopAndDestroy(); // store
    ParameterDescription
    aStoreAn open edit store. Caller must commit and close the store (several attachments can be added before committing store).
    aAttachmentIdAttachment id of the new attachment entry.
    aTextUnicode text to be added as a text/plain attachment.
    aFileSuggested filename for the attachment.
    aConvertParagraphSeparatorFlag that tells the function to search for all 0x2029 characters (Unicode paragraph separator) and to replace them with 0x000d 0x000a (carriage return, line feed). Possible values:ETrue: Convert paragraph separators (default).EFalse: Do not convert paragraph separators.

    DefaultServiceL ( )

    TMsvId DefaultServiceL()const [virtual]

    From CBaseMtm: Return id of default service for this MTM type.

    Only one MMS service is supported.

    Returns: default service id.

    DeleteAttribute ( const TDesC & )

    voidDeleteAttribute(const TDesC &aName)[virtual]

    Delete named attribute from list (for the use of MMS UI only).

    ParameterDescription
    aNameName of the attribute (case sensitive).

    DeliveryDate ( )

    TTime DeliveryDate()const [virtual]

    Get the delivery date of the message.

    Returns: The date and time when the message will be (or was) delivered to the recipient by the MMSC (in UTC time). If the delivery date has not been defined, TTime(0) is returned.

    DeliveryReport ( )

    TInt DeliveryReport()const [virtual]

    Get the delivery report request setting of the message.

    If the value is not defined, default value from MMS settings is used.

    Returns: delivery report request setting. Possible values:EMmsYes: The user wants a delivery report.EMmsNo: The user does not want a delivery report.0: Setting has not been defined.

    DeliveryTimeInterval ( )

    TTimeIntervalSeconds DeliveryTimeInterval()const [virtual]

    Get the delivery time interval of the message.

    Returns: The length of time in seconds after which the message will be delivered to the recipient by MMS Service Centre. If the delivery time interval is 0, it has not been defined.

    Entry ( )

    CMsvEntry &Entry()const [inline]

    Reimplemented from CBaseMtm::Entry()const

    From CBaseMtm: Get reference to current entry.

    Returns: Reference to entry instance.

    ExpiryDate ( )

    TTime ExpiryDate()const [virtual]

    Get the expiration date of the message.

    Returns: The date and time when the message will expire. (in UTC time). If the expiration date has not been defined, TTime(0) will be returned.

    ExpiryInterval ( )

    TTimeIntervalSeconds ExpiryInterval()const [virtual]

    Get the validity period of the message.

    Returns: Storage time of the message in MMS Service Centre (in seconds). If the message cannot be delivered to the recipient within the validity period, it will be discarded. If the validity period is 0, it has not been defined.

    FetchAllL ( TRequestStatus &, TBool )

    CMsvOperation *FetchAllL(TRequestStatus &aCompletionStatus,
    TBoolaForced = ETrue
    )[virtual]

    Fetch pending MMS messages from MMS Service Centre to inbox.

    If there are notifications in postponed state they are all fetched. If there are notification in inbox, they are not touched.

    leave
    KErrNoMemory or other Symbian error code. If the function leaves the owner of aCompletionStatus must not be set active because there will be no pending request.
    DeprecatedPostponed fetching mode is no longer supported by UI. In most cases this function would not have any effect.
    ParameterDescription
    aCompletionStatusiStatus member of an active object. It will be set as completed when the operating system has relayed the request to the server side of Symbian Messaging System.
    aForcedindicates if the messages should be fetched regardless of current mode settings.ETrue: User initiated fetch, use override.EFalse: Event triggered fetch, fetch only if settings allow.

    Returns: Pointer to an operation active object. The operation will complete when the retrieving has been successfully scheduled. The actual retrieving will happen in the background. If scheduling the fetch fails, the status of CMsvOperation will contain the relevant error code. The operation object must not be deleted before it completes.

    Find ( const TDesC &, TMsvPartList )

    TMsvPartList Find(const TDesC &aTextToFind,
    TMsvPartListaPartList
    )[virtual]

    From CBaseMtm: Searches for specified text in selected parts of current message.

    ParameterDescription
    aTextToFindText to search for.
    aPartListFlags specifying which parts to search. (defined in MTMDEF.H). Possible values:KMsvMessagePartPartBody: Ignored.KMsvMessagePartRecipient: Supported.KMsvMessagePartOriginator: Supported.KMsvMessagePartDescription: Supported.KMsvMessagePartDate: Ignored.KMsvMessagePartAttachments: Ignored.

    Returns: TMsvPartList bitmask specifies in which of the specified parts the text was found.

    FindAttribute ( const TDesC & )

    TBool FindAttribute(const TDesC &aName)[virtual]

    Check if attribute is present (for the use of MMS UI only).

    ParameterDescription
    aNameName of the attribute (case sensitive).

    Returns: ETrue if the attribute is found, EFalse otherwise.

    ForwardL ( TMsvId, TMsvPartList, TRequestStatus & )

    CMsvOperation *ForwardL(TMsvIdaDestination,
    TMsvPartListaPartList,
    TRequestStatus &aCompletionStatus
    )[virtual]

    From CBaseMtm: Forward current message to new recipient.

    ParameterDescription
    aDestinationId of the folder where the new message is generated.
    aPartListFlags specifying which standard message parts are to be included in the response. Possible values:KMsvMessagePartPartBody: Ignored.KMsvMessagePartRecipient: Ignored.KMsvMessagePartOriginator: Ignored.KMsvMessagePartDescription: Subject field is copied.KMsvMessagePartDate: Ignored.KMsvMessagePartAttachments: Ignored. Attachments are always automatically included when forwarding a message.
    aCompletionStatusStatus of an active object. This status will be set as completed when the operation completes.

    Returns: Pointer to an operation active object. The progress information provides the id of the created message when the operation is complete. If there was an error while creating the message, then the message will be deleted and the result will contain a null id. The operation object must not be deleted before it completes.

    GetAttributeL ( const TDesC & )

    TPtrC GetAttributeL(const TDesC &aName)[virtual]

    Get value of an attribute (for the use of MMS UI only).

    leave
    KErrNotFound if attribute not found or the length of aName is 0.
    ParameterDescription
    aNameName of the attribute (case sensitive).

    Returns: Value of the attribute.

    GetMaximumImage ( TInt &, TInt & )

    voidGetMaximumImage(TInt &aWidth,
    TInt &aHeight
    )const [virtual]

    Get the maximum size of the images that can be inserted in the message.

    The returned values are 0 if the maximum values have not been defined.

    ParameterDescription
    aWidthimage width in pixels
    aHeightimage height in pixels

    HandleEntryEventL ( TMsvEntryEvent, TAny *, TAny *, TAny * )

    voidHandleEntryEventL(TMsvEntryEventaEvent,
    TAny *arg1,
    TAny *arg2,
    TAny *arg3
    )[protected]

    From CBaseMtm: React to changes

    ParameterDescription
    aEventCode that tells which event has occurred. Event codes defined in MSVAPI.H
    arg1Depends on Event
    arg2Depends on Event
    arg3Depends on Event

    HasContext ( )

    TBool HasContext()const [inline]

    Reimplemented from CBaseMtm::HasContext()const

    From CBaseMtm: Query if entry context has been set.

    Returns: Status, possible values:ETrue: Context has been set.EFalse: Context has not been set.

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

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

    From CBaseMtm: Pass an asychronous request to Server MTM.

    Pass a function code to Server MTM. The operation will run in the background. This function can be used to invoke asynchronous protocol-specific operations. The supported functions are private and this function should be called by MMS UI only.

    ParameterDescription
    aFunctionIdEnumeration constant defining the operation.
    aSelectionArray of message entry ids to be uperated on.
    aParameterA descriptor that contains any parameters required by function specified by aFunctionId.
    aCompletionStatusStatus of an active object. This status will be set as completed when the operation completes

    Returns: Pointer to a message server operation (active object).

    InvokeSyncFunctionL ( TInt, const CMsvEntrySelection &, TDes8 & )

    voidInvokeSyncFunctionL(TIntaFunctionId,
    const CMsvEntrySelection &aSelection,
    TDes8 &aParameter
    )[virtual]

    From CBaseMtm: Pass a request to MMS Server MTM.

    Pass a function code to Server MTM, wait until the function returns. This function can be used to invoke synchronous protocol-specific operations. The supported functions are private and this function should be called by MMS UI only.

    ParameterDescription
    aFunctionIdEnumeration constant defining the operation.
    aSelectionArray of message entry ids to be operated on.
    aParameterA descriptor that contains any parameters required by function specified by aFunctionId.

    ListNotificationsInInboxL ( )

    CMsvEntrySelection *ListNotificationsInInboxL()[protected]
    Lists all visible and free MMS Notifications from inbox.
    Since
    2.8

    Returns: selection of Notifications in inbox.

    LoadMessageL ( )

    voidLoadMessageL()[virtual]

    Reimplemented from CBaseMtm::LoadMessageL()

    From CBaseMtm: Restore current entry data.

    MessageClass ( )

    TInt MessageClass()const [virtual]

    Get the message class.

    Returns: Message class. Possible values:EMmsClassPersonal: Message is a normal person-to-person message (default).EMmsClassAdvertisement: Message contains an advertisement.EMmsClassInformational: Message contains data from an information service.EMmsClassAuto: Message has been automatically generated by the phone. This class is only valid for a message that is a read report to another message.0: Message class has not been defined. Handle as EMmsClassPersonal.

    MessageContentLocation ( )

    TPtrC8 MessageContentLocation()const [virtual]

    Get the Uri from which the message can be fetched.

    This is valid only for a nofification.

    Returns: Content location of the actual message, the Uri from which the message is fetched from MMS Service Centre.

    MessagePriority ( )

    TInt MessagePriority()const [virtual]

    Get the priority of the message.

    Returns: Message priority, possible values:EMmsPriorityLow: Low priority.EMmsPriorityNormal: Normal priority.EMmsPriorityHigh: High priority.0: Priority has not been defined, treat as EMmsPriorityNormal

    MessageReceiveTime ( )

    TTime MessageReceiveTime()const [virtual]

    Get the time when the message was received in the terminal.

    Since
    3.0

    Returns: Time of the arrival of the message (in UTC time). If the time has not been defined, TTime(0) is returned.

    MessageRootAttachment ( )

    TMsvAttachmentId MessageRootAttachment()const [virtual]

    Get the id of the root part of the message.

    Returns: Id of the attachment that starts the message display, KMsvNullIndexEntryId if the root part has not been defined.

    MessageSize ( )

    TInt32 MessageSize()[virtual]

    Get the message size.

    SaveMessageL and LoadMessageL updates the value. This function returns the total amount of disk space the message takes. The actual message size in transmission is smaller due to binary encoding of the headers.

    Returns: size of all message parts in bytes including both attachments and internal header structures.

    MessageTransferSize ( )

    TInt MessageTransferSize()const [virtual]

    Get the incoming message size.

    This is valid only for a notification.

    Returns: Message size in octets as specified in MMS Notification.

    MmsSettings ( )

    const CMmsSettings &MmsSettings()[virtual]

    Get a reference to CMmsSettings class.

    This method should be used by MMS UI only. Other applications should not touch the MMS settings. The methods are needed in MMS Client API to allow MMS UI to inform MMS Client MTM about changed settings.

    The contents of the class are those used by MMS Client MTM when constructing a message. If the settings must be changed, a copy must be made, and SetSettingsL function used to deliver the settings to MMS Client MTM.

     // Usage:
     
     CMmsSettings* settings = CMmsSettings::NewL();
     CleanupStack::PushL( settings );
     iMmsClient->RestoreSettingsL();
     settings->CopyL( iMmsClient->MmsSettings() );
     
     // change settings here...
     // The settings are changed using CMmsSettings API
     
     iMmsClient->SetSettingsL( *settings );
     iMmsClient->StoreSettingsL();
     CleanupStack::PopAndDestroy(); // settings

    Returns: constant reference to iMmsSettings member of CMmsClientMtm.

    NewL ( CRegisteredMtmDll &, CMsvSession & )

    IMPORT_C CMmsClientMtm *NewL(CRegisteredMtmDll &aRegisteredMtmDll,
    CMsvSession &aSession
    )[static]

    Factory function.

    The only function exported by this polymorphic interface dll. This function is not directly called by the application that needs access, it is called by an instance of CClientMtmRegistry class.

    ParameterDescription
    aRegisteredMtmDllMtm Dll registry class
    aSessionMessage Server session.

    Returns: Pointer to CMmsClientMtm class.

    NumberOfPreviousSenders ( )

    TInt NumberOfPreviousSenders()const [virtual]

    Get number of times the message has been forwarded.

    Returns the number of previous senders in case of a message that has been forwarded from one terminal to another based on the MMS notification only without retrieving the actual message to the terminal first.

    Since
    3.0

    Returns: Number of times the message has been forwarded.

    PreviousSender ( TInt )

    TPtrC PreviousSender(TIntaSequenceNumber)const [virtual]

    Get the address of a previous sender.

    The addresses of the previous senders are defined for messages that have been forwarded without fetching them to the terminal first.

    Since
    3.0
    ParameterDescription
    aSequenceNumberIndicates the number of the sender in the sequence. 1 is the first sender, a higher number indicates a later sender.

    Returns: Address of the specified previous sender. If the sequence number exceeds the number of senders or is less than 1, an empty string is returned.

    PreviousSendingDate ( TInt )

    TTime PreviousSendingDate(TIntaSequenceNumber)const [virtual]

    Get the time when the message was previously sent (in UTC time).

    The function is valid only for messages that have been forwarded without fetching them to the terminal first.

    Since
    3.0
    ParameterDescription
    aSequenceNumberIndicates the number of the sender in the sequence. 1 is the first sender, a higher number indicates a later sender.

    Returns: Time of the previous sending (in UTC time). If the sequence number exceeds the number of senders or is less than 1, TTime(0) is returned.

    QueryCapability ( TUid, TInt & )

    TInt QueryCapability(TUidaCapability,
    TInt &aResponse
    )[virtual]

    From CBaseMtm: Query capabilities of MTM.

    ParameterDescription
    aCapabilityUID specifying which capablity is queried. For the possible Capability UIDs and types of return values see mtmuids.h
    aResponseThe value describing the capability at return.

    Returns: error code, Possible values:KErrNone: Specified capability is supported and aResponse contains the value of the capability if available.KErrNotSupported: Capability is not supported.

    ReadReply ( )

    TInt ReadReply()const [virtual]

    Get the read report request setting of the message.

    Specifies if the sender wants a read report for current message. If this value is yes and the message has been received by the phone (has "KMmsMessageMobileTerminated" flag) a read report should be sent to the sender of this message when the message is opened for the first time.

    Returns: read report request setting. Possible values:EMmsYes: The user wants a read report.EMmsNo: The user does not want a read report.0: Setting has not been defined. Do not send a read report.

    RemoveAddressee ( TInt )

    voidRemoveAddressee(TIntaIndex)[virtual]

    From CBaseMtm: Removes an entry from addressee list.

    Cannot distinguish To, Cc and Bcc.

    ParameterDescription
    aIndexIndex to the array of addresses from AddresseeList() function.

    RemoveDefaultServiceL ( )

    voidRemoveDefaultServiceL()[virtual]

    From CBaseMtm: Remove default service.

    Does nothing. Deletion of service not supported.

    ReplyL ( TMsvId, TMsvPartList, TRequestStatus & )

    CMsvOperation *ReplyL(TMsvIdaDestination,
    TMsvPartListaPartlist,
    TRequestStatus &aCompletionStatus
    )[virtual]

    From CBaseMtm: Send a reply to current message.

    ParameterDescription
    aDestinationId of the folder where the reply is generated.
    aPartlistFlags specifying which standard message parts are to be included in the response (defined in MTMDEF.H). Following values are possible:KMsvMessagePartPartBody: Ignored.KMsvMessagePartRecipient: Causes reply-to-all. Otherwise reply-to-sender only.KMsvMessagePartOriginator: Ignored.KMsvMessagePartDescription: Subject field is copied.KMsvMessagePartDate: Ignored.KMsvMessagePartAttachments: Ignored. Attachments are never copied to a reply.
    aCompletionStatusStatus of an active object. This status will be set as completed when the operation completes.

    Returns: Pointer to an operation active object. The progress information provides the id of the created message when the operation is complete. If there was an error while creating the message, then the message will be deleted and the result will contain a null id. The operation object must not be deleted before it completes.

    ResetAttributes ( )

    voidResetAttributes()[virtual]

    Reset all attributes (for the use of MMS UI only).

    Removes all attributes (names and values) from the message.

    ResponseStatus ( )

    TInt ResponseStatus()const [virtual]

    Get the response status value from the message.

    This function returns the status MMS Service Centre has sent with a retrieved message or as a response to a failure to send a message. The status code may be used in case of permanent failures to retrieve or failures to send to indicate the reason of the failure.

    Since
    3.0

    Returns: Status code sent by MMS Service Centre. Possible values are defined in OMA MMS Encapsulations specifications, and depend on the version of the MMS Service Centre sending the response.Error codes 128 - 136 denote legacy errors from MMS encapsulation version 1.0Error codes 192 - 223 denote transient failures.Error codes 224 - 255 denote permanent failures.0 means the response status has not been set. Either the operation was successful or the cause of the failure was not set by MMS Service Centre.

    ResponseText ( )

    TPtrC ResponseText()const [virtual]

    Get the response text from the message.

    Valid only in cases a response text has been obtained from MMS Service Centre. Possible cases are received messages and messages whose senging has failed. The text may explain the cause of the failure.

    Since
    2.0

    Returns: Response text string. If text is not defined, returns an empty string.

    RestoreFactorySettingsL ( TMmsFactorySettingsLevel )

    voidRestoreFactorySettingsL(TMmsFactorySettingsLevelaLevel = EMmsFactorySettingsLevelNormal)[virtual]

    Restore factory settings.

    Restore settings from ROM to the default service entry and select it as the current service entry. DeprecatedMMS UI should restore the factory settings directly.

    ParameterDescription
    aLevelDefines the operations to be done.

    RestoreSettingsL ( )

    voidRestoreSettingsL()[virtual]

    Load settings from disk.

    This method should be used by MMS UI only. Other applications should not touch the MMS settings.

    SaveMessageL ( )

    voidSaveMessageL()[virtual]

    Reimplemented from CBaseMtm::SaveMessageL()

    From CBaseMtm: Store current entry data.

    SendL ( TRequestStatus &, const TTime )

    CMsvOperation *SendL(TRequestStatus &aCompletionStatus,
    const TTimeaSendingTime =  TTime(0)
    )[virtual]

    Send current message in the background.

    The message is automatically moved to Outbox folder before the sending starts.

    leave
    KErrNoMemory or other Symbian error code. If the function leaves the owner of aCompletionStatus must not be set active because there will be no pending request.
    ParameterDescription
    aCompletionStatusiStatus member of an active object. It will be set as completed when the operating system has relayed the request to the server side of Symbian Messaging System.
    aSendingTimeTime at which the message is to be sent given as UTC time. If aSending time is zero or in the past, the message is scheduled to be sent as soon as possible.

    Returns: Pointer to an operation active object. The operation will complete when the sending has been successfully scheduled. The actual sending will happen in the background. If scheduling the send fails, the status of CMsvOperation will contain the relevant error code. The operation object must not be deleted before it completes.

    SendL ( CMsvEntrySelection &, TRequestStatus &, TTime )

    CMsvOperation *SendL(CMsvEntrySelection &aSelection,
    TRequestStatus &aCompletionStatus,
    TTimeaSendingTime =  TTime(0)
    )[virtual]

    Send a selection of messages in the background.

    The messages are moved to Outbox folder before the sending starts. All messages must be in the same place originally (all in drafts, or all in outbox, for example).

    leave
    KErrNotFound if aSelection is empty, or other Symbian error code. If the function leaves the owner of aCompletionStatus must not be set active because there will be no pending request.
    ParameterDescription
    aSelectionList of messages to be sent.
    aCompletionStatusiStatus member of an active object. It will be set as completed when the operating system has relayed the request to the server side of Symbian Messaging System.
    aSendingTimeTime at which the message selection is to be sent given as UTC time. If aSending time is zero or in the past, the message is scheduled to be sent as soon as possible.

    Returns: Pointer to an operation active object. The operation will complete when the sending has been successfully scheduled. The actual sending will happen in the background. If scheduling the send fails, the status of CMsvOperation will contain the relevant error code. The operation object must not be deleted before it completes.

    SendReadReportL ( TMsvId, TRequestStatus &, TMmsReadStatus )

    CMsvOperation *SendReadReportL(TMsvIdaReadMessageId,
    TRequestStatus &aCompletionStatus,
    TMmsReadStatusaReadStatus = EMmsReadStatusRead
    )[virtual]

    Send a read report to the sender of a message.

    This function should be called when a new message is opened and the sender of the message has specified that he wants a read report for the message in question. This function should not be called if the settings indicate that sending read reports is not allowed.

    leave
    KErrLocked if the message entry cannot be accessed.
    ParameterDescription
    aReadMessageIdId of the message for which a read report should be sent. The message must not be locked and the caller should not have CMsvStore open for the message as MMS Client Mtm must be able to read header fields from the original message.
    aCompletionStatusiStatus member of an active object. It will be set as completed when the operating system has relayed the request to the server side of Symbian Messaging System.
    aReadStatusindicates if the message was read Possible values:EMmsReadStatusRead: The message was read.EMmsReadStatusDeletedWithoutBeingRead: The message was deleted without being read.

    Returns: Pointer to an operation active object. The operation will complete when the sending of the read report has been successfully scheduled. The actual sending will happen in the background. If scheduling the send fails, the status of CMsvOperation will contain the relevant error code. If the sender of the message has not requested a read report or read report sending is not allowed, the operation completes with error code KErrGeneral. The operation object must not be deleted before it completes.

    Sender ( )

    const TPtrCSender()const [virtual]

    Get the sender of the message.

    Returns: Address of the sender of the message (for example phone number). If the sender has not been defined, returns an empty string.

    SenderVisibility ( )

    TInt SenderVisibility()const [virtual]

    Get the sender visibility setting of the message.

    Indicates whether the MMS Service Centre should hide the sender's phone number from the recipient. The default is show the sender's number unless the server has a secret number.

    Returns: visibility setting. Possible values:EMmsSenderVisibilityDefault: Default visibility.EMmsSenderVisibilityHide: Hide the sender's number.EMmsSenderVisibilityShow: Show the sender's number even if it is a secret number.0: Sender visibilty has not been defined, use default.

    SendingDate ( )

    TTime SendingDate()const [virtual]

    Get the sending date and time of the message. Valid only for messages received by the phone.

    Returns: the time when MMS Service Centre has received the message from sender (in UTC time). If the time has not been defined, returns TTime(0).

    Session ( )

    CMsvSession &Session()[inline]

    Reimplemented from CBaseMtm::Session()

    From CBaseMtm: Return session that was set at initialization.

    Returns: Reference to Message Server session object.

    SetCurrentEntryL ( CMsvEntry * )

    voidSetCurrentEntryL(CMsvEntry *aEntry)[inline]

    From CBaseMtm: Set current context.

    ParameterDescription
    aEntryPointer to entry instance.

    SetDeliveryDate ( TTime )

    voidSetDeliveryDate(TTimeaDate)[virtual]

    Set the delivery date for the message.

    ParameterDescription
    aDateThe date and time when the message will be delivered to the recipient by the MMSC (in UTC time). The date must be later than 1970-01-01, 00:00:00 GMT. If neither delivery time interval or delivery date have been defined, MMS Service Centre will deliver the message immediately.

    SetDeliveryReport ( TMmsYesNo )

    voidSetDeliveryReport(TMmsYesNoaRequest)[virtual]

    Set the delivery report request setting value for the message.

    If the value is not set, default value from MMS settings will be used.

    ParameterDescription
    aRequesttells if the user wants a delivery report for this message. Possible values:EMmsYes: The user wants a delivery report.EMmsNo: The user does not want a delivery report.

    SetDeliveryTimeInterval ( TTimeIntervalSeconds )

    voidSetDeliveryTimeInterval(TTimeIntervalSecondsaInterval)[virtual]

    Set the delivery time interval for the message.

    ParameterDescription
    aIntervalThe length of time in seconds after which the message will be delivered to the recipient by the MMS Service Centre. If neither delivery time interval or delivery date have been defined, MMS Service Centre will deliver the message immediately.

    SetExpiryDate ( TTime )

    voidSetExpiryDate(TTimeaDate)[virtual]

    Set the expiration date of the message.

    ParameterDescription
    aDateThe date and time when the message will expire (In UTC time). The date must be later than 1970-01-01, 00:00:00 GMT If the MMS Service Centre cannot deliver the message to the recipient before the expiration date, the message will be discarded. If expiration date or validity period have not been defined, default is used.

    SetExpiryInterval ( TTimeIntervalSeconds )

    voidSetExpiryInterval(TTimeIntervalSecondsaInterval)[virtual]

    Set the validity period of the message.

    If the validity period is not defined for the message, default validity period from MMS settings or MMS Service Centre will be used.

    ParameterDescription
    aIntervalThe length of time in seconds after which the message will be discarded by MMS Service Centre. MMSC may limit the maximum length of the validity period.

    SetMaximumImage ( TInt, TInt )

    voidSetMaximumImage(TIntaWidth,
    TIntaHeight
    )[virtual]

    Set the maximum size of the images that can be inserted in the message.

    ParameterDescription
    aWidthImage width in pixels.
    aHeightImage height in pixels.

    SetMessageClass ( TMmsMessageClass )

    voidSetMessageClass(TMmsMessageClassaMessageClass)[virtual]

    Set the message class.

    If message class is not explicitly set, the message will have class "Personal" by default.

    ParameterDescription
    aMessageClassMessage class code. Possible values:EMmsClassPersonal: Message is a normal person-to-person message (default).EMmsClassAdvertisement: Message contains an advertisement.EMmsClassInformational: Message contains data from an information service.EMmsClassAuto: Message has been automatically generated by the phone. This class is only valid for a message that is a read report to another message.

    SetMessageDescriptionL ( const TDesC & )

    voidSetMessageDescriptionL(const TDesC &aText)[virtual]

    Set the message description string.

    This provides a method to override the default message description. The next SaveMessageL saves the description text in the TMsvEntry::iDescription field. This field is shown in Message Centre message lists to describe the contents of the message. Normally it is the message subject, but if there is no subject in the message, the caller may set some text from a text part of the message as the description.

    Note that this method does not check the text length, so avoid long descriptions to minimize memory usage.

    ParameterDescription
    aTextMessage description

    SetMessagePriority ( TMmsMessagePriority )

    voidSetMessagePriority(TMmsMessagePriorityaPriority)[virtual]

    Set the priority of the message.

    If the priority of the message is not set, the default priority will be "normal".

    ParameterDescription
    aPriorityMessage priority, possible values:EMmsPriorityLow: Low priority.EMmsPriorityNormal: Normal priority.EMmsPriorityHigh: High priority.

    SetMessageRootL ( const TMsvAttachmentId )

    voidSetMessageRootL(const TMsvAttachmentIdaId)[virtual]

    Set id of the root part of the message.

    ParameterDescription
    aIdAttachment Id of the message part which controls the display of the message. Should point to the SMIL part if present.

    SetReadReply ( TMmsYesNo )

    voidSetReadReply(TMmsYesNoaRequest)[virtual]

    Set the read report request setting value for the message.

    Specifies if the user wants a read report for the current message. If this value is Yes, the recipient phone should send a read report when the user opens the message for the first time.

    ParameterDescription
    aRequestread report request setting. Possible values:EMmsYes: The user wants a read report.EMmsNo: The user does not want a read report.

    SetSenderL ( const TDesC & )

    voidSetSenderL(const TDesC &aAlias)[virtual]

    Set the sender of the message.

    If the sender of the message is not explicitly defined, the Proxy-Relay or MMS Service Centre will add the sender's phone number.

    ParameterDescription
    aAliasThe phone number of the sender of the message. Maximum length 256 characters. This string will be included as the sender of the message when the message is sent, but the MMS Service Centre will check the validity of the value and replace it with the actual phone number of the sender if it is not correct.

    SetSenderVisibility ( TMmsMessageSenderVisibility )

    voidSetSenderVisibility(TMmsMessageSenderVisibilityaVisibility)[virtual]

    Set the sender visibility setting for the message.

    Indicates whether the MMS Service Centre should hide the sender's phone number from the recipient. If the value is not defined, default is used. The default is to show the sender's number unless the sender has a secret number.

    ParameterDescription
    aVisibilityVisibility of the sender's phone number to the recipient. Possible values:EMmsSenderVisibilityDefault: Use default visibility.EMmsSenderVisibilityHide: Hide the sender's number.EMmsSenderVisibilityShow: Show the sender's number even if it is a secret number.

    SetSettingsL ( const CMmsSettings & )

    voidSetSettingsL(const CMmsSettings &aSettings)[virtual]

    Copy the values from aSettings to CMmsClientMtm.

    This method should be used by MMS UI only. Other applications should not touch the MMS settings.

    Used to provide new settings to MMS Client MTM when settings have been changed. Will affect only messages created after the settings have been changed.

    Use function StoreSettingsL to save the settings on disk.

    ParameterDescription
    aSettingsNew values for CMmsSettings

    SetSubjectL ( const TDesC & )

    voidSetSubjectL(const TDesC &aSubject)[virtual]

    From CBaseMtm: Set message subject.

    ParameterDescription
    aSubjectMessage subject.

    StoreSettingsL ( )

    voidStoreSettingsL()[virtual]

    Save settings to disk.

    This method should be used by MMS UI only. Other applications should not touch the MMS settings.

    SubjectL ( )

    const TPtrCSubjectL()const [virtual]

    Reimplemented from CBaseMtm::SubjectL()const

    From CBaseMtm: Get message subject.

    Returns: Message subject.

    SwitchCurrentEntryL ( TMsvId )

    voidSwitchCurrentEntryL(TMsvIdaId)[inline]

    From CBaseMtm: Switch context to entry defined by aId.

    ParameterDescription
    aIdEntry id in message store.

    Type ( )

    TUid Type()const [inline]

    Reimplemented from CBaseMtm::Type()const

    From CBaseMtm: Return type of this Mtm.

    Returns: Registered Mtm type.

    ValidateMessage ( TMsvPartList )

    TMsvPartList ValidateMessage(TMsvPartListaPartList)[virtual]

    From CBaseMtm: Checks that selected parts of current message are legal.

    ParameterDescription
    aPartListFlags specifying which parts to validate. (defined in MTMDEF.H). Possible values:KMsvMessagePartPartBody: Ignored. MMS engine does not support separate message body.KMsvMessagePartRecipient: Supported.KMsvMessagePartOriginator Supported.KMsvMessagePartDescription: Ignored. Description is always validKMsvMessagePartDate: Ignored. Date is always validKMsvMessagePartAttachments: Supported.

    Returns: TMsvPartList bitmask identifies each invalid part. If all parts are valid, returned value is 0.

    ValidateService ( TMsvId )

    TInt ValidateService(TMsvIdaServiceId)[virtual]

    Validate service.

    Checks that access point refers to a valid entry in comms database.

    ParameterDescription
    aServiceIdId of the MMS service

    Returns: Error code.KErrNone: The service is OK.KErrNotFound: The service id is incorrect.KMmsErrorInvalidSettings: The settings contain invalid values. This error is possible only if the settings file has been corrupted.KMmsErrorNoWAPAccessPoint: No access point has been defined.KMmsErrorAP1Invalid: MMS access point refers to an invalid entry in comms database.KMmsErrorNoURI1: Home page has not been defined for MMS access point