Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: Gsmumsg.h
Link against: gsmu.lib

Class CSmsMessage

class CSmsMessage : public CBase;

Description

Represents a complete SMS message.

This class can:

Internalise and externalise its data

Encode/decode itself to/from one or more SMS PDU's

SMS Message Data is stored in the CSmsBufferBase iBuffer. SMS Message Settings are stored in the CSmsPDU iSmsPDU.

Derivation

Members

Defined in CSmsMessage:
AddEMSInformationElementL(), AddEmailHeaderL(), AddSlotL(), AdditionalInfo(), Buffer(), Buffer(), CopyEmsElementsL(), DecodeMessagePDUsL(), E15MinutesRepresentedInSeconds, EMaximumSeconds, ESmsCombinedStorage, ESmsFlagOptimizeAlphabet, ESmsFlagOptimizeConcatenation, ESmsFlagOptimizeConcatenation16BitReference, ESmsMessageV0, ESmsMessageV1, ESmsMessageV2, ESmsNoStorage, ESmsPhoneStorage, ESmsSIMStorage, EncodeIntoSinglePDUL(), EncodeMessagePDUsL(), ExternalizeL(), ExternalizeWithoutBufferL(), GetEMSInformationElementsL(), GetEmailHeaderL(), GetOperationsForNonIEL(), InternalizeL(), InternalizeWithoutBufferL(), Is16BitConcatenation(), IsComplete(), IsDecoded(), IsEmailHeader(), IsSupportedL(), LogServerId(), MatchSlots(), MaxMessageLength(), MessageLengthL(), NewL(), NewL(), NumMessagePDUsL(), OptimizeSettingsL(), ParsedServiceCenterAddress(), ParsedToFromAddress(), RemoveEMSInformationElementL(), RemoveEMSInformationElementsL(), ResetEMSL(), Scheme(), ServiceCenterAddress(), Set16BitConcatenation(), SetLogServerId(), SetParsedServiceCenterAddressL(), SetParsedToFromAddressL(), SetServiceCenterAddressL(), SetStatus(), SetStorage(), SetTime(), SetToFromAddressL(), SetUserDataSettingsL(), SmsPDU(), SmsPDU(), Status(), Storage(), TMobileSmsStorage, TSmsMessageVersion, TSmsOptimizationFlags, TTimeIntervalsRepresentedInSeconds, TextPresent(), Time(), ToFromAddress(), Type(), UpdateSlotsL(), UserDataSettings(), Version(), iAdditionalInfo, iSlotArray, iVersion, ~CSmsMessage()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

Capability: Illegal

static IMPORT_C CSmsMessage *NewL(RFs &aFs, const TGsmSms &aGsmSms, CSmsBufferBase *aBuffer, TBool aIsRPError=EFalse, TBool aIsMobileTerminated=ETrue);

Description

Allocates and creates a CSmsMessage instance from a TGsmSms.

The type of SMS-XXXX message to construct is defined by the first byte of the TGsmSms TPDU header.

Parameters

RFs &aFs

Reference handle to the file system

const TGsmSms &aGsmSms

Reference to TGsmSms

CSmsBufferBase *aBuffer

The Unicode text for the message. The object takes ownership of aBuffer.

TBool aIsRPError

Set to true if the message contains Reply Path Error. Default is false.

TBool aIsMobileTerminated

Set to True if the message is Mobile Terminated. Default is false.

Return value

CSmsMessage *

New CSmsMessage object


NewL()

Capability: Illegal

static IMPORT_C CSmsMessage *NewL(RFs &aFs, CSmsPDU::TSmsPDUType aType, CSmsBufferBase *aBuffer, TBool aIsRPError=EFalse);

Description

Allocates and creates a CSmsMessage, specifying the SMS-XXX message type with a CSmsPDU::TSmsPduType.

Parameters

RFs &aFs

Reference handle to the file system

CSmsPDU::TSmsPDUType aType

The PDU type

CSmsBufferBase *aBuffer

The Unicode text for the message. The object takes ownership of aBuffer.

TBool aIsRPError

Set to true if the message contains Reply Path Error. Default is false.

Return value

CSmsMessage *

New CSmsMessage object


