1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
20 Gets the message PDU for a SMS-SUBMIT type message.
22 The message PDU type can be checked by using the CSmsHeader::Type API.
25 The SMS-SUBMIT PDU object.
28 The message was not a PDU of type SMS-SUBMIT (debug only).
32 inline CSmsSubmit& CSmsHeader::Submit()
34 __ASSERT_DEBUG( Type() == CSmsPDU::ESmsSubmit, Panic(ESmutPanicUnsupportedMsgType));
35 return (CSmsSubmit&)(iMessage->SmsPDU());
39 Gets the (const) message PDU for a SMS-SUBMIT type message.
41 The message PDU type can be checked by using the CSmsHeader::Type API.
44 The SMS-SUBMIT PDU const object.
47 The message was not a PDU of type SMS-SUBMIT (debug only).
51 inline const CSmsSubmit& CSmsHeader::Submit() const
53 __ASSERT_DEBUG( Type() == CSmsPDU::ESmsSubmit, Panic(ESmutPanicUnsupportedMsgType));
54 return (CSmsSubmit&)(iMessage->SmsPDU());
58 Gets the message PDU for a SMS-DELIVER type message.
60 The message PDU type can be checked by using the CSmsHeader::Type API.
63 The SMS-DELIVER PDU object.
66 The message was not a PDU of type SMS-DELIVER (debug only).
70 inline CSmsDeliver& CSmsHeader::Deliver()
72 __ASSERT_DEBUG( Type() == CSmsPDU::ESmsDeliver, Panic(ESmutPanicUnsupportedMsgType));
73 return (CSmsDeliver&)(iMessage->SmsPDU());
77 Gets the (const) message PDU for a SMS-DELIVER type message.
79 The message PDU type can be checked by using the CSmsHeader::Type API.
82 The SMS-DELIVER PDU const object.
85 The message was not a PDU of type SMS-DELIVER (debug only).
89 inline const CSmsDeliver& CSmsHeader::Deliver() const
91 __ASSERT_DEBUG( Type() == CSmsPDU::ESmsDeliver, Panic(ESmutPanicUnsupportedMsgType));
92 return (CSmsDeliver&)(iMessage->SmsPDU());
96 Gets the message PDU for a SMS-COMMMAND type message.
98 The message PDU type can be checked by using the CSmsHeader::Type API.
100 @return The SMS-COMMMAND PDU object.
103 The message was not a PDU of type SMS-COMMMAND (debug only).
105 @see CSmsHeader::Type
107 inline CSmsCommand& CSmsHeader::Command()
109 __ASSERT_DEBUG( Type() == CSmsPDU::ESmsCommand, Panic(ESmutPanicUnsupportedMsgType));
110 return (CSmsCommand&)(iMessage->SmsPDU());
114 Gets the (const) message PDU for a SMS-COMMMAND type message.
116 The message PDU type can be checked by using the CSmsHeader::Type API.
119 The SMS-COMMMAND PDU const object.
122 The message was not a PDU of type SMS-COMMMAND (debug only).
124 @see CSmsHeader::Type
126 inline const CSmsCommand& CSmsHeader::Command() const
128 __ASSERT_DEBUG( Type() == CSmsPDU::ESmsCommand, Panic(ESmutPanicUnsupportedMsgType));
129 return (CSmsCommand&)(iMessage->SmsPDU());
133 Gets the message PDU for a SMS-STATUS-REPORT type message.
135 The message PDU type can be checked by using the CSmsHeader::Type API.
138 The SMS-STATUS-REPORT PDU object.
141 The message was not a PDU of type SMS-STATUS-REPORT (debug only).
143 @see CSmsHeader::Type
145 inline CSmsStatusReport& CSmsHeader::StatusReport()
147 __ASSERT_DEBUG( Type() == CSmsPDU::ESmsStatusReport, Panic(ESmutPanicUnsupportedMsgType));
148 return (CSmsStatusReport&)(iMessage->SmsPDU());
152 Gets the (const) message PDU for a SMS-STATUS-REPORT type message.
154 The message PDU type can be checked by using the CSmsHeader::Type API.
157 The SMS-STATUS-REPORT PDU const object.
160 The message was not a PDU of type SMS-STATUS-REPORT (debug only).
162 @see CSmsHeader::Type
164 inline const CSmsStatusReport& CSmsHeader::StatusReport() const
166 __ASSERT_DEBUG( Type() == CSmsPDU::ESmsStatusReport, Panic(ESmutPanicUnsupportedMsgType));
167 return (CSmsStatusReport&)(iMessage->SmsPDU());
171 Gets the message PDU type.
173 There are six types of PDU - SMS-DELIVER, SMS-DELIVER-REPORT, SMS-SUBMIT,
174 SMS-SUBMIT-REPORT, SMS-STATUS-REPORT and SMS-COMMAND.
176 There is access to only to SMS-DELIVER, SMS-SUBMIT, SMS-STATUS-REPORT and
177 SMS-COMMAND PDUs via the CSmsHeader encapsulation.
180 The message PDU type.
182 @see CSmsPDU::TSmsPDUType
184 inline CSmsPDU::TSmsPDUType CSmsHeader::Type() const
186 return iMessage->SmsPDU().Type();
190 Gets the (const) message recipients.
193 The const array of message recipients
195 inline const CArrayPtrFlat<CSmsNumber>& CSmsHeader::Recipients() const
201 Gets the (const) message recipients.
204 The array of message recipients
206 inline CArrayPtrFlat<CSmsNumber>& CSmsHeader::Recipients()
212 Gets the SMS stack representation of the message.
215 The SMS stack representation of the message
219 inline CSmsMessage& CSmsHeader::Message()
225 Gets the (const) SMS stack representation of the message.
228 The const SMS stack representation of the message
230 inline const CSmsMessage& CSmsHeader::Message() const
236 Tests if the message contains a reply path.
239 A value of True if the message contains a reply path.
241 inline TBool CSmsHeader::ReplyPathProvided() const
243 return iFlags & ESmsHeaderReplyPathProvided;
247 Set the message flag that indicates whether it contains a reply path.
249 @param aReplyPathProvided
250 A value of True to set the flag.
252 inline void CSmsHeader::SetReplyPathProvided(TBool aReplyPathProvided)
254 iFlags = (iFlags & ~ESmsHeaderReplyPathProvided) | (aReplyPathProvided ? ESmsHeaderReplyPathProvided : ESmsHeaderNoFlags);
258 Sets the originator address.
261 The originator address
263 inline void CSmsHeader::SetFromAddressL(const TDesC& aAddress)
265 Message().SmsPDU().SetToFromAddressL(aAddress);
269 Gets the originator address.
271 Only valid for SMS-DELIVER and SMS-SUBMIT type messages. With any other message
272 types the returned originator address is empty.
275 The originator address.
277 inline TPtrC CSmsHeader::FromAddress() const
281 case(CSmsPDU::ESmsSubmit):
282 return Submit().ToFromAddress();
283 case(CSmsPDU::ESmsDeliver):
284 return Deliver().ToFromAddress();
291 Gets the message's service center address.
293 This can only be used on SMS-SUBMIT type messages. The message PDU type can be
294 checked by using the CSmsHeader::Type API.
297 The Service Center address.
300 The message was not a PDU of type SMS-SUBMIT (debug only).
302 @see CSmsHeader::Type
304 inline TPtrC CSmsHeader::ServiceCenterAddress() const
306 return Submit().ServiceCenterAddress();
310 Sets the message's service center address.
312 This can only be used on SMS-SUBMIT type messages. The message PDU type can be
313 checked by using the CSmsHeader::Type API.
317 The Service Center address
320 The message was not a PDU of type SMS-SUBMIT (debug only).
322 @see CSmsHeader::Type
324 inline void CSmsHeader::SetServiceCenterAddressL(const TDesC& aAddress)
326 Submit().SetServiceCenterAddressL(aAddress);
330 Gets the message's BIO message type identifier.
332 For non-BIO messages, this is EBioMsgIdNbs.
335 The BIO message type identifier
337 inline TBioMsgIdType CSmsHeader::BioMsgIdType() const
339 return iBioMsgIdType;
343 Sets the message's BIO message type identifier.
346 The BIO message type identifier
348 inline void CSmsHeader::SetBioMsgIdType(TBioMsgIdType aBioMsgIdType)
350 iBioMsgIdType = aBioMsgIdType;
363 inline TMsvSmsEntry::TMsvSmsEntry()
371 The index entry to copy.
376 inline TMsvSmsEntry::TMsvSmsEntry(const TMsvEntry& aEntry)
382 Sets the User Prompt Indicator flag.
385 A value of True to set the flag.
390 inline void TMsvSmsEntry::SetUserPromptIndicator(TBool aUPI)
392 (aUPI) ? (iMtmData2 |= EMsvSmsEntryUserPromptIndicator) : (iMtmData2 &= ~EMsvSmsEntryUserPromptIndicator);
396 Gets the User Prompt Indicator flag.
399 A value of True if the User Prompt Indicator flag is.
404 inline TBool TMsvSmsEntry::UserPromptIndicator() const
406 return (iMtmData2 & EMsvSmsEntryUserPromptIndicator);
410 Gets the Protocol Identifier data.
413 The Protocol Identifier data.
418 inline TUint8 TMsvSmsEntry::ProtocolIdentifier() const
420 return STATIC_CAST(TUint8, iMtmData2 & EMsvSmsEntryProtocolIdentifier);
424 Sets the Protocol Identifier data.
427 The Protocol Identifier data.
432 inline void TMsvSmsEntry::SetProtocolIdentifier(TSmsProtocolIdentifier aPID)
434 SetProtocolIdentifier(STATIC_CAST(TUint8, aPID));
438 Sets the Protocol Identifier data.
441 The Protocol Identifier data.
446 inline void TMsvSmsEntry::SetProtocolIdentifier(TUint8 aPID)
448 iMtmData2 = (iMtmData2 & ~EMsvSmsEntryProtocolIdentifier) | (aPID & EMsvSmsEntryProtocolIdentifier);
452 Sets the SMS class data and defined flag.
455 A value of True to set the SMS class data defined flag.
463 inline void TMsvSmsEntry::SetClass(TBool aClassDefined, TSmsDataCodingScheme::TSmsClass aClass)
465 aClassDefined ? (iMtmData2 |= EMsvSmsEntryClassDefined) : (iMtmData2 &= ~EMsvSmsEntryClassDefined);
466 iMtmData2 = (iMtmData2 & ~EMsvSmsEntryClass) | ((aClass << EMsvSmsEntryClassShift) & EMsvSmsEntryClass);
470 Gets the SMS class data and defined flag.
473 An output argument with the SMS class data.
476 A value of True if the SMS class data defined flag is set.
481 inline TBool TMsvSmsEntry::Class(TSmsDataCodingScheme::TSmsClass& aClass) const
483 aClass = STATIC_CAST(TSmsDataCodingScheme::TSmsClass, ((iMtmData2 & EMsvSmsEntryClass) >> EMsvSmsEntryClassShift));
484 return iMtmData2 & EMsvSmsEntryClassDefined;