TObexUtilsMessageHandler Class Reference

class TObexUtilsMessageHandler

Utility methods for message handling.

Public Member Functions
IMPORT_C voidAddEntryToInboxL(TMsvId &, TFileName &)
IMPORT_C voidAddEntryToInboxL(TMsvId &, TFileName &, RArray< TMsvId > *)
IMPORT_C voidCreateDefaultMtmServiceL(TUid)
IMPORT_C voidCreateInboxAttachmentL(CObexBufObject *&, const TUid, TMsvId &, RFile &)
IMPORT_C voidCreateInboxAttachmentL(CObexBufObject *&, const TUid, TMsvId &, RFile &, const TDesC &)
IMPORT_C TMsvIdCreateOutboxEntryL(const TUid &, const TInt &)
IMPORT_C TIntCreateReceiveBufferAndRFileL(RFile &, const TDesC &, TFileName &, CBufFlat *&, const TInt)
IMPORT_C voidDeleteOutboxEntryL(const TMsvId &)
IMPORT_C TIntGetCenRepKeyIntValueL(TUid, TUint32, TInt &)
IMPORT_C TIntGetCenRepKeyStringValueL(TUid, TUint32, TDes &)
IMPORT_C TIntGetFileSystemStatus()
IMPORT_C TIntGetMessageCentreDriveL()
IMPORT_C TIntGetMmcFileSystemStatus()
IMPORT_C TIntGetPubSubKeyIntValue(TUid, TUint, TInt &)
IMPORT_C voidRemoveInboxEntriesL(CObexBufObject *&, TMsvId)
IMPORT_C voidRemoveTemporaryRFileL(const TFileName &)
IMPORT_C voidSaveFileToFileSystemL(CObexBufObject *&, const TUid, TMsvId &, TFileName &, RFile &, const TDesC &)
IMPORT_C voidSaveObjToInboxL(CObexBufObject *, const TDesC16 &, const TUid)
IMPORT_C voidSaveObjToInboxL(CObexBufObject *&, RFile &, TMsvId)
IMPORT_C voidUpdateEntryAttachmentL(TFileName &, CMsvEntry *)
Private Member Functions
CRichText *ConstructRichTextLC()
voidCreateMsvSessionLC(CDummySessionObserver *&, CMsvSession *&)
voidCreateMsvSessionLC(CDummySessionObserver *&, CMsvSession *&, CMsvEntry *&, TMsvId)
voidDoCreateInboxAttachmentL(const TUid, TMsvId &, RFile &, const TDesC &)
voidFinaliseMessageL(CMsvEntry *, TReceivedData &, CMsvStore *, TBool)
voidFinaliseMessageL(CMsvEntry *, CMsvStore *, TEntry &, TParse &)
voidFixExtremeLongFileName(TFileName &, const TDesC &)
TTime GetCurrentTime()
voidMakeValidFileName(RFs &, TDes &)
voidRecogniseObjectsL(TFileName &, CMsvAttachment *)
voidRemoveObexBuffer(CObexBufObject *&)
TInt RenameFileL(TFileName &, TFileName &, const TDesC &, RFs &)
TInt RenameFileWithSegmentNumL(TDes &, TInt, TDes &)
CBIODatabase *SaveMimeAndGetBioLC(TFileName &, RFs &, CMsvAttachment *, TUid &)
voidSetBioDataTextL(TBioMsgIdText &, const TDesC8 &)
voidSetDetailsLC(TPtrC &, const TDesC8 &)
voidStoreAndUpdateBioMessageL(CBIODatabase *, TUid, CMsvEntry *, RFile &)
voidStoreAsRichTextL(CMsvEntry *, RFile &)
voidUpdateAttachmentInformationL(TReceivedData &, CMsvEntry *, CMsvAttachment *, CMsvStore *)

Member Functions Documentation

AddEntryToInboxL(TMsvId &, TFileName &)

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

Add an entry to Inbox S60 v5.0

Parameters

TMsvId & aMsvIdParentParent message entry
TFileName & aFullNameContains the full path and file name of the file

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

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

Add an entry to Inbox S60 v5.0

Parameters

TMsvId & aMsvIdParentParent message entry
TFileName & aFullNameContains the full path and file name of the file
RArray< TMsvId > * aMsvIdArrayan array contains a list of TMsvId ( returned )

ConstructRichTextLC()

CRichText *ConstructRichTextLC()[private, static]

Constructs rich text

CreateDefaultMtmServiceL(TUid)

IMPORT_C voidCreateDefaultMtmServiceL(TUidaMtm)[static]

Creates default Mtm service

Parameters

TUid aMtmMtm

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

IMPORT_C voidCreateInboxAttachmentL(CObexBufObject *&aBufObject,
const TUidaMtmId,
TMsvId &aMsvIdParent,
RFile &aFile
)[static]

Create inbox attachment and entries.

Parameters

