»
Symbian OS v9.3 »
Symbian OS reference »
C++ component reference »
Messaging MSG_SMS8.1 »
CSmsHeader
Location:
SMUTHDR.H
Link against: smcm.lib
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
CBase
- Base class for all classes to be instantiated on the heap
CSmsHeader
- The SMS MTM encapsulation of an SMS message
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
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
Return value
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
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
IMPORT_C ~CSmsHeader();
Description
Destructor.
static IMPORT_C CSmsHeader *NewL(CSmsPDU::TSmsPDUType aType, CEditableText &aText);
Description
Parameters
Return value
static IMPORT_C CSmsHeader *NewL(CSmsPDU::TSmsPDUType aType, CEditableText &aText, RFs &aFs);
Description
Parameters
Return value
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
Return value
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
Return value
static IMPORT_C CSmsHeader *NewL(CSmsMessage *aMessage);
Description
Parameters
Return value
virtual IMPORT_C ~CSmsHeader();
Description
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
See also:
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
Panic codes
SMCM |
0 The message was not a PDU of type SMS-SUBMIT (debug only).
|
|
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).
|
|
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
Panic codes
SMCM |
0 The message was not a PDU of type SMS-DELIVER (debug only).
|
|
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
Panic codes
SMCM |
0 The message was not a PDU of type SMS-DELIVER (debug only).
|
|
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
Panic codes
SMCM |
0 The message was not a PDU of type SMS-COMMMAND (debug only).
|
|
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
Panic codes
SMCM |
0 The message was not a PDU of type SMS-COMMMAND (debug only).
|
|
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
Panic codes
SMCM |
0 The message was not a PDU of type SMS-STATUS-REPORT (debug only).
|
|
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
Panic codes
SMCM |
0 The message was not a PDU of type SMS-STATUS-REPORT (debug only).
|
|
inline CSmsMessage &Message();
Description
Gets the SMS stack representation of the message.
Return value
CSmsMessage & |
The SMS stack representation of the message
|
|
See also:
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
|
|
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.
|
|
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.
|
|
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
|
|
inline void SetBioMsgIdType(TBioMsgIdType aBioMsgIdType=EBioMsgIdNbs);
Description
Sets the message's BIO message type identifier.
Parameters
TBioMsgIdType aBioMsgIdType |
The BIO message type identifier
|
|
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
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).
|
|
IMPORT_C TSmsMessageType MessageType();
Description
Get the current message type
Return value
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
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).
|
|
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
Leave codes
KErrNotSupoprted |
The Telematic Device type is not supported.
|
|
Panic codes
SMCM |
0 The message PDU is not supported (debug only).
|
|
IMPORT_C TSmsBearers SmsBearer() const;
Description
Gets the bearer (generic, GSM or CDMA) of the message
Return value
IMPORT_C TSmsMessageBearing MessageBearing() const;
Description
Return value
inline const CArrayPtrFlat< CSmsNumber > &Recipients() const;
Description
Gets the (const) message recipients.
Return value
inline CArrayPtrFlat< CSmsNumber > &Recipients();
Description
Gets the (const) message recipients.
Return value
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
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
|
|
inline void SetFromAddressL(const TDesC &aAddress);
Description
Sets the originator address.
Parameters
const TDesC &aAddress |
The originator address
|
|
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.
|
|
IMPORT_C void RestoreL(CMsvStore &aStore);
Description
Parameters
IMPORT_C void StoreL(CMsvStore &aStore) const;
Description
Parameters
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.
|
|
IMPORT_C TBool ContainsSmsHeaderL(const CMsvStore &aStore);
Description
Parameters
Return value
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.
|
|
IMPORT_C const CSmsEmailFields &EmailFields() const;
Description
The email fields object for this message.
Return value
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
Return value
TInt
|
KErrNone if recipient is found, otherwise KErrNotFound.
|
|
IMPORT_C void InternalizeL(RMsvReadStream &aStream);
Description
Internalises the object from the specified stream.
Parameters
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
IMPORT_C void ExternalizeL(RMsvWriteStream &aStream) const;
Description
Externalises the object to the specified stream.
Parameters
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
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.
|
|
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
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.
|
|
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
IMPORT_C TBool ContainsSmsHeaderL(const CMsvStore &aStore);
Description
Check whether a CMsvStore
contains an SMS header stream.
Parameters
Return value
TBool
|
ETrue if there is a SMS header
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
inline const CArrayPtrFlat< CSmsNumber > &Recipients() const;
Description
Return value
inline CArrayPtrFlat< CSmsNumber > &Recipients();
Description
Return value
IMPORT_C void InternalizeL(RMsvReadStream &aStream);
Description
Parameters
IMPORT_C void ExternalizeL(RMsvWriteStream &aStream) const;
Description
Parameters
IMPORT_C void SetSmsSettingsL(const CSmsMessageSettings &aSmsSettings);
Description
Parameters
IMPORT_C void GetSmsSettingsL(CSmsMessageSettings &aSmsSettings) const;
Description
Parameters
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
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
|
|