TSmsUtilities Class Reference

class TSmsUtilities

SMS Messaging utility functions.

Member Functions Documentation

CompareEntryL(const TMsvEntry &, TUid, TMsvId &, CMsvEntrySelection *)

voidCompareEntryL(const TMsvEntry &aEntry,
TUidaMtm,
TMsvId &aFirstId,
CMsvEntrySelection *aServiceIds
)[private, static]

Parameters

const TMsvEntry & aEntry
TUid aMtm
TMsvId & aFirstId
CMsvEntrySelection * aServiceIds

DoGetDescriptionL(const CSmsMessage &, TDes &, TInt)

TBool DoGetDescriptionL(const CSmsMessage &aMessage,
TDes &aDescription,
TIntaMaxLength
)[private, static]

Parameters

const CSmsMessage & aMessage
TDes & aDescription
TInt aMaxLength

DoGetDetailsL(RFs &, const TDesC &, TDes &, TInt)

voidDoGetDetailsL(RFs &aFs,
const TDesC &aFromAddress,
TDes &aDetails,
TIntaMaxLength
)[private, static]

Parameters

RFs & aFs
const TDesC & aFromAddress
TDes & aDetails
TInt aMaxLength

ExtractDescriptionFromMessage(const CSmsMessage &, TDes &, TInt)

voidExtractDescriptionFromMessage(const CSmsMessage &aMessage,
TDes &aDescription,
TIntaMaxLength
)[private, static]

Parameters

const CSmsMessage & aMessage
TDes & aDescription
TInt aMaxLength

GetDescription(const CSmsMessage &, TDes &, TInt)

IMPORT_C TIntGetDescription(const CSmsMessage &aMessage,
TDes &aDescription,
TIntaMaxLength =  KSmsDescriptionLength
)[static]

Get the SMS message description.

If the message is Special Message Indication SMS then the description will contain the appropriate localised text for the indication.

If the message is a Status Report then the description will contain the appropriate localised text for a Status Report.

If the message is a standard text message the description will contain the beginning section of the SMS message text itself.

In all cases the buffer limit specified by aMaxLength is observered.

Parameters

const CSmsMessage & aMessageThe SMS message object.
TDes & aDescriptionThe output argument for the description.
TInt aMaxLength =  KSmsDescriptionLength The maximum length of the supplied buffer in aDescription.

GetDetails(RFs &, const CSmsMessage &, TDes &, TInt)

IMPORT_C TIntGetDetails(RFs &aFs,
const CSmsMessage &aMessage,
TDes &aDetails,
TIntaMaxLength =  KSmsDetailsLength
)[static]

Get the SMS message recipient/sender details.

The recipient/sender telephone number is extracted from the supplied message object. If the recipient/sender telephone number appears uniquely in the contacts database then the family name and given name contact details are set into the output argument aDetails in the format specified by the resource item R_SENDER_NAME_FORMAT. The buffer limit specified by aMaxLength is observed.

If there is not a unique contact entry for the recipient/sender telephone number then aDetails will contain the orginally telephone number.

Parameters

RFs & aFsA connected file server session.
const CSmsMessage & aMessageThe message object with the recipient/sender telephone number.
TDes & aDetailsThe output argument to contain the message details.
TInt aMaxLength =  KSmsDetailsLength The maximum length of the supplied buffer in aDetails.

GetDetails(RFs &, const TDesC &, TDes &, TInt)

IMPORT_C TIntGetDetails(RFs &aFs,
const TDesC &aFromAddress,
TDes &aDetails,
TIntaMaxLength =  KSmsDetailsLength
)[static]

Get the SMS message recipient/sender details.

The recipient/sender telephone number is searched for in the contacts database. If a unique match is found then the family name and given name contact details are set into the output argument aDetails in the format specified by the resource item R_SENDER_NAME_FORMAT. The buffer limit specified by aMaxLength is observed.

If a unique match is not found or the supplied telephone number is invalid, then aDetails will contain the orginally telephone number.

Parameters

