#include <app/smut.h>
class TSmsUtilities |
Public Member Enumerations | |
---|---|
enum | TSmsUtilitiesSpecialMessageType { EVoiceMessageWaiting, EFaxMessageWaiting, EEmailMessageWaiting, EOtherMessageWaiting, ESpecialMessageTypeMask } |
Public Member Functions | |
---|---|
IMPORT_C TInt | GetDescription(const CSmsMessage &, TDes &, TInt) |
IMPORT_C TInt | GetDetails(RFs &, const CSmsMessage &, TDes &, TInt) |
IMPORT_C TInt | GetDetails(RFs &, const TDesC &, TDes &, TInt) |
IMPORT_C RResourceFile | OpenResourceFileL(RFs &) |
IMPORT_C void | PopulateMsgEntry(TMsvEntry &, const CSmsMessage &, TMsvId, TUid) |
IMPORT_C void | PopulateMsgEntry(TMsvEntry &, const CSmsMessage &, TMsvId, const CSmsSettings &, TUid) |
IMPORT_C void | ReadResourceStringL(RResourceFile, TInt, TDes &) |
IMPORT_C void | ServiceIdL(CMsvServerEntry &, TMsvId &, TUid, CMsvEntrySelection *) |
IMPORT_C void | ServiceIdL(CMsvEntry &, TMsvId &, TUid, CMsvEntrySelection *) |
IMPORT_C void | ServiceIdL(CMsvSession &, TMsvId &, TUid, CMsvEntrySelection *) |
SMS Messaging utility functions.
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.
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.
Parameter | Description |
---|---|
aMessage | The SMS message object. |
aDescription | The output argument for the description. |
aMaxLength | The maximum length of the supplied buffer in aDescription. |
Returns: An error code if the localised text for a SMS-STATUS-REPORT message could not be obtained. Otherwise KErrNone is returned.
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.
Parameter | Description |
---|---|
aFs | A connected file server session. |
aMessage | The message object with the recipient/sender telephone number. |
aDetails | The output argument to contain the message details. |
aMaxLength | The maximum length of the supplied buffer in aDetails. |
Returns: 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.
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.
Parameter | Description |
---|---|
aFs | A connected file server session. |
aFromAddress | The recipient/sender telephone number. |
aDetails | The output argument to contain the message details. |
aMaxLength | The maximum length of the supplied buffer in aDetails. |
Returns: 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.
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.
Parameter | Description |
---|---|
aFs | A connected file server session. |
Returns: The opened resource file.
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.
Parameter | Description |
---|---|
aEntry | An input/output argument with the index entry to populate. |
aMessage | The SMS message object for the index entry. |
aServiceId | The Service ID for the message. |
aMtm | The specified MTM. This has a default value of KUidMsgTypeSMS. |
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.
Parameter | Description |
---|---|
aEntry | An input/output argument with the index entry to populate. |
aMessage | The SMS message object for the index entry. |
aServiceId | The Service ID for the message. |
aSettings | The settings for the SMS account. |
aMtm | The specified MTM. This has a default value of KUidMsgTypeSMS. |
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.
Parameter | Description |
---|---|
aResourceFile | The opened resource file to read the resource from. |
aResourceId | The ID of the resource that is required. |
aString | An output buffer into which the read resource is placed. |
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.
Parameter | Description |
---|---|
aEntry | A server message entry that can be used by this function. |
aFirstId | An output argument with the first Service ID. |
aMtm | The specified MTM. This has a default value of KUidMsgTypeSMS. |
aServiceIds | An input/output argument with the complete selection of Service IDs. This has a default value of NULL. |
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.
Parameter | Description |
---|---|
aEntry | A message entry that can be used by this function. |
aFirstId | An output argument with the first Service ID. |
aMtm | The specified MTM. This has a default value of KUidMsgTypeSMS. |
aServiceIds | An input/output argument with the complete selection of Service IDs. This has a default value of NULL. |
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.
Parameter | Description |
---|---|
aSession | A message server session. |
aFirstId | An output argument with the first Service ID. |
aMtm | The specified MTM. This has a default value of KUidMsgTypeSMS. |
aServiceIds | An input/output argument with the complete selection of Service IDs. This has a default value of NULL. |