~CSmsMessage()

Capability: Illegal

IMPORT_C ~CSmsMessage();

Description

Destructor, frees resources.

[Top]


Member functions


Type()

inline CSmsPDU::TSmsPDUType Type() const;

Description

Gets the SMS-XXX message type.

Return value

CSmsPDU::TSmsPDUType

SMS-XXX message type


IsComplete()

inline TBool IsComplete() const;

Description

Tests if the SMS message is complete.

Return value

TBool

True if complete


IsDecoded()

inline TBool IsDecoded() const;

Description

Tests if the SMS message is Decoded.

Return value

TBool

True if Decoded


Storage()

inline TMobileSmsStorage Storage() const;

Description

Gets the physical location where the message represented by the object is stored.

Return value

TMobileSmsStorage

Physical location


SetStorage()

inline void SetStorage(TMobileSmsStorage aStorage);

Description

Sets the physical location where the message represented by the object is stored.

Parameters

TMobileSmsStorage aStorage

Physical location


Status()

inline NMobileSmsStore::TMobileSmsStoreStatus Status() const;

Description

Gets the SMS store status of the message.

Return value

NMobileSmsStore::TMobileSmsStoreStatus

SMS store status


SetStatus()

inline void SetStatus(NMobileSmsStore::TMobileSmsStoreStatus aStatus);

Description

Sets the SMS store status of the message.

Parameters

NMobileSmsStore::TMobileSmsStoreStatus aStatus

SMS store status


LogServerId()

inline TInt LogServerId() const;

Description

Gets the Log Server Id.

Return value

TInt

Log Server Id


SetLogServerId()

inline void SetLogServerId(TInt aId);

Description

Sets the Log Server Id.

Parameters

TInt aId

Log Server Id


Time()

inline const TTime &Time() const;

Description

Gets the time of message creation.

Return value

const TTime &

Time of message creation


SetTime()

inline void SetTime(const TTime &aTime);

Description

Sets the time of message creation.

Parameters

const TTime &aTime

Time of message creation


SmsPDU()

inline CSmsPDU &SmsPDU();

Description

Gets the message PDU.

Return value

CSmsPDU &

PDU.


SmsPDU()

inline const CSmsPDU &SmsPDU() const;

Description

Gets the message PDU (const).

Return value

const CSmsPDU &

PDU.


ServiceCenterAddress()

inline TPtrC ServiceCenterAddress() const;

Description

Gets the message Service Center Address.

Return value

TPtrC

Service Center Address


SetServiceCenterAddressL()

inline void SetServiceCenterAddressL(const TDesC &aAddress);

Description

Sets the message Service Center Address.

Parameters

const TDesC &aAddress

Service Center Address


ParsedServiceCenterAddress()

inline void ParsedServiceCenterAddress(TGsmSmsTelNumber &aParsedAddress) const;

Description

Gets the Service Center Address as an ETSI-formatted telephone number.

Parameters

TGsmSmsTelNumber &aParsedAddress

Service Center Address


SetParsedServiceCenterAddressL()

inline void SetParsedServiceCenterAddressL(const TGsmSmsTelNumber &aParsedAddress);

Description

Sets the Service Center Address as an ETSI-formatted telephone number.

Parameters

const TGsmSmsTelNumber &aParsedAddress

Service Center Address


ToFromAddress()

inline TPtrC ToFromAddress() const;

Description

Gets unparsed To and From addresses.

Return value

TPtrC

To and From addresses


SetToFromAddressL()

inline void SetToFromAddressL(const TDesC &aAddress);

Description

Sets unparsed To and From addresses.

Parameters

const TDesC &aAddress

To and From addresses


ParsedToFromAddress()

inline void ParsedToFromAddress(TGsmSmsTelNumber &aParsedAddress) const;

Description

Gets To and From addresses in ETSI format.

Parameters

TGsmSmsTelNumber &aParsedAddress

To and From addresses


SetParsedToFromAddressL()

inline void SetParsedToFromAddressL(const TGsmSmsTelNumber &aParsedAddress);

Description

Sets To and From addresses in ETSI format.

Parameters

const TGsmSmsTelNumber &aParsedAddress

