Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: smut.h
Link against: smcm.lib

Class TSmsUtilities

class TSmsUtilities;

Description

SMS Messaging utility functions.

Members

Defined in TSmsUtilities:
Dummy_Export_1(), Dummy_Export_2(), EEmailMessageWaiting, EEmailMessageWaiting, EFaxMessageWaiting, EFaxMessageWaiting, EOtherMessageWaiting, EOtherMessageWaiting, ESpecialMessageTypeMask, ESpecialMessageTypeMask, EVoiceMessageWaiting, EVoiceMessageWaiting, GetDescription(), GetDescription(), GetDetails(), GetDetails(), GetDetails(), GetDetails(), OpenResourceFileL(), OpenResourceFileL(), PopulateMsgEntry(), PopulateMsgEntry(), PopulateMsgEntry(), PopulateMsgEntry(), ReadResourceStringL(), ReadResourceStringL(), ServiceIdL(), ServiceIdL(), ServiceIdL(), ServiceIdL(), ServiceIdL(), ServiceIdL(), TSmsUtilitiesSpecialMessageType, TSmsUtilitiesSpecialMessageType


Member functions


ServiceIdL()

static IMPORT_C void ServiceIdL(CMsvServerEntry &aEntry, TMsvId &aFirstId, TUid aMtm=KUidMsgTypeSMS, CMsvEntrySelection *aServiceIds=0);

Description

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.

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

The specified MTM. This has a default value of KUidMsgTypeSMS.

CMsvEntrySelection *aServiceIds

An input/output argument with the complete selection of Service IDs. This has a default value of NULL.

Leave codes

KErrNotFound

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


ServiceIdL()

static IMPORT_C void ServiceIdL(CMsvEntry &aEntry, TMsvId &aFirstId, TUid aMtm=KUidMsgTypeSMS, CMsvEntrySelection *aServiceIds=0);

Description

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.

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

The specified MTM. This has a default value of KUidMsgTypeSMS.

CMsvEntrySelection *aServiceIds

An input/output argument with the complete selection of Service IDs. This has a default value of NULL.

Leave codes

KErrNotFound

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


ServiceIdL()

static IMPORT_C void ServiceIdL(CMsvSession &aSession, TMsvId &aFirstId, TUid aMtm=KUidMsgTypeSMS, CMsvEntrySelection *aServiceIds=0);

Description

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.

Parameters

CMsvSession &aSession

A message server session.

TMsvId &aFirstId

An output argument with the first Service ID.

TUid aMtm

The specified MTM. This has a default value of KUidMsgTypeSMS.

CMsvEntrySelection *aServiceIds

An input/output argument with the complete selection of Service IDs. This has a default value of NULL.

Leave codes

KErrNotFound

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


PopulateMsgEntry()

static IMPORT_C void PopulateMsgEntry(TMsvEntry &aEntry, const CSmsMessage &aMessage, TMsvId aServiceId, TUid aMtm=KUidMsgTypeSMS);

Description

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

The specified MTM. This has a default value of KUidMsgTypeSMS.


PopulateMsgEntry()

static IMPORT_C void PopulateMsgEntry(TMsvEntry &aEntry, const CSmsMessage &aMessage, TMsvId aServiceId, const CSmsSettings &aSettings, TUid aMtm=KUidMsgTypeSMS);

Description

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

The specified MTM. This has a default value of KUidMsgTypeSMS.


GetDetails()

static IMPORT_C TInt GetDetails(RFs &aFs, const CSmsMessage &aMessage, TDes &aDetails, TInt aMaxLength=KSmsDetailsLength);

Description

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

The maximum length of the supplied buffer in aDetails.

Return value

TInt

KErrNotSupported if the message is not of type SMS-SUBMIT, SMS-DELIVER or SMS-STATUS-REPORT. KErrArgument if the telephone number is invalid. KErrNotFound if a contact could not be found. KErrAlreadyExists if more than one contact entry found. KErrNone if details is obtained successfully.


GetDetails()

static IMPORT_C TInt GetDetails(RFs &aFs, const TDesC &aFromAddress, TDes &aDetails, TInt aMaxLength=KSmsDetailsLength);

Description

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

The maximum length of the supplied buffer in aDetails.

Return value

TInt

KErrArgument if aFromAddress is not a valid GSM number. KErrNotFound if a contact could not be found. KErrAlreadyExists if more than one contact entry found. KErrNone if details is obtained successfully.


GetDescription()

static IMPORT_C TInt GetDescription(const CSmsMessage &aMessage, TDes &aDescription, TInt aMaxLength=KSmsDescriptionLength);

