CCalenAttachmentModel Class Reference

class CCalenAttachmentModel : public CBase

Attachment model.

Inherits from

Public Member Functions
~CCalenAttachmentModel ()
IMPORT_C void AddAttachmentL (const TDesC &, const TDesC &)
IMPORT_C void AddAttachmentL (const TDesC &, const TDesC &, TInt , TBool , const TDataType &, RFile &)
IMPORT_C CCalenAttachmentInfo & AttachmentInfoAt ( TInt )
IMPORT_C void AttachmentOpen ( TBool &)
IMPORT_C CGulIcon * BitmapForFileL ( CCalenAttachmentInfo &)
IMPORT_C void CheckForExistingAttachmentsL ( CCalEntry *)
IMPORT_C TBool DeleteAttachment ( TInt )
IMPORT_C RFile GetAttachmentFileL ( TInt )
IMPORT_C void GetAttachmentListL ( RPointerArray < CCalenAttachmentInfo > &)
IMPORT_C TBool IsAttachmentOpen ()
IMPORT_C void LoadResourcesL ()
IMPORT_C CCalenAttachmentModel * NewL ()
IMPORT_C TInt NumberOfItems ()
IMPORT_C void Reset ()
IMPORT_C void SetObserver ( MCalenAttachmentModelObserver *)
Private Member Functions
CCalenAttachmentModel ()
CGulIcon * BitmapForAppL (const TUid &)
TBool CheckFileSizeLimitL ( TInt )
void ConstructL ()
CCalenAttachmentInfo * CreateNewInfoL (const TDesC &, const TDesC &, TInt , TBool , const TDataType &, const CCalenAttachmentInfo::TCalenAttachmentStoreType )
TBool DoDeleteAttachmentL ( TInt )
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()
Private Attributes
RApaLsSession iAppList
RPointerArray < CCalenAttachmentInfo > iAttachInfoArray
MCalenAttachmentModelObserver * iAttachmentModelObserver
TBool iEmbeddedFileOpened
TSize iIconSize
TBool isAttachmentModelCleared

Constructor & Destructor Documentation

CCalenAttachmentModel()

CCalenAttachmentModel ( ) [private]

Default Constructor.

~CCalenAttachmentModel()

~CCalenAttachmentModel ( )

Destructor.

Member Functions Documentation

AddAttachmentL(const TDesC &, const TDesC &)

IMPORT_C void AddAttachmentL ( const TDesC & aFullName,
const TDesC & aSystemFileName
)

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

Parameters

const TDesC & aFullName file name of the attachment to be added
const TDesC & aSystemFileName

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

IMPORT_C void AddAttachmentL ( const TDesC & aFullName,
const TDesC & aSystemFileName,
TInt aSize,
TBool aFetched,
const TDataType & aDataType,
RFile & aFile
)

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

Parameters

const TDesC & aFullName file name of the attachment to be added
const TDesC & aSystemFileName
TInt aSize size of the attachment file
TBool aFetched fetched or not
const TDataType & aDataType mime type of the attachment
RFile & aFile

AttachmentInfoAt(TInt)

IMPORT_C CCalenAttachmentInfo & AttachmentInfoAt ( TInt aIndex ) const

Returns reference to attachment info at given index.

Parameters

TInt aIndex index for which attachment info is needed

AttachmentOpen(TBool &)

IMPORT_C void AttachmentOpen ( TBool & aEmbeddedFileOpened )

Set the flag to ETrue if the attachment(Photo, audio and vedio files) is open.

Parameters

TBool & aEmbeddedFileOpened

BitmapForAppL(const TUid &)

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

Returns pointer to bitmap of given application.

Parameters

const TUid & aAppUid UID of the application for which bitmap is requested

BitmapForFileL(CCalenAttachmentInfo &)

IMPORT_C CGulIcon * BitmapForFileL ( CCalenAttachmentInfo & aAttaInfo )

Returns pointer to bitmap of the application that handles given file.

Parameters

CCalenAttachmentInfo & aAttaInfo reference to the attachment info

CheckFileSizeLimitL(TInt)

TBool CheckFileSizeLimitL ( TInt aNewFileSize ) [private]

Parameters

TInt aNewFileSize Size of the selected attachment.

CheckForExistingAttachmentsL(CCalEntry *)

IMPORT_C void CheckForExistingAttachmentsL ( CCalEntry * entry )

Updates attachment mode with the attahcments of entr if it has any

Parameters

CCalEntry * entry

ConstructL()

void ConstructL ( ) [private]

2nd phase constructor.

CreateNewInfoL(const TDesC &, const TDesC &, TInt, TBool, const TDataType &, const CCalenAttachmentInfo::TCalenAttachmentStoreType)

CCalenAttachmentInfo * CreateNewInfoL ( const TDesC & aFileName,
const TDesC & aSystemFileName,
TInt aSize,
TBool aFetched,
const TDataType & aDataType,
const CCalenAttachmentInfo::TCalenAttachmentStoreType aStoreType
) [private]

Creates new attachment info object.

Parameters

const TDesC & aFileName filename of the attachment
const TDesC & aSystemFileName
TInt aSize size of the attachment
TBool aFetched attacment fetched or not
const TDataType & aDataType mime type of the attachment
const CCalenAttachmentInfo::TCalenAttachmentStoreType aStoreType

DeleteAttachment(TInt)

IMPORT_C TBool DeleteAttachment ( TInt aIndex )

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

Parameters

TInt aIndex index for which attachment to be deleted

DoDeleteAttachmentL(TInt)

TBool DoDeleteAttachmentL ( TInt aIndex ) [private]

Deletes attachment from given index.

Parameters

TInt aIndex Index of the deleted attachment.

GetAttachmentFileL(TInt)

IMPORT_C RFile GetAttachmentFileL ( TInt aIndex )

Parameters

TInt aIndex

GetAttachmentListL(RPointerArray< CCalenAttachmentInfo > &)

IMPORT_C void GetAttachmentListL ( RPointerArray < CCalenAttachmentInfo > & aAttachmentList )

Get the attachment lists

Parameters

RPointerArray < CCalenAttachmentInfo > & aAttachmentList fills the attachment list

IsAttachmentOpen()

IMPORT_C TBool IsAttachmentOpen ( )

return ETrue if the atacchment is opened.

LoadResourcesL()

IMPORT_C void LoadResourcesL ( )

Loads resources, i.e. bitmaps & layouts

NewL()

IMPORT_C CCalenAttachmentModel * NewL ( ) [static]

First phase constructor

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).

SetObserver(MCalenAttachmentModelObserver *)

IMPORT_C void SetObserver ( MCalenAttachmentModelObserver * aObserver )

Sets attachment model observer.

Parameters

MCalenAttachmentModelObserver * aObserver pointer to the MCalenAttachmentModelObserver

Member Data Documentation

RApaLsSession iAppList

RApaLsSession iAppList [private]

RPointerArray< CCalenAttachmentInfo > iAttachInfoArray

RPointerArray < CCalenAttachmentInfo > iAttachInfoArray [private]

MCalenAttachmentModelObserver * iAttachmentModelObserver

MCalenAttachmentModelObserver * iAttachmentModelObserver [private]

TBool iEmbeddedFileOpened

TBool iEmbeddedFileOpened [private]

TSize iIconSize

TSize iIconSize [private]

TBool isAttachmentModelCleared

TBool isAttachmentModelCleared [private]