Symbian
Symbian OS Library

SYMBIAN OS V9.2

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



Location: SMUTHDR.H
Link against: smcm_gsm.lib
Link against: smcm_cdma.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).

In GSM there are six types of SMS message. 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

In CDMA there are six types of SMS message. 1. SUBMIT - sent from MS to SC 2. DELIVER - sent from SC to MS 3. CANCELLATION - sent from MS to SC 4. DELIVERY ACKNOWLEDGEMENT - sent from SC to MS 5. USER ACKNOWLEDGEMENT - sent both from MS to SC and from SC to MS 6. READ ACKNOWLEDGEMENT - sent both from MS to SC and from SC to MS

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(), GsmMessage(), GsmMessage(), InternalizeL(), InternalizeL(), Message(), Message(), MessageBearing(), MessageType(), 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

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(CSmsMessage *aMessage);

Description

Parameters

CSmsMessage *aMessage

Return value

CSmsHeader *


~CSmsHeader()

IMPORT_C ~CSmsHeader();

Description


NewL()

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

Description

Allocates and constructs a new CSmsHeader object.

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

Parameters

CSmsPDU::TSmsPDUType aType

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(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.


~CSmsHeader()

virtual IMPORT_C ~CSmsHeader();

Description

Destructor.

[Top]


Member functions


Type()

inline CSmsPDU::TSmsPDUType Type() const;

Description

Return value

CSmsPDU::TSmsPDUType


Submit()

inline CSmsSubmit &Submit();

Description

Return value

CSmsSubmit &


Submit()

inline const CSmsSubmit &Submit() const;

Description

Return value

const CSmsSubmit &


Deliver()

inline CSmsDeliver &Deliver();

Description

Return value

CSmsDeliver &


Deliver()

inline const CSmsDeliver &Deliver() const;

Description

Return value

const CSmsDeliver &


Command()

inline CSmsCommand &Command();

Description

Return value

CSmsCommand &


Command()

inline const CSmsCommand &Command() const;

Description

Return value

const CSmsCommand &


StatusReport()

inline CSmsStatusReport &StatusReport();

Description

Return value

CSmsStatusReport &


StatusReport()

inline const CSmsStatusReport &StatusReport() const;

Description

Return value

const CSmsStatusReport &


Message()

inline CSmsMessage &Message();

Description

Return value

CSmsMessage &


Message()

inline const CSmsMessage &Message() const;

Description

Return value

const CSmsMessage &


ReplyPathProvided()

inline TBool ReplyPathProvided() const;

Description

Return value

TBool


SetReplyPathProvided()

inline void SetReplyPathProvided(TBool aReplyPathProvided);

Description

Parameters

TBool aReplyPathProvided


BioMsgIdType()

inline TBioMsgIdType BioMsgIdType() const;

Description

Return value

TBioMsgIdType


SetBioMsgIdType()

inline void SetBioMsgIdType(TBioMsgIdType aBioMsgIdType=EBioMsgIdNbs);

Description

Parameters

TBioMsgIdType aBioMsgIdType


RestoreL()

Capability: ReadUserDataNeeded 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

Return value

TPtrC


SetServiceCenterAddressL()

inline void SetServiceCenterAddressL(const TDesC &aAddress);

Description

Parameters

const TDesC &aAddress


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

Parameters

const CSmsMessageSettings &aSmsSettings


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.


GetSmsSettingsL()

IMPORT_C void GetSmsSettingsL(CSmsMessageSettings &aSmsSettings) const;

Description

Parameters

CSmsMessageSettings &aSmsSettings


MessageBearing()

IMPORT_C TSmsMessageBearing MessageBearing() const;

Description

Return value

TSmsMessageBearing


Recipients()

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

Description

Return value

const CArrayPtrFlat< CSmsNumber > &


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.


Recipients()

inline CArrayPtrFlat< CSmsNumber > &Recipients();

Description

Return value

CArrayPtrFlat< CSmsNumber > &


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

Parameters

const TDesC &aAddress


FromAddress()

inline TPtrC FromAddress() const;

Description

Return value

TPtrC


RestoreL()

Capability: ReadUserDataNeeded unless owned by client.

IMPORT_C void RestoreL(CMsvStore &aStore);

Description

Restores the object from the message entry store.

The SMS object is restored from the supplied store.

Parameters

CMsvStore &aStore

The store from which the object is restored.


StoreL()

Capability: WriteUserDataNeeded unless owned by client.

IMPORT_C void StoreL(CMsvStore &aStore) const;

Description

Stores the object in the message entry store.

The object is written to the store. Any previous content is overwritten.

Parameters

CMsvStore &aStore

The store into which the object is written.


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


SetEmailFieldsL()

IMPORT_C void SetEmailFieldsL(const CSmsEmailFields &aEmailFields);

Description

Parameters

const CSmsEmailFields &aEmailFields


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.


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.


EmailFields()

IMPORT_C const CSmsEmailFields &EmailFields() const;

Description

Return value

const CSmsEmailFields &


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.


InternalizeL()

IMPORT_C void InternalizeL(RMsvReadStream &aStream);

Description

Parameters

RMsvReadStream &aStream


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.


ExternalizeL()

IMPORT_C void ExternalizeL(RMsvWriteStream &aStream) const;

Description

Parameters

RMsvWriteStream &aStream


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.


RestoreL()

IMPORT_C void RestoreL(CMsvStore &aStore);

Description

Parameters

CMsvStore &aStore


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.


StoreL()

IMPORT_C void StoreL(CMsvStore &aStore) const;

Description

Parameters

CMsvStore &aStore


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.


ContainsSmsHeaderL()

IMPORT_C TBool ContainsSmsHeaderL(const CMsvStore &aStore);

Description

Parameters

const CMsvStore &aStore

Return value

TBool


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

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


InternalizeL()

Capability: ReadUserDataNeeded unless owned by client.

IMPORT_C void InternalizeL(RMsvReadStream &aStream);

Description

Internalises the object from the specified stream.

Parameters

RMsvReadStream &aStream

The stream to be read from.

Leave codes

KErrNotSupported

The Telematic Device type is not supported.


ExternalizeL()

Capability: WriteUserDataNeeded unless owned by client.

IMPORT_C void ExternalizeL(RMsvWriteStream &aStream) const;

Description

Externalises the object to the specified stream.

Parameters

RMsvWriteStream &aStream

The stream to be writen to.

Leave codes

KErrNotSupported

The Telematic Device type is not supported.


SetSmsSettingsL()

IMPORT_C void SetSmsSettingsL(const CSmsMessageSettings &aSmsSettings);

Description

Parameters

const 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