TObexUtilsMessageHandler Class Reference

class TObexUtilsMessageHandler

Utility methods for message handling.

Public Member Functions
IMPORT_C void AddEntryToInboxL ( TMsvId &, TFileName &)
IMPORT_C void AddEntryToInboxL ( TMsvId &, TFileName &, RArray < TMsvId > *)
IMPORT_C void CreateDefaultMtmServiceL ( TUid )
IMPORT_C void CreateInboxAttachmentL (CObexBufObject *&, const TUid , TMsvId &, RFile &)
IMPORT_C void CreateInboxAttachmentL (CObexBufObject *&, const TUid , TMsvId &, RFile &, const TDesC &)
IMPORT_C TMsvId CreateOutboxEntryL (const TUid &, const TInt &)
IMPORT_C TInt CreateReceiveBufferAndRFileL ( RFile &, const TDesC &, TFileName &, CBufFlat *&, const TInt )
IMPORT_C void DeleteOutboxEntryL (const TMsvId &)
IMPORT_C TInt GetCenRepKeyIntValueL ( TUid , TUint32 , TInt &)
IMPORT_C TInt GetCenRepKeyStringValueL ( TUid , TUint32 , TDes &)
IMPORT_C TInt GetFileSystemStatus ()
IMPORT_C TInt GetMessageCentreDriveL ()
IMPORT_C TInt GetMmcFileSystemStatus ()
IMPORT_C TInt GetPubSubKeyIntValue ( TUid , TUint , TInt &)
IMPORT_C void RemoveInboxEntriesL (CObexBufObject *&, TMsvId )
IMPORT_C void RemoveTemporaryRFileL (const TFileName &)
IMPORT_C void SaveFileToFileSystemL (CObexBufObject *&, const TUid , TMsvId &, TFileName &, RFile &, const TDesC &)
IMPORT_C void SaveObjToInboxL (CObexBufObject *, const TDesC16 &, const TUid )
IMPORT_C void SaveObjToInboxL (CObexBufObject *&, RFile &, TMsvId )
IMPORT_C void UpdateEntryAttachmentL ( TFileName &, CMsvEntry *)
Private Member Functions
CRichText * ConstructRichTextLC ()
void CreateMsvSessionLC ( CDummySessionObserver *&, CMsvSession *&)
void CreateMsvSessionLC ( CDummySessionObserver *&, CMsvSession *&, CMsvEntry *&, TMsvId )
void DoCreateInboxAttachmentL (const TUid , TMsvId &, RFile &, const TDesC &)
void FinaliseMessageL ( CMsvEntry *, TReceivedData &, CMsvStore *, TBool )
void FinaliseMessageL ( CMsvEntry *, CMsvStore *, TEntry &, TParse &)
void FixExtremeLongFileName ( TFileName &, const TDesC &)
TTime GetCurrentTime ()
void MakeValidFileName ( RFs &, TDes &)
void RecogniseObjectsL ( TFileName &, CMsvAttachment *)
void RemoveObexBuffer (CObexBufObject *&)
TInt RenameFileL ( TFileName &, TFileName &, const TDesC &, RFs &)
TInt RenameFileWithSegmentNumL ( TDes &, TInt , TDes &)
CBIODatabase * SaveMimeAndGetBioLC ( TFileName &, RFs &, CMsvAttachment *, TUid &)
void SetBioDataTextL ( TBioMsgIdText &, const TDesC8 &)
void SetDetailsLC ( TPtrC &, const TDesC8 &)
void StoreAndUpdateBioMessageL ( CBIODatabase *, TUid , CMsvEntry *, RFile &)
void StoreAsRichTextL ( CMsvEntry *, RFile &)
void UpdateAttachmentInformationL ( TReceivedData &, CMsvEntry *, CMsvAttachment *, CMsvStore *)

Member Functions Documentation

AddEntryToInboxL(TMsvId &, TFileName &)

IMPORT_C void AddEntryToInboxL ( TMsvId & aMsvIdParent,
TFileName & aFullName
) [static]

Add an entry to Inbox S60 v5.0

Parameters

TMsvId & aMsvIdParent Parent message entry
TFileName & aFullName Contains the full path and file name of the file

AddEntryToInboxL(TMsvId &, TFileName &, RArray< TMsvId > *)

IMPORT_C void AddEntryToInboxL ( TMsvId & aMsvIdParent,
TFileName & aFullName,
RArray < TMsvId > * aMsvIdArray
) [static]

Add an entry to Inbox S60 v5.0

Parameters

TMsvId & aMsvIdParent Parent message entry
TFileName & aFullName Contains the full path and file name of the file
RArray < TMsvId > * aMsvIdArray an array contains a list of TMsvId ( returned )

ConstructRichTextLC()

CRichText * ConstructRichTextLC ( ) [private, static]

