Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: SMUTHDR.H
Link against: smcm.lib

Class CSmsHeader

class CSmsHeader : public CBase;

Description

The SMS MTM encapsulation of an SMS message.

This class allows a messaging client to access the lower-level message encapsulation used by the SMS stack.

It also provides functionality to restore and store an SMS message from/to the message store.

An SMS message is encapsulated in a Protocol Data Unit (PDU). In GSM there are six types of SMS message PDU. In the descriptions below, SC means Service Center and MS means Mobile Station (the phone).

1. SMS-DELIVER - sent from SC to MS

2. SMS-DELIVER-REPORT - sent from MS to SC

3. SMS-SUBMIT - sent from MS to SC

4. SMS-SUBMIT-REPORT - sent from SC to MS

5. SMS-STATUS-REPORT - sent from SC to MS

6. SMS-COMMAND - sent from MS to SC

Derivation

Members

Defined in CSmsHeader:
AcknowledgementRequested(), BioMessage(), BioMessage(), BioMsgIdType(), CdmaMessage(), CdmaMessage(), Command(), Command(), ContainsSmsHeaderL(), ContainsSmsHeaderL(), Deliver(), Deliver(), EmailFields(), ExternalizeL(), ExternalizeL(), FindRecipient(), FindRecipient(), FromAddress(), GetDefaultMessageSettingsL(), GetSmsSettingsL(), GetSmsSettingsL(), GsmMessage(), GsmMessage(), InternalizeL(), InternalizeL(), Message(), Message(), MessageBearing(), MessageType(), NewL(), NewL(), NewL(), NewL(), NewL(), NewL(), NewL(), NewL(), Recipients(), Recipients(), Recipients(), Recipients(), ReplyPathProvided(), RestoreL(), RestoreL(), RestoreL(), ServiceCenterAddress(), SetAcknowledgementRequest(), SetBioMsgIdType(), SetDefaultMessageSettingsL(), SetEmailFieldsL(), SetFromAddressL(), SetReplyPathProvided(), SetServiceCenterAddressL(), SetSmsSettingsL(), SetSmsSettingsL(), SmsBearer(), SmsMessage(), SmsMessage(), StatusReport(), StatusReport(), StoreL(), StoreL(), Submit(), Submit(), Type(), ~CSmsHeader(), ~CSmsHeader()

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


Construction and destruction


NewL()

static IMPORT_C CSmsHeader *NewL(CSmsPDU::TSmsPDUType aType, CEditableText &aText);

Description

Allocates and constructs a new CSmsHeader object.

Use this function to create a new SMS-SUBMIT, SMS-COMMAND, SMS-DELIVER or SMS-STATUS-REPORT type message.

Parameters

CSmsPDU::TSmsPDUType aType

The Protocol Data Unit (PDU) type for the SMS message.

CEditableText &aText

The message text.

Return value

CSmsHeader *

A new CSmsHeader object.


NewL()

static IMPORT_C CSmsHeader *NewL(CSmsPDU::TSmsPDUType aType, CEditableText &aText, RFs &aFs);

Description

Allocates and constructs a new CSmsHeader object.

Use this function to create a new SMS-SUBMIT, SMS-COMMAND, SMS-DELIVER or SMS-STATUS-REPORT type message. This version uses a previously connected file server session handle.

Parameters

CSmsPDU::TSmsPDUType aType

The Protocol Data Unit (PDU) type for the SMS message.

CEditableText &aText

The message text.

RFs &aFs

Handle to an open file server session. CSmsHeader will not close the file session.

Return value

CSmsHeader *

A new CSmsHeader object.


NewL()

static IMPORT_C CSmsHeader *NewL(CSmsMessage *aMessage);

Description

Allocates and constructs a new CSmsHeader object.

Use this function to create a new SMS-DELIVER type message.

Parameters

CSmsMessage *aMessage

The SMS message encapsulation from the SMS stack.

Return value

CSmsHeader *

A new CSmsHeader object.


~CSmsHeader()

IMPORT_C ~CSmsHeader();

Description

Destructor.


NewL()

static IMPORT_C CSmsHeader *NewL(CSmsPDU::TSmsPDUType aType, CEditableText &aText);

Description

Parameters

CSmsPDU::TSmsPDUType aType

CEditableText &aText

Return value

CSmsHeader *


NewL()

static IMPORT_C CSmsHeader *NewL(CSmsPDU::TSmsPDUType aType, CEditableText &aText, RFs &aFs);

Description

Parameters

CSmsPDU::TSmsPDUType aType

CEditableText &aText

RFs &aFs

