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.
14 // This file define the classes for the different PDU elements
24 #ifndef __GSMUELEM_H__
25 #define __GSMUELEM_H__
32 #include <gsmunmspacemobph.h>
37 class CSmsEMSBufferSegmenter;
47 const TInt KErrGsmuDecoding = KErrCorrupt;
51 _LIT8(KMOSES,"\x40\x4d\x64\xd3\x50\x00");
55 _LIT16(KNETWORK,"NETWORK");
62 const TUint8 KSms7BitAlphabetEscapeChar=0x1b;
66 * Thin wrapper over TLex8 to provide leaving functions when getting the next
69 * These functions leave with KErrGsmuDecoding if there are insufficient characters
74 class TGsmuLex8 : public TLex8
77 TGsmuLex8(const TDesC8& aSource);
79 void IncL(TInt aNumber = 1);
80 TPtrC8 NextWithNoIncL(TInt aLength) const;
81 TPtrC8 NextWithNoIncL(TInt aLength, TBool aAcceptTruncation) const;
82 TPtrC8 NextAndIncL(TInt aLength);
85 inline void LeaveL() const;
90 * Base class for performing all operations on octets.
97 inline TSmsOctet(TInt aValue);
98 inline TSmsOctet(TUint8 aValue = 0);
99 inline operator TInt() const;
100 const TSmsOctet& operator = (TInt aValue);
101 inline void FillSemiOctets(TInt aNum);
102 inline TInt SemiOctetsToNum() const;
103 TUint8* EncodeL(TUint8* aPtr) const;
104 inline void DecodeL(TGsmuLex8& aPdu);
105 inline void InternalizeL(RReadStream& aStream);
106 inline void ExternalizeL(RWriteStream& aStream) const;
114 * Bit masks for key first octet of an SMS PDU
118 class TSmsFirstOctet : public TSmsOctet
121 /** TP-MTI (Message Type Indicator) First octet of all SMS PDUs. */
124 /** SMS-DELIVER or SMS-DELIVER-REPORT message. */
125 ESmsMTIDeliverOrDeliverReport=0x00,
126 /** SMS-SUBMIT or SMS-SUBMIT-REPORT message. */
127 ESmsMTISubmitOrSubmitReport=0x01,
128 /** SMS-STATUS or SMS-COMMAND message. */
129 ESmsMTIStatusReportOrCommand=0x02,
131 /** Mask for these bit flags. */
136 * TP-UDHI (User Data Header Indicator) Found in first octet of
137 * Submit and Deliver and possibly, Deliver Report and Status Report.
141 /** User data header indicator not present. */
142 ESmsUDHIHeaderNotPresent=0x00,
143 /** User data header indicator present. */
144 ESmsUDHIHeaderPresent=0x40,
146 /** Mask for these bit flags. */
150 /** TP-RP (Reply Path) Found in first octet of Submit and Deliver. */
153 /** Reply path does not exist. */
154 ESmsReplyPathNone=0x00,
155 /** Reply path exists. */
156 ESmsReplyPathExists=0x080,
158 /** Mask for these bit flags. */
159 ESmsReplyPathMask=0x80
162 /** TP-MMS (More Messages To Send) Found in Deliver and Status Report. */
163 enum TSmsMoreMessagesToSend
165 /** More messages to send. */
166 ESmsMoreMessagesToSend=0x00,
167 /** No more messages to send. */
168 ESmsNoMoreMessagesToSend=0x04,
170 /** Mask for these bit flags. */
171 ESmsMoreMessagesToSendMask=0x04,
174 /** T-SRI (Status Report Indicator) Found in Status Report. */
175 enum TSmsStatusReportIndicator
177 /** Status report is not going to be returned. */
178 ESmsStatusReportNotReturned=0x00,
179 /** Status report is going to be returned. */
180 ESmsStatusReportReturned=0x20,
182 /** Mask for these bit flags. */
183 ESmsStatusReportIndicatorMask=0x20
186 /** TP-RD bit flags. */
187 enum TSmsRejectDuplicates
189 * T-RD (Reject Duplicates) Found in Submit
192 /** Accept duplicates. */
193 ESmsAcceptDuplicates=0x00,
194 /** Reject duplicates. */
195 ESmsRejectDuplicates=0x04,
197 /** Mask for these bit flags. */
198 ESmsRejectDuplicatesMask=0x04
201 /** T-SRQ (Status Report Qualifier). Found in Status Report. */
202 enum TSmsStatusReportQualifier
204 /** Status report result of submit. */
205 ESmsStatusReportResultOfSubmit=0x00,
206 /** Status report result of command. */
207 ESmsStatusReportResultOfCommand=0x20,
209 /** Mask for these bit flags. */
210 ESmsStatusReportQualifierMask=0x20
213 /** TP-VPF (Validity Period Format). Found in Submit. */
214 enum TSmsValidityPeriodFormat
216 /** TP-VP field not present. */
218 /** TP-VP field present. Enhanced format (7 octets). */
219 ESmsVPFEnhanced=0x08, // was ESmsVPFReserved, the new GSM spec!
220 /** TP-VP field present, relative validity format. */
221 ESmsVPFInteger=0x10, // relative validity period
222 /** TP-VP field present, absolute validity format. */
223 ESmsVPFSemiOctet=0x18, // absolute validity period
225 /** Mask for these bit flags. */
229 /** TP-SRR (Status Report Request) Found in Submit and Command. */
230 enum TSmsStatusReportRequest
232 /** Status report is not requested. */
233 ESmsStatusReportNotRequested=0x00,
234 /** Status report is requested. */
235 ESmsStatusReportRequested=0x20,
237 /** Mask for these bit flags. */
238 ESmsStatusReportRequestMask=0x20
242 TSmsFirstOctet(TInt aValue=0);
243 const TSmsFirstOctet& operator = (TInt aValue); // Review
248 * TP-FCS (Failure Cause) octet. For Deliver and Submit errors
252 class TSmsFailureCause : public TSmsOctet
256 enum TSmsFailureCauseError
262 /** Telematic interworking not supported. */
263 ESmsPIDErrorTelematicInterworkingNotSupported=0x80,
264 /** Short message Type 0 not supported. */
265 ESmsPIDErrorShortMessageType0NotSupported=0x81,
266 /** Cannot replace short message. */
267 ESmsPIDErrorCannotReplaceShortMessage=0x82,
269 ESmsPIDErrorReserved1=0x83,
271 ESmsPIDErrorReserved2=0x84,
273 ESmsPIDErrorReserved3=0x85,
275 ESmsPIDErrorReserved4=0x86,
277 ESmsPIDErrorReserved5=0x87,
279 ESmsPIDErrorReserved6=0x88,
281 ESmsPIDErrorReserved7=0x89,
283 ESmsPIDErrorReserved8=0x8A,
285 ESmsPIDErrorReserved9=0x8B,
287 ESmsPIDErrorReserved10=0x8C,
289 ESmsPIDErrorReserved11=0x8D,
291 ESmsPIDErrorReserved12=0x8E,
292 /** Unspecified TP-PID error. */
293 ESmsPIDErrorUnspecified=0x8F,
295 /** Data coding scheme (alphabet) not supported. */
296 ESmsDCSErrorAlphabetNotSupported=0x90,
297 /** Message class not supported. */
298 ESmsDCSErrorMessageClassNotSupported=0x91,
300 ESmsDCSErrorReserved1=0x92,
302 ESmsDCSErrorReserved2=0x93,
304 ESmsDCSErrorReserved3=0x94,
306 ESmsDCSErrorReserved4=0x95,
308 ESmsDCSErrorReserved5=0x96,
310 ESmsDCSErrorReserved6=0x97,
312 ESmsDCSErrorReserved7=0x98,
314 ESmsDCSErrorReserved8=0x99,
316 ESmsDCSErrorReserved9=0x9A,
318 ESmsDCSErrorReserved10=0x9B,
320 ESmsDCSErrorReserved11=0x9C,
322 ESmsDCSErrorReserved12=0x9D,
324 ESmsDCSErrorReserved13=0x9E,
326 ESmsDCSErrorUnspecified=0x9F,
328 /** Command cannot be actioned. */
329 ESmsCommandErrorCannotBeActioned=0xA0,
330 /** Command unsupported. */
331 ESmsCommandErrorUnsupported=0xA1,
333 ESmsCommandErrorReserved1=0xA2,
335 ESmsCommandErrorReserved2=0xA3,
337 ESmsCommandErrorReserved3=0xA4,
339 ESmsCommandErrorReserved4=0xA5,
341 ESmsCommandErrorReserved5=0xA6,
343 ESmsCommandErrorReserved6=0xA7,
345 ESmsCommandErrorReserved7=0xA8,
347 ESmsCommandErrorReserved8=0xA9,
349 ESmsCommandErrorReserved9=0xAA,
351 ESmsCommandErrorReserved10=0xAB,
353 ESmsCommandErrorReserved11=0xAC,
355 ESmsCommandErrorReserved12=0xAD,
357 ESmsCommandErrorReserved13=0xAE,
358 /** Unspecified TP-Command error. */
359 ESmsCommandErrorUnspecified=0xAF,
361 /** PDU not supported. */
362 ESmsErrorPDUNotSupported=0xB0,
367 ESmsErrorSCBusy=0xC0,
368 /** No SC subscription. */
369 ESmsErrorNoSCSubscription=0xC1,
370 /** SC system failure. */
371 ESmsErrorNoSCSystemFailure=0xC2,
372 /** Invalid SME address. */
373 ESmsErrorInvalidSMEAddress=0xC3,
374 /** Destination SME barred. */
375 ESmsErrorDestinationSMEBarred=0xC4,
376 /** SM Rejected-Duplicate SM. */
377 ESmsErrorSMRejectedDuplicateSM=0xC5,
378 /** TP-VPF not supported. */
379 ESmsErrorVPFNotSupported=0xC6,
380 /** TP-VP not supported. */
381 ESmsErrorVPNotSupported=0xC7,
385 /** SIM SMS storage full. */
386 ESmsErrorSIMSMSStorageFull=0xD0,
387 /** No SMS storage capability in (U)SIM. */
388 ESmsErrorNoSMSStorageCapabilityOnSIM=0xD1,
390 ESmsErrorErrorInMS=0xD2,
391 /** Memory Capacity Exceeded. */
392 ESmsErrorMemoryCapacityExceded=0xD3,
393 /** (U)SIM Application Toolkit Busy. */
394 ESmsErrorSIMApplicationToolkitBusy=0xD4,
395 /** (U)SIM data download error. */
396 ESmsErrorSIMDataDownloadError=0xD5,
400 /** Value specific to an application. */
401 ESmsApplicationError1=0xE0,
402 /** Value specific to an application. */
403 ESmsApplicationError2=0xE1,
404 /** Value specific to an application. */
405 ESmsApplicationError3=0xE2,
406 /** Value specific to an application. */
407 ESmsApplicationError4=0xE3,
408 /** Value specific to an application. */
409 ESmsApplicationError5=0xE4,
410 /** Value specific to an application. */
411 ESmsApplicationError6=0xE5,
412 /** Value specific to an application. */
413 ESmsApplicationError7=0xE6,
414 /** Value specific to an application. */
415 ESmsApplicationError8=0xE7,
416 /** Value specific to an application. */
417 ESmsApplicationError9=0xE8,
418 /** Value specific to an application. */
419 ESmsApplicationError10=0xE9,
420 /** Value specific to an application. */
421 ESmsApplicationError11=0xEA,
422 /** Value specific to an application. */
423 ESmsApplicationError12=0xEB,
424 /** Value specific to an application. */
425 ESmsApplicationError13=0xEC,
426 /** Value specific to an application. */
427 ESmsApplicationError14=0xED,
428 /** Value specific to an application. */
429 ESmsApplicationError15=0xEE,
430 /** Value specific to an application. */
431 ESmsApplicationError16=0xEF,
432 /** Value specific to an application. */
433 ESmsApplicationError17=0xF0,
434 /** Value specific to an application. */
435 ESmsApplicationError18=0xF1,
436 /** Value specific to an application. */
437 ESmsApplicationError19=0xF2,
438 /** Value specific to an application. */
439 ESmsApplicationError20=0xF3,
440 /** Value specific to an application. */
441 ESmsApplicationError21=0xF4,
442 /** Value specific to an application. */
443 ESmsApplicationError22=0xF5,
444 /** Value specific to an application. */
445 ESmsApplicationError23=0xF6,
446 /** Value specific to an application. */
447 ESmsApplicationError24=0xF7,
448 /** Value specific to an application. */
449 ESmsApplicationError25=0xF8,
450 /** Value specific to an application. */
451 ESmsApplicationError26=0xF9,
452 /** Value specific to an application. */
453 ESmsApplicationError27=0xFA,
454 /** Value specific to an application. */
455 ESmsApplicationError28=0xFB,
456 /** Value specific to an application. */
457 ESmsApplicationError29=0xFC,
458 /** Value specific to an application. */
459 ESmsApplicationError30=0xFD,
460 /** Value specific to an application. */
461 ESmsApplicationError31=0xFE,
463 /** Unspecified error cause. */
464 ESmsErrorUnspecified=0xFF,
466 /** @internalComponent */
471 inline TInt Error() const;
472 inline void SetError(TSmsFailureCauseError aError);
477 * TP-ST (Status Report) octet. Found in Status Report
481 class TSmsStatus : public TSmsOctet
484 /** TP-ST flag values. */
487 // Short message transaction completed
488 /** Short message received by the SME. */
489 ESmsShortMessageReceivedBySME=0x00,
491 * Short message forwarded by the SC to the SME but the SC is unable to confirm
494 ESmsShortMessageForwardedBySCToSMEButUnconfirmedBySC=0x01,
495 /** Short message replaced by the SC. */
496 ESmsShortMessageReplacedBySC=0x02,
500 // Temporary error, SC still trying to transfer SM
501 /** Temporary error, SC still trying to transfer SM: congestion. */
502 ESmsTempError1StatusCongestion=0x20,
503 /** Temporary error, SC still trying to transfer SM: SME busy. */
504 ESmsTempError1StatusSMEBusy=0x21,
505 /** Temporary error, SC still trying to transfer SM: No response from SME. */
506 ESmsTempError1StatusNoResponseFromSME=0x22,
507 /** Temporary error, SC still trying to transfer SM: Service rejected. */
508 ESmsTempError1StatusServiceRejected=0x23,
509 /** Temporary error, SC still trying to transfer SM: Quality of service not available. */
510 ESmsTempError1StatusQualityOfServiceNotAvailable=0x24,
511 /** Temporary error, SC still trying to transfer SM: Error in SME. */
512 ESmsTempError1StatusErrorInSME=0x25,
516 // Permanent error, SC is not making any more transfer attempts
518 * Permanent error, SC is not making any more transfer attempts: Remote procedure
521 ESmsPermErrorRemoteProcedureError=0x40,
523 * Permanent error, SC is not making any more transfer attempts: Incompatible
526 ESmsPermErrorIncompatibleDestination=0x41,
528 * Permanent error, SC is not making any more transfer attempts: Connection rejected
531 ESmsPermErrorConnectionRejectedBySME=0x42,
532 /** Permanent error, SC is not making any more transfer attempts: Not obtainable. */
533 ESmsPermErrorNotObtainable=0x43,
535 * Permanent error, SC is not making any more transfer attempts: Quality of service
538 ESmsPermErrorQualityOfServiceNotAvailable2=0x44,
540 * Permanent error, SC is not making any more transfer attempts: No interworking
543 ESmsPermErrorNoInterworkingAvailable=0x45,
545 * Permanent error, SC is not making any more transfer attempts: SM Validity Period
548 ESmsPermErrorSMValidityPeriodExpired=0x46,
550 * Permanent error, SC is not making any more transfer attempts: SM Deleted by
553 ESmsPermErrorSMDeletedByOriginatingSME=0x47,
555 * Permanent error, SC is not making any more transfer attempts: SM Deleted by
558 ESmsPermErrorSMDeletedBySCAdministration=0x48,
559 /** Permanent error, SC is not making any more transfer attempts: SM does not exist. */
560 ESmsPermErrorDoesNotExist=0x49,
564 // Temporary error, SC is not making any more transfer attempts
565 /** Temporary error, SC is not making any more transfer attempts: Congestion. */
566 ESmsTempError2Congestion=0x60,
567 /** Temporary error, SC is not making any more transfer attempts: SME Busy. */
568 ESmsTempError2SMEBusy=0x61,
570 * Temporary error, SC is not making any more transfer attempts: No response from
573 ESmsTempError2NoResponseFromSME=0x62,
574 /** Temporary error, SC is not making any more transfer attempts: Service rejected. */
575 ESmsTempError2ServiceRejected=0x63,
577 * Temporary error, SC is not making any more transfer attempts: Quality of service
580 ESmsTempError2QualityOfServiceNotAvailable=0x64,
581 /** Temporary error, SC is not making any more transfer attempts: Error in SME. */
582 ESmsTempError2ErrorInSME=0x65,
589 inline TSmsStatus::TSmsStatusValue Status() const;
590 inline void SetStatus(TSmsStatusValue aValue);
595 * TP-PI octet. Found in Reports and Commands
599 class TSmsParameterIndicator : public TSmsOctet
602 /** TP-PI bit flags. */
605 /** Protocol identifier present. */
606 ESmsPIDProtocolIdentifierPresent=0x01,
607 /** Data coding scheme present. */
608 ESmsPIDDataCodingSchemePresent=0x02,
609 /** User data present. */
610 ESmsPIDUserDataPresent=0x04,
612 ESmsPIDReserved1=0x08,
614 ESmsPIDReserved2=0x10,
616 ESmsPIDReserved3=0x20,
618 ESmsPIDReserved4=0x40,
620 ESmsPIDExtension=0x80
623 TSmsParameterIndicator();
624 inline TBool Extension() const;
625 inline void SetExtension(TBool aExtension);
626 inline TBool UserDataPresent() const;
627 inline void SetUserDataPresent(TBool aPresent);
628 inline TBool DataCodingSchemePresent() const;
629 inline void SetDataCodingSchemePresent(TBool aPresent);
630 inline TBool ProtocolIdentifierPresent() const;
631 inline void SetProtocolIdentifierPresent(TBool aPresent);
634 // TSmsPID - conversion (None, Fax, Mail, etc.)
637 * TP-PID PDU octet. Found in ALL 6 message types.
641 class TSmsProtocolIdentifier : public TSmsOctet
644 /** PID bits 7-6, which determine the meaning of the lower order bits. */
647 /** Telematic interworking. */
648 ESmsPIDTelematicInterworking=0x00,
649 /** Short message. */
650 ESmsPIDShortMessageType=0x40,
652 ESmsPIDReserved=0x80,
653 /** SC specific use. */
654 ESmsPIDSCSpecificUse=0xC0,
656 /** Mask of bits 7-6. */
660 /** Telematic device indicator flags. Bit 5 - When Bit 7 = 0, Bit 6 = 0 */
661 enum TSmsTelematicDeviceIndicator
663 /** No telematic device. */
664 ESmsNoTelematicDevice=0x00,
665 /** Telematic device. */
666 ESmsTelematicDevice=0x20,
668 /** Telematic device indicator mask. */
669 EPIDTelematicDeviceIndicatorMask=0x20
672 /** Telematic Interworking device type flags. Bits 4-0 - When Bit 5 = 1*/
673 enum TSmsTelematicDeviceType
675 /** Device type is specific to this SC. */
676 ESmsSCSpecificDevice=0x00,
679 /** Group 3 telefax. */
680 ESmsGroup3TeleFax=0x02,
681 /** Group 4 telefax. */
682 ESmsGroup4TeleFax=0x03,
683 /** Voice telephone. */
684 ESmsVoiceTelephone=0x04,
687 /** National Paging System. */
688 ESmsNationalPagingSystem=0x06,
691 /** Teletex, carrier unspecified. */
692 ESmsTeletexCarrierUnspecified=0x08,
693 /** Teletex, PSPDN. */
694 ESmsTeletexPSPDN=0x09,
695 /** Teletex, CSPDN. */
696 ESmsTeletexCSPDN=0x0A,
697 /** Teletex, in analog PSTN. */
698 ESmsTeletexAnaloguePSTN=0x0B,
699 /** Teletex, in digital ISDN */
700 ESmsTeletexDigitalISDN=0x0C,
701 /** UCI (Universal Computer Interface, ETSI DE/PS 3 01-3). */
707 /** A message handling facility. */
708 ESmsMessageHandlingFacility=0x10,
709 /** X.400 message handling system. */
710 ESmsX400MessageHandlingSystem=0x11,
711 /** Internet Electronic Mail. */
712 ESmsInternetElectronicMail=0x12,
723 /** Value specific to each SC. */
724 ESmsSCSpecific1=0x18,
725 /** Value specific to each SC. */
726 ESmsSCSpecific2=0x19,
727 /** Value specific to each SC. */
728 ESmsSCSpecific3=0x1A,
729 /** Value specific to each SC. */
730 ESmsSCSpecific4=0x1B,
731 /** Value specific to each SC. */
732 ESmsSCSpecific5=0x1C,
733 /** Value specific to each SC. */
734 ESmsSCSpecific6=0x1D,
735 /** Value specific to each SC. */
736 ESmsSCSpecific7=0x1E,
737 /** Value specific to each SC. */
738 ESmsGsmMobileStation=0x1F,
740 /** Mask for telematic device type bits. */
741 ESmsTelematicDeviceTypeMask=0x1F
744 /** SM-AL protocol flag. No Telematic Interworking. Bits 4-0 - When Bit 5 = 0*/
745 enum TSmsShortMessageALProtocol
747 /** Mask for SM-AL protocol flag bit. */
748 ESmsShortMessageALProtocolMask=0x0F
751 /** Short Message Type flags. Bits 5-0 - When Bit 7 = 1, Bit 6 = 0*/
752 enum TSmsShortMessageType
754 /** Short Message Type 0. */
755 ESmsShortMessageType0=0x00,
756 /** Replace Short Message Type 1. */
757 ESmsReplaceShortMessageType1=0x01,
758 /** Replace Short Message Type 2. */
759 ESmsReplaceShortMessageType2=0x02,
760 /** Replace Short Message Type 3. */
761 ESmsReplaceShortMessageType3=0x03,
762 /** Replace Short Message Type 4. */
763 ESmsReplaceShortMessageType4=0x04,
764 /** Replace Short Message Type 5. */
765 ESmsReplaceShortMessageType5=0x05,
766 /** Replace Short Message Type 6. */
767 ESmsReplaceShortMessageType6=0x06,
768 /** Replace Short Message Type 7. */
769 ESmsReplaceShortMessageType7=0x07,
773 /** Return Call Message. */
774 ESmsReturnCallMesage=0x1F,
778 ESmsAnsi136RData=0x3C,
779 ESmsMEDataDownload=0x3D,
780 /** ME De-personalization Short Message. */
781 ESmsMEDepersonalizationShortMessage=0x3E,
782 /** ME Data download. */
783 ESmsSIMDataDownLoad=0x3F,
785 // ESmsShortMessageTypeMask=0x1F
786 /** Mask for Short Message type bits. */
787 ESmsShortMessageTypeMask=0x3F
790 TSmsProtocolIdentifier();
791 inline TSmsPIDType PIDType() const;
792 inline void SetPIDType(TSmsPIDType aSmsPIDType);
793 TSmsTelematicDeviceIndicator TelematicDeviceIndicator() const;
794 void SetTelematicDeviceIndicator(TSmsTelematicDeviceIndicator aIndicator);
795 TSmsTelematicDeviceType TelematicDeviceType() const;
796 void SetTelematicDeviceType(TSmsTelematicDeviceType aDeviceType);
797 TInt ShortMessageALProtocol() const;
798 void SetShortMessageALProtocol(TSmsShortMessageALProtocol aProtocol);
799 TInt ShortMessageType() const;
800 void SetShortMessageType(TSmsShortMessageType aShortMessageType);
805 * TP-DCS Data Coding Scheme defined in 3GPP TS 23.038.
807 * The data coding scheme is not always present in an GSM SMS PDU (CSmsPDU).
808 * It is always present for a SUBMIT (CSmsSubmit) and a DELIVER (CSmsDeliver),
809 * and is sometimes present for a DELIVER REPORT (CSmsDeliverReport), a SUBMIT
810 * REPORT (CSmsSubmitReport) or a STATUS REPORT (CSmsStatusReport), depending
811 * on the parameter indicator (TSmsParameterIndicator).
815 class TSmsDataCodingScheme : public TSmsOctet
818 /** Flags for bits 7-4, which determine the meaning of the lower order bits. */
821 /** Text is uncompressed, no class information. */
822 ESmsDCSTextUncompressedWithNoClassInfo=0x00,
823 /** Text is uncompressed, class information present. */
824 ESmsDCSTextUncompressedWithClassInfo=0x10,
825 /** Text is compressed, no class information. */
826 ESmsDCSTextCompressedWithNoClassInfo=0x20,
827 /** Text is compressed, class information present. */
828 ESmsDCSTextCompressedWithClassInfo=0x30,
830 /** Auto Deletion, Text is uncompressed, no class information. */
831 ESmsDCSAutoDelNoClassInfoUncompressedText=0x40,
832 /** Auto Deletion, Text is uncompressed, class information present. */
833 ESmsDCSAutoDelClassInfoUncompressedText=0x50,
834 /** Auto Deletion, Text is compressed, no class information. */
835 ESmsDCSAutoDelNoClassInfoCompressedText=0x60,
836 /** Auto Deletion, Text is compressed, class information present. */
837 ESmsDCSAutoDelClassInfoTextCompressedText=0x70,
840 ESmsDCSReserved1=0x40,
842 ESmsDCSReserved2=0x50,
844 ESmsDCSReserved3=0x60,
846 ESmsDCSReserved4=0x70,
848 ESmsDCSReserved5=0x80,
850 ESmsDCSReserved6=0x90,
852 ESmsDCSReserved7=0xA0,
854 ESmsDCSReserved8=0xB0,
858 /** Message Waiting Indication Group: Discard Message. */
859 ESmsDCSMessageWaitingIndicationDiscardMessage=0xC0,
861 /** Message Waiting Indication Group (7 bit). */
862 ESmsDCSMessageWaitingIndication7Bit=0xD0, // 7 bit User data
863 /** Message Waiting Indication Group (UCS2). */
864 ESmsDCSMessageWaitingIndicationUCS2=0xE0, // unicode User data
866 /** Text uncompressed, 7 bit or 8 bit. */
867 ESmsDCSTextUncompressed7BitOr8Bit=0xF0,
869 /** Masks bits 7 to 4. */
870 ESmsDCSBits7To4Mask=0xF0
873 /** Message Marked for Automatic Deletion */
874 enum TAutomaticDeletionGroup
876 ESmsDCSAutomaticDeletion = 0x40,
877 ESmsDCSAutomaticDeletionMask = 0xC0
880 /** Alphabet bit flags. */
883 /** GSM 7 bit default alphabet. */
884 ESmsAlphabet7Bit=0x00,
886 ESmsAlphabet8Bit=0x04,
888 ESmsAlphabetUCS2=0x08,
890 ESmsAlphabetReserved=0x0C,
892 /** Mask for these bit flags. */
893 ESmsAlphabetMask=0x0C,
895 /** Message Class bit flags. */
907 /** Mask for these bit flags. */
911 /** Indication Sense bit flags. */
912 enum TSmsIndicationState
914 /** Indication inactive. */
915 ESmsIndicationInactive=0x00,
916 /** Indication active. */
917 ESmsIndicationActive=0x08,
919 /** Mask for these bit flags. */
920 ESmsIndicationStateMask=0x08
922 /** Indication Type bit flags. */
923 enum TSmsIndicationType
925 /** Voicemail Message Waiting. */
926 ESmsVoicemailMessageWaiting=0x00,
927 /** Fax Message Waiting. */
928 ESmsFaxMessageWaiting=0x01,
929 /** Electronic Mail Message Waiting. */
930 ESmsElectronicMailMessageWaiting=0x02,
931 /** Other Message Waiting. */
932 ESmsFaxOtherMessageWaiting=0x03,
934 /** Mask for these bit flags. */
935 ESmsIndicationTypeMask=0x03
939 TSmsDataCodingScheme();
940 inline TSmsDCSBits7To4 Bits7To4() const;
941 inline void SetBits7To4(TSmsDCSBits7To4 aBits7To4);
942 // Normal SMS settings
943 TBool TextCompressed() const;
944 void SetTextCompressed(TBool aCompressed);
945 TSmsAlphabet Alphabet() const;
946 void SetAlphabet(TSmsAlphabet aAlphabet);
947 TBool Class(TSmsClass& aClass) const;
948 void SetClass(TBool aClassDefined,TSmsClass aClass);
949 // Message waiting settings
950 TSmsIndicationState IndicationState() const;
951 void SetIndicationState(TSmsIndicationState aState);
952 TSmsIndicationType IndicationType() const;
953 void SetIndicationType(TSmsIndicationType aType);
958 * Specifies alternative 7bit encoding combinations to use if the default
959 * GSM encoding cannot encode the message as 7bit without data loss.
966 /** Default value meaning that no alternative encoding would be used. */
967 ESmsEncodingNone = 0,
970 * Allows the use of the Turkish Single Shift table in place of the
971 * default GSM shift table.
973 * @note If used during encoding there will be a 3 octet cost in the User Data
976 ESmsEncodingTurkishSingleShift = 0x11,
979 * Allows the use of the Turkish Locking Shift table in place of the
980 * default GSM alphabet table.
982 * @note If used during encoding there will be a 3 octet cost in the User Data
984 * @note This encoding should only be used if the relevant national
985 * regulatory body has requested its use.
987 ESmsEncodingTurkishLockingShift = 0x12,
990 * Allows the use of the Turkish Locking Shift and/or the Turkish Single
991 * Shift tables in place of the default GSM alphabet and shift tables.
993 * @note If used during encoding there will be a 3 or 6 octet cost in the User Data
995 * @note This encoding should only be used if the relevant national
996 * regulatory body has requested its use.
998 ESmsEncodingTurkishLockingAndSingleShift = 0x13,
1001 * Allows the use of the Spanish Single Shift table in place of the
1002 * default GSM shift table.
1004 * @note If used during encoding there will be a 3 octet cost in the User Data
1007 ESmsEncodingSpanishSingleShift = 0x21,
1010 * Allows the use of the Portuguese Single Shift table in place of the
1011 * default GSM shift table.
1013 * @note If used during encoding there will be a 3 octet cost in the User Data
1016 ESmsEncodingPortugueseSingleShift = 0x31,
1019 * Allows the use of the Portuguese Locking Shift table in place of the
1020 * default GSM alphabet table.
1022 * @note If used during encoding there will be a 3 octet cost in the User Data
1024 * @note This encoding should only be used if the relevant national
1025 * regulatory body has requested its use.
1027 ESmsEncodingPortugueseLockingShift = 0x32,
1030 * Allows the use of the Portuguese Locking Shift and/or the Portuguese Single
1031 * Shift tables in place of the default GSM alphabet and shift tables.
1033 * @note If used during encoding there will be a 3 or 6 octet cost in the User Data
1035 * @note This encoding should only be used if the relevant national
1036 * regulatory body has requested its use.
1038 ESmsEncodingPortugueseLockingAndSingleShift = 0x33
1043 * GSM National Language Identifiers.
1048 enum TSmsNationalLanguageIdentifier
1051 ESmsNationalLanguageIdentifierTurkish = 1,
1054 ESmsNationalLanguageIdentifierSpanish = 2,
1057 ESmsNationalLanguageIdentifierPortuguese = 3
1062 * Utility to provide piecewise character set conversion to / from unpacked user
1067 class CSmsAlphabetConverter : public CBase
1070 // Construction and destruction methods
1071 IMPORT_C static CSmsAlphabetConverter* NewLC(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsDataCodingScheme::TSmsAlphabet aSmsAlphabet,TBool aIsBinary);
1072 IMPORT_C ~CSmsAlphabetConverter();
1074 // Enumerated types and structs
1076 * Indicates whether there is a fixed relationship between the number of characters
1077 * and user data elements.
1079 * For example, Unicode characters always map to a single SMS UCS2 character,
1080 * while a Unicode character might map to one, two or more SMS 7-bit User Data
1081 * Elements (extended 7-bit characters).
1083 enum TSmsAlphabetWidthConversion
1085 /** Fixed relationship. */
1086 ESmsAlphabetWidthConversionFixed,
1087 /** Variable relationship. */
1088 ESmsAlphabetWidthConversionVariable
1091 struct TSmsAlphabetConversionProperties
1093 * Holds the number of user data elements required for conversion from a single
1096 * This value is applicable only if the iWidthConversion parameter is ESmsAlphabetWidthConversionFixed.
1099 /** Alphabet width conversion. */
1100 TSmsAlphabetWidthConversion iWidthConversion;
1101 /** Number of user data elements required for conversion from a single native character */
1102 TInt iUDElementsPerNativeCharacter;
1106 // Conversion methods
1107 void ConversionPropertiesL(TSmsAlphabetConversionProperties& aConversionProperties) const;
1108 IMPORT_C TPtrC8 ConvertFromNativeL(const TDesC& aNativeCharacters);
1109 IMPORT_C TPtrC8 ConvertFromNativeL(const TDesC& aNativeCharacters,
1110 TSmsEncoding aEncoding,
1111 TInt& aNumberOfUnconvertibleCharacters,
1112 TInt& aNumberOfDowngradedCharacters);
1113 IMPORT_C TPtrC ConvertToNativeL(const TDesC8& aUDElements);
1114 IMPORT_C TPtrC ConvertToNativeL(const TDesC8& aUDElements, TSmsEncoding aEncoding);
1116 TBool IsSupportedL(TChar aChar);
1117 TBool IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters,
1118 TInt& aIndexOfFirstUnconvertibleCharacter);
1120 TBool IsSupportedL(TChar aChar, TSmsEncoding aEncoding, TBool& aIsDowngrade,
1121 TBool& aRequiresAlternativeEncoding);
1122 TBool IsSupportedL(const TDesC& aDes, TSmsEncoding aEncoding,
1123 TInt& aNumberOfUnconvertibleCharacters,
1124 TInt& aNumberOfDowngradedCharacters,
1125 TInt& aNumberRequiringAlternativeEncoding,
1126 TInt& aIndexOfFirstUnconvertibleCharacter);
1128 // Alternative Encoding methods
1129 TSmsEncoding FindBestAlternativeEncodingL(const TDesC& aNativeCharacters,
1130 TSmsEncoding aSuggestedEncoding);
1131 void ConfirmAlternativeEncoderL(TSmsEncoding aEncoding) const;
1133 // Unconverted buffer methods
1134 inline void ResetUnconvertedNativeCharacters();
1135 inline void ResetUnconvertedUDElements();
1136 inline TPtrC UnconvertedNativeCharacters();
1137 inline TPtrC8 UnconvertedUDElements();
1140 inline TSmsDataCodingScheme::TSmsAlphabet Alphabet() const;
1143 // Private construction methods
1144 CSmsAlphabetConverter(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsDataCodingScheme::TSmsAlphabet aSmsAlphabet,TBool aIsBinary);
1147 // Private conversion preparation methods
1148 void PrepareForConversionFromNativeL(TSmsEncoding aEncoding);
1149 void PrepareForConversionToNativeL(TSmsEncoding aEncoding);
1151 // Private Alternative Encoding methods
1152 void GetAlternativeEncoderIDL(TSmsEncoding aEncoding, TUint& aEncoderID) const;
1154 // Private buffer helper methods
1155 TPtr16 CheckAllocBufferL(HBufC16** aBuffer,TInt aMaxLength,TInt aUsedLength);
1156 TPtr8 CheckAllocBufferL(HBufC8** aBuffer,TInt aMaxLength,TInt aUsedLength);
1158 // Private constants
1161 KMaxSmsAlphabetConversionRetries=4
1166 KMinSmsAlphabetConversionAllocIncrement=4
1171 CCnvCharacterSetConverter& iCharacterSetConverter;
1173 TSmsDataCodingScheme::TSmsAlphabet iSmsAlphabet;
1175 HBufC* iConvertedNativeCharacters;
1176 HBufC8* iConvertedUDElements;
1177 HBufC* iUnconvertedNativeCharacters;
1178 TPtr iUnconvertedNativeCharactersPtr;
1179 HBufC8* iUnconvertedUDElements;
1180 TPtr8 iUnconvertedUDElementsPtr;
1184 /** Type-of-number, as defined in ETSI 3GPP TS 23.040. */
1185 enum TGsmSmsTypeOfNumber
1188 * Unknown, used when the user or network has no a priori information about the
1190 * In this case, the Address-Value field is organized according to the network
1191 * dialling plan, e.g. prefix or escape digits might be present.
1193 EGsmSmsTONUnknown=0x00,
1195 * International number.
1196 * The international format shall be accepted also when the message is destined
1197 * to a recipient in the same country as the MSC or as the SGSN.
1199 EGsmSmsTONInternationalNumber=0x10,
1202 * Prefix or escape digits shall not be included.
1204 EGsmSmsTONNationalNumber=0x20,
1206 * Network specific number.
1207 * Administration/service number specific to the serving network, e.g. used to
1208 * access an operator.
1210 EGsmSmsTONNetworkSpecificNumber=0x30,
1212 * Subscriber number.
1213 * Used when a specific short number representation is stored in one or more
1214 * SCs as part of a higher layer application. (Note that "Subscriber number"
1215 * shall only be used in connection with the proper PID referring to this application).
1217 EGsmSmsTONSubscriberNumber=0x40,
1220 * Coded according to 3GPP TS 23.038 - GSM 7-bit default alphabet.
1222 EGsmSmsTONAlphaNumeric=0x50,
1223 EGsmSmsTONAbbreviatedNumber=0x60, ///< Abbreviated number
1224 EGsmSmsTONReserverved=0x70, ///< Reserved for extension
1227 /** Numbering-plan-identification defined in ETSI 3GPP TS 23.040. */
1228 enum TGsmSmsNumberingPlanIdentification
1231 EGsmSmsNPIUnknown=0x00,
1232 /** ISDN telephone numbering plan. */
1233 EGsmSmsNPIISDNTelephoneNumberingPlan=0x01,
1234 /** Data numbering plan. */
1235 EGsmSmsNPIDataNumberingPlan=0x03,
1236 /** Telex numbering plan. */
1237 EGsmSmsNPITelexNumberingPlan=0x04,
1238 /** National numbering plan. */
1239 EGsmSmsNPINationalNumberingPlan=0x08,
1240 /** Private numbering plan. */
1241 EGsmSmsNPIPrivateNumberingPlan=0x09,
1242 /** ERMES numbering plan. */
1243 EGsmSmsNPIERMESNumberingPlan=0x0A,
1244 /** Reserved for extension. */
1245 EGsmSmsNPIReservedForExtension=0x0F,
1250 * Type-of-address field defined in ETSI 3GPP TS 23.040
1254 class TGsmSmsTypeOfAddress : public TSmsOctet
1260 EGsmSmsFirstBitMask=0x80,
1261 EGsmSmsTONMask=0x70,
1267 inline TGsmSmsTypeOfAddress(TInt aValue = EGsmSmsFirstBitMask);
1268 inline TGsmSmsTypeOfAddress(TGsmSmsTypeOfNumber aTon, TGsmSmsNumberingPlanIdentification aNPI);
1270 inline TGsmSmsTypeOfNumber TON() const;
1271 inline void SetTON(TGsmSmsTypeOfNumber aTON);
1273 inline TGsmSmsNumberingPlanIdentification NPI() const;
1275 * Sets the numbering plan identification.
1276 * @param aNPI Numbering plan identification
1278 inline void SetNPI(TGsmSmsNumberingPlanIdentification aNPI);
1281 * Converts type of number and numbering plan identification information from
1282 * the type of address parameter to the NMobilePhone::TMobileTON and NMobilePhone::TMobileNPI
1285 * @param aTON On return, type of number
1286 * @param aNPI On return, numbering plan identification
1288 IMPORT_C void ConvertToETelMM(NMobilePhone::TMobileTON& aTON, NMobilePhone::TMobileNPI& aNPI) const;
1290 * Sets type of number and numbering plan identification information from values
1291 * specified in NMobilePhone::TMobileTON and NMobilePhone::TMobileNPI formats.
1293 * @param aTON Type of number
1294 * @param aNPI Numbering plan identification
1296 IMPORT_C void SetFromETelMM(NMobilePhone::TMobileTON aTON, NMobilePhone::TMobileNPI aNPI);
1299 /** Maximum length of a Service Centre address = 21, as defined in ETSI GSM 04.11. */
1300 const TInt TGsmSmsTelNumberMaxLen = 21;
1304 * Encapsulation of basic address information
1308 class TGsmSmsTelNumber
1312 * @internalComponent
1313 * If the address is an alphanumeric address,
1314 * it can represent a voice message waiting indicator
1315 * as defined in the Common PCN Handset Specification
1316 * v4.2. The specification allows other indicators
1317 * to be defined in the future.
1319 enum TTypeOfIndicator
1321 EVoiceMessageWaitingIndicator = 0
1325 enum TCPHSIndicatorTypeByte
1327 ECPSHIndicatorTypeBitMask = 0x7E,
1328 ECPSHVoiceMailId = 0x10,
1329 ECPHSIndicatorSettingBit = 0x01,
1330 ECPHSVoiceMailSettingSpareBit = 0x80
1333 enum TCPHSIndicatorIdByte
1335 ECPSHIndicatorIdBitMask = 0x7E,
1336 ECPSHIndicatorId = 0x00,
1337 ECPSHIndicatorIdSettingBit = 0x01,
1338 ECTSHVoiceMailIndicatorSpareBit = 0x80
1344 ECPHSAddressType = 1,
1345 ECPHSAddressIndicatorType = 2,
1346 ECPHSAddressIndicatorId = 3,
1347 ECPHSSizeOfAddressField = 4
1351 inline TGsmSmsTelNumber();
1353 IMPORT_C TBool IsInstanceOf(TTypeOfIndicator aType);
1357 TGsmSmsTypeOfAddress iTypeOfAddress; ///< The type-of-address of iTelNumber
1358 TBuf<TGsmSmsTelNumberMaxLen> iTelNumber; ///< Telephone number, in format of iTypeOfAddress
1363 * CSmsAddress - address of the recipient or SC
1367 class CSmsAddress : public CBase
1372 KSmsAddressMaxAddressValueLength=10,// octets
1373 KSmsAddressMaxAddressLength = 12 // address length, type and address value
1376 static CSmsAddress* NewL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs);
1378 TPtrC Address() const;
1379 void SetAddressL(const TDesC& aAddress);
1380 void ParsedAddress(TGsmSmsTelNumber& aParsedAddress) const;
1381 void SetParsedAddressL(const TGsmSmsTelNumber& aParsedAddress);
1383 void SetRawAddressL(TGsmSmsTypeOfAddress aTypeOfAddress, TPtrC aBuffer);
1384 TGsmSmsTypeOfAddress& TypeOfAddress();
1388 TUint8* EncodeL(TUint8* aPtr) const;
1389 void DecodeL(TGsmuLex8& aPdu);
1390 void InternalizeL(RReadStream& aStream);
1391 void ExternalizeL(RWriteStream& aStream) const;
1393 CSmsAddress(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs);
1394 void NewBufferL(TInt aLength);
1395 void DoSetParsedAddressL(const TDesC& aAddress);
1398 CCnvCharacterSetConverter& iCharacterSetConverter;
1400 TGsmSmsTypeOfAddress iTypeOfAddress;
1406 * TP-SCTS Service Center Time Stamp Found in Deliver, Submit Report, Status Report,
1410 class TSmsServiceCenterTimeStamp
1413 enum {KSmsMaxTimeZoneNumQuarterHours=79};
1414 /** Time zone offset sign bit. */
1415 enum TSmsTimeZoneSignBit
1417 /** Positive offset. */
1418 ESmsTimeZonePositive=0x00,
1419 /** Negative offset. */
1420 ESmsTimeZoneNegative=0x08,
1422 /** Mask for these bit flags. */
1423 ESmsTimeZoneSignBitMask=0x08
1426 TSmsServiceCenterTimeStamp();
1427 inline TInt TimeOffset() const;
1428 void SetTimeOffset(TInt aNumQuarterHours);
1429 inline const TTime& Time() const;
1430 inline void SetTime(const TTime& aTime);
1431 TUint8* EncodeL(TUint8* aPtr) const;
1432 void DecodeL(TGsmuLex8& aPdu, TInt& aTimeError);
1433 void InternalizeL(RReadStream& aStream);
1434 void ExternalizeL(RWriteStream& aStream) const;
1437 TInt iTimeZoneNumQuarterHours;
1442 * TP-VP Validity Period Found in SUBMIT PDUs.
1444 * The validy period format is encoded in the first octet of the PDU, so the
1445 * class takes a reference to a TSmsFirstOctet. The validty period specifies
1446 * the length of time the PDU lives in the service center if the PDU cannot be
1447 * immediately delivered.
1451 class TSmsValidityPeriod
1454 /** Validity period units (in minutes). */
1455 enum TValidityPeriodUnitInMinutes
1457 /** Five minutes. */
1458 EFiveMinuteUnitInMinutes=5,
1460 EHalfHourUnitInMinutes=30,
1462 EOneDayUnitInMinutes=1440,
1464 EOneWeekUnitInMinutes=7*EOneDayUnitInMinutes
1466 /** Limits for validity period units (in minutes). */
1467 enum TValidityPeriodUnitLimitInMinutes
1469 /** Limit for 5 minute validity period unit. */
1470 EFiveMinuteUnitLimitInMinutes=24*EHalfHourUnitInMinutes,
1471 /** Limit for 30 minute validity period unit. */
1472 EHalfHourUnitLimitInMinutes=EOneDayUnitInMinutes,
1473 /** Limit for 1 day validity period unit. */
1474 EOneDayUnitLimitInMinutes=30*EOneDayUnitInMinutes,
1475 /** Limit for 1 week validity period unit. */
1476 EOneWeekUnitLimitInMinutes=63*EOneWeekUnitInMinutes
1478 /** Limits for validity period units. */
1479 enum TValidityPeriodLimit
1481 /** Limit for 5 minute validity period unit. */
1482 EFiveMinuteUnitLimit=143,
1483 /** Limit for 30 minute validity period unit. */
1484 EHalfHourUnitLimit=167,
1485 /** Limit for 1 day validity period unit. */
1486 EOneDayUnitLimit=196,
1487 /** Limit for 1 week validity period unit. */
1488 EOneWeekUnitLimit=255
1491 TSmsValidityPeriod(TSmsFirstOctet& aFirstOctet);
1492 inline TSmsFirstOctet::TSmsValidityPeriodFormat ValidityPeriodFormat() const;
1493 inline void SetValidityPeriodFormat(TSmsFirstOctet::TSmsValidityPeriodFormat aValidityPeriodFormat);
1494 inline const TTimeIntervalMinutes& TimeIntervalMinutes() const;
1495 inline void SetTimeIntervalMinutes(const TTimeIntervalMinutes& aTimeIntervalMinutes);
1497 TUint8* EncodeL(TUint8* aPtr) const;
1498 void DecodeL(TGsmuLex8& aPdu);
1499 void InternalizeL(RReadStream& aStream);
1500 void ExternalizeL(RWriteStream& aStream) const;
1502 TSmsFirstOctet& iFirstOctet;
1503 TTimeIntervalMinutes iTimeIntervalMinutes;
1506 class CEmsInformationElement;
1509 * SMS element defined in TP-UD octet.
1511 * This element is found in Deliver, Deliver Report, Submit, Submit Report, Status
1512 * Report and Command type messages.
1516 class CSmsInformationElement : public CBase
1519 /** TP-UD Information Element Identifier. */
1520 enum TSmsInformationElementIdentifier
1522 /** Concatenated short messages, 8-bit reference number. */
1523 ESmsIEIConcatenatedShortMessages8BitReference=0x00,
1524 /** Special SMS Message Indication. */
1525 ESmsIEISpecialSMSMessageIndication=0x01,
1527 ESmsIEIReserved=0x02,
1528 /** Value not used to avoid misinterpretation as line feed character. */
1529 ESmsIEIValueNotUsed=0x03,
1530 /** Application port addressing scheme, 8 bit address. */
1531 ESmsIEIApplicationPortAddressing8Bit=0x04,
1532 /** Application port addressing scheme, 16 bit address */
1533 ESmsIEIApplicationPortAddressing16Bit=0x05,
1534 /** SMSC Control Parameters. */
1535 ESmsIEISMSCControlParameters=0x06,
1536 /** UDH Source Indicator. */
1537 ESmsIEIUDHSourceIndicator=0x07,
1538 /** Concatenated short message, 16-bit reference number. */
1539 ESmsIEIConcatenatedShortMessages16BitReference=0x08,
1540 /** Wireless Control Message Protocol. */
1541 ESmsIEIWirelessControlMessageProtocol=0x09,
1542 ESmsIEIRFC822EmailHeader=0x20,
1546 ESmsEnhancedTextFormatting=0x0A,
1547 ESmsEnhancedPredefinedSound=0x0B,
1548 ESmsEnhancedUserDefinedSound=0x0C,
1549 ESmsEnhancedPredefinedAnimation=0x0D,
1550 ESmsEnhancedLargeAnimation=0x0E,
1551 ESmsEnhancedSmallAnimation=0x0F,
1552 ESmsEnhancedLargePicture=0x10,
1553 ESmsEnhancedSmallPicture=0x11,
1554 ESmsEnhancedVariablePicture=0x12,
1555 ESmsEnhancedUserPromptIndicator=0x13,
1556 ESmsEnhancedExtendedObject=0x14,
1557 ESmsEnhancedReusedExtendedObject=0x15,
1558 ESmsEnhancedCompressionControl=0x16,
1559 ESmsEnhancedODI=0x17,
1560 ESmsEnhancedStandardWVG=0x18,
1561 ESmsEnhancedCharacterSizeWVG=0x19,
1562 ESmsEnhancedextendedObjectDataRequest=0x1A,
1564 // Control Information Elements
1566 ESmsHyperLinkFormat = 0x21,
1567 ESmsReplyAddressFormat = 0x22,
1568 ESmsEnhanceVoiceMailInformation = 0x23,
1569 ESmsNationalLanguageSingleShift = 0x24,
1570 ESmsNationalLanguageLockingShift = 0x25,
1575 /** SIM Toolkit Security Header 1. */
1576 ESmsIEISIMToolkitSecurityHeaders1=0x70,
1577 /** SIM Toolkit Security Header 2. */
1578 ESmsIEISIMToolkitSecurityHeaders2=0x71,
1579 /** SIM Toolkit Security Header 3. */
1580 ESmsIEISIMToolkitSecurityHeaders3=0x72,
1581 /** SIM Toolkit Security Header 4. */
1582 ESmsIEISIMToolkitSecurityHeaders4=0x73,
1583 /** SIM Toolkit Security Header 5. */
1584 ESmsIEISIMToolkitSecurityHeaders5=0x74,
1585 /** SIM Toolkit Security Header 6. */
1586 ESmsIEISIMToolkitSecurityHeaders6=0x75,
1587 /** SIM Toolkit Security Header 7. */
1588 ESmsIEISIMToolkitSecurityHeaders7=0x76,
1589 /** SIM Toolkit Security Header 8. */
1590 ESmsIEISIMToolkitSecurityHeaders8=0x77,
1591 /** SIM Toolkit Security Header 9. */
1592 ESmsIEISIMToolkitSecurityHeaders9=0x78,
1593 /** SIM Toolkit Security Header 10. */
1594 ESmsIEISIMToolkitSecurityHeaders10=0x79,
1595 /** SIM Toolkit Security Header 11. */
1596 ESmsIEISIMToolkitSecurityHeaders11=0x7A,
1597 /** SIM Toolkit Security Header 12. */
1598 ESmsIEISIMToolkitSecurityHeaders12=0x7B,
1599 /** SIM Toolkit Security Header 13. */
1600 ESmsIEISIMToolkitSecurityHeaders13=0x7C,
1601 /** SIM Toolkit Security Header 14. */
1602 ESmsIEISIMToolkitSecurityHeaders14=0x7D,
1603 /** SIM Toolkit Security Header 15. */
1604 ESmsIEISIMToolkitSecurityHeaders15=0x7E,
1605 /** SIM Toolkit Security Header 16. */
1606 ESmsIEISIMToolkitSecurityHeaders16=0x7F,
1607 /** SME to SME specific use 1. */
1608 ESmsIEISMEToSMESpecificUse1=0x80,
1609 /** SME to SME specific use 2. */
1610 ESmsIEISMEToSMESpecificUse2=0x81,
1611 /** SME to SME specific use 3. */
1612 ESmsIEISMEToSMESpecificUse3=0x82,
1613 /** SME to SME specific use 4. */
1614 ESmsIEISMEToSMESpecificUse4=0x83,
1615 /** SME to SME specific use 5. */
1616 ESmsIEISMEToSMESpecificUse5=0x84,
1617 /** SME to SME specific use 6. */
1618 ESmsIEISMEToSMESpecificUse6=0x85,
1619 /** SME to SME specific use 7. */
1620 ESmsIEISMEToSMESpecificUse7=0x86,
1621 /** SME to SME specific use 8. */
1622 ESmsIEISMEToSMESpecificUse8=0x87,
1623 /** SME to SME specific use 9. */
1624 ESmsIEISMEToSMESpecificUse9=0x88,
1625 /** SME to SME specific use 10. */
1626 ESmsIEISMEToSMESpecificUse10=0x89,
1627 /** SME to SME specific use 11. */
1628 ESmsIEISMEToSMESpecificUse11=0x8A,
1629 /** SME to SME specific use 12. */
1630 ESmsIEISMEToSMESpecificUse12=0x8B,
1631 /** SME to SME specific use 13. */
1632 ESmsIEISMEToSMESpecificUse13=0x8C,
1633 /** SME to SME specific use 14. */
1634 ESmsIEISMEToSMESpecificUse14=0x8D,
1635 /** SME to SME specific use 15. */
1636 ESmsIEISMEToSMESpecificUse15=0x8E,
1637 /** SME to SME specific use 16. */
1638 ESmsIEISMEToSMESpecificUse16=0x8F,
1639 /** SME to SME specific use 17. */
1640 ESmsIEISMEToSMESpecificUse17=0x90,
1641 /** SME to SME specific use 18. */
1642 ESmsIEISMEToSMESpecificUse18=0x91,
1643 /** SME to SME specific use 19. */
1644 ESmsIEISMEToSMESpecificUse19=0x92,
1645 /** SME to SME specific use 20. */
1646 ESmsIEISMEToSMESpecificUse20=0x93,
1647 /** SME to SME specific use 21. */
1648 ESmsIEISMEToSMESpecificUse21=0x94,
1649 /** SME to SME specific use 22. */
1650 ESmsIEISMEToSMESpecificUse22=0x95,
1651 /** SME to SME specific use 23. */
1652 ESmsIEISMEToSMESpecificUse23=0x96,
1653 /** SME to SME specific use 24. */
1654 ESmsIEISMEToSMESpecificUse24=0x97,
1655 /** SME to SME specific use 25. */
1656 ESmsIEISMEToSMESpecificUse25=0x98,
1657 /** SME to SME specific use 26. */
1658 ESmsIEISMEToSMESpecificUse26=0x99,
1659 /** SME to SME specific use 27. */
1660 ESmsIEISMEToSMESpecificUse27=0x9A,
1661 /** SME to SME specific use 28. */
1662 ESmsIEISMEToSMESpecificUse28=0x9B,
1663 /** SME to SME specific use 29. */
1664 ESmsIEISMEToSMESpecificUse29=0x9C,
1665 /** SME to SME specific use 30. */
1666 ESmsIEISMEToSMESpecificUse30=0x9D,
1667 /** SME to SME specific use 31. */
1668 ESmsIEISMEToSMESpecificUse31=0x9E,
1669 /** SME to SME specific use 32. */
1670 ESmsIEISMEToSMESpecificUse32=0x9F,
1674 /** SC specific use 1. */
1675 ESmsIEISCSpecificUse1=0xC0,
1676 /** SC specific use 2. */
1677 ESmsIEISCSpecificUse2=0xC1,
1678 /** SC specific use 3. */
1679 ESmsIEISCSpecificUse3=0xC2,
1680 /** SC specific use 4. */
1681 ESmsIEISCSpecificUse4=0xC3,
1682 /** SC specific use 5. */
1683 ESmsIEISCSpecificUse5=0xC4,
1684 /** SC specific use 6. */
1685 ESmsIEISCSpecificUse6=0xC5,
1686 /** SC specific use 7. */
1687 ESmsIEISCSpecificUse7=0xC6,
1688 /** SC specific use 8. */
1689 ESmsIEISCSpecificUse8=0xC7,
1690 /** SC specific use 9. */
1691 ESmsIEISCSpecificUse9=0xC8,
1692 /** SC specific use 10. */
1693 ESmsIEISCSpecificUse10=0xC9,
1694 /** SC specific use 11. */
1695 ESmsIEISCSpecificUse11=0xCA,
1696 /** SC specific use 12. */
1697 ESmsIEISCSpecificUse12=0xCB,
1698 /** SC specific use 13. */
1699 ESmsIEISCSpecificUse13=0xCC,
1700 /** SC specific use 14. */
1701 ESmsIEISCSpecificUse14=0xCD,
1702 /** SC specific use 15. */
1703 ESmsIEISCSpecificUse15=0xCE,
1704 /** SC specific use 16. */
1705 ESmsIEISCSpecificUse16=0xCF,
1706 /** SC specific use 17. */
1707 ESmsIEISCSpecificUse17=0xD0,
1708 /** SC specific use 18. */
1709 ESmsIEISCSpecificUse18=0xD1,
1710 /** SC specific use 19. */
1711 ESmsIEISCSpecificUse19=0xD2,
1712 /** SC specific use 20. */
1713 ESmsIEISCSpecificUse20=0xD3,
1714 /** SC specific use 21. */
1715 ESmsIEISCSpecificUse21=0xD4,
1716 /** SC specific use 22. */
1717 ESmsIEISCSpecificUse22=0xD5,
1718 /** SC specific use 23. */
1719 ESmsIEISCSpecificUse23=0xD6,
1720 /** SC specific use 24. */
1721 ESmsIEISCSpecificUse24=0xD7,
1722 /** SC specific use 25. */
1723 ESmsIEISCSpecificUse25=0xD8,
1724 /** SC specific use 26. */
1725 ESmsIEISCSpecificUse26=0xD9,
1726 /** SC specific use 27. */
1727 ESmsIEISCSpecificUse27=0xDA,
1728 /** SC specific use 28. */
1729 ESmsIEISCSpecificUse28=0xDB,
1730 /** SC specific use 29. */
1731 ESmsIEISCSpecificUse29=0xDC,
1732 /** SC specific use 30. */
1733 ESmsIEISCSpecificUse30=0xDD,
1734 /** SC specific use 31. */
1735 ESmsIEISCSpecificUse31=0xDE,
1736 /** SC specific use 32. */
1737 ESmsIEISCSpecificUse32=0xDF,
1739 * @internalComponent
1741 ESmsIEMaximum = 0xFF
1745 // Exported functions
1746 IMPORT_C TSmsInformationElementIdentifier Identifier() const;
1747 IMPORT_C TPtr8 Data();
1748 IMPORT_C const TDesC8& Data() const;
1750 static CSmsInformationElement* NewL(TSmsInformationElementIdentifier aIdentifier,const TDesC8& aData);
1751 static CSmsInformationElement* NewL();
1752 ~CSmsInformationElement();
1754 TUint8* EncodeL(TUint8* aPtr) const;
1755 void DecodeL(TGsmuLex8& aPdu);
1756 void InternalizeL(RReadStream& aStream);
1757 void ExternalizeL(RWriteStream& aStream) const;
1758 void ConstructL(const TDesC8& aData);
1759 TUint Length() const;
1761 void NewDataL(TInt aLength);
1762 inline CSmsInformationElement(TSmsInformationElementIdentifier aInformationElementIdentifier);
1764 TSmsOctet iIdentifier;
1770 * @internalComponent
1772 * TSmsInformationElementCategories
1774 * This class specifies where information elements are located SMS Messages.
1776 * It specifies which PDUs each information element can be located in.
1778 * The SMS stack uses this information when encoding and decoding SMS messages.
1780 class TSmsInformationElementCategories
1784 // Comment, table approach probably is not necessary here.
1785 // Simply use a switch statement as cannot index directly into table.
1787 enum TInformationElementCategory
1789 EEmsInformationElement,
1790 ECtrlMandatoryInEveryPDUAndWithIdenticalValues, // e.g. Port Addresses
1791 ECtrlMandatoryInEveryPDUMultipleInstancesPerPDU, // e.g. Special SMS Message Indication
1792 ECtrlMandatoryInEveryPDUButWithValueSpecificToPDU, // e.g. Email Header / Concatenation Elements, SMSC Parameters
1793 ECtrlMandatoryIn1stPDUOnly, // e.g. Reply Address
1794 ECtrlSingleInstanceOnly, // e.g. Enhanced Voice Mail
1795 ECtrlMultipleInstancesAllowed, // e.g. Hyperlink format
1799 typedef CSmsInformationElement::TSmsInformationElementIdentifier TInformationElementId;
1802 enum TIndexToCategory
1804 EIndexEmsInformationElement,
1805 EIndexCtrlMandatoryInEveryPDUAndWithIdenticalValues,
1806 EIndexCtrlMandatoryInEveryPDUMultipleInstancesPerPDU,
1807 EIndexCtrlMandatoryInEveryPDUButWithValueSpecificToPDU,
1808 EIndexCtrlMandatoryIn1stPDUOnly,
1809 EIndexCtrlSingleInstanceOnly,
1810 EIndexCtrlMultipleInstancesAllowed,
1811 EIndexCtrlOptionalInEveryPDUWithValueSpecificToPDU,
1816 static TBool GetCategoryDefinition(TInformationElementId aId, TInformationElementCategory& aCategory);
1818 static TBool TranslateCategoryToIndex(TInformationElementId aId, TInt& index);
1819 TSmsInformationElementCategories() {};
1820 ~TSmsInformationElementCategories() {};
1821 void operator=(TSmsInformationElementCategories& aCategory) {(void) aCategory; };
1822 TBool operator==(TSmsInformationElementCategories& aCategory){(void) aCategory; return EFalse; };
1823 static const TInformationElementCategory categories[ENumberOfIndices];
1828 * @internalComponent
1830 typedef CSmsInformationElement::TSmsInformationElementIdentifier TSmsId;
1834 * Mobile originated SMS sent to the network requesting an action or information
1835 * on the status of a previously sent SUBMIT.
1837 * This is internal and not intended for use.
1841 class CSmsCommandData : public CBase
1844 enum {KSmsMaxDataSize=157};
1846 static CSmsCommandData* NewL(TSmsFirstOctet& aFirstOctet);
1849 inline TInt NumInformationElements() const;
1850 CSmsInformationElement& InformationElement(TInt aIndex) const;
1851 CSmsInformationElement*& InformationElementPtr(TInt aIndex);
1852 TBool InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,
1853 TInt& aIndex) const;
1854 void AddInformationElementL(const TSmsId aIdentifier,const TDesC8& aData);
1855 void RemoveInformationElement(TInt aIndex);
1857 inline TInt MaxDataLength() const;
1858 TPtrC8 Data() const;
1859 void SetDataL(const TDesC8& aData);
1861 TUint8* EncodeL(TUint8* aPtr) const;
1862 void DecodeL(TGsmuLex8& aPdu);
1863 void InternalizeL(RReadStream& aStream);
1864 void ExternalizeL(RWriteStream& aStream) const;
1866 CSmsCommandData(TSmsFirstOctet& aFirstOctet);
1868 TInt HeaderLength() const;
1869 TInt TotalHeaderLengthInUDLUnits() const;
1871 TBool HeaderPresent() const;
1872 void SetHeaderPresent(TBool aHeaderPresent);
1875 TSmsFirstOctet& iFirstOctet;
1876 CArrayPtrFlat <CSmsInformationElement> iInformationElementArray;
1882 * Enumerations and operations for SMS commands.
1886 class TSmsCommandType : public TSmsOctet
1889 /** Command types. */
1890 enum TSmsCommandTypeValue
1893 ESmsCommandTypeEnquiry=0x00,
1895 ESmsCommandTypeCancel=0x01,
1897 ESmsCommandTypeDelete=0x02,
1898 /** Enable Status Report Request. */
1899 ESmsCommandTypeEnableStatusReportRequest=0x03
1906 inline TInt CommandType() const;
1907 inline void SetCommandType(TSmsCommandTypeValue aType);
1912 * Operations on the User Data described in TP-UD.
1916 class CSmsUserData : public CBase
1919 enum {KSmsMaxUserDataSize=140};
1922 static CSmsUserData* NewL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsFirstOctet& aFirstOctet,const TSmsDataCodingScheme& aDataCodingScheme);
1925 inline TInt NumInformationElements() const;
1926 IMPORT_C CSmsInformationElement& InformationElement(TInt aIndex) const;
1927 IMPORT_C TBool InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,TInt& aIndex) const;
1928 IMPORT_C TBool InformationElementLastIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,TInt& aIndex) const;
1929 IMPORT_C void AddInformationElementL(TSmsId aIdentifier,const TDesC8& aData);
1930 IMPORT_C void RemoveInformationElement(TInt aIndex);
1931 void InformationElementIndicesL(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier, CArrayFixFlat<TInt>& aIndices) const;
1933 // EMS related methods
1934 void AddEmsInformationElementL(CEmsInformationElement* aIe); // takes ownership od aIe;
1935 TBool EmsInformationElementWillFitL(CEmsInformationElement* aIe,CSmsEMSBufferSegmenter& aSeg,TUint& aCharsAddedToCurrentPDU);
1936 // Control Information Element related methods
1937 TBool ControlInformationElementWillFitL(CSmsInformationElement* aIe);
1938 void UpdateInformationElementArrayL(TSmsId aIdentifier,const TDesC8& aData);
1939 CSmsInformationElement*& InformationElementPtr(TInt aIndex);
1941 TInt MaxPackedUDUnitsInBodyRemaining() const;
1942 TInt MaxPackedUDUnitsInBodyRemaining(TUint totalHeaderLengthInUDLUnits) const;
1944 IMPORT_C TInt MaxBodyLengthInChars() const;
1945 IMPORT_C TPtrC8 Body() const;
1946 IMPORT_C void SetBodyL(const TDesC8& aBody);
1947 void AppendBodyL(const TDesC8& aExtraBody);
1949 IMPORT_C TBool IsSupportedL(TChar aChar);
1950 IMPORT_C TBool IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters,
1951 TInt& aIndexOfFirstUnconvertibleCharacter) const;
1953 IMPORT_C TBool IsSupportedL(const TDesC& aDes, TSmsEncoding aEncoding,
1954 TInt& aNumberOfUnconvertibleCharacters,
1955 TInt& aNumberOfDowngradedCharacters,
1956 TInt& aNumberRequiringAlternativeEncoding,
1957 TInt& aIndexOfFirstUnconvertibleCharacter) const;
1959 TBool IsBinaryData() const;
1961 TUint8* EncodeL(TUint8* aPtr) const;
1962 void DecodeL(TGsmuLex8& aPdu);
1963 void DecodeL(TGsmuLex8& aPdu, TBool aAcceptTruncation);
1964 void InternalizeL(RReadStream& aStream);
1965 void ExternalizeL(RWriteStream& aStream) const;
1967 CSmsUserData(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsFirstOctet& aFirstOctet,const TSmsDataCodingScheme& aDataCodingScheme);
1969 TInt HeaderLength() const;
1970 TInt TotalHeaderLengthInUDLUnits() const;
1971 TInt BodyLengthInUDLUnits() const;
1972 void NewBodyL(TInt aLengthInChars);
1973 TBool HeaderPresent() const;
1974 void SetHeaderPresent(TBool aHeaderPresent);
1975 TInt TotalHeaderLengthInUDLUnits(TInt aIElen) const;
1979 CCnvCharacterSetConverter& iCharacterSetConverter;
1982 TSmsFirstOctet& iFirstOctet;
1983 const TSmsDataCodingScheme& iDataCodingScheme;
1984 CArrayPtrFlat<CSmsInformationElement> iInformationElementArray;
1988 enum TSmsMessageIndicationType
1990 EGsmSmsVoiceMessageWaiting =0x00,
1991 EGsmSmsFaxMessageWaiting =0x01,
1992 EGsmSmsElectronicMailMessageWaiting =0x02,
1993 EGsmSmsExtendedMessageTypeWaiting =0x03,
1996 enum TExtendedSmsIndicationType
1998 EGsmSmsNoExtendedMessageTypeIndication=0x00,
1999 EGsmSmsVideoMessageWaiting =0x01,
2000 EGsmSmsExtendedIndicationType2 =0x02,
2001 EGsmSmsExtendedIndicationType3 =0x03,
2002 EGsmSmsExtendedIndicationType4 =0x04,
2003 EGsmSmsExtendedIndicationType5 =0x05,
2004 EGsmSmsExtendedIndicationType6 =0x06,
2005 EGsmSmsExtendedIndicationType7 =0x07
2008 enum TSmsSpecialMessageIndicationTypeMask
2010 /** Define a mask for the bits representing */
2011 /** the TSmsMessageIndicationType and the */
2012 /** TExtendedSmsIndicationType */
2013 EGsmSmsSpecialMessageIndicationTypeMask = 0x1F
2016 enum TSmsMessageProfileType
2018 EGsmSmsProfileId1 =0x00,
2019 EGsmSmsProfileId2 =0x01,
2020 EGsmSmsProfileId3 =0x02,
2021 EGsmSmsProfileId4 =0x03
2024 enum TVoiceMailInfoType
2026 EGsmSmsVoiceMailNotification = 0x00,
2027 EGsmSmsVoiceMailDeleteConfirmation = 0x01
2030 /** SMSC Control Parameters Selective Status Report For Each Segment. Found in Submit. */
2031 enum TSmsSMSCControlParameters
2033 /** Status Report for short message transaction completed. */
2034 ESmsStatusReportTransactionCompleted=0x01,
2035 /** Status Report for permanent error when Service Centre is not making any more transfer attempts. */
2036 ESmsStatusReportPermanentError=0x02,
2037 /** Status Report for temporary error when Service Centre is not making any more transfer attempts. */
2038 ESmsStatusReportTemporaryError=0x04,
2039 /** Status Report for temporary error when Service Centre is still trying to transfer message segment. */
2040 ESmsStatusReportTemporaryErrorSCTrying=0x08,
2041 /** This is not Supported.
2042 Reserved for future use. */
2043 ESmsStatusReportForFutureUse1=0x10,
2044 /** This is not Supported.
2045 Reserved for future use. */
2046 ESmsStatusReportForFutureUse2=0x20,
2047 /** This is not Supported.
2048 A Status Report generated by this Short Message, due to a permanent error or last temporary error,
2049 cancels the SRR of the rest of the Short Messages in a concatenated message. */
2050 ESmsStatusReportCancelRestSRR=0x40,
2051 /** This is not Supported.
2052 Include original UDH into the Status Report. */
2053 ESmsStatusReportIncludeOriginalUDH=0x80,
2054 /** Mask. The 4 least significant bits, which are supported, are set. */
2055 ESmsSMSCControlParametersMask=0x0F
2059 /** Non Information Element Identifiers. */
2060 enum TSmsNonIEIdentifier
2062 ESmsTPSRRParameter = 0x00,
2063 ESmsIncompleteClass0MessageParameter = 0x01
2067 /** Status Report Scheme*/
2068 enum TSmsStatusReportScheme
2070 EDefaultScheme = 0x00,
2071 ETPSRRScheme = 0x01,
2072 EControlParametersScheme = 0x10
2077 * This is the base class for Enhanced Voice Mail Notifications and
2078 * Enhanced Voice Mail Delete Confirmations. It encapsulates
2079 * the attributes and encoding / decoding algorithms common to
2080 * both types of Enhanced Voice Mail Information Element.
2084 class CEnhancedVoiceMailBoxInformation : public CBase
2087 enum {KSmsMaxEnhancedVoiceMailSize = CSmsUserData::KSmsMaxUserDataSize - 3};
2088 // allow space in user data for the following bytes: user data header length, IE ID, IE Length
2090 IMPORT_C TVoiceMailInfoType Type() const;
2091 IMPORT_C void SetProfile(TSmsMessageProfileType aProfile);
2092 IMPORT_C TSmsMessageProfileType Profile() const;
2093 IMPORT_C void SetStorage(TBool aIsStored);
2094 IMPORT_C TBool Store() const;
2095 IMPORT_C void SetAlmostMaximumCapacity(TBool aIsAlmostFull);
2096 IMPORT_C TBool AlmostMaximumCapacity() const;
2097 IMPORT_C void SetMaximumCapacity(TBool aIsFull);
2098 IMPORT_C TBool MaximumCapacity() const;
2099 IMPORT_C TBool ExtensionIndicator() const;
2100 IMPORT_C void SetAccessAddressL(const TDesC& aParsedAddress);
2101 IMPORT_C void SetParsedAccessAddressL(const TGsmSmsTelNumber& aParsedAddress);
2102 IMPORT_C TPtrC AccessAddress() const;
2103 IMPORT_C void ParsedAccessAddress(TGsmSmsTelNumber& aParsedAddress) const;
2104 IMPORT_C void SetNumberOfVoiceMessages(TUint8 aNumber);
2105 IMPORT_C TUint8 NumberOfVoiceMessages() const;
2107 static CEnhancedVoiceMailBoxInformation* NewL();
2108 virtual ~CEnhancedVoiceMailBoxInformation();
2110 virtual TUint8* EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const;
2111 virtual void DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
2113 CEnhancedVoiceMailBoxInformation();
2114 CEnhancedVoiceMailBoxInformation(TVoiceMailInfoType aTVoiceMailInfoType);
2116 CEnhancedVoiceMailBoxInformation(const CEnhancedVoiceMailBoxInformation&);
2117 TBool operator==(const CEnhancedVoiceMailBoxInformation&);
2118 void operator=(const CEnhancedVoiceMailBoxInformation&);
2121 void NewBufferL(TInt aLength);
2122 void DoSetParsedAddressL(const TDesC& aAddress);
2124 TVoiceMailInfoType iType;
2126 TSmsMessageProfileType iProfile;
2130 TBool iExtensionIndicator;
2132 HBufC* iAccessAddress;
2133 TGsmSmsTypeOfAddress iTypeOfAddress;
2135 TUint8 iNumberOfVoiceMessages;
2147 * This class encapsulates the attributes of a VM Notification as described in 23.040 V6.5.0.
2148 * It is used as one of the attributes a Enhanced Voice Mail Notification.
2152 class CVoiceMailNotification : public CBase
2155 IMPORT_C void SetMessageId(TUint16 aMessageId);
2156 IMPORT_C TUint16 MessageId() const;
2157 IMPORT_C void SetMessageLength(TUint8 aLength);
2158 IMPORT_C TUint8 MessageLength() const;
2159 IMPORT_C void SetRetentionDays(TUint8 aDays);
2160 IMPORT_C TUint8 RetentionDays() const;
2161 IMPORT_C void SetPriorityIndication(TBool aPriority);
2162 IMPORT_C TBool PriorityIndication() const;
2163 IMPORT_C TBool MessageExtensionIndication() const;
2164 IMPORT_C void SetCallingLineIdentityL(TDesC& aLineIdentity);
2165 IMPORT_C TPtrC CallingLineIdentity() const;
2166 IMPORT_C void SetParsedCallingLineIdentityL(TGsmSmsTelNumber& aParsedAddress);
2167 IMPORT_C void ParsedCallingLineIdentity(TGsmSmsTelNumber& aParsedAddress) const;
2169 IMPORT_C static CVoiceMailNotification* NewL();
2170 IMPORT_C virtual ~CVoiceMailNotification();
2172 TUint8 SizeL(CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
2174 virtual TUint8* EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const;
2175 virtual void DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
2177 CVoiceMailNotification();
2178 CVoiceMailNotification(const CVoiceMailNotification&);
2179 TBool operator==(const CVoiceMailNotification&);
2180 void operator=(const CVoiceMailNotification&);
2182 void NewBufferL(TInt aLength);
2183 void NewExtensionL(TInt aLength);
2185 void DoSetParsedAddressL(const TDesC& aAddress);
2188 TUint8 iMessageLength;
2189 TUint8 iRetentionDays;
2191 TBool iPriorityIndication;
2192 TBool iMessageExtensionIndicator;
2194 HBufC* iCallingLineIdentity;
2195 TGsmSmsTypeOfAddress iTypeOfAddress;
2210 * This class encapsulates the attributes of an Enhanced Voice Mail Notification as described in
2211 * 9.2.3.24.13.1. An enhanced voice mail notification is added to a CSmsMessage using the
2212 * interface provided by the class CSmsEnhancedVoiceMailOperations.
2214 * Clients should be aware that 23.040 v6.5.0 specifies that this information element must fit into the
2215 * user data field of a single PDU. The amount of space available in the user data field depends on both
2216 * the number and size of the mandatory information elements that must also be present.
2217 * Intuitively the largest Enhanced Voice Mail information element can be added when no mandatory information
2218 * elements need to be encoded in the PDU. To achieve this, the CSmsMessage must be configured with
2219 * only the Enhanced Voice Mail Information Element and no other information elements or text.
2223 class CEnhancedVoiceMailNotification : public CEnhancedVoiceMailBoxInformation
2226 enum {KMaxNumberOfNotifications = 15};
2228 enum {KSmsNotificationBitMask = 0x0F};
2229 // bits mask for bit representing the number of voice mail notifications.
2231 IMPORT_C TUint8 NumberOfVoiceMails();
2232 IMPORT_C RPointerArray<CVoiceMailNotification>& GetVoiceMailNotifications();
2234 IMPORT_C static CEnhancedVoiceMailNotification* NewL();
2235 IMPORT_C ~CEnhancedVoiceMailNotification();
2237 TUint8* EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const;
2238 void DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
2240 CEnhancedVoiceMailNotification();
2241 CEnhancedVoiceMailNotification(const CEnhancedVoiceMailNotification&);
2242 TBool operator==(const CEnhancedVoiceMailNotification&);
2243 void operator=(const CEnhancedVoiceMailNotification&);
2244 void NewExtensionL(TInt aLength);
2247 TUint iNumberOfVMNotifications;
2249 RPointerArray<CVoiceMailNotification>* iNotifications;
2254 * This class encapsulates the attributes of a VM Deletion as described in 23.040 V6.5.0.
2257 * It is used as one of the attributes of a Enhanced Voice Mail Delete Confirmation.
2261 class CVoiceMailDeletion : public CBase
2264 IMPORT_C void SetMessageId(TUint16 aMessageId);
2265 IMPORT_C TUint16 MessageId() const;
2266 IMPORT_C TBool MessageExtensionIndication() const;
2268 IMPORT_C static CVoiceMailDeletion* NewL();
2269 IMPORT_C virtual ~CVoiceMailDeletion();
2272 virtual TUint8* EncodeL(TUint8* aPtr) const;
2273 virtual void DecodeL(TGsmuLex8& aVoiceMailInfo);
2275 CVoiceMailDeletion();
2276 CVoiceMailDeletion(const CVoiceMailDeletion&);
2277 TBool operator==(const CVoiceMailDeletion&);
2278 void operator=(const CVoiceMailDeletion&);
2281 void NewBufferL(TInt aLength);
2284 TBool iExtensionIndicator;
2290 * This class encapsulates the attributes of an Enhanced Voice Delete Confirmation as described in
2291 * 9.2.3.24.13.2. An enhanced voice delete confirmation is added to a CSmsMessage using the
2292 * interface provided by the class CSmsEnhancedVoiceMailOperations.
2296 class CEnhancedVoiceMailDeleteConfirmations : public
2297 CEnhancedVoiceMailBoxInformation
2300 enum {KMaxNumberOfNotifications = 31};
2302 enum {KSmsNotificationBitMask = 0x1F};
2303 // bits mask for bit representing the number of voice mail deletions.
2305 IMPORT_C TUint8 NumberOfDeletes();
2306 IMPORT_C RPointerArray<CVoiceMailDeletion>& GetVoiceMailDeletions();
2308 IMPORT_C static CEnhancedVoiceMailDeleteConfirmations* NewL();
2309 IMPORT_C ~CEnhancedVoiceMailDeleteConfirmations();
2311 TUint8* EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const;
2312 void DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
2314 CEnhancedVoiceMailDeleteConfirmations();
2315 CEnhancedVoiceMailDeleteConfirmations(const CEnhancedVoiceMailDeleteConfirmations&);
2316 TBool operator==(const CEnhancedVoiceMailDeleteConfirmations&);
2317 void operator=(const CEnhancedVoiceMailDeleteConfirmations&);
2320 void NewExtensionL(TInt aLength);
2323 RPointerArray<CVoiceMailDeletion>* iVoiceMailDeletions;
2327 #include <gsmuelem.inl>
2329 #endif // !defined __GSMUELEM_H__