Constructs rich text

CreateDefaultMtmServiceL(TUid)

IMPORT_C void CreateDefaultMtmServiceL ( TUid aMtm ) [static]

Creates default Mtm service

Parameters

TUid aMtm Mtm

CreateInboxAttachmentL(CObexBufObject *&, const TUid, TMsvId &, RFile &)

IMPORT_C void CreateInboxAttachmentL ( CObexBufObject *& aBufObject,
const TUid aMtmId,
TMsvId & aMsvIdParent,
RFile & aFile
) [static]

Create inbox attachment and entries.

Parameters

CObexBufObject *& aBufObject The object to be saved
const TUid aMtmId MTM Id
TMsvId & aMsvIdParent Parent message entry (returned)
RFile & aFile File to the attachment (returned)

CreateInboxAttachmentL(CObexBufObject *&, const TUid, TMsvId &, RFile &, const TDesC &)

IMPORT_C void CreateInboxAttachmentL ( CObexBufObject *& aBufObject,
const TUid aMtmId,
TMsvId & aMsvIdParent,
RFile & aFile,
const TDesC & aRemoteBluetoothName
) [static]

Create inbox attachment and entries.

Parameters

CObexBufObject *& aBufObject The object to be saved
const TUid aMtmId MTM Id
TMsvId & aMsvIdParent Parent message entry (returned)
RFile & aFile File to the attachment (returned)
const TDesC & aRemoteBluetoothName sender's bluetooth name.

CreateMsvSessionLC(CDummySessionObserver *&, CMsvSession *&)

void CreateMsvSessionLC ( CDummySessionObserver *& aSessionObs,
CMsvSession *& aMsvSession
) [private, static]

Parameters

CDummySessionObserver *& aSessionObs
CMsvSession *& aMsvSession

CreateMsvSessionLC(CDummySessionObserver *&, CMsvSession *&, CMsvEntry *&, TMsvId)

void CreateMsvSessionLC ( CDummySessionObserver *& aSessionObs,
CMsvSession *& aMsvSession,
CMsvEntry *& aDestination,
TMsvId aMsvId
) [private, static]

Parameters

CDummySessionObserver *& aSessionObs
CMsvSession *& aMsvSession
CMsvEntry *& aDestination
TMsvId aMsvId

CreateOutboxEntryL(const TUid &, const TInt &)

IMPORT_C TMsvId CreateOutboxEntryL ( const TUid & aMtm,
const TInt & aResourceID
) [static]

Creates an Outbox entry

Parameters

const TUid & aMtm
const TInt & aResourceID Resource id for the message entry text

CreateReceiveBufferAndRFileL(RFile &, const TDesC &, TFileName &, CBufFlat *&, const TInt)

IMPORT_C TInt CreateReceiveBufferAndRFileL ( RFile & aFile,
const TDesC & aPath,
TFileName & aFullName,
CBufFlat *& aReceiveObject,
const TInt aBufSize
) [static]

Create receive buffer and RFile object. S60 v5.0

Parameters

RFile & aFile File to temp file
const TDesC & aPath Path The directory in which the file is created
TFileName & aFullName Contains the full path and file name of the file (returned)
CBufFlat *& aReceiveObject Obex object for receive buffer ( returned )
const TInt aBufSize Size of receive buffer

DeleteOutboxEntryL(const TMsvId &)

IMPORT_C void DeleteOutboxEntryL ( const TMsvId & aMessageServerIndex ) [static]

Deletes an Outbox entry

Parameters

const TMsvId & aMessageServerIndex Message server entry

DoCreateInboxAttachmentL(const TUid, TMsvId &, RFile &, const TDesC &)

void DoCreateInboxAttachmentL ( const TUid aMtmId,
TMsvId & aMsvIdParent,
RFile & aFile,
const TDesC & aRemoteBluetoothName =  KNullDesC
) [private, static]

Create inbox attachment and entries.

Parameters

const TUid aMtmId Mtm ID of the message
TMsvId & aMsvIdParent Parent message entry (returned)
RFile & aFile File to the attachment (returned)
const TDesC & aRemoteBluetoothName =  KNullDesC sender's bluetooth name.

FinaliseMessageL(CMsvEntry *, TReceivedData &, CMsvStore *, TBool)

void FinaliseMessageL ( CMsvEntry * aParentEntry,
TReceivedData & aRecData,
CMsvStore * aStore,
TBool aIsBioMsg
) [private, static]

Finalises the parent entry to contain correct data

Parameters

CMsvEntry * aParentEntry Parent entry
TReceivedData & aRecData
CMsvStore * aStore Attachment's store
TBool aIsBioMsg Is BIO message?

FinaliseMessageL(CMsvEntry *, CMsvStore *, TEntry &, TParse &)