Return value

CSmsHeader *


NewL()

static IMPORT_C CSmsHeader *NewL(TSmsMessageType aType, CEditableText &aText);

Description

Allocates and constructs a new CSmsHeader object.

Use this method to create an outgoing SMS message.

Parameters

TSmsMessageType aType

the type of SMS message.

CEditableText &aText

The message text.

Return value

CSmsHeader *

A new CSmsHeader object.


NewL()

static IMPORT_C CSmsHeader *NewL(TSmsMessageType aType, CEditableText &aText, tia637::TTeleserviceId aTeleservice);

Description

Allocates and constructs a new CSmsHeader object.

Use this method to create an outgoing CDMA SMS message.

Parameters

TSmsMessageType aType

the type of SMS message.

CEditableText &aText

The message text.

tia637::TTeleserviceId aTeleservice

the teleservice of the SMS message

Return value

CSmsHeader *

A new CSmsHeader object.


NewL()

static IMPORT_C CSmsHeader *NewL(CSmsMessage *aMessage);

Description

Parameters

CSmsMessage *aMessage

Return value

CSmsHeader *


~CSmsHeader()

virtual IMPORT_C ~CSmsHeader();

Description

[Top]


Member functions


Type()

inline CSmsPDU::TSmsPDUType Type() const;

Description

Gets the message PDU type.

There are six types of PDU - SMS-DELIVER, SMS-DELIVER-REPORT, SMS-SUBMIT, SMS-SUBMIT-REPORT, SMS-STATUS-REPORT and SMS-COMMAND.

There is access to only to SMS-DELIVER, SMS-SUBMIT, SMS-STATUS-REPORT and SMS-COMMAND PDUs via the CSmsHeader encapsulation.

Return value

CSmsPDU::TSmsPDUType

The message PDU type.

See also:


Submit()

inline CSmsSubmit &Submit();

Description

Gets the message PDU for a SMS-SUBMIT type message.

The message PDU type can be checked by using the CSmsHeader::Type API.

Return value

CSmsSubmit &

The SMS-SUBMIT PDU object.

Panic codes

SMCM

0 The message was not a PDU of type SMS-SUBMIT (debug only).


Submit()

inline const CSmsSubmit &Submit() const;

Description

Gets the (const) message PDU for a SMS-SUBMIT type message.

The message PDU type can be checked by using the CSmsHeader::Type API.

Return value

const CSmsSubmit &

The SMS-SUBMIT PDU const object.

Panic codes

SMCM

0 The message was not a PDU of type SMS-SUBMIT (debug only).


Deliver()

inline CSmsDeliver &Deliver();

Description

Gets the message PDU for a SMS-DELIVER type message.

The message PDU type can be checked by using the CSmsHeader::Type API.

Return value

CSmsDeliver &

The SMS-DELIVER PDU object.

Panic codes

SMCM

0 The message was not a PDU of type SMS-DELIVER (debug only).


Deliver()

inline const CSmsDeliver &Deliver() const;

Description

Gets the (const) message PDU for a SMS-DELIVER type message.

The message PDU type can be checked by using the CSmsHeader::Type API.

Return value

const CSmsDeliver &

The SMS-DELIVER PDU const object.

Panic codes

SMCM

0 The message was not a PDU of type SMS-DELIVER (debug only).


Command()

inline CSmsCommand &Command();

Description

Gets the message PDU for a SMS-COMMMAND type message.

The message PDU type can be checked by using the CSmsHeader::Type API.

Return value

CSmsCommand &

The SMS-COMMMAND PDU object.

Panic codes

SMCM

0 The message was not a PDU of type SMS-COMMMAND (debug only).


Command()

inline const CSmsCommand &Command() const;

Description

Gets the (const) message PDU for a SMS-COMMMAND type message.

The message PDU type can be checked by using the CSmsHeader::Type API.

Return value

const CSmsCommand &

The SMS-COMMMAND PDU const object.

Panic codes

SMCM

0 The message was not a PDU of type SMS-COMMMAND (debug only).


StatusReport()

inline CSmsStatusReport &StatusReport();

Description

Gets the message PDU for a SMS-STATUS-REPORT type message.

The message PDU type can be checked by using the CSmsHeader::Type API.

Return value

CSmsStatusReport &

The SMS-STATUS-REPORT PDU object.

Panic codes

SMCM

0 The message was not a PDU of type SMS-STATUS-REPORT (debug only).


StatusReport()

inline const CSmsStatusReport &StatusReport() const;

Description

Gets the (const) message PDU for a SMS-STATUS-REPORT type message.

