class TSmsUtilities |
SMS Messaging utility functions.
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 *) |
Private Member Functions | |
---|---|
void | CompareEntryL (const TMsvEntry &, TUid , TMsvId &, CMsvEntrySelection *) |
TBool | DoGetDescriptionL (const CSmsMessage &, TDes &, TInt ) |
void | DoGetDetailsL ( RFs &, const TDesC &, TDes &, TInt ) |
void | ExtractDescriptionFromMessage (const CSmsMessage &, TDes &, TInt ) |
void | GetName ( CContactItemField &, TUid , TDes &) |
void | Replace (const TDesC &, const TDesC &, TDes &) |
TBool | ValidGsmNumber (const TDesC &) |
Public Member Enumerations | |
---|---|
enum | TSmsUtilitiesSpecialMessageType { EVoiceMessageWaiting = 0, EFaxMessageWaiting , EEmailMessageWaiting , EOtherMessageWaiting , ESpecialMessageTypeMask = 0x7F } |
void | CompareEntryL | ( | const TMsvEntry & | aEntry, |
TUid | aMtm, | |||
TMsvId & | aFirstId, | |||
CMsvEntrySelection * | aServiceIds | |||
) | [private, static] |
const TMsvEntry & aEntry | |
TUid aMtm | |
TMsvId & aFirstId | |
CMsvEntrySelection * aServiceIds |
TBool | DoGetDescriptionL | ( | const CSmsMessage & | aMessage, |
TDes & | aDescription, | |||
TInt | aMaxLength | |||
) | [private, static] |
const CSmsMessage & aMessage | |
TDes & aDescription | |
TInt aMaxLength |
void | DoGetDetailsL | ( | RFs & | aFs, |
const TDesC & | aFromAddress, | |||
TDes & | aDetails, | |||
TInt | aMaxLength | |||
) | [private, static] |
void | ExtractDescriptionFromMessage | ( | const CSmsMessage & | aMessage, |
TDes & | aDescription, | |||
TInt | aMaxLength | |||
) | [private, static] |
const CSmsMessage & aMessage | |
TDes & aDescription | |
TInt aMaxLength |
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.
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. |
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.
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. |
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.
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. |
void | GetName | ( | CContactItemField & | aField, |
TUid | aFieldType, | |||
TDes & | aName | |||
) | [private, static] |
CContactItemField & aField | |
TUid aFieldType | |
TDes & aName |
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.
RFs & aFs | A connected file server session. |
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.
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. |
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.
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. |
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.
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. |
void | Replace | ( | const TDesC & | aOld, |
const TDesC & | aNew, | |||
TDes & | aString | |||
) | [private, static] |
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.
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. |
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.
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. |
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.
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. |
TBool | ValidGsmNumber | ( | const TDesC & | aTelephone | ) | [private, static] |
const TDesC & aTelephone |
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 = 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. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.