CMsgAttachmentModel Class Reference

class CMsgAttachmentModel : public CBase

Attachment model.

Inherits from

Public Member Functions
~CMsgAttachmentModel()
IMPORT_C CMsgAttachmentInfo *AddAttachmentL(const TDesC &, TInt, TMsvAttachmentId, TBool, TInt)
IMPORT_C CMsgAttachmentInfo *AddAttachmentL(const TDesC &, TInt, TMsvAttachmentId, TBool, const TDataType &, TInt)
IMPORT_C CMsgAttachmentInfo *AddAttachmentL(const TDesC &, TInt, TMsvAttachmentId, TBool, const TDataType &, CMsgAttachmentInfo::TDRMDataType, TInt)
IMPORT_C CMsgAttachmentInfo &AttachmentInfoAt(TInt)
IMPORT_C CGulIcon *BitmapForFileL(CMsgAttachmentInfo &)
IMPORT_C voidDeleteAttachment(TInt)
IMPORT_C RFileGetAttachmentFileL(TInt)
IMPORT_C TBoolIsFileAttached(const TDesC &)
IMPORT_C TBoolIsIdAttached(TMsvAttachmentId)
IMPORT_C TBoolIsModified()
IMPORT_C TBoolIsReadOnly()
IMPORT_C voidLoadResourcesL()
IMPORT_C CMsgAttachmentModel *NewL(TBool)
IMPORT_C TIntNumberOfItems()
IMPORT_C voidReset()
IMPORT_C voidSetModified(TBool)
IMPORT_C voidSetObserver(MMsgAttachmentModelObserver *)
IMPORT_C voidViewAttachmentL(TInt)
Protected Member Functions
CMsgAttachmentModel(TBool)
IMPORT_C voidConstructL()
Private Member Functions
TUid AppUidForDataTypeL(const TDataType &)
TUid AppUidForFileL(const TFileName &)
TUid AppUidFromGameFileL(TDataType &, const TDesC &)
CGulIcon *BitmapForAppL(const TUid &)
CFbsBitmap *CopyBitmapL(const CFbsBitmap *)
CMsgAttachmentInfo *CreateNewInfoL(const TDesC &, TInt, TBool, TBool, TMsvAttachmentId, const TDataType &, CMsgAttachmentInfo::TDRMDataType)
voidDoDeleteAttachmentL(TInt)
voidFadeBitmapL(CFbsBitmap *)
CGulIcon *LoadDefaultBitmapL(TBool)
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()
Protected Attributes
CAttInfoArray *iAttachInfoArray
MMsgAttachmentModelObserver *iAttachmentModelObserver
TBool iModified
Private Attributes
TSize iAddIconSize
RApaLsSession iAppList
CGulIcon *iDRMFWDLockIcon
CGulIcon *iDRMFWDLockIconNoRights
CGulIcon *iDRMSDIconNoRights
CGulIcon *iDRMSDIconRightsValid
TSize iIconSize
TBool iReadOnly

Constructor & Destructor Documentation

CMsgAttachmentModel(TBool)

IMPORT_CCMsgAttachmentModel(TBoolaReadOnly)[protected]

Constructor.

Parameters

TBool aReadOnly

~CMsgAttachmentModel()

IMPORT_C~CMsgAttachmentModel()

Destructor.

Member Functions Documentation

AddAttachmentL(const TDesC &, TInt, TMsvAttachmentId, TBool, TInt)

IMPORT_C CMsgAttachmentInfo *AddAttachmentL(const TDesC &aFullName,
TIntaSize,
TMsvAttachmentIdaAttachmentEntryId,
TBoolaFetched,
TIntaIndex = -1
)

Adds attachment to the internal array. Notifies attachment model observer with EMsgAttachmentAdded parameter.

Parameters

const TDesC & aFullName
TInt aSize
TMsvAttachmentId aAttachmentEntryId
TBool aFetched
TInt aIndex = -1