RFs & aFsA connected file server session.
const TDesC & aFromAddressThe recipient/sender telephone number.
TDes & aDetailsThe output argument to contain the message details.
TInt aMaxLength =  KSmsDetailsLength The maximum length of the supplied buffer in aDetails.

GetName(CContactItemField &, TUid, TDes &)

voidGetName(CContactItemField &aField,
TUidaFieldType,
TDes &aName
)[private, static]

Parameters

CContactItemField & aField
TUid aFieldType
TDes & aName

OpenResourceFileL(RFs &)

IMPORT_C RResourceFileOpenResourceFileL(RFs &aFs)[static]

Opens and returns the SMS client MTM resource file.

It is the responsibility of the caller to ensure that the resource file is closed once it is no longer required.

Parameters

RFs & aFsA connected file server session.

PopulateMsgEntry(TMsvEntry &, const CSmsMessage &, TMsvId, TUid)

IMPORT_C voidPopulateMsgEntry(TMsvEntry &aEntry,
const CSmsMessage &aMessage,
TMsvIdaServiceId,
TUidaMtm =  KUidMsgTypeSMS
)[static]

Populates a message index.

The input data is used to set the fields in supplied message index. The affected fields are the entry type, MTM, entry date, Service ID and error fields. The date field is set from the time information in the aMessage argument.

This function can be used as part of the process when creating SMS messages in the message store.

Parameters

TMsvEntry & aEntryAn input/output argument with the index entry to populate.
const CSmsMessage & aMessageThe SMS message object for the index entry.
TMsvId aServiceIdThe Service ID for the message.
TUid aMtm =  KUidMsgTypeSMS The specified MTM. This has a default value of KUidMsgTypeSMS.

PopulateMsgEntry(TMsvEntry &, const CSmsMessage &, TMsvId, const CSmsSettings &, TUid)

IMPORT_C voidPopulateMsgEntry(TMsvEntry &aEntry,
const CSmsMessage &aMessage,
TMsvIdaServiceId,
const CSmsSettings &aSettings,
TUidaMtm =  KUidMsgTypeSMS
)[static]

Populates a message index.

The input data is used to set the fields in supplied message index. The affected fields are the entry type, MTM, entry date, Service ID and error fields. The date field is either set from the time information in the aMessage argument or from the service center timestamp in the PDU depending on the associated SMS setting.

This function can be used as part of the process when creating SMS messages in the message store.

Parameters

TMsvEntry & aEntryAn input/output argument with the index entry to populate.
const CSmsMessage & aMessageThe SMS message object for the index entry.
TMsvId aServiceIdThe Service ID for the message.
const CSmsSettings & aSettingsThe settings for the SMS account.
TUid aMtm =  KUidMsgTypeSMS The specified MTM. This has a default value of KUidMsgTypeSMS.

ReadResourceStringL(RResourceFile, TInt, TDes &)

IMPORT_C voidReadResourceStringL(RResourceFileaResourceFile,
TIntaResourceId,
TDes &aString
)[static]

Reads the resource specified by aResourceId from the supplied resource file.

The resource is returned in the output argument aString. The supplied resource file must be open or this function will leave.

leave
KErrOverflow The length of the resource string is greater than the maximum allowed.

Parameters

RResourceFile aResourceFileThe opened resource file to read the resource from.
TInt aResourceIdThe ID of the resource that is required.
TDes & aStringAn output buffer into which the read resource is placed.

Replace(const TDesC &, const TDesC &, TDes &)

voidReplace(const TDesC &aOld,
const TDesC &aNew,
TDes &aString
)[private, static]

Parameters

const TDesC & aOld
const TDesC & aNew
TDes & aString

ServiceIdL(CMsvServerEntry &, TMsvId &, TUid, CMsvEntrySelection *)

IMPORT_C voidServiceIdL(CMsvServerEntry &aEntry,
TMsvId &aFirstId,
TUidaMtm =  KUidMsgTypeSMS ,
CMsvEntrySelection *aServiceIds = NULL
)[static]

