»
Symbian OS v9.2 »
Symbian OS reference »
C++ component reference »
Messaging SMS (8.1) »
CSmsHeader
Location:
SMUTHDR.H
Link against: smcm_gsm.lib
Link against: smcm_cdma.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).
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
CBase - Base class for all classes to be instantiated on the heapCSmsHeader - 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(), 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
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(CSmsMessage *aMessage);
Description
Parameters
Return value
IMPORT_C ~CSmsHeader();
Description
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
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(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
virtual IMPORT_C ~CSmsHeader();
Description
Destructor.
inline CSmsPDU::TSmsPDUType Type() const;
Description
Return value
inline CSmsSubmit &Submit();
Description
Return value
inline const CSmsSubmit &Submit() const;
Description
Return value
inline CSmsDeliver &Deliver();
Description
Return value
inline const CSmsDeliver &Deliver() const;
Description
Return value
inline CSmsCommand &Command();
Description
Return value
inline const CSmsCommand &Command() const;
Description
Return value
inline CSmsStatusReport &StatusReport();
Description
Return value
inline const CSmsStatusReport &StatusReport() const;
Description
Return value
inline CSmsMessage &Message();
Description
Return value
inline const CSmsMessage &Message() const;
Description
Return value
inline TBool ReplyPathProvided() const;
Description
Return value
inline void SetReplyPathProvided(TBool aReplyPathProvided);
Description
Parameters
inline TBioMsgIdType BioMsgIdType() const;
Description
Return value
inline void SetBioMsgIdType(TBioMsgIdType aBioMsgIdType=EBioMsgIdNbs);
Description
Parameters
TBioMsgIdType aBioMsgIdType |
|
|
| 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
Return value
SetServiceCenterAddressL()
inline void SetServiceCenterAddressL(const TDesC &aAddress);
Description
Parameters
IMPORT_C TSmsMessageType MessageType();
Description
Get the current message type
Return value
IMPORT_C void SetSmsSettingsL(const CSmsMessageSettings &aSmsSettings);
Description
Parameters
IMPORT_C TSmsBearers SmsBearer() const;
Description
Gets the bearer (generic, GSM or CDMA) of the message
Return value
IMPORT_C void GetSmsSettingsL(CSmsMessageSettings &aSmsSettings) const;
Description
Parameters
IMPORT_C TSmsMessageBearing MessageBearing() const;
Description
Return value
inline const CArrayPtrFlat< CSmsNumber > &Recipients() const;
Description
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. |
|
inline CArrayPtrFlat< CSmsNumber > &Recipients();
Description
Return value
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
Parameters
inline TPtrC FromAddress() const;
Description
Return value
| Capability: | ReadUserData | Needed 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. |
|
| Capability: | WriteUserData | Needed 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. |
|
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 void SetEmailFieldsL(const CSmsEmailFields &aEmailFields);
Description
Parameters
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 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 const CSmsEmailFields &EmailFields() const;
Description
Return value
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 InternalizeL(RMsvReadStream &aStream);
Description
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 ExternalizeL(RMsvWriteStream &aStream) const;
Description
Parameters
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 RestoreL(CMsvStore &aStore);
Description
Parameters
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 void StoreL(CMsvStore &aStore) const;
Description
Parameters
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 TBool ContainsSmsHeaderL(const CMsvStore &aStore);
Description
Parameters
Return value
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
Gets the (const) message recipients.
Return value
inline CArrayPtrFlat< CSmsNumber > &Recipients();
Description
Gets the (const) message recipients.
Return value
| Capability: | ReadUserData | Needed unless owned by client. |
IMPORT_C void InternalizeL(RMsvReadStream &aStream);
Description
Internalises the object from the specified stream.
Parameters
Leave codes
KErrNotSupported |
The Telematic Device type is not supported. |
|
| Capability: | WriteUserData | Needed unless owned by client. |
IMPORT_C void ExternalizeL(RMsvWriteStream &aStream) const;
Description
Externalises the object to the specified stream.
Parameters
Leave codes
KErrNotSupported |
The Telematic Device type is not supported. |
|
IMPORT_C void SetSmsSettingsL(const CSmsMessageSettings &aSmsSettings);
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 |
|