void FinaliseMessageL ( CMsvEntry * aParentEntry,
CMsvStore * aStore,
TEntry & aFileEntry,
TParse & aFileNameParser
) [private, static]

Finalises the parent entry to contain correct data v5.0

Parameters

CMsvEntry * aParentEntry Parent entry
CMsvStore * aStore Attachment's store
TEntry & aFileEntry a file entry
TParse & aFileNameParser a file name parser

FixExtremeLongFileName(TFileName &, const TDesC &)

void FixExtremeLongFileName ( TFileName & aExtremeLongFileName,
const TDesC & aDriveAndPath
) [private, static]

FixExtremeLongFileName

Parameters

TFileName & aExtremeLongFileName
const TDesC & aDriveAndPath file drive and path

GetCenRepKeyIntValueL(TUid, TUint32, TInt &)

IMPORT_C TInt GetCenRepKeyIntValueL ( TUid aRepositoryUid,
TUint32 aId,
TInt & aVal
) [static]

Gets central repository key's integer value

Parameters

TUid aRepositoryUid Central repository's UID value
TUint32 aId Central repository's ID value
TInt & aVal Returned integer value

GetCenRepKeyStringValueL(TUid, TUint32, TDes &)

IMPORT_C TInt GetCenRepKeyStringValueL ( TUid aRepositoryUid,
TUint32 aId,
TDes & aVal
) [static]

Gets central repository key's string value

Parameters

TUid aRepositoryUid Central repository's UID value
TUint32 aId Central repository's ID value
TDes & aVal Returned string value

GetCurrentTime()

TTime GetCurrentTime ( ) [private, static]

Gets current time

GetFileSystemStatus()

IMPORT_C TInt GetFileSystemStatus ( ) [static]

Get status of file system. (in C drive)

GetMessageCentreDriveL()

IMPORT_C TInt GetMessageCentreDriveL ( ) [static]

Get current message centre drive

GetMmcFileSystemStatus()

IMPORT_C TInt GetMmcFileSystemStatus ( ) [static]

Get status of file system in MMC.

GetPubSubKeyIntValue(TUid, TUint, TInt &)

IMPORT_C TInt GetPubSubKeyIntValue ( TUid aCategory,
TUint aKey,
TInt & value
) [static]

Gets Publish & Subscribe key's integer value

Parameters

TUid aCategory Category of the key
TUint aKey PUBSUB Key
TInt & value Returned value

MakeValidFileName(RFs &, TDes &)

void MakeValidFileName ( RFs & aFileSession,
TDes & aFileName
) [private, static]

Makes a valid OS filesystem filename by removing illegal characters

Parameters

RFs & aFileSession File server filesession
TDes & aFileName File name to check and modify

RecogniseObjectsL(TFileName &, CMsvAttachment *)

void RecogniseObjectsL ( TFileName & aFileName,
CMsvAttachment * aAttachInfo
) [private, static]

Recognises MIME type of a file

Parameters

TFileName & aFileName
CMsvAttachment * aAttachInfo Attachment information

RemoveInboxEntriesL(CObexBufObject *&, TMsvId)

IMPORT_C void RemoveInboxEntriesL ( CObexBufObject *& aBufObject,
TMsvId aMsvIdParent
) [static]

Remove unfinished work from inbox

Parameters

CObexBufObject *& aBufObject The object to be saved (set to null after remove)
TMsvId aMsvIdParent Parent message entry

RemoveObexBuffer(CObexBufObject *&)

void RemoveObexBuffer ( CObexBufObject *& aBufObject ) [private, static]

Deletes Obex Buf Object buffer

Parameters

CObexBufObject *& aBufObject The buffer object

RemoveTemporaryRFileL(const TFileName &)

IMPORT_C void RemoveTemporaryRFileL ( const TFileName & aFullName ) [static]

Remove temporary RFile object. S60 v5.0

Parameters

const TFileName & aFullName Contains the full path and file name of the file

RenameFileL(TFileName &, TFileName &, const TDesC &, RFs &)

TInt RenameFileL ( TFileName & aFileName,
TFileName & aNewFileName,
const TDesC & aNewPath,
RFs & aFileSession
) [private, static]

Rename file and move file if needed. S60 v5.0

Parameters

TFileName & aFileName
TFileName & aNewFileName new path where file will be moved to
const TDesC & aNewPath
RFs & aFileSession a file session

RenameFileWithSegmentNumL(TDes &, TInt, TDes &)

TInt RenameFileWithSegmentNumL ( TDes & aFileName,
TInt aSegmentNum,
TDes & aSegementString
) [private, static]

Rename filename with a segement number. S60 v5.0

Parameters

TDes & aFileName
TInt aSegmentNum number used to modifed the file name
TDes & aSegementString

