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 void DeleteAttachment ( TInt )
IMPORT_C RFile GetAttachmentFileL ( TInt )
IMPORT_C TBool IsFileAttached (const TDesC &)
IMPORT_C TBool IsIdAttached ( TMsvAttachmentId )
IMPORT_C TBool IsModified ()
IMPORT_C TBool IsReadOnly ()
IMPORT_C void LoadResourcesL ()
IMPORT_C CMsgAttachmentModel * NewL ( TBool )
IMPORT_C TInt NumberOfItems ()
IMPORT_C void Reset ()
IMPORT_C void SetModified ( TBool )
IMPORT_C void SetObserver ( MMsgAttachmentModelObserver *)
IMPORT_C void ViewAttachmentL ( TInt )
Protected Member Functions
CMsgAttachmentModel ( TBool )
IMPORT_C void ConstructL ()
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 )
void DoDeleteAttachmentL ( TInt )
void FadeBitmapL ( 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_C CMsgAttachmentModel ( TBool aReadOnly ) [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,
TInt aSize,
TMsvAttachmentId aAttachmentEntryId,
TBool aFetched,
TInt aIndex = -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,
TInt aSize,
TMsvAttachmentId aAttachmentEntryId,
TBool aFetched,
const TDataType & aDataType,
TInt aIndex = -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,
TInt aSize,
TMsvAttachmentId aAttachmentEntryId,
TBool aFetched,
const TDataType & aDataType,
CMsgAttachmentInfo::TDRMDataType aDRMDataType,
TInt aIndex = -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 ( TInt aIndex ) 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 void ConstructL ( ) [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,
TInt aSize,
TBool aFetched,
TBool aAttachedThisSession,
TMsvAttachmentId aAttachmentId,
const TDataType & aDataType,
CMsgAttachmentInfo::TDRMDataType aDRMDataType
) [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 void DeleteAttachment ( TInt aIndex )

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

Parameters

TInt aIndex

DoDeleteAttachmentL(TInt)

void DoDeleteAttachmentL ( TInt aIndex ) [private]

Deletes attachment from given index.

Parameters

TInt aIndex Index of the deleted attachment.

FadeBitmapL(CFbsBitmap *)

void FadeBitmapL ( CFbsBitmap * aBitmap ) [private]

Apply fade effect on given bitmap

Parameters

CFbsBitmap * aBitmap

GetAttachmentFileL(TInt)

IMPORT_C RFile GetAttachmentFileL ( TInt aIndex )

Parameters

TInt aIndex

IsFileAttached(const TDesC &)

IMPORT_C TBool IsFileAttached ( const TDesC & aFileName ) const

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

Parameters

const TDesC & aFileName

IsIdAttached(TMsvAttachmentId)

IMPORT_C TBool IsIdAttached ( TMsvAttachmentId aId ) const

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

Parameters

TMsvAttachmentId aId

IsModified()

IMPORT_C TBool IsModified ( ) const

Returns true if stored info about attachments is modified.

IsReadOnly()

IMPORT_C TBool IsReadOnly ( )

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

LoadDefaultBitmapL(TBool)

CGulIcon * LoadDefaultBitmapL ( TBool aSupported ) [private]

Loads system default bitmap.

Parameters

TBool aSupported

LoadResourcesL()

IMPORT_C void LoadResourcesL ( )

Loads resources, i.e. bitmaps & layouts

NewL(TBool)

IMPORT_C CMsgAttachmentModel * NewL ( TBool aReadOnly ) [static]

Factory method that creates this object.

Parameters

TBool aReadOnly

NumberOfItems()

IMPORT_C TInt NumberOfItems ( ) const

Returns number of attachments in the internal array of attachments.

Reset()

IMPORT_C void Reset ( )

Reset the attachment model (empties the internal array).

SetModified(TBool)

IMPORT_C void SetModified ( TBool aModified )

Sets the modified flag.

Parameters

TBool aModified

SetObserver(MMsgAttachmentModelObserver *)

IMPORT_C void SetObserver ( MMsgAttachmentModelObserver * aObserver )

Sets attachment model observer.

Parameters

MMsgAttachmentModelObserver * aObserver

ViewAttachmentL(TInt)

IMPORT_C void ViewAttachmentL ( TInt aIndex )

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]