CObexBufObject *& aBufObjectThe object to be saved
const TUid aMtmIdMTM Id
TMsvId & aMsvIdParentParent message entry (returned)
RFile & aFileFile to the attachment (returned)

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

IMPORT_C voidCreateInboxAttachmentL(CObexBufObject *&aBufObject,
const TUidaMtmId,
TMsvId &aMsvIdParent,
RFile &aFile,
const TDesC &aRemoteBluetoothName
)[static]

Create inbox attachment and entries.

Parameters

CObexBufObject *& aBufObjectThe object to be saved
const TUid aMtmIdMTM Id
TMsvId & aMsvIdParentParent message entry (returned)
RFile & aFileFile to the attachment (returned)
const TDesC & aRemoteBluetoothNamesender's bluetooth name.

CreateMsvSessionLC(CDummySessionObserver *&, CMsvSession *&)

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

Parameters

CDummySessionObserver *& aSessionObs
CMsvSession *& aMsvSession

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

voidCreateMsvSessionLC(CDummySessionObserver *&aSessionObs,
CMsvSession *&aMsvSession,
CMsvEntry *&aDestination,
TMsvIdaMsvId
)[private, static]

Parameters

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

CreateOutboxEntryL(const TUid &, const TInt &)

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

Creates an Outbox entry

Parameters

const TUid & aMtm
const TInt & aResourceIDResource id for the message entry text

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

IMPORT_C TIntCreateReceiveBufferAndRFileL(RFile &aFile,
const TDesC &aPath,
TFileName &aFullName,
CBufFlat *&aReceiveObject,
const TIntaBufSize
)[static]

Create receive buffer and RFile object. S60 v5.0

Parameters

RFile & aFileFile to temp file
const TDesC & aPathPath The directory in which the file is created
TFileName & aFullNameContains the full path and file name of the file (returned)
CBufFlat *& aReceiveObjectObex object for receive buffer ( returned )
const TInt aBufSizeSize of receive buffer

DeleteOutboxEntryL(const TMsvId &)

IMPORT_C voidDeleteOutboxEntryL(const TMsvId &aMessageServerIndex)[static]

Deletes an Outbox entry

Parameters

const TMsvId & aMessageServerIndexMessage server entry

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

voidDoCreateInboxAttachmentL(const TUidaMtmId,
TMsvId &aMsvIdParent,
RFile &aFile,
const TDesC &aRemoteBluetoothName =  KNullDesC
)[private, static]

Create inbox attachment and entries.

Parameters

const TUid aMtmIdMtm ID of the message
TMsvId & aMsvIdParentParent message entry (returned)
RFile & aFileFile to the attachment (returned)
const TDesC & aRemoteBluetoothName =  KNullDesC sender's bluetooth name.

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

voidFinaliseMessageL(CMsvEntry *aParentEntry,
TReceivedData &aRecData,
CMsvStore *aStore,
TBoolaIsBioMsg
)[private, static]

Finalises the parent entry to contain correct data

Parameters

CMsvEntry * aParentEntryParent entry
TReceivedData & aRecData
CMsvStore * aStoreAttachment's store
TBool aIsBioMsgIs BIO message?

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

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

Finalises the parent entry to contain correct data v5.0

Parameters

CMsvEntry * aParentEntryParent entry
CMsvStore * aStoreAttachment's store
TEntry & aFileEntrya file entry
TParse & aFileNameParsera file name parser

FixExtremeLongFileName(TFileName &, const TDesC &)

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

FixExtremeLongFileName

Parameters

TFileName & aExtremeLongFileName
const TDesC & aDriveAndPathfile drive and path

GetCenRepKeyIntValueL(TUid, TUint32, TInt &)

IMPORT_C TIntGetCenRepKeyIntValueL(TUidaRepositoryUid,
TUint32aId,
TInt &aVal
)[static]

Gets central repository key's integer value

Parameters

TUid aRepositoryUidCentral repository's UID value
TUint32 aIdCentral repository's ID value
TInt & aValReturned integer value

GetCenRepKeyStringValueL(TUid, TUint32, TDes &)

IMPORT_C TIntGetCenRepKeyStringValueL(TUidaRepositoryUid,
TUint32aId,
TDes &aVal
)[static]

Gets central repository key's string value

Parameters

TUid aRepositoryUidCentral repository's UID value
TUint32 aIdCentral repository's ID value
TDes & aValReturned string value

GetCurrentTime()

TTime GetCurrentTime()[private, static]

Gets current time

GetFileSystemStatus()

IMPORT_C TIntGetFileSystemStatus()[static]

Get status of file system. (in C drive)

GetMessageCentreDriveL()

IMPORT_C TIntGetMessageCentreDriveL()[static]

Get current message centre drive

GetMmcFileSystemStatus()

IMPORT_C TIntGetMmcFileSystemStatus()[static]

Get status of file system in MMC.

