CMsvAttachment Class Reference

class CMsvAttachment : public CBase

Represents a single attachment and information about the attachment.

This object is used to represent all types of attachments (file, linked file or message entry). Note that some APIs may not be valid for particular attachment types. This is described under each method. It is the responsibility of the client to ensure that the data about the attachment is set such as its mime-type or size.

Inherits from

Public Member Functions
~CMsvAttachment()
IMPORT_C const TDesC &AttachmentName()
IMPORT_C TBoolComplete()
IMPORT_C TMsvIdEntryAttachmentId()
voidExternalizeL(RWriteStream &)
IMPORT_C const TDesC &FilePath()
IMPORT_C TIntGetDesC8Attribute(TUid, TPtrC8 &)
IMPORT_C TIntGetIntAttribute(TUid, TInt &)
IMPORT_C TMsvAttachmentIdId()
voidInternalizeL(RReadStream &)
TBool IsPathRequired()
IMPORT_C const TDesC8 &MimeType()
IMPORT_C CMsvAttachment *NewL(TMsvAttachmentType)
IMPORT_C CMsvAttachment *NewL(TMsvAttachmentType, TInt, HBufC8 *, HBufC *)
IMPORT_C CMsvAttachment *NewL(const CMsvAttachment &)
IMPORT_C voidRemoveDesC8Attribute(TUid)
IMPORT_C voidRemoveIntAttribute(TUid)
IMPORT_C voidSetAttachmentNameL(const TDesC &)
IMPORT_C voidSetComplete(TBool)
IMPORT_C voidSetDesC8AttributeL(TUid, const TDesC8 &)
voidSetEntryAttachmentId(TMsvId)
voidSetFilePathL(const TDesC &)
IMPORT_C voidSetId(TMsvAttachmentId)
IMPORT_C voidSetIntAttributeL(TUid, TInt)
IMPORT_C voidSetMimeTypeL(const TDesC8 &)
IMPORT_C voidSetSize(TInt)
IMPORT_C TIntSize()
IMPORT_C TMsvAttachmentTypeType()
Private Member Functions
CMsvAttachment(TMsvAttachmentType)
CMsvAttachment(TMsvAttachmentType, TInt, HBufC8 *, HBufC *)
voidConstructL()
voidConstructL(const CMsvAttachment &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
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()
Public Member Enumerations
enumTMsvAttachmentType { EMsvFile = 0, EMsvLinkedFile, EMsvMessageEntry }
Private Attributes
HBufC *iAttachmentName
CMsvAttributeManager *iAttributeManager
TBool iComplete
TMsvId iEntryId
HBufC *iFilePath
TMsvAttachmentId iId
HBufC8 *iMimeType
TBool iNeedsPath
TInt iSize
TMsvAttachmentType iType

Constructor & Destructor Documentation

CMsvAttachment(TMsvAttachmentType)

CMsvAttachment(TMsvAttachmentTypeaType)[private]

Parameters

TMsvAttachmentType aType

CMsvAttachment(TMsvAttachmentType, TInt, HBufC8 *, HBufC *)

CMsvAttachment(TMsvAttachmentTypeaType,
TIntaSize,
HBufC8 *aMimeType,
HBufC *aAttachmentName
)[private]

Parameters

TMsvAttachmentType aType
TInt aSize
HBufC8 * aMimeType
HBufC * aAttachmentName

~CMsvAttachment()

IMPORT_C~CMsvAttachment()

Member Functions Documentation

AttachmentName()

IMPORT_C const TDesC &AttachmentName()const

Complete()

IMPORT_C TBoolComplete()const

ConstructL()

voidConstructL()[private]

ConstructL(const CMsvAttachment &)

voidConstructL(const CMsvAttachment &aAttachment)[private]

Parameters

const CMsvAttachment & aAttachment

EntryAttachmentId()

IMPORT_C TMsvIdEntryAttachmentId()const

ExternalizeL(RWriteStream &)

voidExternalizeL(RWriteStream &aStream)const

Parameters

RWriteStream & aStream

FilePath()

IMPORT_C const TDesC &FilePath()const

GetDesC8Attribute(TUid, TPtrC8 &)

IMPORT_C TIntGetDesC8Attribute(TUidaAttributeId,
TPtrC8 &aAttribute
)const

Parameters

TUid aAttributeId
TPtrC8 & aAttribute

GetIntAttribute(TUid, TInt &)

IMPORT_C TIntGetIntAttribute(TUidaAttributeId,
TInt &aAttribute
)const

Parameters

TUid aAttributeId
TInt & aAttribute

Id()

IMPORT_C TMsvAttachmentIdId()const

InternalizeL(RReadStream &)

voidInternalizeL(RReadStream &aStream)

Parameters

RReadStream & aStream

IsPathRequired()

TBool IsPathRequired()const

MimeType()

IMPORT_C const TDesC8 &MimeType()const

NewL(TMsvAttachmentType)

IMPORT_C CMsvAttachment *NewL(TMsvAttachmentTypeaType)[static]

Parameters

TMsvAttachmentType aType

NewL(TMsvAttachmentType, TInt, HBufC8 *, HBufC *)

IMPORT_C CMsvAttachment *NewL(TMsvAttachmentTypeaType,
TIntaSize,
HBufC8 *aMimeType,
HBufC *aAttachmentName
)[static]

Parameters

TMsvAttachmentType aType
TInt aSize
HBufC8 * aMimeType
HBufC * aAttachmentName

NewL(const CMsvAttachment &)

IMPORT_C CMsvAttachment *NewL(const CMsvAttachment &aAttachment)[static]

Parameters

const CMsvAttachment & aAttachment

RemoveDesC8Attribute(TUid)

IMPORT_C voidRemoveDesC8Attribute(TUidaAttributeId)

Parameters

TUid aAttributeId

RemoveIntAttribute(TUid)

IMPORT_C voidRemoveIntAttribute(TUidaAttributeId)

Parameters

TUid aAttributeId

SetAttachmentNameL(const TDesC &)

IMPORT_C voidSetAttachmentNameL(const TDesC &aAttachmentName)

Parameters

const TDesC & aAttachmentName

SetComplete(TBool)

IMPORT_C voidSetComplete(TBoolaComplete)

Parameters

TBool aComplete

SetDesC8AttributeL(TUid, const TDesC8 &)

IMPORT_C voidSetDesC8AttributeL(TUidaAttributeId,
const TDesC8 &aAttribute
)

Parameters

TUid aAttributeId
const TDesC8 & aAttribute

SetEntryAttachmentId(TMsvId)

voidSetEntryAttachmentId(TMsvIdaEntryId)

Parameters

TMsvId aEntryId

SetFilePathL(const TDesC &)

voidSetFilePathL(const TDesC &aFilePath)

Parameters

const TDesC & aFilePath

SetId(TMsvAttachmentId)

IMPORT_C voidSetId(TMsvAttachmentIdaId)

Parameters

TMsvAttachmentId aId

SetIntAttributeL(TUid, TInt)

IMPORT_C voidSetIntAttributeL(TUidaAttributeId,
TIntaAttribute
)

Parameters

TUid aAttributeId
TInt aAttribute

SetMimeTypeL(const TDesC8 &)

IMPORT_C voidSetMimeTypeL(const TDesC8 &aMimeType)

Parameters

const TDesC8 & aMimeType

SetSize(TInt)

IMPORT_C voidSetSize(TIntaSize)

Parameters

TInt aSize

Size()

IMPORT_C TIntSize()const

Type()

IMPORT_C TMsvAttachmentTypeType()const

Member Enumerations Documentation

Enum TMsvAttachmentType

Enum to define the different types of attachments supported by messaging.

Enumerators

EMsvFile = 0

File attachment. This is a file attachment that is copied into the message store.

EMsvLinkedFile

Linked file attachment. This is an attachment that is linked to using its file path, this is not copied into the message store.

EMsvMessageEntry

Message entry attachment. This is a message entry that is registered as an attachment.

Member Data Documentation

HBufC * iAttachmentName

HBufC *iAttachmentName[private]

Name of the attachment to identify to the attachment.

CMsvAttributeManager * iAttributeManager

CMsvAttributeManager *iAttributeManager[private]

Attribute manager for handling the attributes for this attachment.

TBool iComplete

TBool iComplete[private]

Attachment entry completeness flag.

TMsvId iEntryId

TMsvId iEntryId[private]

The message entry Id of the entry attachment.

HBufC * iFilePath

HBufC *iFilePath[private]

The full file path and file name of attachment files and linked files.

TMsvAttachmentId iId

TMsvAttachmentId iId[private]

The unique attachment Id. This is unique per message entry and is auto-assigned.

HBufC8 * iMimeType

HBufC8 *iMimeType[private]

Descriptor indicating the mime type of the attachment.

TBool iNeedsPath

TBool iNeedsPath[private]

Flag to indicate whether a path needs to be added.

TInt iSize

TInt iSize[private]

Size of the attachment in bytes.

TMsvAttachmentType iType

TMsvAttachmentType iType[private]

The attachment type.