SaveFileToFileSystemL(CObexBufObject *&, const TUid, TMsvId &, TFileName &, RFile &, const TDesC &)

IMPORT_C void SaveFileToFileSystemL ( CObexBufObject *& aReceiveObject,
const TUid aMtmId,
TMsvId & aMsvIdParent,
TFileName & aFullName,
RFile & aFile,
const TDesC & aSenderBluetoothName
) [static]

Create inbox entries and saves received object to file system S60 v5.0

Parameters

CObexBufObject *& aReceiveObject Obex object for receive buffer
const TUid aMtmId MTM Id
TMsvId & aMsvIdParent Parent message entry (returned)
TFileName & aFullName The directory and file name in which the file is saved (returned)
RFile & aFile File handler identical with the one in CreateReceiveBufferAndRFileL() it must be opened before use.
const TDesC & aSenderBluetoothName

SaveMimeAndGetBioLC(TFileName &, RFs &, CMsvAttachment *, TUid &)

CBIODatabase * SaveMimeAndGetBioLC ( TFileName & aFileName,
RFs & aFsSess,
CMsvAttachment * aAttachInfo,
TUid & aBioMsgId
) [private, static]

Saves MIME type and gets BIO for that MIME type

Parameters

TFileName & aFileName
RFs & aFsSess File session to use for BIO database
CMsvAttachment * aAttachInfo Attachment information
TUid & aBioMsgId Returned BIO message's ID

SaveObjToInboxL(CObexBufObject *, const TDesC16 &, const TUid)

IMPORT_C void SaveObjToInboxL ( CObexBufObject * aReceivedObject,
const TDesC16 & aPath,
const TUid aMtmID
) [static]

Saves received object to Inbox.

Parameters

CObexBufObject * aReceivedObject The object to be saved.
const TDesC16 & aPath
const TUid aMtmID The message type module id.

SaveObjToInboxL(CObexBufObject *&, RFile &, TMsvId)

IMPORT_C void SaveObjToInboxL ( CObexBufObject *& aReceivedObject,
RFile & aFile,
TMsvId aMsvIdParent
) [static]

Saves received object to Inbox.

Parameters

CObexBufObject *& aReceivedObject The object to be saved (set to null after remove).
RFile & aFile File to the attachment
TMsvId aMsvIdParent Parent message entry

SetBioDataTextL(TBioMsgIdText &, const TDesC8 &)

void SetBioDataTextL ( TBioMsgIdText & aText,
const TDesC8 & aType
) [private, static]

Converts text from UTF-8 to two-byte Unicode

Parameters

TBioMsgIdText & aText destination where to store the converted text
const TDesC8 & aType source of conversion in UTF-8

SetDetailsLC(TPtrC &, const TDesC8 &)

void SetDetailsLC ( TPtrC & aDetails,
const TDesC8 & aType
) [private, static]

Converts text from UTF-8 to two-byte Unicode

Parameters

TPtrC & aDetails destination where to store the converted text
const TDesC8 & aType source of conversion in UTF-8

StoreAndUpdateBioMessageL(CBIODatabase *, TUid, CMsvEntry *, RFile &)

void StoreAndUpdateBioMessageL ( CBIODatabase * aBioDB,
TUid aBioMsgId,
CMsvEntry * parentEntry,
RFile & aFile
) [private, static]

Stores BIO message to parent entry's body and updates information

Parameters

CBIODatabase * aBioDB BIO database for a BIO message
TUid aBioMsgId
CMsvEntry * parentEntry Parent entry
RFile & aFile File to save to parent entry's body

StoreAsRichTextL(CMsvEntry *, RFile &)

void StoreAsRichTextL ( CMsvEntry * aParentEntry,
RFile & aFile
) [private, static]

Stores message as rich text

Parameters

CMsvEntry * aParentEntry Parent entry
RFile & aFile File to store to the message entry's store

UpdateAttachmentInformationL(TReceivedData &, CMsvEntry *, CMsvAttachment *, CMsvStore *)

void UpdateAttachmentInformationL ( TReceivedData & aRecData,
CMsvEntry * aAttachEntry,
CMsvAttachment * aAttachInfo,
CMsvStore * aStore
) [private, static]

Updates attachment's information

Parameters

TReceivedData & aRecData Received obex data
CMsvEntry * aAttachEntry Attachment entry
CMsvAttachment * aAttachInfo Attachment information
CMsvStore * aStore Message store (attachment)

UpdateEntryAttachmentL(TFileName &, CMsvEntry *)

IMPORT_C void UpdateEntryAttachmentL ( TFileName & aFullName,
CMsvEntry * aParentEntry
) [static]

Update entry attachmeent in Inbox S60 v5.0

Parameters

TFileName & aFullName Contains the full path and file name of the file
CMsvEntry * aParentEntry