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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This file define the classes for the different PDU elements
25 #ifndef __GSMUELEM_H__
26 #define __GSMUELEM_H__
33 #include <gsmunmspacemobph.h>
38 class CSmsEMSBufferSegmenter;
48 const TInt KErrGsmuDecoding = KErrCorrupt;
51 * Thin wrapper over TLex8 to provide leaving functions when getting the next
54 * These functions leave with KErrGsmuDecoding if there are insufficient characters
59 class TGsmuLex8 : public TLex8
62 TGsmuLex8(const TDesC8& aSource);
64 void IncL(TInt aNumber = 1);
65 TPtrC8 NextWithNoIncL(TInt aLength) const;
66 TPtrC8 NextWithNoIncL(TInt aLength, TBool aAcceptTruncation) const;
67 TPtrC8 NextAndIncL(TInt aLength);
70 inline void LeaveL() const;
75 * Base class for performing all operations on octets.
82 inline TSmsOctet(TInt aValue);
83 inline TSmsOctet(TUint8 aValue = 0);
84 inline operator TInt() const;
85 const TSmsOctet& operator = (TInt aValue);
86 inline void FillSemiOctets(TInt aNum);
87 inline TInt SemiOctetsToNum() const;
88 TUint8* EncodeL(TUint8* aPtr) const;
89 inline void DecodeL(TGsmuLex8& aPdu);
90 inline void InternalizeL(RReadStream& aStream);
91 inline void ExternalizeL(RWriteStream& aStream) const;
99 * Bit masks for key first octet of an SMS PDU
103 class TSmsFirstOctet : public TSmsOctet
106 /** TP-MTI (Message Type Indicator) First octet of all SMS PDUs. */
109 /** SMS-DELIVER or SMS-DELIVER-REPORT message. */
110 ESmsMTIDeliverOrDeliverReport=0x00,
111 /** SMS-SUBMIT or SMS-SUBMIT-REPORT message. */
112 ESmsMTISubmitOrSubmitReport=0x01,
113 /** SMS-STATUS or SMS-COMMAND message. */
114 ESmsMTIStatusReportOrCommand=0x02,
116 /** Mask for these bit flags. */
121 * TP-UDHI (User Data Header Indicator) Found in first octet of
122 * Submit and Deliver and possibly, Deliver Report and Status Report.
126 /** User data header indicator not present. */
127 ESmsUDHIHeaderNotPresent=0x00,
128 /** User data header indicator present. */
129 ESmsUDHIHeaderPresent=0x40,
131 /** Mask for these bit flags. */
135 /** TP-RP (Reply Path) Found in first octet of Submit and Deliver. */
138 /** Reply path does not exist. */
139 ESmsReplyPathNone=0x00,
140 /** Reply path exists. */
141 ESmsReplyPathExists=0x080,
143 /** Mask for these bit flags. */
144 ESmsReplyPathMask=0x80
147 /** TP-MMS (More Messages To Send) Found in Deliver and Status Report. */
148 enum TSmsMoreMessagesToSend
150 /** More messages to send. */
151 ESmsMoreMessagesToSend=0x00,
152 /** No more messages to send. */
153 ESmsNoMoreMessagesToSend=0x04,
155 /** Mask for these bit flags. */
156 ESmsMoreMessagesToSendMask=0x04,
159 /** T-SRI (Status Report Indicator) Found in Status Report. */
160 enum TSmsStatusReportIndicator
162 /** Status report is not going to be returned. */
163 ESmsStatusReportNotReturned=0x00,
164 /** Status report is going to be returned. */
165 ESmsStatusReportReturned=0x20,
167 /** Mask for these bit flags. */
168 ESmsStatusReportIndicatorMask=0x20
171 /** TP-RD bit flags. */
172 enum TSmsRejectDuplicates
174 * T-RD (Reject Duplicates) Found in Submit
177 /** Accept duplicates. */
178 ESmsAcceptDuplicates=0x00,
179 /** Reject duplicates. */
180 ESmsRejectDuplicates=0x04,
182 /** Mask for these bit flags. */
183 ESmsRejectDuplicatesMask=0x04
186 /** T-SRQ (Status Report Qualifier). Found in Status Report. */
187 enum TSmsStatusReportQualifier
189 /** Status report result of submit. */
190 ESmsStatusReportResultOfSubmit=0x00,
191 /** Status report result of command. */
192 ESmsStatusReportResultOfCommand=0x20,
194 /** Mask for these bit flags. */
195 ESmsStatusReportQualifierMask=0x20
198 /** TP-VPF (Validity Period Format). Found in Submit. */
199 enum TSmsValidityPeriodFormat
201 /** TP-VP field not present. */
203 /** TP-VP field present. Enhanced format (7 octets). */
204 ESmsVPFEnhanced=0x08, // was ESmsVPFReserved, the new GSM spec!
205 /** TP-VP field present, relative validity format. */
206 ESmsVPFInteger=0x10, // relative validity period
207 /** TP-VP field present, absolute validity format. */
208 ESmsVPFSemiOctet=0x18, // absolute validity period
210 /** Mask for these bit flags. */
214 /** TP-SRR (Status Report Request) Found in Submit and Command. */
215 enum TSmsStatusReportRequest
217 /** Status report is not requested. */
218 ESmsStatusReportNotRequested=0x00,
219 /** Status report is requested. */
220 ESmsStatusReportRequested=0x20,
222 /** Mask for these bit flags. */
223 ESmsStatusReportRequestMask=0x20
227 TSmsFirstOctet(TInt aValue=0);
228 const TSmsFirstOctet& operator = (TInt aValue); // Review
233 * TP-FCS (Failure Cause) octet. For Deliver and Submit errors
237 class TSmsFailureCause : public TSmsOctet
241 enum TSmsFailureCauseError
247 /** Telematic interworking not supported. */
248 ESmsPIDErrorTelematicInterworkingNotSupported=0x80,
249 /** Short message Type 0 not supported. */
250 ESmsPIDErrorShortMessageType0NotSupported=0x81,
251 /** Cannot replace short message. */
252 ESmsPIDErrorCannotReplaceShortMessage=0x82,
254 ESmsPIDErrorReserved1=0x83,
256 ESmsPIDErrorReserved2=0x84,
258 ESmsPIDErrorReserved3=0x85,
260 ESmsPIDErrorReserved4=0x86,
262 ESmsPIDErrorReserved5=0x87,
264 ESmsPIDErrorReserved6=0x88,
266 ESmsPIDErrorReserved7=0x89,
268 ESmsPIDErrorReserved8=0x8A,
270 ESmsPIDErrorReserved9=0x8B,
272 ESmsPIDErrorReserved10=0x8C,
274 ESmsPIDErrorReserved11=0x8D,
276 ESmsPIDErrorReserved12=0x8E,
277 /** Unspecified TP-PID error. */
278 ESmsPIDErrorUnspecified=0x8F,
280 /** Data coding scheme (alphabet) not supported. */
281 ESmsDCSErrorAlphabetNotSupported=0x90,
282 /** Message class not supported. */
283 ESmsDCSErrorMessageClassNotSupported=0x91,
285 ESmsDCSErrorReserved1=0x92,
287 ESmsDCSErrorReserved2=0x93,
289 ESmsDCSErrorReserved3=0x94,
291 ESmsDCSErrorReserved4=0x95,
293 ESmsDCSErrorReserved5=0x96,
295 ESmsDCSErrorReserved6=0x97,
297 ESmsDCSErrorReserved7=0x98,
299 ESmsDCSErrorReserved8=0x99,
301 ESmsDCSErrorReserved9=0x9A,
303 ESmsDCSErrorReserved10=0x9B,
305 ESmsDCSErrorReserved11=0x9C,
307 ESmsDCSErrorReserved12=0x9D,
309 ESmsDCSErrorReserved13=0x9E,
311 ESmsDCSErrorUnspecified=0x9F,
313 /** Command cannot be actioned. */
314 ESmsCommandErrorCannotBeActioned=0xA0,
315 /** Command unsupported. */
316 ESmsCommandErrorUnsupported=0xA1,
318 ESmsCommandErrorReserved1=0xA2,
320 ESmsCommandErrorReserved2=0xA3,
322 ESmsCommandErrorReserved3=0xA4,
324 ESmsCommandErrorReserved4=0xA5,
326 ESmsCommandErrorReserved5=0xA6,
328 ESmsCommandErrorReserved6=0xA7,
330 ESmsCommandErrorReserved7=0xA8,
332 ESmsCommandErrorReserved8=0xA9,
334 ESmsCommandErrorReserved9=0xAA,
336 ESmsCommandErrorReserved10=0xAB,
338 ESmsCommandErrorReserved11=0xAC,
340 ESmsCommandErrorReserved12=0xAD,
342 ESmsCommandErrorReserved13=0xAE,
343 /** Unspecified TP-Command error. */
344 ESmsCommandErrorUnspecified=0xAF,
346 /** PDU not supported. */
347 ESmsErrorPDUNotSupported=0xB0,
352 ESmsErrorSCBusy=0xC0,
353 /** No SC subscription. */
354 ESmsErrorNoSCSubscription=0xC1,
355 /** SC system failure. */
356 ESmsErrorNoSCSystemFailure=0xC2,
357 /** Invalid SME address. */
358 ESmsErrorInvalidSMEAddress=0xC3,
359 /** Destination SME barred. */
360 ESmsErrorDestinationSMEBarred=0xC4,
361 /** SM Rejected-Duplicate SM. */
362 ESmsErrorSMRejectedDuplicateSM=0xC5,
363 /** TP-VPF not supported. */
364 ESmsErrorVPFNotSupported=0xC6,
365 /** TP-VP not supported. */
366 ESmsErrorVPNotSupported=0xC7,
370 /** SIM SMS storage full. */
371 ESmsErrorSIMSMSStorageFull=0xD0,
372 /** No SMS storage capability in (U)SIM. */
373 ESmsErrorNoSMSStorageCapabilityOnSIM=0xD1,
375 ESmsErrorErrorInMS=0xD2,
376 /** Memory Capacity Exceeded. */
377 ESmsErrorMemoryCapacityExceded=0xD3,
378 /** (U)SIM Application Toolkit Busy. */
379 ESmsErrorSIMApplicationToolkitBusy=0xD4,
380 /** (U)SIM data download error. */
381 ESmsErrorSIMDataDownloadError=0xD5,
385 /** Value specific to an application. */
386 ESmsApplicationError1=0xE0,
387 /** Value specific to an application. */
388 ESmsApplicationError2=0xE1,
389 /** Value specific to an application. */
390 ESmsApplicationError3=0xE2,
391 /** Value specific to an application. */
392 ESmsApplicationError4=0xE3,
393 /** Value specific to an application. */
394 ESmsApplicationError5=0xE4,
395 /** Value specific to an application. */
396 ESmsApplicationError6=0xE5,
397 /** Value specific to an application. */
398 ESmsApplicationError7=0xE6,
399 /** Value specific to an application. */
400 ESmsApplicationError8=0xE7,
401 /** Value specific to an application. */
402 ESmsApplicationError9=0xE8,
403 /** Value specific to an application. */
404 ESmsApplicationError10=0xE9,
405 /** Value specific to an application. */
406 ESmsApplicationError11=0xEA,
407 /** Value specific to an application. */
408 ESmsApplicationError12=0xEB,
409 /** Value specific to an application. */
410 ESmsApplicationError13=0xEC,
411 /** Value specific to an application. */
412 ESmsApplicationError14=0xED,
413 /** Value specific to an application. */
414 ESmsApplicationError15=0xEE,
415 /** Value specific to an application. */
416 ESmsApplicationError16=0xEF,
417 /** Value specific to an application. */
418 ESmsApplicationError17=0xF0,
419 /** Value specific to an application. */
420 ESmsApplicationError18=0xF1,
421 /** Value specific to an application. */
422 ESmsApplicationError19=0xF2,
423 /** Value specific to an application. */
424 ESmsApplicationError20=0xF3,
425 /** Value specific to an application. */
426 ESmsApplicationError21=0xF4,
427 /** Value specific to an application. */
428 ESmsApplicationError22=0xF5,
429 /** Value specific to an application. */
430 ESmsApplicationError23=0xF6,
431 /** Value specific to an application. */
432 ESmsApplicationError24=0xF7,
433 /** Value specific to an application. */
434 ESmsApplicationError25=0xF8,
435 /** Value specific to an application. */
436 ESmsApplicationError26=0xF9,
437 /** Value specific to an application. */
438 ESmsApplicationError27=0xFA,
439 /** Value specific to an application. */
440 ESmsApplicationError28=0xFB,
441 /** Value specific to an application. */
442 ESmsApplicationError29=0xFC,
443 /** Value specific to an application. */
444 ESmsApplicationError30=0xFD,
445 /** Value specific to an application. */
446 ESmsApplicationError31=0xFE,
448 /** Unspecified error cause. */
449 ESmsErrorUnspecified=0xFF,
456 inline TInt Error() const;
457 inline void SetError(TSmsFailureCauseError aError);
462 * TP-ST (Status Report) octet. Found in Status Report
466 class TSmsStatus : public TSmsOctet
469 /** TP-ST flag values. */
472 // Short message transaction completed
473 /** Short message received by the SME. */
474 ESmsShortMessageReceivedBySME=0x00,
476 * Short message forwarded by the SC to the SME but the SC is unable to confirm
479 ESmsShortMessageForwardedBySCToSMEButUnconfirmedBySC=0x01,
480 /** Short message replaced by the SC. */
481 ESmsShortMessageReplacedBySC=0x02,
485 // Temporary error, SC still trying to transfer SM
486 /** Temporary error, SC still trying to transfer SM: congestion. */
487 ESmsTempError1StatusCongestion=0x20,
488 /** Temporary error, SC still trying to transfer SM: SME busy. */
489 ESmsTempError1StatusSMEBusy=0x21,
490 /** Temporary error, SC still trying to transfer SM: No response from SME. */
491 ESmsTempError1StatusNoResponseFromSME=0x22,
492 /** Temporary error, SC still trying to transfer SM: Service rejected. */
493 ESmsTempError1StatusServiceRejected=0x23,
494 /** Temporary error, SC still trying to transfer SM: Quality of service not available. */
495 ESmsTempError1StatusQualityOfServiceNotAvailable=0x24,
496 /** Temporary error, SC still trying to transfer SM: Error in SME. */
497 ESmsTempError1StatusErrorInSME=0x25,
501 // Permanent error, SC is not making any more transfer attempts
503 * Permanent error, SC is not making any more transfer attempts: Remote procedure
506 ESmsPermErrorRemoteProcedureError=0x40,
508 * Permanent error, SC is not making any more transfer attempts: Incompatible
511 ESmsPermErrorIncompatibleDestination=0x41,
513 * Permanent error, SC is not making any more transfer attempts: Connection rejected
516 ESmsPermErrorConnectionRejectedBySME=0x42,
517 /** Permanent error, SC is not making any more transfer attempts: Not obtainable. */
518 ESmsPermErrorNotObtainable=0x43,
520 * Permanent error, SC is not making any more transfer attempts: Quality of service
523 ESmsPermErrorQualityOfServiceNotAvailable2=0x44,
525 * Permanent error, SC is not making any more transfer attempts: No interworking
528 ESmsPermErrorNoInterworkingAvailable=0x45,
530 * Permanent error, SC is not making any more transfer attempts: SM Validity Period
533 ESmsPermErrorSMValidityPeriodExpired=0x46,
535 * Permanent error, SC is not making any more transfer attempts: SM Deleted by
538 ESmsPermErrorSMDeletedByOriginatingSME=0x47,
540 * Permanent error, SC is not making any more transfer attempts: SM Deleted by
543 ESmsPermErrorSMDeletedBySCAdministration=0x48,
544 /** Permanent error, SC is not making any more transfer attempts: SM does not exist. */
545 ESmsPermErrorDoesNotExist=0x49,
549 // Temporary error, SC is not making any more transfer attempts
550 /** Temporary error, SC is not making any more transfer attempts: Congestion. */
551 ESmsTempError2Congestion=0x60,
552 /** Temporary error, SC is not making any more transfer attempts: SME Busy. */
553 ESmsTempError2SMEBusy=0x61,
555 * Temporary error, SC is not making any more transfer attempts: No response from
558 ESmsTempError2NoResponseFromSME=0x62,
559 /** Temporary error, SC is not making any more transfer attempts: Service rejected. */
560 ESmsTempError2ServiceRejected=0x63,
562 * Temporary error, SC is not making any more transfer attempts: Quality of service
565 ESmsTempError2QualityOfServiceNotAvailable=0x64,
566 /** Temporary error, SC is not making any more transfer attempts: Error in SME. */
567 ESmsTempError2ErrorInSME=0x65,
574 inline TSmsStatus::TSmsStatusValue Status() const;
575 inline void SetStatus(TSmsStatusValue aValue);
580 * TP-PI octet. Found in Reports and Commands
584 class TSmsParameterIndicator : public TSmsOctet
587 /** TP-PI bit flags. */
590 /** Protocol identifier present. */
591 ESmsPIDProtocolIdentifierPresent=0x01,
592 /** Data coding scheme present. */
593 ESmsPIDDataCodingSchemePresent=0x02,
594 /** User data present. */
595 ESmsPIDUserDataPresent=0x04,
597 ESmsPIDReserved1=0x08,
599 ESmsPIDReserved2=0x10,
601 ESmsPIDReserved3=0x20,
603 ESmsPIDReserved4=0x40,
605 ESmsPIDExtension=0x80
608 TSmsParameterIndicator();
609 inline TBool Extension() const;
610 inline void SetExtension(TBool aExtension);
611 inline TBool UserDataPresent() const;
612 inline void SetUserDataPresent(TBool aPresent);
613 inline TBool DataCodingSchemePresent() const;
614 inline void SetDataCodingSchemePresent(TBool aPresent);
615 inline TBool ProtocolIdentifierPresent() const;
616 inline void SetProtocolIdentifierPresent(TBool aPresent);
619 // TSmsPID - conversion (None, Fax, Mail, etc.)
622 * TP-PID PDU octet. Found in ALL 6 message types.
626 class TSmsProtocolIdentifier : public TSmsOctet
629 /** PID bits 7-6, which determine the meaning of the lower order bits. */
632 /** Telematic interworking. */
633 ESmsPIDTelematicInterworking=0x00,
634 /** Short message. */
635 ESmsPIDShortMessageType=0x40,
637 ESmsPIDReserved=0x80,
638 /** SC specific use. */
639 ESmsPIDSCSpecificUse=0xC0,
641 /** Mask of bits 7-6. */
645 /** Telematic device indicator flags. Bit 5 - When Bit 7 = 0, Bit 6 = 0 */
646 enum TSmsTelematicDeviceIndicator
648 /** No telematic device. */
649 ESmsNoTelematicDevice=0x00,
650 /** Telematic device. */
651 ESmsTelematicDevice=0x20,
653 /** Telematic device indicator mask. */
654 EPIDTelematicDeviceIndicatorMask=0x20
657 /** Telematic Interworking device type flags. Bits 4-0 - When Bit 5 = 1*/
658 enum TSmsTelematicDeviceType
660 /** Device type is specific to this SC. */
661 ESmsSCSpecificDevice=0x00,
664 /** Group 3 telefax. */
665 ESmsGroup3TeleFax=0x02,
666 /** Group 4 telefax. */
667 ESmsGroup4TeleFax=0x03,
668 /** Voice telephone. */
669 ESmsVoiceTelephone=0x04,
672 /** National Paging System. */
673 ESmsNationalPagingSystem=0x06,
676 /** Teletex, carrier unspecified. */
677 ESmsTeletexCarrierUnspecified=0x08,
678 /** Teletex, PSPDN. */
679 ESmsTeletexPSPDN=0x09,
680 /** Teletex, CSPDN. */
681 ESmsTeletexCSPDN=0x0A,
682 /** Teletex, in analog PSTN. */
683 ESmsTeletexAnaloguePSTN=0x0B,
684 /** Teletex, in digital ISDN */
685 ESmsTeletexDigitalISDN=0x0C,
686 /** UCI (Universal Computer Interface, ETSI DE/PS 3 01-3). */
692 /** A message handling facility. */
693 ESmsMessageHandlingFacility=0x10,
694 /** X.400 message handling system. */
695 ESmsX400MessageHandlingSystem=0x11,
696 /** Internet Electronic Mail. */
697 ESmsInternetElectronicMail=0x12,
708 /** Value specific to each SC. */
709 ESmsSCSpecific1=0x18,
710 /** Value specific to each SC. */
711 ESmsSCSpecific2=0x19,
712 /** Value specific to each SC. */
713 ESmsSCSpecific3=0x1A,
714 /** Value specific to each SC. */
715 ESmsSCSpecific4=0x1B,
716 /** Value specific to each SC. */
717 ESmsSCSpecific5=0x1C,
718 /** Value specific to each SC. */
719 ESmsSCSpecific6=0x1D,
720 /** Value specific to each SC. */
721 ESmsSCSpecific7=0x1E,
722 /** Value specific to each SC. */
723 ESmsGsmMobileStation=0x1F,
725 /** Mask for telematic device type bits. */
726 ESmsTelematicDeviceTypeMask=0x1F
729 /** SM-AL protocol flag. No Telematic Interworking. Bits 4-0 - When Bit 5 = 0*/
730 enum TSmsShortMessageALProtocol
732 /** Mask for SM-AL protocol flag bit. */
733 ESmsShortMessageALProtocolMask=0x0F
736 /** Short Message Type flags. Bits 5-0 - When Bit 7 = 1, Bit 6 = 0*/
737 enum TSmsShortMessageType
739 /** Short Message Type 0. */
740 ESmsShortMessageType0=0x00,
741 /** Replace Short Message Type 1. */
742 ESmsReplaceShortMessageType1=0x01,
743 /** Replace Short Message Type 2. */
744 ESmsReplaceShortMessageType2=0x02,
745 /** Replace Short Message Type 3. */
746 ESmsReplaceShortMessageType3=0x03,
747 /** Replace Short Message Type 4. */
748 ESmsReplaceShortMessageType4=0x04,
749 /** Replace Short Message Type 5. */
750 ESmsReplaceShortMessageType5=0x05,
751 /** Replace Short Message Type 6. */
752 ESmsReplaceShortMessageType6=0x06,
753 /** Replace Short Message Type 7. */
754 ESmsReplaceShortMessageType7=0x07,
758 /** Return Call Message. */
759 ESmsReturnCallMesage=0x1F,
763 ESmsAnsi136RData=0x3C,
764 ESmsMEDataDownload=0x3D,
765 /** ME De-personalization Short Message. */
766 ESmsMEDepersonalizationShortMessage=0x3E,
767 /** ME Data download. */
768 ESmsSIMDataDownLoad=0x3F,
770 // ESmsShortMessageTypeMask=0x1F
771 /** Mask for Short Message type bits. */
772 ESmsShortMessageTypeMask=0x3F
775 TSmsProtocolIdentifier();
776 inline TSmsPIDType PIDType() const;
777 inline void SetPIDType(TSmsPIDType aSmsPIDType);
778 TSmsTelematicDeviceIndicator TelematicDeviceIndicator() const;
779 void SetTelematicDeviceIndicator(TSmsTelematicDeviceIndicator aIndicator);
780 TSmsTelematicDeviceType TelematicDeviceType() const;
781 void SetTelematicDeviceType(TSmsTelematicDeviceType aDeviceType);
782 TInt ShortMessageALProtocol() const;
783 void SetShortMessageALProtocol(TSmsShortMessageALProtocol aProtocol);
784 TInt ShortMessageType() const;
785 void SetShortMessageType(TSmsShortMessageType aShortMessageType);
790 * TP-DCS Data Coding Scheme defined in 3GPP TS 23.038.
792 * The data coding scheme is not always present in an GSM SMS PDU (CSmsPDU).
793 * It is always present for a SUBMIT (CSmsSubmit) and a DELIVER (CSmsDeliver),
794 * and is sometimes present for a DELIVER REPORT (CSmsDeliverReport), a SUBMIT
795 * REPORT (CSmsSubmitReport) or a STATUS REPORT (CSmsStatusReport), depending
796 * on the parameter indicator (TSmsParameterIndicator).
800 class TSmsDataCodingScheme : public TSmsOctet
803 /** Flags for bits 7-4, which determine the meaning of the lower order bits. */
806 /** Text is uncompressed, no class information. */
807 ESmsDCSTextUncompressedWithNoClassInfo=0x00,
808 /** Text is uncompressed, class information present. */
809 ESmsDCSTextUncompressedWithClassInfo=0x10,
810 /** Text is compressed, no class information. */
811 ESmsDCSTextCompressedWithNoClassInfo=0x20,
812 /** Text is compressed, class information present. */
813 ESmsDCSTextCompressedWithClassInfo=0x30,
815 /** Auto Deletion, Text is uncompressed, no class information. */
816 ESmsDCSAutoDelNoClassInfoUncompressedText=0x40,
817 /** Auto Deletion, Text is uncompressed, class information present. */
818 ESmsDCSAutoDelClassInfoUncompressedText=0x50,
819 /** Auto Deletion, Text is compressed, no class information. */
820 ESmsDCSAutoDelNoClassInfoCompressedText=0x60,
821 /** Auto Deletion, Text is compressed, class information present. */
822 ESmsDCSAutoDelClassInfoTextCompressedText=0x70,
825 ESmsDCSReserved1=0x40,
827 ESmsDCSReserved2=0x50,
829 ESmsDCSReserved3=0x60,
831 ESmsDCSReserved4=0x70,
833 ESmsDCSReserved5=0x80,
835 ESmsDCSReserved6=0x90,
837 ESmsDCSReserved7=0xA0,
839 ESmsDCSReserved8=0xB0,
843 /** Message Waiting Indication Group: Discard Message. */
844 ESmsDCSMessageWaitingIndicationDiscardMessage=0xC0,
846 /** Message Waiting Indication Group (7 bit). */
847 ESmsDCSMessageWaitingIndication7Bit=0xD0, // 7 bit User data
848 /** Message Waiting Indication Group (UCS2). */
849 ESmsDCSMessageWaitingIndicationUCS2=0xE0, // unicode User data
851 /** Text uncompressed, 7 bit or 8 bit. */
852 ESmsDCSTextUncompressed7BitOr8Bit=0xF0,
854 /** Masks bits 7 to 4. */
855 ESmsDCSBits7To4Mask=0xF0
858 /** Message Marked for Automatic Deletion */
859 enum TAutomaticDeletionGroup
861 ESmsDCSAutomaticDeletion = 0x40,
862 ESmsDCSAutomaticDeletionMask = 0xC0
865 /** Alphabet bit flags. */
868 /** GSM 7 bit default alphabet. */
869 ESmsAlphabet7Bit=0x00,
871 ESmsAlphabet8Bit=0x04,
873 ESmsAlphabetUCS2=0x08,
875 ESmsAlphabetReserved=0x0C,
877 /** Mask for these bit flags. */
878 ESmsAlphabetMask=0x0C,
880 /** Message Class bit flags. */
892 /** Mask for these bit flags. */
896 /** Indication Sense bit flags. */
897 enum TSmsIndicationState
899 /** Indication inactive. */
900 ESmsIndicationInactive=0x00,
901 /** Indication active. */
902 ESmsIndicationActive=0x08,
904 /** Mask for these bit flags. */
905 ESmsIndicationStateMask=0x08
907 /** Indication Type bit flags. */
908 enum TSmsIndicationType
910 /** Voicemail Message Waiting. */
911 ESmsVoicemailMessageWaiting=0x00,
912 /** Fax Message Waiting. */
913 ESmsFaxMessageWaiting=0x01,
914 /** Electronic Mail Message Waiting. */
915 ESmsElectronicMailMessageWaiting=0x02,
916 /** Other Message Waiting. */
917 ESmsFaxOtherMessageWaiting=0x03,
919 /** Mask for these bit flags. */
920 ESmsIndicationTypeMask=0x03
924 TSmsDataCodingScheme();
925 inline TSmsDCSBits7To4 Bits7To4() const;
926 inline void SetBits7To4(TSmsDCSBits7To4 aBits7To4);
927 // Normal SMS settings
928 TBool TextCompressed() const;
929 void SetTextCompressed(TBool aCompressed);
930 TSmsAlphabet Alphabet() const;
931 void SetAlphabet(TSmsAlphabet aAlphabet);
932 TBool Class(TSmsClass& aClass) const;
933 void SetClass(TBool aClassDefined,TSmsClass aClass);
934 // Message waiting settings
935 TSmsIndicationState IndicationState() const;
936 void SetIndicationState(TSmsIndicationState aState);
937 TSmsIndicationType IndicationType() const;
938 void SetIndicationType(TSmsIndicationType aType);
943 * Specifies alternative 7bit encoding combinations to use if the default
944 * GSM encoding cannot encode the message as 7bit without data loss.
951 /** Default value meaning that no alternative encoding would be used. */
952 ESmsEncodingNone = 0,
955 * Allows the use of the Turkish Single Shift table in place of the
956 * default GSM shift table.
958 * @note If used during encoding there will be a 3 octet cost in the User Data
961 ESmsEncodingTurkishSingleShift = 0x11,
964 * Allows the use of the Turkish Locking Shift table in place of the
965 * default GSM alphabet table.
967 * @note If used during encoding there will be a 3 octet cost in the User Data
969 * @note This encoding should only be used if the relevant national
970 * regulatory body has requested its use.
972 ESmsEncodingTurkishLockingShift = 0x12,
975 * Allows the use of the Turkish Locking Shift and/or the Turkish Single
976 * Shift tables in place of the default GSM alphabet and shift tables.
978 * @note If used during encoding there will be a 3 or 6 octet cost in the User Data
980 * @note This encoding should only be used if the relevant national
981 * regulatory body has requested its use.
983 ESmsEncodingTurkishLockingAndSingleShift = 0x13,
986 * Allows the use of the Spanish Single Shift table in place of the
987 * default GSM shift table.
989 * @note If used during encoding there will be a 3 octet cost in the User Data
992 ESmsEncodingSpanishSingleShift = 0x21,
995 * Allows the use of the Portuguese Single Shift table in place of the
996 * default GSM shift table.
998 * @note If used during encoding there will be a 3 octet cost in the User Data
1001 ESmsEncodingPortugueseSingleShift = 0x31,
1004 * Allows the use of the Portuguese Locking Shift table in place of the
1005 * default GSM alphabet table.
1007 * @note If used during encoding there will be a 3 octet cost in the User Data
1009 * @note This encoding should only be used if the relevant national
1010 * regulatory body has requested its use.
1012 ESmsEncodingPortugueseLockingShift = 0x32,
1015 * Allows the use of the Portuguese Locking Shift and/or the Portuguese Single
1016 * Shift tables in place of the default GSM alphabet and shift tables.
1018 * @note If used during encoding there will be a 3 or 6 octet cost in the User Data
1020 * @note This encoding should only be used if the relevant national
1021 * regulatory body has requested its use.
1023 ESmsEncodingPortugueseLockingAndSingleShift = 0x33
1028 * GSM National Language Identifiers.
1033 enum TSmsNationalLanguageIdentifier
1036 ESmsNationalLanguageIdentifierTurkish = 1,
1039 ESmsNationalLanguageIdentifierSpanish = 2,
1042 ESmsNationalLanguageIdentifierPortuguese = 3
1047 * Utility to provide piecewise character set conversion to / from unpacked user
1052 class CSmsAlphabetConverter : public CBase
1055 // Construction and destruction methods
1056 IMPORT_C static CSmsAlphabetConverter* NewLC(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsDataCodingScheme::TSmsAlphabet aSmsAlphabet,TBool aIsBinary);
1057 IMPORT_C ~CSmsAlphabetConverter();
1059 // Enumerated types and structs
1061 * Indicates whether there is a fixed relationship between the number of characters
1062 * and user data elements.
1064 * For example, Unicode characters always map to a single SMS UCS2 character,
1065 * while a Unicode character might map to one, two or more SMS 7-bit User Data
1066 * Elements (extended 7-bit characters).
1068 enum TSmsAlphabetWidthConversion
1070 /** Fixed relationship. */
1071 ESmsAlphabetWidthConversionFixed,
1072 /** Variable relationship. */
1073 ESmsAlphabetWidthConversionVariable
1076 struct TSmsAlphabetConversionProperties
1078 * Holds the number of user data elements required for conversion from a single
1081 * This value is applicable only if the iWidthConversion parameter is ESmsAlphabetWidthConversionFixed.
1084 /** Alphabet width conversion. */
1085 TSmsAlphabetWidthConversion iWidthConversion;
1086 /** Number of user data elements required for conversion from a single native character */
1087 TInt iUDElementsPerNativeCharacter;
1091 // Conversion methods
1092 void ConversionPropertiesL(TSmsAlphabetConversionProperties& aConversionProperties) const;
1093 IMPORT_C TPtrC8 ConvertFromNativeL(const TDesC& aNativeCharacters);
1094 IMPORT_C TPtrC8 ConvertFromNativeL(const TDesC& aNativeCharacters,
1095 TSmsEncoding aEncoding,
1096 TInt& aNumberOfUnconvertibleCharacters,
1097 TInt& aNumberOfDowngradedCharacters);
1098 IMPORT_C TPtrC ConvertToNativeL(const TDesC8& aUDElements);
1099 IMPORT_C TPtrC ConvertToNativeL(const TDesC8& aUDElements, TSmsEncoding aEncoding);
1101 TBool IsSupportedL(TChar aChar);
1102 TBool IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters,
1103 TInt& aIndexOfFirstUnconvertibleCharacter);
1105 TBool IsSupportedL(TChar aChar, TSmsEncoding aEncoding, TBool& aIsDowngrade,
1106 TBool& aRequiresAlternativeEncoding);
1107 TBool IsSupportedL(const TDesC& aDes, TSmsEncoding aEncoding,
1108 TInt& aNumberOfUnconvertibleCharacters,
1109 TInt& aNumberOfDowngradedCharacters,
1110 TInt& aNumberRequiringAlternativeEncoding,
1111 TInt& aIndexOfFirstUnconvertibleCharacter);
1113 // Alternative Encoding methods
1114 TSmsEncoding FindBestAlternativeEncodingL(const TDesC& aNativeCharacters,
1115 TSmsEncoding aSuggestedEncoding);
1116 void ConfirmAlternativeEncoderL(TSmsEncoding aEncoding) const;
1118 // Unconverted buffer methods
1119 inline void ResetUnconvertedNativeCharacters();
1120 inline void ResetUnconvertedUDElements();
1121 inline TPtrC UnconvertedNativeCharacters();
1122 inline TPtrC8 UnconvertedUDElements();
1125 inline TSmsDataCodingScheme::TSmsAlphabet Alphabet() const;
1128 // Private construction methods
1129 CSmsAlphabetConverter(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsDataCodingScheme::TSmsAlphabet aSmsAlphabet,TBool aIsBinary);
1132 // Private conversion preparation methods
1133 void PrepareForConversionFromNativeL(TSmsEncoding aEncoding);
1134 void PrepareForConversionToNativeL(TSmsEncoding aEncoding);
1136 // Private Alternative Encoding methods
1137 void GetAlternativeEncoderIDL(TSmsEncoding aEncoding, TUint& aEncoderID) const;
1139 // Private buffer helper methods
1140 TPtr16 CheckAllocBufferL(HBufC16** aBuffer,TInt aMaxLength,TInt aUsedLength);
1141 TPtr8 CheckAllocBufferL(HBufC8** aBuffer,TInt aMaxLength,TInt aUsedLength);
1143 // Private constants
1146 KMaxSmsAlphabetConversionRetries=4
1151 KMinSmsAlphabetConversionAllocIncrement=4
1156 CCnvCharacterSetConverter& iCharacterSetConverter;
1158 TSmsDataCodingScheme::TSmsAlphabet iSmsAlphabet;
1160 HBufC* iConvertedNativeCharacters;
1161 HBufC8* iConvertedUDElements;
1162 HBufC* iUnconvertedNativeCharacters;
1163 TPtr iUnconvertedNativeCharactersPtr;
1164 HBufC8* iUnconvertedUDElements;
1165 TPtr8 iUnconvertedUDElementsPtr;
1169 /** Type-of-number, as defined in ETSI 3GPP TS 23.040. */
1170 enum TGsmSmsTypeOfNumber
1173 * Unknown, used when the user or network has no a priori information about the
1175 * In this case, the Address-Value field is organized according to the network
1176 * dialling plan, e.g. prefix or escape digits might be present.
1178 EGsmSmsTONUnknown=0x00,
1180 * International number.
1181 * The international format shall be accepted also when the message is destined
1182 * to a recipient in the same country as the MSC or as the SGSN.
1184 EGsmSmsTONInternationalNumber=0x10,
1187 * Prefix or escape digits shall not be included.
1189 EGsmSmsTONNationalNumber=0x20,
1191 * Network specific number.
1192 * Administration/service number specific to the serving network, e.g. used to
1193 * access an operator.
1195 EGsmSmsTONNetworkSpecificNumber=0x30,
1197 * Subscriber number.
1198 * Used when a specific short number representation is stored in one or more
1199 * SCs as part of a higher layer application. (Note that "Subscriber number"
1200 * shall only be used in connection with the proper PID referring to this application).
1202 EGsmSmsTONSubscriberNumber=0x40,
1205 * Coded according to 3GPP TS 23.038 - GSM 7-bit default alphabet.
1207 EGsmSmsTONAlphaNumeric=0x50,
1208 EGsmSmsTONAbbreviatedNumber=0x60, //< Abbreviated number
1209 EGsmSmsTONReserverved=0x70, //< Reserved for extension
1212 /** Numbering-plan-identification defined in ETSI 3GPP TS 23.040. */
1213 enum TGsmSmsNumberingPlanIdentification
1216 EGsmSmsNPIUnknown=0x00,
1217 /** ISDN telephone numbering plan. */
1218 EGsmSmsNPIISDNTelephoneNumberingPlan=0x01,
1219 /** Data numbering plan. */
1220 EGsmSmsNPIDataNumberingPlan=0x03,
1221 /** Telex numbering plan. */
1222 EGsmSmsNPITelexNumberingPlan=0x04,
1223 /** National numbering plan. */
1224 EGsmSmsNPINationalNumberingPlan=0x08,
1225 /** Private numbering plan. */
1226 EGsmSmsNPIPrivateNumberingPlan=0x09,
1227 /** ERMES numbering plan. */
1228 EGsmSmsNPIERMESNumberingPlan=0x0A,
1229 /** Reserved for extension. */
1230 EGsmSmsNPIReservedForExtension=0x0F,
1235 * Type-of-address field defined in ETSI 3GPP TS 23.040
1239 class TGsmSmsTypeOfAddress : public TSmsOctet
1245 EGsmSmsFirstBitMask=0x80,
1246 EGsmSmsTONMask=0x70,
1252 inline TGsmSmsTypeOfAddress(TInt aValue = EGsmSmsFirstBitMask);
1253 inline TGsmSmsTypeOfAddress(TGsmSmsTypeOfNumber aTon, TGsmSmsNumberingPlanIdentification aNPI);
1255 inline TGsmSmsTypeOfNumber TON() const;
1256 inline void SetTON(TGsmSmsTypeOfNumber aTON);
1258 inline TGsmSmsNumberingPlanIdentification NPI() const;
1260 * Sets the numbering plan identification.
1261 * @param aNPI Numbering plan identification
1263 inline void SetNPI(TGsmSmsNumberingPlanIdentification aNPI);
1266 * Converts type of number and numbering plan identification information from
1267 * the type of address parameter to the NMobilePhone::TMobileTON and NMobilePhone::TMobileNPI
1270 * @param aTON On return, type of number
1271 * @param aNPI On return, numbering plan identification
1273 IMPORT_C void ConvertToETelMM(NMobilePhone::TMobileTON& aTON, NMobilePhone::TMobileNPI& aNPI) const;
1275 * Sets type of number and numbering plan identification information from values
1276 * specified in NMobilePhone::TMobileTON and NMobilePhone::TMobileNPI formats.
1278 * @param aTON Type of number
1279 * @param aNPI Numbering plan identification
1281 IMPORT_C void SetFromETelMM(NMobilePhone::TMobileTON aTON, NMobilePhone::TMobileNPI aNPI);
1284 /** Maximum length of a Service Centre address = 21, as defined in ETSI GSM 04.11. */
1285 const TInt TGsmSmsTelNumberMaxLen = 21;
1289 * Encapsulation of basic address information
1293 class TGsmSmsTelNumber
1298 * If the address is an alphanumeric address,
1299 * it can represent a voice message waiting indicator
1300 * as defined in the Common PCN Handset Specification
1301 * v4.2. The specification allows other indicators
1302 * to be defined in the future.
1304 enum TTypeOfIndicator
1306 EVoiceMessageWaitingIndicator = 0
1310 enum TCPHSIndicatorTypeByte
1312 ECPSHIndicatorTypeBitMask = 0x7E,
1313 ECPSHVoiceMailId = 0x10,
1314 ECPHSIndicatorSettingBit = 0x01,
1315 ECPHSVoiceMailSettingSpareBit = 0x80
1318 enum TCPHSIndicatorIdByte
1320 ECPSHIndicatorIdBitMask = 0x7E,
1321 ECPSHIndicatorId = 0x00,
1322 ECPSHIndicatorIdSettingBit = 0x01,
1323 ECTSHVoiceMailIndicatorSpareBit = 0x80
1329 ECPHSAddressType = 1,
1330 ECPHSAddressIndicatorType = 2,
1331 ECPHSAddressIndicatorId = 3,
1332 ECPHSSizeOfAddressField = 4
1336 inline TGsmSmsTelNumber();
1338 IMPORT_C TBool IsInstanceOf(TTypeOfIndicator aType);
1342 TGsmSmsTypeOfAddress iTypeOfAddress; //< The type-of-address of iTelNumber
1343 TBuf<TGsmSmsTelNumberMaxLen> iTelNumber; //< Telephone number, in format of iTypeOfAddress
1348 * CSmsAddress - address of the recipient or SC
1352 class CSmsAddress : public CBase
1357 KSmsAddressMaxAddressValueLength=10,// octets
1358 KSmsAddressMaxAddressLength = 12 // address length, type and address value
1361 static CSmsAddress* NewL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs);
1363 TPtrC Address() const;
1364 void SetAddressL(const TDesC& aAddress);
1365 void ParsedAddress(TGsmSmsTelNumber& aParsedAddress) const;
1366 void SetParsedAddressL(const TGsmSmsTelNumber& aParsedAddress);
1368 void SetRawAddressL(TGsmSmsTypeOfAddress aTypeOfAddress, TPtrC aBuffer);
1369 TGsmSmsTypeOfAddress& TypeOfAddress();
1373 TUint8* EncodeL(TUint8* aPtr) const;
1374 void DecodeL(TGsmuLex8& aPdu);
1375 void InternalizeL(RReadStream& aStream);
1376 void ExternalizeL(RWriteStream& aStream) const;
1378 CSmsAddress* DuplicateL() const;
1381 CSmsAddress(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs);
1382 void NewBufferL(TInt aLength);
1383 void DoSetParsedAddressL(const TDesC& aAddress);
1386 CCnvCharacterSetConverter& iCharacterSetConverter;
1388 TGsmSmsTypeOfAddress iTypeOfAddress;
1394 * TP-SCTS Service Center Time Stamp Found in Deliver, Submit Report, Status Report,
1398 class TSmsServiceCenterTimeStamp
1401 enum {KSmsMaxTimeZoneNumQuarterHours=79};
1402 /** Time zone offset sign bit. */
1403 enum TSmsTimeZoneSignBit
1405 /** Positive offset. */
1406 ESmsTimeZonePositive=0x00,
1407 /** Negative offset. */
1408 ESmsTimeZoneNegative=0x08,
1410 /** Mask for these bit flags. */
1411 ESmsTimeZoneSignBitMask=0x08
1414 TSmsServiceCenterTimeStamp();
1415 inline TInt TimeOffset() const;
1416 void SetTimeOffset(TInt aNumQuarterHours);
1417 inline const TTime& Time() const;
1418 inline void SetTime(const TTime& aTime);
1419 TUint8* EncodeL(TUint8* aPtr) const;
1420 void DecodeL(TGsmuLex8& aPdu, TInt& aTimeError);
1421 void InternalizeL(RReadStream& aStream);
1422 void ExternalizeL(RWriteStream& aStream) const;
1425 TInt iTimeZoneNumQuarterHours;
1430 * TP-VP Validity Period Found in SUBMIT PDUs.
1432 * The validy period format is encoded in the first octet of the PDU, so the
1433 * class takes a reference to a TSmsFirstOctet. The validty period specifies
1434 * the length of time the PDU lives in the service center if the PDU cannot be
1435 * immediately delivered.
1439 class TSmsValidityPeriod
1442 /** Validity period units (in minutes). */
1443 enum TValidityPeriodUnitInMinutes
1445 /** Five minutes. */
1446 EFiveMinuteUnitInMinutes=5,
1448 EHalfHourUnitInMinutes=30,
1450 EOneDayUnitInMinutes=1440,
1452 EOneWeekUnitInMinutes=7*EOneDayUnitInMinutes
1454 /** Limits for validity period units (in minutes). */
1455 enum TValidityPeriodUnitLimitInMinutes
1457 /** Limit for 5 minute validity period unit. */
1458 EFiveMinuteUnitLimitInMinutes=24*EHalfHourUnitInMinutes,
1459 /** Limit for 30 minute validity period unit. */
1460 EHalfHourUnitLimitInMinutes=EOneDayUnitInMinutes,
1461 /** Limit for 1 day validity period unit. */
1462 EOneDayUnitLimitInMinutes=30*EOneDayUnitInMinutes,
1463 /** Limit for 1 week validity period unit. */
1464 EOneWeekUnitLimitInMinutes=63*EOneWeekUnitInMinutes
1466 /** Limits for validity period units. */
1467 enum TValidityPeriodLimit
1469 /** Limit for 5 minute validity period unit. */
1470 EFiveMinuteUnitLimit=143,
1471 /** Limit for 30 minute validity period unit. */
1472 EHalfHourUnitLimit=167,
1473 /** Limit for 1 day validity period unit. */
1474 EOneDayUnitLimit=196,
1475 /** Limit for 1 week validity period unit. */
1476 EOneWeekUnitLimit=255
1479 TSmsValidityPeriod(TSmsFirstOctet& aFirstOctet);
1480 inline TSmsFirstOctet::TSmsValidityPeriodFormat ValidityPeriodFormat() const;
1481 inline void SetValidityPeriodFormat(TSmsFirstOctet::TSmsValidityPeriodFormat aValidityPeriodFormat);
1482 inline const TTimeIntervalMinutes& TimeIntervalMinutes() const;
1483 inline void SetTimeIntervalMinutes(const TTimeIntervalMinutes& aTimeIntervalMinutes);
1485 TUint8* EncodeL(TUint8* aPtr) const;
1486 TUint8* EncodeL(TUint8* aPtr, const TEncodeParams* aEncodeParams) const;
1487 void DecodeL(TGsmuLex8& aPdu);
1488 void InternalizeL(RReadStream& aStream);
1489 void ExternalizeL(RWriteStream& aStream) const;
1491 TSmsFirstOctet& iFirstOctet;
1492 TTimeIntervalMinutes iTimeIntervalMinutes;
1495 class CEmsInformationElement;
1498 * SMS element defined in TP-UD octet.
1500 * This element is found in Deliver, Deliver Report, Submit, Submit Report, Status
1501 * Report and Command type messages.
1505 class CSmsInformationElement : public CBase
1508 /** TP-UD Information Element Identifier. */
1509 enum TSmsInformationElementIdentifier
1511 /** Concatenated short messages, 8-bit reference number. */
1512 ESmsIEIConcatenatedShortMessages8BitReference=0x00,
1513 /** Special SMS Message Indication. */
1514 ESmsIEISpecialSMSMessageIndication=0x01,
1516 ESmsIEIReserved=0x02,
1517 /** Value not used to avoid misinterpretation as line feed character. */
1518 ESmsIEIValueNotUsed=0x03,
1519 /** Application port addressing scheme, 8 bit address. */
1520 ESmsIEIApplicationPortAddressing8Bit=0x04,
1521 /** Application port addressing scheme, 16 bit address */
1522 ESmsIEIApplicationPortAddressing16Bit=0x05,
1523 /** SMSC Control Parameters. */
1524 ESmsIEISMSCControlParameters=0x06,
1525 /** UDH Source Indicator. */
1526 ESmsIEIUDHSourceIndicator=0x07,
1527 /** Concatenated short message, 16-bit reference number. */
1528 ESmsIEIConcatenatedShortMessages16BitReference=0x08,
1529 /** Wireless Control Message Protocol. */
1530 ESmsIEIWirelessControlMessageProtocol=0x09,
1531 ESmsIEIRFC822EmailHeader=0x20,
1535 ESmsEnhancedTextFormatting=0x0A,
1536 ESmsEnhancedPredefinedSound=0x0B,
1537 ESmsEnhancedUserDefinedSound=0x0C,
1538 ESmsEnhancedPredefinedAnimation=0x0D,
1539 ESmsEnhancedLargeAnimation=0x0E,
1540 ESmsEnhancedSmallAnimation=0x0F,
1541 ESmsEnhancedLargePicture=0x10,
1542 ESmsEnhancedSmallPicture=0x11,
1543 ESmsEnhancedVariablePicture=0x12,
1544 ESmsEnhancedUserPromptIndicator=0x13,
1545 ESmsEnhancedExtendedObject=0x14,
1546 ESmsEnhancedReusedExtendedObject=0x15,
1547 ESmsEnhancedCompressionControl=0x16,
1548 ESmsEnhancedODI=0x17,
1549 ESmsEnhancedStandardWVG=0x18,
1550 ESmsEnhancedCharacterSizeWVG=0x19,
1551 ESmsEnhancedextendedObjectDataRequest=0x1A,
1553 // Control Information Elements
1555 ESmsHyperLinkFormat = 0x21,
1556 ESmsReplyAddressFormat = 0x22,
1557 ESmsEnhanceVoiceMailInformation = 0x23,
1558 ESmsNationalLanguageSingleShift = 0x24,
1559 ESmsNationalLanguageLockingShift = 0x25,
1564 /** SIM Toolkit Security Header 1. */
1565 ESmsIEISIMToolkitSecurityHeaders1=0x70,
1566 /** SIM Toolkit Security Header 2. */
1567 ESmsIEISIMToolkitSecurityHeaders2=0x71,
1568 /** SIM Toolkit Security Header 3. */
1569 ESmsIEISIMToolkitSecurityHeaders3=0x72,
1570 /** SIM Toolkit Security Header 4. */
1571 ESmsIEISIMToolkitSecurityHeaders4=0x73,
1572 /** SIM Toolkit Security Header 5. */
1573 ESmsIEISIMToolkitSecurityHeaders5=0x74,
1574 /** SIM Toolkit Security Header 6. */
1575 ESmsIEISIMToolkitSecurityHeaders6=0x75,
1576 /** SIM Toolkit Security Header 7. */
1577 ESmsIEISIMToolkitSecurityHeaders7=0x76,
1578 /** SIM Toolkit Security Header 8. */
1579 ESmsIEISIMToolkitSecurityHeaders8=0x77,
1580 /** SIM Toolkit Security Header 9. */
1581 ESmsIEISIMToolkitSecurityHeaders9=0x78,
1582 /** SIM Toolkit Security Header 10. */
1583 ESmsIEISIMToolkitSecurityHeaders10=0x79,
1584 /** SIM Toolkit Security Header 11. */
1585 ESmsIEISIMToolkitSecurityHeaders11=0x7A,
1586 /** SIM Toolkit Security Header 12. */
1587 ESmsIEISIMToolkitSecurityHeaders12=0x7B,
1588 /** SIM Toolkit Security Header 13. */
1589 ESmsIEISIMToolkitSecurityHeaders13=0x7C,
1590 /** SIM Toolkit Security Header 14. */
1591 ESmsIEISIMToolkitSecurityHeaders14=0x7D,
1592 /** SIM Toolkit Security Header 15. */
1593 ESmsIEISIMToolkitSecurityHeaders15=0x7E,
1594 /** SIM Toolkit Security Header 16. */
1595 ESmsIEISIMToolkitSecurityHeaders16=0x7F,
1596 /** SME to SME specific use 1. */
1597 ESmsIEISMEToSMESpecificUse1=0x80,
1598 /** SME to SME specific use 2. */
1599 ESmsIEISMEToSMESpecificUse2=0x81,
1600 /** SME to SME specific use 3. */
1601 ESmsIEISMEToSMESpecificUse3=0x82,
1602 /** SME to SME specific use 4. */
1603 ESmsIEISMEToSMESpecificUse4=0x83,
1604 /** SME to SME specific use 5. */
1605 ESmsIEISMEToSMESpecificUse5=0x84,
1606 /** SME to SME specific use 6. */
1607 ESmsIEISMEToSMESpecificUse6=0x85,
1608 /** SME to SME specific use 7. */
1609 ESmsIEISMEToSMESpecificUse7=0x86,
1610 /** SME to SME specific use 8. */
1611 ESmsIEISMEToSMESpecificUse8=0x87,
1612 /** SME to SME specific use 9. */
1613 ESmsIEISMEToSMESpecificUse9=0x88,
1614 /** SME to SME specific use 10. */
1615 ESmsIEISMEToSMESpecificUse10=0x89,
1616 /** SME to SME specific use 11. */
1617 ESmsIEISMEToSMESpecificUse11=0x8A,
1618 /** SME to SME specific use 12. */
1619 ESmsIEISMEToSMESpecificUse12=0x8B,
1620 /** SME to SME specific use 13. */
1621 ESmsIEISMEToSMESpecificUse13=0x8C,
1622 /** SME to SME specific use 14. */
1623 ESmsIEISMEToSMESpecificUse14=0x8D,
1624 /** SME to SME specific use 15. */
1625 ESmsIEISMEToSMESpecificUse15=0x8E,
1626 /** SME to SME specific use 16. */
1627 ESmsIEISMEToSMESpecificUse16=0x8F,
1628 /** SME to SME specific use 17. */
1629 ESmsIEISMEToSMESpecificUse17=0x90,
1630 /** SME to SME specific use 18. */
1631 ESmsIEISMEToSMESpecificUse18=0x91,
1632 /** SME to SME specific use 19. */
1633 ESmsIEISMEToSMESpecificUse19=0x92,
1634 /** SME to SME specific use 20. */
1635 ESmsIEISMEToSMESpecificUse20=0x93,
1636 /** SME to SME specific use 21. */
1637 ESmsIEISMEToSMESpecificUse21=0x94,
1638 /** SME to SME specific use 22. */
1639 ESmsIEISMEToSMESpecificUse22=0x95,
1640 /** SME to SME specific use 23. */
1641 ESmsIEISMEToSMESpecificUse23=0x96,
1642 /** SME to SME specific use 24. */
1643 ESmsIEISMEToSMESpecificUse24=0x97,
1644 /** SME to SME specific use 25. */
1645 ESmsIEISMEToSMESpecificUse25=0x98,
1646 /** SME to SME specific use 26. */
1647 ESmsIEISMEToSMESpecificUse26=0x99,
1648 /** SME to SME specific use 27. */
1649 ESmsIEISMEToSMESpecificUse27=0x9A,
1650 /** SME to SME specific use 28. */
1651 ESmsIEISMEToSMESpecificUse28=0x9B,
1652 /** SME to SME specific use 29. */
1653 ESmsIEISMEToSMESpecificUse29=0x9C,
1654 /** SME to SME specific use 30. */
1655 ESmsIEISMEToSMESpecificUse30=0x9D,
1656 /** SME to SME specific use 31. */
1657 ESmsIEISMEToSMESpecificUse31=0x9E,
1658 /** SME to SME specific use 32. */
1659 ESmsIEISMEToSMESpecificUse32=0x9F,
1663 /** SC specific use 1. */
1664 ESmsIEISCSpecificUse1=0xC0,
1665 /** SC specific use 2. */
1666 ESmsIEISCSpecificUse2=0xC1,
1667 /** SC specific use 3. */
1668 ESmsIEISCSpecificUse3=0xC2,
1669 /** SC specific use 4. */
1670 ESmsIEISCSpecificUse4=0xC3,
1671 /** SC specific use 5. */
1672 ESmsIEISCSpecificUse5=0xC4,
1673 /** SC specific use 6. */
1674 ESmsIEISCSpecificUse6=0xC5,
1675 /** SC specific use 7. */
1676 ESmsIEISCSpecificUse7=0xC6,
1677 /** SC specific use 8. */
1678 ESmsIEISCSpecificUse8=0xC7,
1679 /** SC specific use 9. */
1680 ESmsIEISCSpecificUse9=0xC8,
1681 /** SC specific use 10. */
1682 ESmsIEISCSpecificUse10=0xC9,
1683 /** SC specific use 11. */
1684 ESmsIEISCSpecificUse11=0xCA,
1685 /** SC specific use 12. */
1686 ESmsIEISCSpecificUse12=0xCB,
1687 /** SC specific use 13. */
1688 ESmsIEISCSpecificUse13=0xCC,
1689 /** SC specific use 14. */
1690 ESmsIEISCSpecificUse14=0xCD,
1691 /** SC specific use 15. */
1692 ESmsIEISCSpecificUse15=0xCE,
1693 /** SC specific use 16. */
1694 ESmsIEISCSpecificUse16=0xCF,
1695 /** SC specific use 17. */
1696 ESmsIEISCSpecificUse17=0xD0,
1697 /** SC specific use 18. */
1698 ESmsIEISCSpecificUse18=0xD1,
1699 /** SC specific use 19. */
1700 ESmsIEISCSpecificUse19=0xD2,
1701 /** SC specific use 20. */
1702 ESmsIEISCSpecificUse20=0xD3,
1703 /** SC specific use 21. */
1704 ESmsIEISCSpecificUse21=0xD4,
1705 /** SC specific use 22. */
1706 ESmsIEISCSpecificUse22=0xD5,
1707 /** SC specific use 23. */
1708 ESmsIEISCSpecificUse23=0xD6,
1709 /** SC specific use 24. */
1710 ESmsIEISCSpecificUse24=0xD7,
1711 /** SC specific use 25. */
1712 ESmsIEISCSpecificUse25=0xD8,
1713 /** SC specific use 26. */
1714 ESmsIEISCSpecificUse26=0xD9,
1715 /** SC specific use 27. */
1716 ESmsIEISCSpecificUse27=0xDA,
1717 /** SC specific use 28. */
1718 ESmsIEISCSpecificUse28=0xDB,
1719 /** SC specific use 29. */
1720 ESmsIEISCSpecificUse29=0xDC,
1721 /** SC specific use 30. */
1722 ESmsIEISCSpecificUse30=0xDD,
1723 /** SC specific use 31. */
1724 ESmsIEISCSpecificUse31=0xDE,
1725 /** SC specific use 32. */
1726 ESmsIEISCSpecificUse32=0xDF,
1730 ESmsIEMaximum = 0xFF
1734 // Exported functions
1735 IMPORT_C TSmsInformationElementIdentifier Identifier() const;
1736 IMPORT_C TPtr8 Data();
1737 IMPORT_C const TDesC8& Data() const;
1739 static CSmsInformationElement* NewL(TSmsInformationElementIdentifier aIdentifier,const TDesC8& aData);
1740 static CSmsInformationElement* NewL();
1741 ~CSmsInformationElement();
1743 TUint8* EncodeL(TUint8* aPtr) const;
1744 void DecodeL(TGsmuLex8& aPdu);
1745 void InternalizeL(RReadStream& aStream);
1746 void ExternalizeL(RWriteStream& aStream) const;
1747 void ConstructL(const TDesC8& aData);
1748 TUint Length() const;
1750 void NewDataL(TInt aLength);
1751 inline CSmsInformationElement(TSmsInformationElementIdentifier aInformationElementIdentifier);
1753 TSmsOctet iIdentifier;
1761 * TSmsInformationElementCategories
1763 * This class specifies where information elements are located SMS Messages.
1765 * It specifies which PDUs each information element can be located in.
1767 * The SMS stack uses this information when encoding and decoding SMS messages.
1769 class TSmsInformationElementCategories
1773 // Comment, table approach probably is not necessary here.
1774 // Simply use a switch statement as cannot index directly into table.
1776 enum TInformationElementCategory
1778 EEmsInformationElement,
1779 ECtrlMandatoryInEveryPDUAndWithIdenticalValues, // e.g. Port Addresses
1780 ECtrlMandatoryInEveryPDUMultipleInstancesPerPDU, // e.g. Special SMS Message Indication
1781 ECtrlMandatoryInEveryPDUButWithValueSpecificToPDU, // e.g. Email Header / Concatenation Elements, SMSC Parameters
1782 ECtrlMandatoryIn1stPDUOnly, // e.g. Reply Address
1783 ECtrlSingleInstanceOnly, // e.g. Enhanced Voice Mail
1784 ECtrlMultipleInstancesAllowed, // e.g. Hyperlink format
1788 typedef CSmsInformationElement::TSmsInformationElementIdentifier TInformationElementId;
1791 enum TIndexToCategory
1793 EIndexEmsInformationElement,
1794 EIndexCtrlMandatoryInEveryPDUAndWithIdenticalValues,
1795 EIndexCtrlMandatoryInEveryPDUMultipleInstancesPerPDU,
1796 EIndexCtrlMandatoryInEveryPDUButWithValueSpecificToPDU,
1797 EIndexCtrlMandatoryIn1stPDUOnly,
1798 EIndexCtrlSingleInstanceOnly,
1799 EIndexCtrlMultipleInstancesAllowed,
1800 EIndexCtrlOptionalInEveryPDUWithValueSpecificToPDU,
1805 static TBool GetCategoryDefinition(TInformationElementId aId, TInformationElementCategory& aCategory);
1807 static TBool TranslateCategoryToIndex(TInformationElementId aId, TInt& index);
1808 TSmsInformationElementCategories() {};
1809 ~TSmsInformationElementCategories() {};
1810 void operator=(TSmsInformationElementCategories& aCategory) {(void) aCategory; };
1811 TBool operator==(TSmsInformationElementCategories& aCategory){(void) aCategory; return EFalse; };
1812 static const TInformationElementCategory categories[ENumberOfIndices];
1819 typedef CSmsInformationElement::TSmsInformationElementIdentifier TSmsId;
1823 * Mobile originated SMS sent to the network requesting an action or information
1824 * on the status of a previously sent SUBMIT.
1826 * This is internal and not intended for use.
1830 class CSmsCommandData : public CBase
1833 enum {KSmsMaxDataSize=157};
1835 static CSmsCommandData* NewL(TSmsFirstOctet& aFirstOctet);
1838 inline TInt NumInformationElements() const;
1839 CSmsInformationElement& InformationElement(TInt aIndex) const;
1840 CSmsInformationElement*& InformationElementPtr(TInt aIndex);
1841 TBool InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,
1842 TInt& aIndex) const;
1843 void AddInformationElementL(const TSmsId aIdentifier,const TDesC8& aData);
1844 void RemoveInformationElement(TInt aIndex);
1846 inline TInt MaxDataLength() const;
1847 TPtrC8 Data() const;
1848 void SetDataL(const TDesC8& aData);
1850 TUint8* EncodeL(TUint8* aPtr) const;
1851 void DecodeL(TGsmuLex8& aPdu);
1852 void InternalizeL(RReadStream& aStream);
1853 void ExternalizeL(RWriteStream& aStream) const;
1855 CSmsCommandData* DuplicateL() const;
1858 CSmsCommandData(TSmsFirstOctet& aFirstOctet);
1860 TInt HeaderLength() const;
1861 TInt TotalHeaderLengthInUDLUnits() const;
1863 TBool HeaderPresent() const;
1864 void SetHeaderPresent(TBool aHeaderPresent);
1867 TSmsFirstOctet& iFirstOctet;
1868 CArrayPtrFlat <CSmsInformationElement> iInformationElementArray;
1874 * Enumerations and operations for SMS commands.
1878 class TSmsCommandType : public TSmsOctet
1881 /** Command types. */
1882 enum TSmsCommandTypeValue
1885 ESmsCommandTypeEnquiry=0x00,
1887 ESmsCommandTypeCancel=0x01,
1889 ESmsCommandTypeDelete=0x02,
1890 /** Enable Status Report Request. */
1891 ESmsCommandTypeEnableStatusReportRequest=0x03
1898 inline TInt CommandType() const;
1899 inline void SetCommandType(TSmsCommandTypeValue aType);
1904 * Operations on the User Data described in TP-UD.
1908 class CSmsUserData : public CBase
1911 enum {KSmsMaxUserDataSize=140};
1912 enum {KSmsMaxUserDataLengthInChars=(KSmsMaxUserDataSize*8)/7};
1915 static CSmsUserData* NewL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsFirstOctet& aFirstOctet,const TSmsDataCodingScheme& aDataCodingScheme);
1918 inline TInt NumInformationElements() const;
1919 IMPORT_C CSmsInformationElement& InformationElement(TInt aIndex) const;
1920 IMPORT_C TBool InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,TInt& aIndex) const;
1921 IMPORT_C TBool InformationElementLastIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,TInt& aIndex) const;
1922 IMPORT_C void AddInformationElementL(TSmsId aIdentifier,const TDesC8& aData);
1923 IMPORT_C void RemoveInformationElement(TInt aIndex);
1924 void InformationElementIndicesL(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier, CArrayFixFlat<TInt>& aIndices) const;
1926 // EMS related methods
1927 void AddEmsInformationElementL(CEmsInformationElement* aIe); // takes ownership od aIe;
1928 TBool EmsInformationElementWillFitL(CEmsInformationElement* aIe,CSmsEMSBufferSegmenter& aSeg,TUint& aCharsAddedToCurrentPDU);
1929 // Control Information Element related methods
1930 TBool ControlInformationElementWillFitL(CSmsInformationElement* aIe);
1931 void UpdateInformationElementArrayL(TSmsId aIdentifier,const TDesC8& aData);
1932 CSmsInformationElement*& InformationElementPtr(TInt aIndex);
1934 TInt MaxPackedUDUnitsInBodyRemaining() const;
1935 TInt MaxPackedUDUnitsInBodyRemaining(TUint totalHeaderLengthInUDLUnits) const;
1937 IMPORT_C TInt MaxBodyLengthInChars() const;
1938 IMPORT_C TPtrC8 Body() const;
1939 IMPORT_C void SetBodyL(const TDesC8& aBody);
1940 void AppendBodyL(const TDesC8& aExtraBody);
1942 IMPORT_C TBool IsSupportedL(TChar aChar);
1943 IMPORT_C TBool IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters,
1944 TInt& aIndexOfFirstUnconvertibleCharacter) const;
1946 IMPORT_C TBool IsSupportedL(const TDesC& aDes, TSmsEncoding aEncoding,
1947 TInt& aNumberOfUnconvertibleCharacters,
1948 TInt& aNumberOfDowngradedCharacters,
1949 TInt& aNumberRequiringAlternativeEncoding,
1950 TInt& aIndexOfFirstUnconvertibleCharacter) const;
1952 TBool IsBinaryData() const;
1954 TUint8* EncodeL(TUint8* aPtr) const;
1955 void DecodeL(TGsmuLex8& aPdu);
1956 void DecodeL(TGsmuLex8& aPdu, TBool aAcceptTruncation);
1957 void InternalizeL(RReadStream& aStream);
1958 void ExternalizeL(RWriteStream& aStream) const;
1960 CSmsUserData* DuplicateL(TSmsFirstOctet& aFirstOctet, const TSmsDataCodingScheme& aDataCodingScheme) const;
1963 CSmsUserData(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsFirstOctet& aFirstOctet,const TSmsDataCodingScheme& aDataCodingScheme);
1965 TInt HeaderLength() const;
1966 TInt TotalHeaderLengthInUDLUnits() const;
1967 TInt BodyLengthInUDLUnits() const;
1968 void NewBodyL(TInt aLengthInChars);
1969 TBool HeaderPresent() const;
1970 void SetHeaderPresent(TBool aHeaderPresent);
1971 TInt TotalHeaderLengthInUDLUnits(TInt aIElen) const;
1975 CCnvCharacterSetConverter& iCharacterSetConverter;
1978 TSmsFirstOctet& iFirstOctet;
1979 const TSmsDataCodingScheme& iDataCodingScheme;
1980 CArrayPtrFlat<CSmsInformationElement> iInformationElementArray;
1984 enum TSmsMessageIndicationType
1986 EGsmSmsVoiceMessageWaiting =0x00,
1987 EGsmSmsFaxMessageWaiting =0x01,
1988 EGsmSmsElectronicMailMessageWaiting =0x02,
1989 EGsmSmsExtendedMessageTypeWaiting =0x03,
1992 enum TExtendedSmsIndicationType
1994 EGsmSmsNoExtendedMessageTypeIndication=0x00,
1995 EGsmSmsVideoMessageWaiting =0x01,
1996 EGsmSmsExtendedIndicationType2 =0x02,
1997 EGsmSmsExtendedIndicationType3 =0x03,
1998 EGsmSmsExtendedIndicationType4 =0x04,
1999 EGsmSmsExtendedIndicationType5 =0x05,
2000 EGsmSmsExtendedIndicationType6 =0x06,
2001 EGsmSmsExtendedIndicationType7 =0x07
2004 enum TSmsSpecialMessageIndicationTypeMask
2006 /** Define a mask for the bits representing */
2007 /** the TSmsMessageIndicationType and the */
2008 /** TExtendedSmsIndicationType */
2009 EGsmSmsSpecialMessageIndicationTypeMask = 0x1F
2012 enum TSmsMessageProfileType
2014 EGsmSmsProfileId1 =0x00,
2015 EGsmSmsProfileId2 =0x01,
2016 EGsmSmsProfileId3 =0x02,
2017 EGsmSmsProfileId4 =0x03
2020 enum TVoiceMailInfoType
2022 EGsmSmsVoiceMailNotification = 0x00,
2023 EGsmSmsVoiceMailDeleteConfirmation = 0x01
2026 /** SMSC Control Parameters Selective Status Report For Each Segment. Found in Submit. */
2027 enum TSmsSMSCControlParameters
2029 /** Status Report for short message transaction completed. */
2030 ESmsStatusReportTransactionCompleted=0x01,
2031 /** Status Report for permanent error when Service Centre is not making any more transfer attempts. */
2032 ESmsStatusReportPermanentError=0x02,
2033 /** Status Report for temporary error when Service Centre is not making any more transfer attempts. */
2034 ESmsStatusReportTemporaryError=0x04,
2035 /** Status Report for temporary error when Service Centre is still trying to transfer message segment. */
2036 ESmsStatusReportTemporaryErrorSCTrying=0x08,
2037 /** This is not Supported.
2038 Reserved for future use. */
2039 ESmsStatusReportForFutureUse1=0x10,
2040 /** This is not Supported.
2041 Reserved for future use. */
2042 ESmsStatusReportForFutureUse2=0x20,
2043 /** This is not Supported.
2044 A Status Report generated by this Short Message, due to a permanent error or last temporary error,
2045 cancels the SRR of the rest of the Short Messages in a concatenated message. */
2046 ESmsStatusReportCancelRestSRR=0x40,
2047 /** This is not Supported.
2048 Include original UDH into the Status Report. */
2049 ESmsStatusReportIncludeOriginalUDH=0x80,
2050 /** Mask. The 4 least significant bits, which are supported, are set. */
2051 ESmsSMSCControlParametersMask=0x0F
2055 /** Non Information Element Identifiers. */
2056 enum TSmsNonIEIdentifier
2058 ESmsTPSRRParameter = 0x00,
2059 ESmsIncompleteClass0MessageParameter = 0x01
2063 /** Status Report Scheme*/
2064 enum TSmsStatusReportScheme
2066 EDefaultScheme = 0x00,
2067 ETPSRRScheme = 0x01,
2068 EControlParametersScheme = 0x10
2073 * This is the base class for Enhanced Voice Mail Notifications and
2074 * Enhanced Voice Mail Delete Confirmations. It encapsulates
2075 * the attributes and encoding / decoding algorithms common to
2076 * both types of Enhanced Voice Mail Information Element.
2081 class CEnhancedVoiceMailBoxInformation : public CBase
2084 enum {KSmsMaxEnhancedVoiceMailSize = CSmsUserData::KSmsMaxUserDataSize - 3};
2085 // allow space in user data for the following bytes: user data header length, IE ID, IE Length
2087 IMPORT_C TVoiceMailInfoType Type() const;
2088 IMPORT_C void SetProfile(TSmsMessageProfileType aProfile);
2089 IMPORT_C TSmsMessageProfileType Profile() const;
2090 IMPORT_C void SetStorage(TBool aIsStored);
2091 IMPORT_C TBool Store() const;
2092 IMPORT_C void SetAlmostMaximumCapacity(TBool aIsAlmostFull);
2093 IMPORT_C TBool AlmostMaximumCapacity() const;
2094 IMPORT_C void SetMaximumCapacity(TBool aIsFull);
2095 IMPORT_C TBool MaximumCapacity() const;
2096 IMPORT_C TBool ExtensionIndicator() const;
2097 IMPORT_C void SetAccessAddressL(const TDesC& aParsedAddress);
2098 IMPORT_C void SetParsedAccessAddressL(const TGsmSmsTelNumber& aParsedAddress);
2099 IMPORT_C TPtrC AccessAddress() const;
2100 IMPORT_C void ParsedAccessAddress(TGsmSmsTelNumber& aParsedAddress) const;
2101 IMPORT_C void SetNumberOfVoiceMessages(TUint8 aNumber);
2102 IMPORT_C TUint8 NumberOfVoiceMessages() const;
2104 static CEnhancedVoiceMailBoxInformation* NewL();
2105 virtual ~CEnhancedVoiceMailBoxInformation();
2107 virtual TUint8* EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const;
2108 virtual void DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
2110 CEnhancedVoiceMailBoxInformation();
2111 CEnhancedVoiceMailBoxInformation(TVoiceMailInfoType aTVoiceMailInfoType);
2113 CEnhancedVoiceMailBoxInformation(const CEnhancedVoiceMailBoxInformation&);
2114 TBool operator==(const CEnhancedVoiceMailBoxInformation&);
2115 void operator=(const CEnhancedVoiceMailBoxInformation&);
2118 void NewBufferL(TInt aLength);
2119 void DoSetParsedAddressL(const TDesC& aAddress);
2121 TVoiceMailInfoType iType;
2123 TSmsMessageProfileType iProfile;
2127 TBool iExtensionIndicator;
2129 HBufC* iAccessAddress;
2130 TGsmSmsTypeOfAddress iTypeOfAddress;
2132 TUint8 iNumberOfVoiceMessages;
2144 * This class encapsulates the attributes of a VM Notification as described in 23.040 V6.5.0.
2145 * It is used as one of the attributes a Enhanced Voice Mail Notification.
2150 class CVoiceMailNotification : public CBase
2153 IMPORT_C void SetMessageId(TUint16 aMessageId);
2154 IMPORT_C TUint16 MessageId() const;
2155 IMPORT_C void SetMessageLength(TUint8 aLength);
2156 IMPORT_C TUint8 MessageLength() const;
2157 IMPORT_C void SetRetentionDays(TUint8 aDays);
2158 IMPORT_C TUint8 RetentionDays() const;
2159 IMPORT_C void SetPriorityIndication(TBool aPriority);
2160 IMPORT_C TBool PriorityIndication() const;
2161 IMPORT_C TBool MessageExtensionIndication() const;
2162 IMPORT_C void SetCallingLineIdentityL(TDesC& aLineIdentity);
2163 IMPORT_C TPtrC CallingLineIdentity() const;
2164 IMPORT_C void SetParsedCallingLineIdentityL(TGsmSmsTelNumber& aParsedAddress);
2165 IMPORT_C void ParsedCallingLineIdentity(TGsmSmsTelNumber& aParsedAddress) const;
2167 IMPORT_C static CVoiceMailNotification* NewL();
2168 IMPORT_C virtual ~CVoiceMailNotification();
2170 TUint8 SizeL(CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
2172 virtual TUint8* EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const;
2173 virtual void DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
2175 CVoiceMailNotification();
2176 CVoiceMailNotification(const CVoiceMailNotification&);
2177 TBool operator==(const CVoiceMailNotification&);
2178 void operator=(const CVoiceMailNotification&);
2180 void NewBufferL(TInt aLength);
2181 void NewExtensionL(TInt aLength);
2183 void DoSetParsedAddressL(const TDesC& aAddress);
2186 TUint8 iMessageLength;
2187 TUint8 iRetentionDays;
2189 TBool iPriorityIndication;
2190 TBool iMessageExtensionIndicator;
2192 HBufC* iCallingLineIdentity;
2193 TGsmSmsTypeOfAddress iTypeOfAddress;
2208 * This class encapsulates the attributes of an Enhanced Voice Mail Notification as described in
2209 * 9.2.3.24.13.1. An enhanced voice mail notification is added to a CSmsMessage using the
2210 * interface provided by the class CSmsEnhancedVoiceMailOperations.
2212 * Clients should be aware that 23.040 v6.5.0 specifies that this information element must fit into the
2213 * user data field of a single PDU. The amount of space available in the user data field depends on both
2214 * the number and size of the mandatory information elements that must also be present.
2215 * Intuitively the largest Enhanced Voice Mail information element can be added when no mandatory information
2216 * elements need to be encoded in the PDU. To achieve this, the CSmsMessage must be configured with
2217 * only the Enhanced Voice Mail Information Element and no other information elements or text.
2222 class CEnhancedVoiceMailNotification : public CEnhancedVoiceMailBoxInformation
2225 enum {KMaxNumberOfNotifications = 15};
2227 enum {KSmsNotificationBitMask = 0x0F};
2228 // bits mask for bit representing the number of voice mail notifications.
2230 IMPORT_C TUint8 NumberOfVoiceMails();
2231 IMPORT_C RPointerArray<CVoiceMailNotification>& GetVoiceMailNotifications();
2233 IMPORT_C static CEnhancedVoiceMailNotification* NewL();
2234 IMPORT_C ~CEnhancedVoiceMailNotification();
2236 TUint8* EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const;
2237 void DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
2239 CEnhancedVoiceMailNotification();
2240 CEnhancedVoiceMailNotification(const CEnhancedVoiceMailNotification&);
2241 TBool operator==(const CEnhancedVoiceMailNotification&);
2242 void operator=(const CEnhancedVoiceMailNotification&);
2243 void NewExtensionL(TInt aLength);
2246 TUint iNumberOfVMNotifications;
2248 RPointerArray<CVoiceMailNotification>* iNotifications;
2253 * This class encapsulates the attributes of a VM Deletion as described in 23.040 V6.5.0.
2256 * 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.
2297 class CEnhancedVoiceMailDeleteConfirmations : public
2298 CEnhancedVoiceMailBoxInformation
2301 enum {KMaxNumberOfNotifications = 31};
2303 enum {KSmsNotificationBitMask = 0x1F};
2304 // bits mask for bit representing the number of voice mail deletions.
2306 IMPORT_C TUint8 NumberOfDeletes();
2307 IMPORT_C RPointerArray<CVoiceMailDeletion>& GetVoiceMailDeletions();
2309 IMPORT_C static CEnhancedVoiceMailDeleteConfirmations* NewL();
2310 IMPORT_C ~CEnhancedVoiceMailDeleteConfirmations();
2312 TUint8* EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const;
2313 void DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
2315 CEnhancedVoiceMailDeleteConfirmations();
2316 CEnhancedVoiceMailDeleteConfirmations(const CEnhancedVoiceMailDeleteConfirmations&);
2317 TBool operator==(const CEnhancedVoiceMailDeleteConfirmations&);
2318 void operator=(const CEnhancedVoiceMailDeleteConfirmations&);
2321 void NewExtensionL(TInt aLength);
2324 RPointerArray<CVoiceMailDeletion>* iVoiceMailDeletions;
2328 #include <gsmuelem.inl>
2330 #endif // !defined __GSMUELEM_H__