To and From addresses


InternalizeWithoutBufferL()

Capability: Illegal

IMPORT_C void InternalizeWithoutBufferL(RReadStream &aStream);

Description

Internalises all object data except for the CSmsBufferBase.

This is used when the buffer is stored elsewhere.

Parameters

RReadStream &aStream

Stream to read from


ExternalizeWithoutBufferL()

Capability: Illegal

IMPORT_C void ExternalizeWithoutBufferL(RWriteStream &aStream) const;

Description

Externalises all object data except for the CSmsBufferBase.

This is used when the buffer is stored elsewhere.

Parameters

RWriteStream &aStream

Stream to write to


InternalizeL()

Capability: Illegal

IMPORT_C void InternalizeL(RReadStream &aStream);

Description

Internalises all object data.

Parameters

RReadStream &aStream

Stream to read from


ExternalizeL()

Capability: Illegal

IMPORT_C void ExternalizeL(RWriteStream &aStream) const;

Description

Externalises all object data.

Parameters

RWriteStream &aStream

Stream to write to


Buffer()

inline CSmsBufferBase &Buffer();

Description

Gets the text portion of the message (non-const).

Return value

CSmsBufferBase &

Text portion of the message


Buffer()

inline const CSmsBufferBase &Buffer() const;

Description

Return value

const CSmsBufferBase &

The text portion of the CSmsMessage (const)


TextPresent()

Capability: Illegal

IMPORT_C TBool TextPresent() const;

Description

Tests if the message contains text.

Return value

TBool

True if the message contains text


NumMessagePDUsL()

Capability: Illegal

IMPORT_C TInt NumMessagePDUsL();

Description

Gets the number of PDU's required to encode the complete message.

Return value

TInt

Number of PDU's

Leave codes

KErrOverflow

Leaves if the number of required PDUs exceeds the maximum or the message cannot be encoded.


MaxMessageLength()

Capability: Illegal

IMPORT_C TInt MaxMessageLength() const;

Description

Gets the maximum message length possible with the current settings.

If Text is compressed, this returns the maximum number of bytes available with text compressed.

Return value

TInt

Maximum message length


MessageLengthL()

Capability: Illegal

IMPORT_C TInt MessageLengthL();

Description

Gets the message length.

In the case where the message is compressed, this function compresses the text and returns the number of bytes of the compressed buffer.

The function calls ConvertedBufferLengthL(), and is therefore an expensive operation.

Return value

TInt

Message length


UserDataSettings()

Capability: Illegal

IMPORT_C void UserDataSettings(TSmsUserDataSettings &aSettings) const;

Description

Gets the User Data Settings.

Parameters

TSmsUserDataSettings &aSettings

User Data Settings


SetUserDataSettingsL()

Capability: Illegal

IMPORT_C void SetUserDataSettingsL(const TSmsUserDataSettings &aSettings);

Description

Sets the User Data Settings.

Parameters

const TSmsUserDataSettings &aSettings

User Data Settings


OptimizeSettingsL()

Capability: Illegal

IMPORT_C void OptimizeSettingsL(TInt aOptions);

Description

Optimizes the user data settings.

The alphabet flag causes an alphabet to be chosen which preserves information in the message and makes the number of PDUs as small as possible.

The compression settings flag is not supported.

The compression flag causes compression to be switched on if the resultant number of PDUs is smaller.

If user explicitly defines alphabet as UCS2 or 8-bit coding, this setting is preserved; otherwise, if 7-bit (default) alphabet can not support current text of message UCS2 alphabet (Unicode) is used.

The two concatenation flags are mutually exclusive as they deal with 8-bit and 16-bit referenced concatenation. Both flags cause compression to be switched off and if the message length is greater than the maximum message length, concatenation is switched on.

Parameters

TInt aOptions

Combination of TSmsOptimizationFlags


IsSupportedL()

Capability: Illegal

IMPORT_C TBool IsSupportedL(const TDesC &aDes, TInt &aNumberOfUnconvertibleCharacters, TInt &aIndexOfFirstUnconvertibleCharacter);

Description

Tests if a buffer can be encoded without loss of information.

Parameters

const TDesC &aDes

The buffer to test for encoding