The message PDU type can be checked by using the CSmsHeader::Type API.

Return value

const CSmsStatusReport &

The SMS-STATUS-REPORT PDU const object.

Panic codes

SMCM

0 The message was not a PDU of type SMS-STATUS-REPORT (debug only).


Message()

inline CSmsMessage &Message();

Description

Gets the SMS stack representation of the message.

Return value

CSmsMessage &

The SMS stack representation of the message

See also:


Message()

inline const CSmsMessage &Message() const;

Description

Gets the (const) SMS stack representation of the message.

Return value

const CSmsMessage &

The const SMS stack representation of the message


ReplyPathProvided()

inline TBool ReplyPathProvided() const;

Description

Tests if the message contains a reply path.

Return value

TBool

A value of True if the message contains a reply path.


SetReplyPathProvided()

inline void SetReplyPathProvided(TBool aReplyPathProvided);

Description

Set the message flag that indicates whether it contains a reply path.

Parameters

TBool aReplyPathProvided

A value of True to set the flag.


BioMsgIdType()

inline TBioMsgIdType BioMsgIdType() const;

Description

Gets the message's BIO message type identifier.

For non-BIO messages, this is EBioMsgIdNbs.

Return value

TBioMsgIdType

The BIO message type identifier


SetBioMsgIdType()

inline void SetBioMsgIdType(TBioMsgIdType aBioMsgIdType=EBioMsgIdNbs);

Description

Sets the message's BIO message type identifier.

Parameters

TBioMsgIdType aBioMsgIdType

The BIO message type identifier


RestoreL()

Capability: ReadUserData Needed unless owned by client

static IMPORT_C CSmsHeader *RestoreL(CMsvStore &aStore, CEditableText &aText);

Description

Restores the CSmsHeader object from the store. Intended to be used when restoring is needed and not knowing the type of the message before hand

Parameters

CMsvStore &aStore

The store to restore the object from aText The reference to the user data

CEditableText &aText

Return value

CSmsHeader *

A restored CSmsHeader object


ServiceCenterAddress()

inline TPtrC ServiceCenterAddress() const;

Description

Gets the message's service center address.

This can only be used on SMS-SUBMIT type messages. The message PDU type can be checked by using the CSmsHeader::Type API.

Return value

TPtrC

The Service Center address.

Panic codes

SMCM

0 The message was not a PDU of type SMS-SUBMIT (debug only).


SetServiceCenterAddressL()

inline void SetServiceCenterAddressL(const TDesC &aAddress);

Description

Sets the message's service center address.

This can only be used on SMS-SUBMIT type messages. The message PDU type can be checked by using the CSmsHeader::Type API.

Parameters

const TDesC &aAddress

The Service Center address

Panic codes

SMCM

0 The message was not a PDU of type SMS-SUBMIT (debug only).


MessageType()

IMPORT_C TSmsMessageType MessageType();

Description

Get the current message type

Return value

TSmsMessageType

The message type.


SetSmsSettingsL()

IMPORT_C void SetSmsSettingsL(const CSmsMessageSettings &aSmsSettings);

Description

Sets the SMS message settings for the message.

This can only be used on SMS-SUBMIT, SMS-COMMAND, SMS-DELIVER or SMS-STATUS-REPORT type messages.

NOTE - if this is an Email over SMS message then the PID of is not changed. The PID would have been set correctly when the email fields were set.

Parameters

const CSmsMessageSettings &aSmsSettings

The SMS message settings for the message

Leave codes

KErrNotSupported

The message PDU type was not supported, or the message conversion value was not supported.

Panic codes

SMCM

0 The message PDU is not supported (debug only).


GetSmsSettingsL()

IMPORT_C void GetSmsSettingsL(CSmsMessageSettings &aSmsSettings) const;

Description

Gets the SMS message settings for the message.

This can only be used on SMS-SUBMIT type messages.

Parameters

CSmsMessageSettings &aSmsSettings

The output argument with the SMS message settings.

Leave codes

KErrNotSupoprted

The Telematic Device type is not supported.

Panic codes

SMCM

0 The message PDU is not supported (debug only).


SmsBearer()

IMPORT_C TSmsBearers SmsBearer() const;

Description

Gets the bearer (generic, GSM or CDMA) of the message

Return value

TSmsBearers

The bearer of the message.


MessageBearing()

IMPORT_C TSmsMessageBearing MessageBearing() const;

Description

Return value

TSmsMessageBearing


Recipients()

inline const CArrayPtrFlat< CSmsNumber > &Recipients() const;

Description