Description

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

The maximum length of the supplied buffer in aDescription.

Return value

TInt

An error code if the localised text for a SMS-STATUS-REPORT message could not be obtained. Otherwise KErrNone is returned.


OpenResourceFileL()

static IMPORT_C RResourceFile OpenResourceFileL(RFs &aFs);

Description

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.

Return value

RResourceFile

The opened resource file.


ReadResourceStringL()

static IMPORT_C void ReadResourceStringL(RResourceFile aResourceFile, TInt aResourceId, TDes &aString);

Description

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.

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.

Leave codes

KErrOverflow

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


Dummy_Export_1()

IMPORT_C void Dummy_Export_1();

Description


Dummy_Export_2()

IMPORT_C void Dummy_Export_2();

Description


ServiceIdL()

static IMPORT_C void ServiceIdL(CMsvServerEntry &aEntry, TMsvId &aFirstId, TUid aMtm=KUidMsgTypeSMS, CMsvEntrySelection *aServiceIds=0);

Description

Parameters

CMsvServerEntry &aEntry

TMsvId &aFirstId

TUid aMtm

CMsvEntrySelection *aServiceIds


ServiceIdL()

static IMPORT_C void ServiceIdL(CMsvEntry &aEntry, TMsvId &aFirstId, TUid aMtm=KUidMsgTypeSMS, CMsvEntrySelection *aServiceIds=0);

Description

Parameters

CMsvEntry &aEntry

TMsvId &aFirstId

TUid aMtm

CMsvEntrySelection *aServiceIds


ServiceIdL()

static IMPORT_C void ServiceIdL(CMsvSession &aSession, TMsvId &aFirstId, TUid aMtm=KUidMsgTypeSMS, CMsvEntrySelection *aServiceIds=0);

Description

Parameters

CMsvSession &aSession

TMsvId &aFirstId

TUid aMtm

CMsvEntrySelection *aServiceIds


PopulateMsgEntry()

static IMPORT_C void PopulateMsgEntry(TMsvEntry &aEntry, const CSmsMessage &aMessage, TMsvId aServiceId, TUid aMtm=KUidMsgTypeSMS);

Description

Parameters

TMsvEntry &aEntry

const CSmsMessage &aMessage

TMsvId aServiceId

TUid aMtm


PopulateMsgEntry()

static IMPORT_C void PopulateMsgEntry(TMsvEntry &aEntry, const CSmsMessage &aMessage, TMsvId aServiceId, const CSmsSettings &aSettings, TUid aMtm=KUidMsgTypeSMS);

Description

Parameters

TMsvEntry &aEntry

const CSmsMessage &aMessage

TMsvId aServiceId

const CSmsSettings &aSettings

TUid aMtm


GetDetails()

static IMPORT_C TInt GetDetails(RFs &aFs, const CSmsMessage &aMessage, TDes &aDetails, TInt aMaxLength=KSmsDetailsLength);

Description

Parameters

RFs &aFs

const CSmsMessage &aMessage

TDes &aDetails

TInt aMaxLength

Return value

TInt


GetDetails()

static IMPORT_C TInt GetDetails(RFs &aFs, const TDesC &aFromAddress, TDes &aDetails, TInt aMaxLength=KSmsDetailsLength);

Description

Parameters

RFs &aFs

const TDesC &aFromAddress

TDes &aDetails

TInt aMaxLength

Return value

TInt


GetDescription()

static IMPORT_C TInt GetDescription(const CSmsMessage &aMessage, TDes &aDescription, TInt aMaxLength=KSmsDescriptionLength);

Description

Parameters

const CSmsMessage &aMessage

TDes &aDescription

TInt aMaxLength

Return value

TInt


OpenResourceFileL()

static IMPORT_C RResourceFile OpenResourceFileL(RFs &aFs);

Description

Parameters

RFs &aFs

Return value

RResourceFile


ReadResourceStringL()

static IMPORT_C void ReadResourceStringL(RResourceFile aResourceFile, TInt aResourceId, TDes &aString);

Description

Parameters

RResourceFile aResourceFile

TInt aResourceId

TDes &aString

[Top]


Member enumerations


Enum TSmsUtilitiesSpecialMessageType

TSmsUtilitiesSpecialMessageType

Description

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.

EVoiceMessageWaiting

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

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


Enum TSmsUtilitiesSpecialMessageType

TSmsUtilitiesSpecialMessageType

Description

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.

EVoiceMessageWaiting

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

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