TSmsUtilities Class Reference

class TSmsUtilities

SMS Messaging utility functions.

Member Functions Documentation

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

void CompareEntryL ( const TMsvEntry & aEntry,
TUid aMtm,
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,
TInt aMaxLength
) [private, static]

Parameters

const CSmsMessage & aMessage
TDes & aDescription
TInt aMaxLength

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

void DoGetDetailsL ( RFs & aFs,
const TDesC & aFromAddress,
TDes & aDetails,
TInt aMaxLength
) [private, static]

Parameters

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

ExtractDescriptionFromMessage(const CSmsMessage &, TDes &, TInt)

void ExtractDescriptionFromMessage ( const CSmsMessage & aMessage,
TDes & aDescription,
TInt aMaxLength
) [private, static]

Parameters

const CSmsMessage & aMessage
TDes & aDescription
TInt aMaxLength

GetDescription(const CSmsMessage &, TDes &, TInt)

IMPORT_C TInt GetDescription ( const CSmsMessage & aMessage,
TDes & aDescription,
TInt aMaxLength =  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 & aMessage The SMS message object.
TDes & aDescription The 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 TInt GetDetails ( RFs & aFs,
const CSmsMessage & aMessage,
TDes & aDetails,
TInt aMaxLength =  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 & aFs A connected file server session.
const CSmsMessage & aMessage The message object with the recipient/sender telephone number.
TDes & aDetails The 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 TInt GetDetails ( RFs & aFs,
const TDesC & aFromAddress,
TDes & aDetails,
TInt aMaxLength =  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 & aFs A connected file server session.
const TDesC & aFromAddress The recipient/sender telephone number.
TDes & aDetails The output argument to contain the message details.
TInt aMaxLength =  KSmsDetailsLength The maximum length of the supplied buffer in aDetails.

GetName(CContactItemField &, TUid, TDes &)

void GetName ( CContactItemField & aField,
TUid aFieldType,
TDes & aName
) [private, static]

Parameters

CContactItemField & aField
TUid aFieldType
TDes & aName

OpenResourceFileL(RFs &)

IMPORT_C RResourceFile OpenResourceFileL ( 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 & aFs A connected file server session.

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

IMPORT_C void PopulateMsgEntry ( TMsvEntry & aEntry,
const CSmsMessage & aMessage,
TMsvId aServiceId,
TUid aMtm =  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 & aEntry An input/output argument with the index entry to populate.
const CSmsMessage & aMessage The SMS message object for the index entry.
TMsvId aServiceId The 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 void PopulateMsgEntry ( TMsvEntry & aEntry,
const CSmsMessage & aMessage,
TMsvId aServiceId,
const CSmsSettings & aSettings,
TUid aMtm =  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 & aEntry An input/output argument with the index entry to populate.
const CSmsMessage & aMessage The SMS message object for the index entry.
TMsvId aServiceId The Service ID for the message.
const CSmsSettings & aSettings The settings for the SMS account.
TUid aMtm =  KUidMsgTypeSMS The specified MTM. This has a default value of KUidMsgTypeSMS.

ReadResourceStringL(RResourceFile, TInt, TDes &)

IMPORT_C void ReadResourceStringL ( RResourceFile aResourceFile,
TInt aResourceId,
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 aResourceFile The opened resource file to read the resource from.
TInt aResourceId The ID of the resource that is required.
TDes & aString An output buffer into which the read resource is placed.

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

void Replace ( 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 void ServiceIdL ( CMsvServerEntry & aEntry,
TMsvId & aFirstId,
TUid aMtm =  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 & aEntry A server message entry that can be used by this function.
TMsvId & aFirstId An output argument with the first Service ID.
TUid aMtm =  KUidMsgTypeSMS The specified MTM. This has a default value of KUidMsgTypeSMS.
CMsvEntrySelection * aServiceIds = NULL An input/output argument with the complete selection of Service IDs. This has a default value of NULL.

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

IMPORT_C void ServiceIdL ( CMsvEntry & aEntry,
TMsvId & aFirstId,
TUid aMtm =  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 & aEntry A message entry that can be used by this function.
TMsvId & aFirstId An output argument with the first Service ID.
TUid aMtm =  KUidMsgTypeSMS The specified MTM. This has a default value of KUidMsgTypeSMS.
CMsvEntrySelection * aServiceIds = NULL An input/output argument with the complete selection of Service IDs. This has a default value of NULL.

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

IMPORT_C void ServiceIdL ( CMsvSession & aSession,
TMsvId & aFirstId,
TUid aMtm =  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 & aSession A message server session.
TMsvId & aFirstId An output argument with the first Service ID.
TUid aMtm =  KUidMsgTypeSMS The specified MTM. This has a default value of KUidMsgTypeSMS.
CMsvEntrySelection * aServiceIds = NULL An 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.