AddAttachmentL(const TDesC &, TInt, TMsvAttachmentId, TBool, const TDataType &, TInt)

IMPORT_C CMsgAttachmentInfo *AddAttachmentL(const TDesC &aFullName,
TIntaSize,
TMsvAttachmentIdaAttachmentEntryId,
TBoolaFetched,
const TDataType &aDataType,
TIntaIndex = -1
)

Adds attachment to the internal array. Notifies attachment model observer with EMsgAttachmentAdded parameter.

Parameters

const TDesC & aFullName
TInt aSize
TMsvAttachmentId aAttachmentEntryId
TBool aFetched
const TDataType & aDataType
TInt aIndex = -1

AddAttachmentL(const TDesC &, TInt, TMsvAttachmentId, TBool, const TDataType &, CMsgAttachmentInfo::TDRMDataType, TInt)

IMPORT_C CMsgAttachmentInfo *AddAttachmentL(const TDesC &aFullName,
TIntaSize,
TMsvAttachmentIdaAttachmentEntryId,
TBoolaFetched,
const TDataType &aDataType,
CMsgAttachmentInfo::TDRMDataTypeaDRMDataType,
TIntaIndex = -1
)

Adds attachment to the internal array. Notifies attachment model observer with EMsgAttachmentAdded parameter.

Parameters

const TDesC & aFullName
TInt aSize
TMsvAttachmentId aAttachmentEntryId
TBool aFetched
const TDataType & aDataType
CMsgAttachmentInfo::TDRMDataType aDRMDataType
TInt aIndex = -1

AppUidForDataTypeL(const TDataType &)

TUid AppUidForDataTypeL(const TDataType &aDataType)[private]

Returns app uid of application that handles given data type.

Parameters

const TDataType & aDataType

AppUidForFileL(const TFileName &)

TUid AppUidForFileL(const TFileName &aFileName)[private]

Returns app uid of application that handles given file.

Parameters

const TFileName & aFileName

AppUidFromGameFileL(TDataType &, const TDesC &)

TUid AppUidFromGameFileL(TDataType &aDataType,
const TDesC &aFileName
)[private]

Returns app uid of application that handles given game data.

Parameters

TDataType & aDataType
const TDesC & aFileName

AttachmentInfoAt(TInt)

IMPORT_C CMsgAttachmentInfo &AttachmentInfoAt(TIntaIndex)const

Returns reference to attachment info at given index.

Parameters

TInt aIndex

BitmapForAppL(const TUid &)

CGulIcon *BitmapForAppL(const TUid &aAppUid)[private]

Returns pointer to bitmap of given application.

Parameters

const TUid & aAppUid

BitmapForFileL(CMsgAttachmentInfo &)

IMPORT_C CGulIcon *BitmapForFileL(CMsgAttachmentInfo &aAttaInfo)

Returns pointer to bitmap of the application that handles given file. If application not found returns default bitmap and sets supported flag of the aAttaInfo to EFalse.

Parameters

CMsgAttachmentInfo & aAttaInfo

ConstructL()

IMPORT_C voidConstructL()[protected]

2nd phase constructor.

CopyBitmapL(const CFbsBitmap *)

CFbsBitmap *CopyBitmapL(const CFbsBitmap *aBitmap)[private]

Makes a copy of the original bitmap

Parameters

const CFbsBitmap * aBitmap

CreateNewInfoL(const TDesC &, TInt, TBool, TBool, TMsvAttachmentId, const TDataType &, CMsgAttachmentInfo::TDRMDataType)

CMsgAttachmentInfo *CreateNewInfoL(const TDesC &aFileName,
TIntaSize,
TBoolaFetched,
TBoolaAttachedThisSession,
TMsvAttachmentIdaAttachmentId,
const TDataType &aDataType,
CMsgAttachmentInfo::TDRMDataTypeaDRMDataType
)[private, virtual]

Creates new attachment info object.

Parameters