Gets the (const) message recipients.

Return value

const CArrayPtrFlat< CSmsNumber > &

The const array of message recipients


Recipients()

inline CArrayPtrFlat< CSmsNumber > &Recipients();

Description

Gets the (const) message recipients.

Return value

CArrayPtrFlat< CSmsNumber > &

The array of message recipients


AcknowledgementRequested()

IMPORT_C TBool AcknowledgementRequested(TSmsAckType aAckType) const;

Description

Test if an acknowledgement is requested.

Use this method to get if a specified acknowledgement type is requested in the current message.

Parameters

TSmsAckType aAckType

The acknowledgement Type

Return value

TBool

A flag indicating whether the acknowledgement is requested.


SetAcknowledgementRequest()

IMPORT_C void SetAcknowledgementRequest(TSmsAckType aAckType, TBool aToggle);

Description

Set whether an acknowledgement is requested.

Use this method to enable/disable the request of a specified acknowledgement type

Parameters

TSmsAckType aAckType

The acknowledgement Type

TBool aToggle

A flag to enable or disable the request of the acknowledgement


SetFromAddressL()

inline void SetFromAddressL(const TDesC &aAddress);

Description

Sets the originator address.

Parameters

const TDesC &aAddress

The originator address


FromAddress()

inline TPtrC FromAddress() const;

Description

Gets the originator address.

Only valid for SMS-DELIVER and SMS-SUBMIT type messages. With any other message types the returned originator address is empty.

Return value

TPtrC

The originator address.


RestoreL()

IMPORT_C void RestoreL(CMsvStore &aStore);

Description

Parameters

CMsvStore &aStore


StoreL()

IMPORT_C void StoreL(CMsvStore &aStore) const;

Description

Parameters

CMsvStore &aStore


SetEmailFieldsL()

IMPORT_C void SetEmailFieldsL(const CSmsEmailFields &aEmailFields);

Description

Sets the email fields for the message.

If the supplied email fields is not empty then the PID of the PDU of the message is set for interworking with email.

If the supplied email fields is empty and the PID of the PDU of the message is set for interworking with email then the PID is set to the default value that indicates no telematic device. If the PID was not set for interworking with email then it is left unchanged.

Parameters

const CSmsEmailFields &aEmailFields

The email fields object. A copy is made of this object.


ContainsSmsHeaderL()

IMPORT_C TBool ContainsSmsHeaderL(const CMsvStore &aStore);

Description

Parameters

const CMsvStore &aStore

Return value

TBool


FindRecipient()

IMPORT_C TInt FindRecipient(const TDesC &aAddress, CSmsNumber *&arRecipient) const;

Description

Finds the recipient in the CSmsHeader object.

Use this method to search for a recipient with the specified address

Parameters

const TDesC &aAddress

The address to be matched

CSmsNumber *&arRecipient

The output arguement holding the found recipient.

Return value

TInt

KErrNone if recipient is found, otherwise KErrNotFound.


EmailFields()

IMPORT_C const CSmsEmailFields &EmailFields() const;

Description

The email fields object for this message.

Return value

const CSmsEmailFields &

The email fields object for this message.


FindRecipient()

IMPORT_C TInt FindRecipient(TSmsMessageIdentifier aMessageIdentifier, CSmsNumber *&arRecipient) const;

Description

Finds the recipient in the CSmsHeader object.

Use this method to search for a recipient with the specified message identfier

Parameters

TSmsMessageIdentifier aMessageIdentifier

The message identifier to be matched

CSmsNumber *&arRecipient

The output arguement holding the found recipient

Return value

TInt

KErrNone if recipient is found, otherwise KErrNotFound.


InternalizeL()

IMPORT_C void InternalizeL(RMsvReadStream &aStream);

Description

Internalises the object from the specified stream.

Parameters

RMsvReadStream &aStream

The stream to be read from.


BioMessage()

IMPORT_C TMsvMessageBio &BioMessage();

Description

Returns a reference to the BIO wrapper

Use this method to get the BIO wrapper to access (read/write) the BIO features, e.g., encoding, BIO type, and originating address.

Return value

TMsvMessageBio &

The BIO wrapper reference.


ExternalizeL()

IMPORT_C void ExternalizeL(RMsvWriteStream &aStream) const;

Description

Externalises the object to the specified stream.

Parameters

RMsvWriteStream &aStream

The stream to be writen to.


BioMessage()

IMPORT_C const TMsvMessageBio &BioMessage() const;

Description

Returns a const reference to the BIO wrapper

Use this method to get the BIO wrapper to read the BIO features, e.g., encoding, BIO type, and originating address.