Finds and returns all the Service IDs for the specified MTM.

A Service ID is the entry ID for an service-type entry. The first Service ID for the specified MTM is returned.

If the complete set of Service IDs for the MTM is required then the caller should provide a valid CMsvEntrySelection object in aServiceIds. The Service Ids are appended to this object. If the complete set is not required then the input/output argument aServiceIds should be set to NULL.

leave
KErrNotFound A service entry could not be found for the specified MTM.

Parameters

CMsvServerEntry & aEntryA server message entry that can be used by this function.
TMsvId & aFirstIdAn output argument with the first Service ID.
TUid aMtm =  KUidMsgTypeSMS The specified MTM. This has a default value of KUidMsgTypeSMS.
CMsvEntrySelection * aServiceIds = NULLAn input/output argument with the complete selection of Service IDs. This has a default value of NULL.

ServiceIdL(CMsvEntry &, TMsvId &, TUid, CMsvEntrySelection *)

IMPORT_C voidServiceIdL(CMsvEntry &aEntry,
TMsvId &aFirstId,
TUidaMtm =  KUidMsgTypeSMS ,
CMsvEntrySelection *aServiceIds = NULL
)[static]

Finds and returns all the Service IDs for the specified MTM.

A Service ID is the entry ID for an service-type entry. The first Service ID for the specified MTM is returned.

If the complete set of Service IDs for the MTM is required then the caller should provide a valid CMsvEntrySelection object in aServiceIds. The Service Ids are appended to this object. If the complete set is not required then the input/output argument aServiceIds should be set to NULL.

leave
KErrNotFound A service entry could not be found for the specified MTM.

Parameters

CMsvEntry & aEntryA message entry that can be used by this function.
TMsvId & aFirstIdAn output argument with the first Service ID.
TUid aMtm =  KUidMsgTypeSMS The specified MTM. This has a default value of KUidMsgTypeSMS.
CMsvEntrySelection * aServiceIds = NULLAn input/output argument with the complete selection of Service IDs. This has a default value of NULL.

ServiceIdL(CMsvSession &, TMsvId &, TUid, CMsvEntrySelection *)

IMPORT_C voidServiceIdL(CMsvSession &aSession,
TMsvId &aFirstId,
TUidaMtm =  KUidMsgTypeSMS ,
CMsvEntrySelection *aServiceIds = NULL
)[static]

Finds and returns all the Service IDs for the specified MTM.

A Service ID is the entry ID for an service-type entry. The first Service ID for the specified MTM is returned.

If the complete set of Service IDs for the MTM is required then the caller should provide a valid CMsvEntrySelection object in aServiceIds. The Service Ids are appended to this object. If the complete set is not required then the input/output argument aServiceIds should be set to NULL.

leave
KErrNotFound A service entry could not be found for the specified MTM.

Parameters

CMsvSession & aSessionA message server session.
TMsvId & aFirstIdAn output argument with the first Service ID.
TUid aMtm =  KUidMsgTypeSMS The specified MTM. This has a default value of KUidMsgTypeSMS.
CMsvEntrySelection * aServiceIds = NULLAn input/output argument with the complete selection of Service IDs. This has a default value of NULL.

ValidGsmNumber(const TDesC &)

TBool ValidGsmNumber(const TDesC &aTelephone)[private, static]

Parameters

const TDesC & aTelephone

Member Enumerations Documentation

Enum TSmsUtilitiesSpecialMessageType

Special SMS Message Indication Type.

A special SMS message indication is used to notify of waiting services, for instance a voicemail message.

The TSmsUtilitiesSpecialMessageType enum represents the flags for the known indication types.

Enumerators

EVoiceMessageWaiting = 0

Voice message waiting.

EFaxMessageWaiting

Fax message waiting.

EEmailMessageWaiting

E-mail message waiting.

EOtherMessageWaiting

Other message-type waiting (see 3GPP TS 23.038 [9] for definition of "other").

ESpecialMessageTypeMask = 0x7F

Mask used to obtain the mesasge indication type from the SMS data.