const TDesC & aFileName
TInt aSize
TBool aFetched
TBool aAttachedThisSession
TMsvAttachmentId aAttachmentId
const TDataType & aDataType
CMsgAttachmentInfo::TDRMDataType aDRMDataType

DeleteAttachment(TInt)

IMPORT_C voidDeleteAttachment(TIntaIndex)

Deletes attachment from internal array. Notifies attachment model observer with EMsgAttachmentRemoved parameter.

Parameters

TInt aIndex

DoDeleteAttachmentL(TInt)

voidDoDeleteAttachmentL(TIntaIndex)[private]

Deletes attachment from given index.

Parameters

TInt aIndexIndex of the deleted attachment.

FadeBitmapL(CFbsBitmap *)

voidFadeBitmapL(CFbsBitmap *aBitmap)[private]

Apply fade effect on given bitmap

Parameters

CFbsBitmap * aBitmap

GetAttachmentFileL(TInt)

IMPORT_C RFileGetAttachmentFileL(TIntaIndex)

Parameters

TInt aIndex

IsFileAttached(const TDesC &)

IMPORT_C TBoolIsFileAttached(const TDesC &aFileName)const

Returns ETrue if given file is found from the internal array.

Parameters

const TDesC & aFileName

IsIdAttached(TMsvAttachmentId)

IMPORT_C TBoolIsIdAttached(TMsvAttachmentIdaId)const

Returns ETrue if given attachment id is found from the internal array.

Parameters

TMsvAttachmentId aId

IsModified()

IMPORT_C TBoolIsModified()const

Returns true if stored info about attachments is modified.

IsReadOnly()

IMPORT_C TBoolIsReadOnly()

Returns ETrue if attachment model was created to be read-only.

LoadDefaultBitmapL(TBool)

CGulIcon *LoadDefaultBitmapL(TBoolaSupported)[private]

Loads system default bitmap.

Parameters

TBool aSupported

LoadResourcesL()

IMPORT_C voidLoadResourcesL()

Loads resources, i.e. bitmaps & layouts

NewL(TBool)

IMPORT_C CMsgAttachmentModel *NewL(TBoolaReadOnly)[static]

Factory method that creates this object.

Parameters

TBool aReadOnly

NumberOfItems()

IMPORT_C TIntNumberOfItems()const

Returns number of attachments in the internal array of attachments.

Reset()

IMPORT_C voidReset()

Reset the attachment model (empties the internal array).

SetModified(TBool)

IMPORT_C voidSetModified(TBoolaModified)

Sets the modified flag.

Parameters

TBool aModified

SetObserver(MMsgAttachmentModelObserver *)

IMPORT_C voidSetObserver(MMsgAttachmentModelObserver *aObserver)

Sets attachment model observer.

Parameters

MMsgAttachmentModelObserver * aObserver

ViewAttachmentL(TInt)

IMPORT_C voidViewAttachmentL(TIntaIndex)

Opens seleceted attachment in corresponding target application.

Parameters

TInt aIndex

Member Data Documentation

TSize iAddIconSize

TSize iAddIconSize[private]

RApaLsSession iAppList

RApaLsSession iAppList[private]

CAttInfoArray * iAttachInfoArray

CAttInfoArray *iAttachInfoArray[protected]

MMsgAttachmentModelObserver * iAttachmentModelObserver

MMsgAttachmentModelObserver *iAttachmentModelObserver[protected]

CGulIcon * iDRMFWDLockIcon

CGulIcon *iDRMFWDLockIcon[private]

CGulIcon * iDRMFWDLockIconNoRights

CGulIcon *iDRMFWDLockIconNoRights[private]

CGulIcon * iDRMSDIconNoRights

CGulIcon *iDRMSDIconNoRights[private]

CGulIcon * iDRMSDIconRightsValid

CGulIcon *iDRMSDIconRightsValid[private]

TSize iIconSize

TSize iIconSize[private]

TBool iModified

TBool iModified[protected]

TBool iReadOnly

TBool iReadOnly[private]