Return value

const TMsvMessageBio &

The const BIO wrapper reference.


RestoreL()

IMPORT_C void RestoreL(CMsvStore &aStore);

Description

Restores the object from the message entry store.

The SMS object is restored from the KUidMsvSMSHeaderStream in the supplied store.

Parameters

CMsvStore &aStore

The store from which the object is restored.

Leave codes

KErrNotFound

The stream KUidMsvSMSHeaderStream does not exist in aStore.


SmsMessage()

IMPORT_C TMsvMessageSms &SmsMessage();

Description

Returns a reference to the SMS wrapper

Use this method to get the SMS wrapper to access (read/write) the common SMS features, e.g., validity period, message center time stamp, and EMS.

Return value

TMsvMessageSms &

The SMS wrapper reference.


StoreL()

IMPORT_C void StoreL(CMsvStore &aStore) const;

Description

Stores the object in the message entry store.

The object is written to the KUidMsvSMSHeaderStream stream. Any previous content is overwritten.

Parameters

CMsvStore &aStore

The store to hold the stream into which the object is written.


SmsMessage()

IMPORT_C const TMsvMessageSms &SmsMessage() const;

Description

Returns a const reference to the SMS wrapper

Use this method to get the SMS wrapper to read the common SMS features, e.g., validity period, message center time stamp, and EMS.

Return value

const TMsvMessageSms &

The const SMS wrapper reference.


ContainsSmsHeaderL()

IMPORT_C TBool ContainsSmsHeaderL(const CMsvStore &aStore);

Description

Check whether a CMsvStore contains an SMS header stream.

Parameters

const CMsvStore &aStore

The store.

Return value

TBool

ETrue if there is a SMS header


GsmMessage()

IMPORT_C TMsvMessageGsm &GsmMessage();

Description

Returns a reference to the GSM wrapper.

Use this method to get the GSM wrapper to access (read/write) GSM specific features.

Return value

TMsvMessageGsm &

The GSM wrapper reference.


GsmMessage()

IMPORT_C const TMsvMessageGsm &GsmMessage() const;

Description

Returns a const reference to the GSM wrapper.

Use this method to get the GSM wrapper to read GSM specific features.

Return value

const TMsvMessageGsm &

The const GSM wrapper reference.


CdmaMessage()

IMPORT_C TMsvMessageCdma &CdmaMessage();

Description

Returns a reference to the CDMA wrapper.

Use this method to get the CDMA wrapper to access (read/write) CDMA specific features.

Return value

TMsvMessageCdma &

The CDMA wrapper reference.


CdmaMessage()

IMPORT_C const TMsvMessageCdma &CdmaMessage() const;

Description

Returns a const reference to the CDMA wrapper .

Use this method to get the CDMA wrapper to read CDMA specific features

Return value

const TMsvMessageCdma &

The const CDMA wrapper reference.


Recipients()

inline const CArrayPtrFlat< CSmsNumber > &Recipients() const;

Description

Return value

const CArrayPtrFlat< CSmsNumber > &


Recipients()

inline CArrayPtrFlat< CSmsNumber > &Recipients();

Description

Return value

CArrayPtrFlat< CSmsNumber > &


InternalizeL()

IMPORT_C void InternalizeL(RMsvReadStream &aStream);

Description

Parameters

RMsvReadStream &aStream


ExternalizeL()

IMPORT_C void ExternalizeL(RMsvWriteStream &aStream) const;

Description

Parameters

RMsvWriteStream &aStream


SetSmsSettingsL()

IMPORT_C void SetSmsSettingsL(const CSmsMessageSettings &aSmsSettings);

Description

Parameters

const CSmsMessageSettings &aSmsSettings


GetSmsSettingsL()

IMPORT_C void GetSmsSettingsL(CSmsMessageSettings &aSmsSettings) const;

Description

Parameters

CSmsMessageSettings &aSmsSettings


SetDefaultMessageSettingsL()

IMPORT_C void SetDefaultMessageSettingsL(const CSmsSettings &aSmsSettings);

Description

Sets the SMS message settings for the message.

This can only be used on outgoing type messages.

Parameters

const CSmsSettings &aSmsSettings

The SMS service settings

Panic codes

SMCM

0 The message type is not supported (debug only).


GetDefaultMessageSettingsL()

IMPORT_C void GetDefaultMessageSettingsL(CSmsSettings &aSmsSettings) const;

Description

Retrieves the SMS message settings for the message

Parameters

CSmsSettings &aSmsSettings

The ouput argument to get the current message settings