GetPubSubKeyIntValue(TUid, TUint, TInt &)

IMPORT_C TIntGetPubSubKeyIntValue(TUidaCategory,
TUintaKey,
TInt &value
)[static]

Gets Publish & Subscribe key's integer value

Parameters

TUid aCategoryCategory of the key
TUint aKeyPUBSUB Key
TInt & valueReturned value

MakeValidFileName(RFs &, TDes &)

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

Makes a valid OS filesystem filename by removing illegal characters

Parameters

RFs & aFileSessionFile server filesession
TDes & aFileNameFile name to check and modify

RecogniseObjectsL(TFileName &, CMsvAttachment *)

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

Recognises MIME type of a file

Parameters

TFileName & aFileName
CMsvAttachment * aAttachInfoAttachment information

RemoveInboxEntriesL(CObexBufObject *&, TMsvId)

IMPORT_C voidRemoveInboxEntriesL(CObexBufObject *&aBufObject,
TMsvIdaMsvIdParent
)[static]

Remove unfinished work from inbox

Parameters

CObexBufObject *& aBufObjectThe object to be saved (set to null after remove)
TMsvId aMsvIdParentParent message entry

RemoveObexBuffer(CObexBufObject *&)

voidRemoveObexBuffer(CObexBufObject *&aBufObject)[private, static]

Deletes Obex Buf Object buffer

Parameters

CObexBufObject *& aBufObjectThe buffer object

RemoveTemporaryRFileL(const TFileName &)

IMPORT_C voidRemoveTemporaryRFileL(const TFileName &aFullName)[static]

Remove temporary RFile object. S60 v5.0

Parameters

const TFileName & aFullNameContains 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 & aNewFileNamenew path where file will be moved to
const TDesC & aNewPath
RFs & aFileSessiona file session

RenameFileWithSegmentNumL(TDes &, TInt, TDes &)

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

Rename filename with a segement number. S60 v5.0

Parameters

TDes & aFileName
TInt aSegmentNumnumber used to modifed the file name
TDes & aSegementString

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

IMPORT_C voidSaveFileToFileSystemL(CObexBufObject *&aReceiveObject,
const TUidaMtmId,
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 *& aReceiveObjectObex object for receive buffer
const TUid aMtmIdMTM Id
TMsvId & aMsvIdParentParent message entry (returned)
TFileName & aFullNameThe directory and file name in which the file is saved (returned)
RFile & aFileFile 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 & aFsSessFile session to use for BIO database
CMsvAttachment * aAttachInfoAttachment information
TUid & aBioMsgIdReturned BIO message's ID

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

IMPORT_C voidSaveObjToInboxL(CObexBufObject *aReceivedObject,
const TDesC16 &aPath,
const TUidaMtmID
)[static]

Saves received object to Inbox.

Parameters

CObexBufObject * aReceivedObjectThe object to be saved.
const TDesC16 & aPath
const TUid aMtmIDThe message type module id.

SaveObjToInboxL(CObexBufObject *&, RFile &, TMsvId)

IMPORT_C voidSaveObjToInboxL(CObexBufObject *&aReceivedObject,
RFile &aFile,
TMsvIdaMsvIdParent
)[static]

Saves received object to Inbox.

Parameters

CObexBufObject *& aReceivedObjectThe object to be saved (set to null after remove).
RFile & aFileFile to the attachment
TMsvId aMsvIdParentParent message entry

SetBioDataTextL(TBioMsgIdText &, const TDesC8 &)

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

Converts text from UTF-8 to two-byte Unicode

Parameters

TBioMsgIdText & aTextdestination where to store the converted text
const TDesC8 & aTypesource of conversion in UTF-8

SetDetailsLC(TPtrC &, const TDesC8 &)

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

Converts text from UTF-8 to two-byte Unicode

Parameters

TPtrC & aDetailsdestination where to store the converted text
const TDesC8 & aTypesource of conversion in UTF-8

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

voidStoreAndUpdateBioMessageL(CBIODatabase *aBioDB,
TUidaBioMsgId,
CMsvEntry *parentEntry,
RFile &aFile
)[private, static]

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

Parameters

CBIODatabase * aBioDBBIO database for a BIO message
TUid aBioMsgId
CMsvEntry * parentEntryParent entry
RFile & aFileFile to save to parent entry's body

StoreAsRichTextL(CMsvEntry *, RFile &)

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

Stores message as rich text

Parameters

CMsvEntry * aParentEntryParent entry
RFile & aFileFile to store to the message entry's store

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

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

Updates attachment's information

Parameters

TReceivedData & aRecDataReceived obex data
CMsvEntry * aAttachEntryAttachment entry
CMsvAttachment * aAttachInfoAttachment information
CMsvStore * aStoreMessage store (attachment)

UpdateEntryAttachmentL(TFileName &, CMsvEntry *)

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

Update entry attachmeent in Inbox S60 v5.0

Parameters

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