TInt &aNumberOfUnconvertibleCharacters

On return, the number of unconvertible characters

TInt &aIndexOfFirstUnconvertibleCharacter

On return, the index of the first unconvertible character

Return value

TBool

True if aDes can be encoded without loss of information


EncodeMessagePDUsL()

Capability: Illegal

IMPORT_C void EncodeMessagePDUsL(CArrayFix< TGsmSms > &aSmsArray, TInt aReference=0);

Description

Encodes message PDUs as an array of TGsmSms objects.

Note, this function should only be called after EncodeIntoSinglePDUL() as EncodeBufferL() now automatically prepares PDUs for concatenation.

Parameters

CArrayFix< TGsmSms > &aSmsArray

(In) an empty array. On return, one or more encoded TGsmSms.

TInt aReference

Sets a Concatenated Message Reference (default 0)


DecodeMessagePDUsL()

Capability: Illegal

IMPORT_C void DecodeMessagePDUsL(const CArrayFix< TGsmSms > &aSmsArray);

Description

Decodes message PDUs from an array of TGsmSms objects.

The array contains a concatenated message, and must have the correct number of PDUs.

Parameters

const CArrayFix< TGsmSms > &aSmsArray

Concatenated message


GetEMSInformationElementsL()

Capability: Illegal

IMPORT_C const RPointerArray< const CEmsInformationElement > &GetEMSInformationElementsL() const;

Description

Removes EMS IE from a CSmsMessage

Return value

const RPointerArray< const CEmsInformationElement > &

CArrayPtrFlat<const CEmsInformationElement>& of internal EMS array


AddEMSInformationElementL()

Capability: Illegal

IMPORT_C void AddEMSInformationElementL(const CEmsInformationElement &aEmsIE);

Description

Adds EMS IE to a CSmsMessage

Parameters

const CEmsInformationElement &aEmsIE

EMS object to be added.


RemoveEMSInformationElementsL()

Capability: Illegal

IMPORT_C RPointerArray< CEmsInformationElement > *RemoveEMSInformationElementsL(const TUint aStartPosition, const TSmsId aEmsId);

Description

Removes all EMS IEs that matches the criteria from the CSmsMessage

Parameters

const TUint aStartPosition

of a EMS object to be removed.

const TSmsId aEmsId

type of a EMS object to be removed

Return value

RPointerArray< CEmsInformationElement > *

pointer to array of EMS IE


RemoveEMSInformationElementL()

Capability: Illegal

IMPORT_C CEmsInformationElement *RemoveEMSInformationElementL(const TUint aStartPosition, const TSmsId aEmsId);

Description

Removes first EMS IE that matches the criteria from the CSmsMessage

Parameters

const TUint aStartPosition

of a EMS object to be removed.

const TSmsId aEmsId

type of a EMS object to be removed

Return value

CEmsInformationElement *

pointer EMS information element


ResetEMSL()

Capability: Illegal

IMPORT_C void ResetEMSL();

Description

Resets EMS IE from a CSmsMessage


EncodeIntoSinglePDUL()

Capability: Illegal

IMPORT_C TBool EncodeIntoSinglePDUL(CArrayFix< TGsmSms > &aSmsArray);

Description

Parameters

CArrayFix< TGsmSms > &aSmsArray

Return value

TBool


CopyEmsElementsL()

Capability: Illegal

IMPORT_C void CopyEmsElementsL(CSmsMessage &aToMessage) const;

Description

Copy EMS elements to dest CSmsMessage Uses CSmsMessage extended EMS API Creates new CEmsInformationElement instance(s) and passes ownership to the dest CSmsMessage

Parameters

CSmsMessage &aToMessage


AddSlotL()

Capability: Illegal

IMPORT_C void AddSlotL(const TGsmSmsSlotEntry &aSlot);

Description

Parameters

const TGsmSmsSlotEntry &aSlot


MatchSlots()

Capability: Illegal

IMPORT_C TBool MatchSlots(const CArrayFixFlat< TGsmSmsSlotEntry > &aSlotArray);

Description

Parameters

const CArrayFixFlat< TGsmSmsSlotEntry > &aSlotArray

Return value

TBool


AddEmailHeaderL()

Capability: Illegal

IMPORT_C void AddEmailHeaderL(const TDesC &aEmailHeader, const TDesC &aEmailBody);

Description

Adds a header to an email body

Parameters

const TDesC &aEmailHeader

The buffer which holds RFC 822 e-mail header

const TDesC &aEmailBody


IsEmailHeader()

Capability: Illegal

IMPORT_C TBool IsEmailHeader() const;

Description

Checks whether the SmsMessage contains an e-mail.

Return value

TBool

ETrue if CSmsMessage contains e-mail ( e-mail header information element), otherwise EFalse


GetEmailHeaderL()

Capability: Illegal

IMPORT_C TBool GetEmailHeaderL(HBufC **aEmailHeader, HBufC **aEmailBody);

Description

Extracts e-mail header and body from the SmsMessage

Parameters

HBufC **aEmailHeader

HBufC **aEmailBody

Return value

TBool

aEMailHeader The buffer containing the extracted email header aEMailBody The buffer containing the extracted email body ETrue if extraction of e-mail header and body succeeds


Set16BitConcatenation()

inline void Set16BitConcatenation(TBool aIs16BitConcatenation);

Description

Parameters

TBool aIs16BitConcatenation


Is16BitConcatenation()

inline TBool Is16BitConcatenation() const;

Description

Return value

TBool


UpdateSlotsL()

Capability: Illegal

IMPORT_C void UpdateSlotsL(TDesC8 &aBuf);

Description

Updates the slot information for the given message as described in the supplied buffer

Parameters

TDesC8 &aBuf

buffer, layout: byte 0 store id, byte 1..n PDU slot indexes

Leave codes

KErrArgument


Version()

IMPORT_C TInt Version();

Description

Returns the message version number.

Return value

TInt


AdditionalInfo()

inline void *AdditionalInfo();

Description


GetOperationsForNonIEL()

IMPORT_C CSmsNonIEOperation &GetOperationsForNonIEL(TSmsNonIEIdentifier) const;

Description

Parameters

TSmsNonIEIdentifier

Return value

CSmsNonIEOperation &


Scheme()

IMPORT_C TSmsStatusReportScheme Scheme() const;

Description

Gets the scheme of the status report.

Return value

TSmsStatusReportScheme

Staus Report Scheme

[Top]


Member enumerations


Enum TSmsOptimizationFlags

TSmsOptimizationFlags

Description

User data optimisation flags.

ESmsFlagOptimizeAlphabet

The alphabet flag causes an alphabet to be chosen which preserves information in the message and makes the number of PDUs as small as possible.

ESmsFlagOptimizeConcatenation

8-bit referenced concatenation.

This causes compression to be switched off and if the message length is greater than the maximum message length, concatenation is switched on.

ESmsFlagOptimizeConcatenation16BitReference

16-bit referenced concatenation.

This causes compression to be switched off and if the message length is greater than the maximum message length, concatenation is switched on.


Enum TMobileSmsStorage

TMobileSmsStorage

Description

Flags that indicate whether a message is stored.

ESmsNoStorage

No storage.

ESmsSIMStorage

SIM storage.

ESmsPhoneStorage

Phone storage.

ESmsCombinedStorage

Combined storage.


Enum TTimeIntervalsRepresentedInSeconds

TTimeIntervalsRepresentedInSeconds

Description

E15MinutesRepresentedInSeconds

EMaximumSeconds


Enum TSmsMessageVersion

TSmsMessageVersion

Description

SMS versions

ESmsMessageV0

The default value.

ESmsMessageV1

Release 6 SMS Support

ESmsMessageV2

Latest version

[Top]


Member data


iSlotArray

CArrayFixFlat< TGsmSmsSlotEntry > iSlotArray;

Description

Array for slots.


iVersion

protected: TInt iVersion;

Description

iVersion is the version of CSmsMessage. This parameter will be used to identify what iAdditionalInfo points to for that particular version of CSmsMessage


iAdditionalInfo

protected: void * iAdditionalInfo;

Description

iAdditionalInfo would point to any new added data structure. iVersion would identify which data structure is valid for that particular version of CSmsMessage