1.1 --- a/epoc32/include/gsmuelem.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/gsmuelem.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,2329 @@
1.4 -gsmuelem.h
1.5 +// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +// This file define the classes for the different PDU elements
1.19 +//
1.20 +//
1.21 +
1.22 +
1.23 +
1.24 +/**
1.25 + @file
1.26 +*/
1.27 +
1.28 +#ifndef __GSMUELEM_H__
1.29 +#define __GSMUELEM_H__
1.30 +
1.31 +// Includes
1.32 +
1.33 +#include <e32std.h>
1.34 +#include <e32base.h>
1.35 +#include <charconv.h>
1.36 +#include <gsmunmspacemobph.h>
1.37 +
1.38 +class RFs;
1.39 +class RReadStream;
1.40 +class RWriteStream;
1.41 +class CSmsEMSBufferSegmenter;
1.42 +
1.43 +
1.44 +// class declarations
1.45 +
1.46 +/**
1.47 + * Decoding error.
1.48 + * @publishedAll
1.49 + * @released
1.50 + */
1.51 +const TInt KErrGsmuDecoding = KErrCorrupt;
1.52 +/**
1.53 + * @internalComponent
1.54 + */
1.55 +_LIT8(KMOSES,"\x40\x4d\x64\xd3\x50\x00");
1.56 +/**
1.57 + * @internalComponent
1.58 + */
1.59 +_LIT16(KNETWORK,"NETWORK");
1.60 +
1.61 +
1.62 +// Constants
1.63 +/**
1.64 + * @internalComponent
1.65 + */
1.66 +const TUint8 KSms7BitAlphabetEscapeChar=0x1b;
1.67 +
1.68 +
1.69 +/**
1.70 + * Thin wrapper over TLex8 to provide leaving functions when getting the next
1.71 + * character(s).
1.72 + *
1.73 + * These functions leave with KErrGsmuDecoding if there are insufficient characters
1.74 + * remaining.
1.75 + * @publishedAll
1.76 + * @released
1.77 + */
1.78 +class TGsmuLex8 : public TLex8
1.79 + {
1.80 + public:
1.81 + TGsmuLex8(const TDesC8& aSource);
1.82 + TUint8 GetL();
1.83 + void IncL(TInt aNumber = 1);
1.84 + TPtrC8 NextWithNoIncL(TInt aLength) const;
1.85 + TPtrC8 NextWithNoIncL(TInt aLength, TBool aAcceptTruncation) const;
1.86 + TPtrC8 NextAndIncL(TInt aLength);
1.87 +
1.88 + private:
1.89 + inline void LeaveL() const;
1.90 + };
1.91 +
1.92 +
1.93 +/**
1.94 + * Base class for performing all operations on octets.
1.95 + * @publishedAll
1.96 + * @released
1.97 + */
1.98 +class TSmsOctet
1.99 + {
1.100 +public:
1.101 + inline TSmsOctet(TInt aValue);
1.102 + inline TSmsOctet(TUint8 aValue = 0);
1.103 + inline operator TInt() const;
1.104 + const TSmsOctet& operator = (TInt aValue);
1.105 + inline void FillSemiOctets(TInt aNum);
1.106 + inline TInt SemiOctetsToNum() const;
1.107 + TUint8* EncodeL(TUint8* aPtr) const;
1.108 + inline void DecodeL(TGsmuLex8& aPdu);
1.109 + inline void InternalizeL(RReadStream& aStream);
1.110 + inline void ExternalizeL(RWriteStream& aStream) const;
1.111 +protected:
1.112 + /** Octet value. */
1.113 + TUint8 iValue;
1.114 + };
1.115 +
1.116 +
1.117 +/**
1.118 + * Bit masks for key first octet of an SMS PDU
1.119 + * @publishedAll
1.120 + * @released
1.121 + */
1.122 +class TSmsFirstOctet : public TSmsOctet
1.123 + {
1.124 +public:
1.125 +/** TP-MTI (Message Type Indicator) First octet of all SMS PDUs. */
1.126 + enum TSmsMTI
1.127 + {
1.128 + /** SMS-DELIVER or SMS-DELIVER-REPORT message. */
1.129 + ESmsMTIDeliverOrDeliverReport=0x00,
1.130 + /** SMS-SUBMIT or SMS-SUBMIT-REPORT message. */
1.131 + ESmsMTISubmitOrSubmitReport=0x01,
1.132 + /** SMS-STATUS or SMS-COMMAND message. */
1.133 + ESmsMTIStatusReportOrCommand=0x02,
1.134 +
1.135 + /** Mask for these bit flags. */
1.136 + ESmsMTIMask=0x03
1.137 + };
1.138 +
1.139 +/**
1.140 + * TP-UDHI (User Data Header Indicator) Found in first octet of
1.141 + * Submit and Deliver and possibly, Deliver Report and Status Report.
1.142 + */
1.143 + enum TSmsUDHI
1.144 + {
1.145 + /** User data header indicator not present. */
1.146 + ESmsUDHIHeaderNotPresent=0x00,
1.147 + /** User data header indicator present. */
1.148 + ESmsUDHIHeaderPresent=0x40,
1.149 +
1.150 + /** Mask for these bit flags. */
1.151 + ESmsUDHIMask=0x40
1.152 + };
1.153 +
1.154 +/** TP-RP (Reply Path) Found in first octet of Submit and Deliver. */
1.155 + enum TSmsReplyPath
1.156 + {
1.157 + /** Reply path does not exist. */
1.158 + ESmsReplyPathNone=0x00,
1.159 + /** Reply path exists. */
1.160 + ESmsReplyPathExists=0x080,
1.161 +
1.162 + /** Mask for these bit flags. */
1.163 + ESmsReplyPathMask=0x80
1.164 + };
1.165 +
1.166 +/** TP-MMS (More Messages To Send) Found in Deliver and Status Report. */
1.167 + enum TSmsMoreMessagesToSend
1.168 + {
1.169 + /** More messages to send. */
1.170 + ESmsMoreMessagesToSend=0x00,
1.171 + /** No more messages to send. */
1.172 + ESmsNoMoreMessagesToSend=0x04,
1.173 +
1.174 + /** Mask for these bit flags. */
1.175 + ESmsMoreMessagesToSendMask=0x04,
1.176 + };
1.177 +
1.178 +/** T-SRI (Status Report Indicator) Found in Status Report. */
1.179 + enum TSmsStatusReportIndicator
1.180 + {
1.181 + /** Status report is not going to be returned. */
1.182 + ESmsStatusReportNotReturned=0x00,
1.183 + /** Status report is going to be returned. */
1.184 + ESmsStatusReportReturned=0x20,
1.185 +
1.186 + /** Mask for these bit flags. */
1.187 + ESmsStatusReportIndicatorMask=0x20
1.188 + };
1.189 +
1.190 +/** TP-RD bit flags. */
1.191 + enum TSmsRejectDuplicates
1.192 + /**
1.193 + * T-RD (Reject Duplicates) Found in Submit
1.194 + */
1.195 + {
1.196 + /** Accept duplicates. */
1.197 + ESmsAcceptDuplicates=0x00,
1.198 + /** Reject duplicates. */
1.199 + ESmsRejectDuplicates=0x04,
1.200 +
1.201 + /** Mask for these bit flags. */
1.202 + ESmsRejectDuplicatesMask=0x04
1.203 + };
1.204 +
1.205 +/** T-SRQ (Status Report Qualifier). Found in Status Report. */
1.206 + enum TSmsStatusReportQualifier
1.207 + {
1.208 + /** Status report result of submit. */
1.209 + ESmsStatusReportResultOfSubmit=0x00,
1.210 + /** Status report result of command. */
1.211 + ESmsStatusReportResultOfCommand=0x20,
1.212 +
1.213 + /** Mask for these bit flags. */
1.214 + ESmsStatusReportQualifierMask=0x20
1.215 + };
1.216 +
1.217 +/** TP-VPF (Validity Period Format). Found in Submit. */
1.218 + enum TSmsValidityPeriodFormat
1.219 + {
1.220 + /** TP-VP field not present. */
1.221 + ESmsVPFNone=0x00,
1.222 + /** TP-VP field present. Enhanced format (7 octets). */
1.223 + ESmsVPFEnhanced=0x08, // was ESmsVPFReserved, the new GSM spec!
1.224 + /** TP-VP field present, relative validity format. */
1.225 + ESmsVPFInteger=0x10, // relative validity period
1.226 + /** TP-VP field present, absolute validity format. */
1.227 + ESmsVPFSemiOctet=0x18, // absolute validity period
1.228 +
1.229 + /** Mask for these bit flags. */
1.230 + ESmsVPFMask=0x18
1.231 + };
1.232 +
1.233 +/** TP-SRR (Status Report Request) Found in Submit and Command. */
1.234 + enum TSmsStatusReportRequest
1.235 + {
1.236 + /** Status report is not requested. */
1.237 + ESmsStatusReportNotRequested=0x00,
1.238 + /** Status report is requested. */
1.239 + ESmsStatusReportRequested=0x20,
1.240 +
1.241 + /** Mask for these bit flags. */
1.242 + ESmsStatusReportRequestMask=0x20
1.243 + };
1.244 +
1.245 +public:
1.246 + TSmsFirstOctet(TInt aValue=0);
1.247 + const TSmsFirstOctet& operator = (TInt aValue); // Review
1.248 + };
1.249 +
1.250 +
1.251 +/**
1.252 + * TP-FCS (Failure Cause) octet. For Deliver and Submit errors
1.253 + * @publishedAll
1.254 + * @released
1.255 + */
1.256 +class TSmsFailureCause : public TSmsOctet
1.257 + {
1.258 +public:
1.259 +/** TP-FCS flags. */
1.260 + enum TSmsFailureCauseError
1.261 + {
1.262 +// Reserved values
1.263 +// ....
1.264 +// ....
1.265 +// PID errors
1.266 + /** Telematic interworking not supported. */
1.267 + ESmsPIDErrorTelematicInterworkingNotSupported=0x80,
1.268 + /** Short message Type 0 not supported. */
1.269 + ESmsPIDErrorShortMessageType0NotSupported=0x81,
1.270 + /** Cannot replace short message. */
1.271 + ESmsPIDErrorCannotReplaceShortMessage=0x82,
1.272 + /** Reserved. */
1.273 + ESmsPIDErrorReserved1=0x83,
1.274 + /** Reserved. */
1.275 + ESmsPIDErrorReserved2=0x84,
1.276 + /** Reserved. */
1.277 + ESmsPIDErrorReserved3=0x85,
1.278 + /** Reserved. */
1.279 + ESmsPIDErrorReserved4=0x86,
1.280 + /** Reserved. */
1.281 + ESmsPIDErrorReserved5=0x87,
1.282 + /** Reserved. */
1.283 + ESmsPIDErrorReserved6=0x88,
1.284 + /** Reserved. */
1.285 + ESmsPIDErrorReserved7=0x89,
1.286 + /** Reserved. */
1.287 + ESmsPIDErrorReserved8=0x8A,
1.288 + /** Reserved. */
1.289 + ESmsPIDErrorReserved9=0x8B,
1.290 + /** Reserved. */
1.291 + ESmsPIDErrorReserved10=0x8C,
1.292 + /** Reserved. */
1.293 + ESmsPIDErrorReserved11=0x8D,
1.294 + /** Reserved. */
1.295 + ESmsPIDErrorReserved12=0x8E,
1.296 + /** Unspecified TP-PID error. */
1.297 + ESmsPIDErrorUnspecified=0x8F,
1.298 +// DCS errors
1.299 + /** Data coding scheme (alphabet) not supported. */
1.300 + ESmsDCSErrorAlphabetNotSupported=0x90,
1.301 + /** Message class not supported. */
1.302 + ESmsDCSErrorMessageClassNotSupported=0x91,
1.303 + /** Reserved. */
1.304 + ESmsDCSErrorReserved1=0x92,
1.305 + /** Reserved. */
1.306 + ESmsDCSErrorReserved2=0x93,
1.307 + /** Reserved. */
1.308 + ESmsDCSErrorReserved3=0x94,
1.309 + /** Reserved. */
1.310 + ESmsDCSErrorReserved4=0x95,
1.311 + /** Reserved. */
1.312 + ESmsDCSErrorReserved5=0x96,
1.313 + /** Reserved. */
1.314 + ESmsDCSErrorReserved6=0x97,
1.315 + /** Reserved. */
1.316 + ESmsDCSErrorReserved7=0x98,
1.317 + /** Reserved. */
1.318 + ESmsDCSErrorReserved8=0x99,
1.319 + /** Reserved. */
1.320 + ESmsDCSErrorReserved9=0x9A,
1.321 + /** Reserved. */
1.322 + ESmsDCSErrorReserved10=0x9B,
1.323 + /** Reserved. */
1.324 + ESmsDCSErrorReserved11=0x9C,
1.325 + /** Reserved. */
1.326 + ESmsDCSErrorReserved12=0x9D,
1.327 + /** Reserved. */
1.328 + ESmsDCSErrorReserved13=0x9E,
1.329 + /** Reserved. */
1.330 + ESmsDCSErrorUnspecified=0x9F,
1.331 +// CommandErrors
1.332 + /** Command cannot be actioned. */
1.333 + ESmsCommandErrorCannotBeActioned=0xA0,
1.334 + /** Command unsupported. */
1.335 + ESmsCommandErrorUnsupported=0xA1,
1.336 + /** Reserved. */
1.337 + ESmsCommandErrorReserved1=0xA2,
1.338 + /** Reserved. */
1.339 + ESmsCommandErrorReserved2=0xA3,
1.340 + /** Reserved. */
1.341 + ESmsCommandErrorReserved3=0xA4,
1.342 + /** Reserved. */
1.343 + ESmsCommandErrorReserved4=0xA5,
1.344 + /** Reserved. */
1.345 + ESmsCommandErrorReserved5=0xA6,
1.346 + /** Reserved. */
1.347 + ESmsCommandErrorReserved6=0xA7,
1.348 + /** Reserved. */
1.349 + ESmsCommandErrorReserved7=0xA8,
1.350 + /** Reserved. */
1.351 + ESmsCommandErrorReserved8=0xA9,
1.352 + /** Reserved. */
1.353 + ESmsCommandErrorReserved9=0xAA,
1.354 + /** Reserved. */
1.355 + ESmsCommandErrorReserved10=0xAB,
1.356 + /** Reserved. */
1.357 + ESmsCommandErrorReserved11=0xAC,
1.358 + /** Reserved. */
1.359 + ESmsCommandErrorReserved12=0xAD,
1.360 + /** Reserved. */
1.361 + ESmsCommandErrorReserved13=0xAE,
1.362 + /** Unspecified TP-Command error. */
1.363 + ESmsCommandErrorUnspecified=0xAF,
1.364 +//
1.365 + /** PDU not supported. */
1.366 + ESmsErrorPDUNotSupported=0xB0,
1.367 +// Reserved values
1.368 +// ....
1.369 +// ....
1.370 + /** SC busy. */
1.371 + ESmsErrorSCBusy=0xC0,
1.372 + /** No SC subscription. */
1.373 + ESmsErrorNoSCSubscription=0xC1,
1.374 + /** SC system failure. */
1.375 + ESmsErrorNoSCSystemFailure=0xC2,
1.376 + /** Invalid SME address. */
1.377 + ESmsErrorInvalidSMEAddress=0xC3,
1.378 + /** Destination SME barred. */
1.379 + ESmsErrorDestinationSMEBarred=0xC4,
1.380 + /** SM Rejected-Duplicate SM. */
1.381 + ESmsErrorSMRejectedDuplicateSM=0xC5,
1.382 + /** TP-VPF not supported. */
1.383 + ESmsErrorVPFNotSupported=0xC6,
1.384 + /** TP-VP not supported. */
1.385 + ESmsErrorVPNotSupported=0xC7,
1.386 +// Reserved values
1.387 +// ....
1.388 +// ....
1.389 + /** SIM SMS storage full. */
1.390 + ESmsErrorSIMSMSStorageFull=0xD0,
1.391 + /** No SMS storage capability in (U)SIM. */
1.392 + ESmsErrorNoSMSStorageCapabilityOnSIM=0xD1,
1.393 + /** Error in MS. */
1.394 + ESmsErrorErrorInMS=0xD2,
1.395 + /** Memory Capacity Exceeded. */
1.396 + ESmsErrorMemoryCapacityExceded=0xD3,
1.397 + /** (U)SIM Application Toolkit Busy. */
1.398 + ESmsErrorSIMApplicationToolkitBusy=0xD4,
1.399 + /** (U)SIM data download error. */
1.400 + ESmsErrorSIMDataDownloadError=0xD5,
1.401 +// Reserved values
1.402 +// ....
1.403 +// ....
1.404 + /** Value specific to an application. */
1.405 + ESmsApplicationError1=0xE0,
1.406 + /** Value specific to an application. */
1.407 + ESmsApplicationError2=0xE1,
1.408 + /** Value specific to an application. */
1.409 + ESmsApplicationError3=0xE2,
1.410 + /** Value specific to an application. */
1.411 + ESmsApplicationError4=0xE3,
1.412 + /** Value specific to an application. */
1.413 + ESmsApplicationError5=0xE4,
1.414 + /** Value specific to an application. */
1.415 + ESmsApplicationError6=0xE5,
1.416 + /** Value specific to an application. */
1.417 + ESmsApplicationError7=0xE6,
1.418 + /** Value specific to an application. */
1.419 + ESmsApplicationError8=0xE7,
1.420 + /** Value specific to an application. */
1.421 + ESmsApplicationError9=0xE8,
1.422 + /** Value specific to an application. */
1.423 + ESmsApplicationError10=0xE9,
1.424 + /** Value specific to an application. */
1.425 + ESmsApplicationError11=0xEA,
1.426 + /** Value specific to an application. */
1.427 + ESmsApplicationError12=0xEB,
1.428 + /** Value specific to an application. */
1.429 + ESmsApplicationError13=0xEC,
1.430 + /** Value specific to an application. */
1.431 + ESmsApplicationError14=0xED,
1.432 + /** Value specific to an application. */
1.433 + ESmsApplicationError15=0xEE,
1.434 + /** Value specific to an application. */
1.435 + ESmsApplicationError16=0xEF,
1.436 + /** Value specific to an application. */
1.437 + ESmsApplicationError17=0xF0,
1.438 + /** Value specific to an application. */
1.439 + ESmsApplicationError18=0xF1,
1.440 + /** Value specific to an application. */
1.441 + ESmsApplicationError19=0xF2,
1.442 + /** Value specific to an application. */
1.443 + ESmsApplicationError20=0xF3,
1.444 + /** Value specific to an application. */
1.445 + ESmsApplicationError21=0xF4,
1.446 + /** Value specific to an application. */
1.447 + ESmsApplicationError22=0xF5,
1.448 + /** Value specific to an application. */
1.449 + ESmsApplicationError23=0xF6,
1.450 + /** Value specific to an application. */
1.451 + ESmsApplicationError24=0xF7,
1.452 + /** Value specific to an application. */
1.453 + ESmsApplicationError25=0xF8,
1.454 + /** Value specific to an application. */
1.455 + ESmsApplicationError26=0xF9,
1.456 + /** Value specific to an application. */
1.457 + ESmsApplicationError27=0xFA,
1.458 + /** Value specific to an application. */
1.459 + ESmsApplicationError28=0xFB,
1.460 + /** Value specific to an application. */
1.461 + ESmsApplicationError29=0xFC,
1.462 + /** Value specific to an application. */
1.463 + ESmsApplicationError30=0xFD,
1.464 + /** Value specific to an application. */
1.465 + ESmsApplicationError31=0xFE,
1.466 +//
1.467 + /** Unspecified error cause. */
1.468 + ESmsErrorUnspecified=0xFF,
1.469 +
1.470 + /** @internalComponent */
1.471 + ESmsErrorFree=0x100
1.472 + };
1.473 +public:
1.474 + TSmsFailureCause();
1.475 + inline TInt Error() const;
1.476 + inline void SetError(TSmsFailureCauseError aError);
1.477 + };
1.478 +
1.479 +
1.480 +/**
1.481 + * TP-ST (Status Report) octet. Found in Status Report
1.482 + * @publishedAll
1.483 + * @released
1.484 + */
1.485 +class TSmsStatus : public TSmsOctet
1.486 + {
1.487 +public:
1.488 +/** TP-ST flag values. */
1.489 + enum TSmsStatusValue
1.490 + {
1.491 +// Short message transaction completed
1.492 + /** Short message received by the SME. */
1.493 + ESmsShortMessageReceivedBySME=0x00,
1.494 + /**
1.495 + * Short message forwarded by the SC to the SME but the SC is unable to confirm
1.496 + * delivery.
1.497 + */
1.498 + ESmsShortMessageForwardedBySCToSMEButUnconfirmedBySC=0x01,
1.499 + /** Short message replaced by the SC. */
1.500 + ESmsShortMessageReplacedBySC=0x02,
1.501 +// Reserved values
1.502 +// ....
1.503 +// ....
1.504 +// Temporary error, SC still trying to transfer SM
1.505 + /** Temporary error, SC still trying to transfer SM: congestion. */
1.506 + ESmsTempError1StatusCongestion=0x20,
1.507 + /** Temporary error, SC still trying to transfer SM: SME busy. */
1.508 + ESmsTempError1StatusSMEBusy=0x21,
1.509 + /** Temporary error, SC still trying to transfer SM: No response from SME. */
1.510 + ESmsTempError1StatusNoResponseFromSME=0x22,
1.511 + /** Temporary error, SC still trying to transfer SM: Service rejected. */
1.512 + ESmsTempError1StatusServiceRejected=0x23,
1.513 + /** Temporary error, SC still trying to transfer SM: Quality of service not available. */
1.514 + ESmsTempError1StatusQualityOfServiceNotAvailable=0x24,
1.515 + /** Temporary error, SC still trying to transfer SM: Error in SME. */
1.516 + ESmsTempError1StatusErrorInSME=0x25,
1.517 +// Reserved values
1.518 +// ....
1.519 +// ....
1.520 +// Permanent error, SC is not making any more transfer attempts
1.521 + /**
1.522 + * Permanent error, SC is not making any more transfer attempts: Remote procedure
1.523 + * error.
1.524 + */
1.525 + ESmsPermErrorRemoteProcedureError=0x40,
1.526 + /**
1.527 + * Permanent error, SC is not making any more transfer attempts: Incompatible
1.528 + * destination.
1.529 + */
1.530 + ESmsPermErrorIncompatibleDestination=0x41,
1.531 + /**
1.532 + * Permanent error, SC is not making any more transfer attempts: Connection rejected
1.533 + * by SME.
1.534 + */
1.535 + ESmsPermErrorConnectionRejectedBySME=0x42,
1.536 + /** Permanent error, SC is not making any more transfer attempts: Not obtainable. */
1.537 + ESmsPermErrorNotObtainable=0x43,
1.538 + /**
1.539 + * Permanent error, SC is not making any more transfer attempts: Quality of service
1.540 + * not available.
1.541 + */
1.542 + ESmsPermErrorQualityOfServiceNotAvailable2=0x44,
1.543 + /**
1.544 + * Permanent error, SC is not making any more transfer attempts: No interworking
1.545 + * available.
1.546 + */
1.547 + ESmsPermErrorNoInterworkingAvailable=0x45,
1.548 + /**
1.549 + * Permanent error, SC is not making any more transfer attempts: SM Validity Period
1.550 + * Expired.
1.551 + */
1.552 + ESmsPermErrorSMValidityPeriodExpired=0x46,
1.553 + /**
1.554 + * Permanent error, SC is not making any more transfer attempts: SM Deleted by
1.555 + * originating SME.
1.556 + */
1.557 + ESmsPermErrorSMDeletedByOriginatingSME=0x47,
1.558 + /**
1.559 + * Permanent error, SC is not making any more transfer attempts: SM Deleted by
1.560 + * SC Administration.
1.561 + */
1.562 + ESmsPermErrorSMDeletedBySCAdministration=0x48,
1.563 + /** Permanent error, SC is not making any more transfer attempts: SM does not exist. */
1.564 + ESmsPermErrorDoesNotExist=0x49,
1.565 +// Reserved values
1.566 +// ....
1.567 +// ....
1.568 +// Temporary error, SC is not making any more transfer attempts
1.569 + /** Temporary error, SC is not making any more transfer attempts: Congestion. */
1.570 + ESmsTempError2Congestion=0x60,
1.571 + /** Temporary error, SC is not making any more transfer attempts: SME Busy. */
1.572 + ESmsTempError2SMEBusy=0x61,
1.573 + /**
1.574 + * Temporary error, SC is not making any more transfer attempts: No response from
1.575 + * SME.
1.576 + */
1.577 + ESmsTempError2NoResponseFromSME=0x62,
1.578 + /** Temporary error, SC is not making any more transfer attempts: Service rejected. */
1.579 + ESmsTempError2ServiceRejected=0x63,
1.580 + /**
1.581 + * Temporary error, SC is not making any more transfer attempts: Quality of service
1.582 + * not available.
1.583 + */
1.584 + ESmsTempError2QualityOfServiceNotAvailable=0x64,
1.585 + /** Temporary error, SC is not making any more transfer attempts: Error in SME. */
1.586 + ESmsTempError2ErrorInSME=0x65,
1.587 +// Reserved values
1.588 +// ....
1.589 +// ....
1.590 + };
1.591 +public:
1.592 + TSmsStatus();
1.593 + inline TSmsStatus::TSmsStatusValue Status() const;
1.594 + inline void SetStatus(TSmsStatusValue aValue);
1.595 + };
1.596 +
1.597 +
1.598 +/**
1.599 + * TP-PI octet. Found in Reports and Commands
1.600 + * @publishedAll
1.601 + * @released
1.602 + */
1.603 +class TSmsParameterIndicator : public TSmsOctet
1.604 + {
1.605 +public:
1.606 +/** TP-PI bit flags. */
1.607 + enum TSmsPIBits
1.608 + {
1.609 + /** Protocol identifier present. */
1.610 + ESmsPIDProtocolIdentifierPresent=0x01,
1.611 + /** Data coding scheme present. */
1.612 + ESmsPIDDataCodingSchemePresent=0x02,
1.613 + /** User data present. */
1.614 + ESmsPIDUserDataPresent=0x04,
1.615 + /** Reserved. */
1.616 + ESmsPIDReserved1=0x08,
1.617 + /** Reserved. */
1.618 + ESmsPIDReserved2=0x10,
1.619 + /** Reserved. */
1.620 + ESmsPIDReserved3=0x20,
1.621 + /** Reserved. */
1.622 + ESmsPIDReserved4=0x40,
1.623 + /** Extension. */
1.624 + ESmsPIDExtension=0x80
1.625 + };
1.626 +public:
1.627 + TSmsParameterIndicator();
1.628 + inline TBool Extension() const;
1.629 + inline void SetExtension(TBool aExtension);
1.630 + inline TBool UserDataPresent() const;
1.631 + inline void SetUserDataPresent(TBool aPresent);
1.632 + inline TBool DataCodingSchemePresent() const;
1.633 + inline void SetDataCodingSchemePresent(TBool aPresent);
1.634 + inline TBool ProtocolIdentifierPresent() const;
1.635 + inline void SetProtocolIdentifierPresent(TBool aPresent);
1.636 + };
1.637 +
1.638 +// TSmsPID - conversion (None, Fax, Mail, etc.)
1.639 +
1.640 +/**
1.641 + * TP-PID PDU octet. Found in ALL 6 message types.
1.642 + * @publishedAll
1.643 + * @released
1.644 + */
1.645 +class TSmsProtocolIdentifier : public TSmsOctet
1.646 + {
1.647 +public:
1.648 +/** PID bits 7-6, which determine the meaning of the lower order bits. */
1.649 + enum TSmsPIDType
1.650 + {
1.651 + /** Telematic interworking. */
1.652 + ESmsPIDTelematicInterworking=0x00,
1.653 + /** Short message. */
1.654 + ESmsPIDShortMessageType=0x40,
1.655 + /** Reserved. */
1.656 + ESmsPIDReserved=0x80,
1.657 + /** SC specific use. */
1.658 + ESmsPIDSCSpecificUse=0xC0,
1.659 +
1.660 + /** Mask of bits 7-6. */
1.661 + ESmsPIDTypeMask=0xC0
1.662 + };
1.663 +
1.664 +/** Telematic device indicator flags. Bit 5 - When Bit 7 = 0, Bit 6 = 0 */
1.665 + enum TSmsTelematicDeviceIndicator
1.666 + {
1.667 + /** No telematic device. */
1.668 + ESmsNoTelematicDevice=0x00,
1.669 + /** Telematic device. */
1.670 + ESmsTelematicDevice=0x20,
1.671 +
1.672 + /** Telematic device indicator mask. */
1.673 + EPIDTelematicDeviceIndicatorMask=0x20
1.674 + };
1.675 +
1.676 +/** Telematic Interworking device type flags. Bits 4-0 - When Bit 5 = 1*/
1.677 + enum TSmsTelematicDeviceType
1.678 + {
1.679 + /** Device type is specific to this SC. */
1.680 + ESmsSCSpecificDevice=0x00,
1.681 + /** Telex. */
1.682 + ESmsTelex=0x01,
1.683 + /** Group 3 telefax. */
1.684 + ESmsGroup3TeleFax=0x02,
1.685 + /** Group 4 telefax. */
1.686 + ESmsGroup4TeleFax=0x03,
1.687 + /** Voice telephone. */
1.688 + ESmsVoiceTelephone=0x04,
1.689 + /** ERMES. */
1.690 + ESmsERMES=0x05,
1.691 + /** National Paging System. */
1.692 + ESmsNationalPagingSystem=0x06,
1.693 + /** Videotex. */
1.694 + ESmsVideotex=0x07,
1.695 + /** Teletex, carrier unspecified. */
1.696 + ESmsTeletexCarrierUnspecified=0x08,
1.697 + /** Teletex, PSPDN. */
1.698 + ESmsTeletexPSPDN=0x09,
1.699 + /** Teletex, CSPDN. */
1.700 + ESmsTeletexCSPDN=0x0A,
1.701 + /** Teletex, in analog PSTN. */
1.702 + ESmsTeletexAnaloguePSTN=0x0B,
1.703 + /** Teletex, in digital ISDN */
1.704 + ESmsTeletexDigitalISDN=0x0C,
1.705 + /** UCI (Universal Computer Interface, ETSI DE/PS 3 01-3). */
1.706 + ESmsUCI=0x0D,
1.707 + /** Reserved. */
1.708 + ESmsReserved1=0x0E,
1.709 + /** Reserved. */
1.710 + ESmsReserved2=0x0F,
1.711 + /** A message handling facility. */
1.712 + ESmsMessageHandlingFacility=0x10,
1.713 + /** X.400 message handling system. */
1.714 + ESmsX400MessageHandlingSystem=0x11,
1.715 + /** Internet Electronic Mail. */
1.716 + ESmsInternetElectronicMail=0x12,
1.717 + /** Reserved. */
1.718 + ESmsReserved3=0x13,
1.719 + /** Reserved. */
1.720 + ESmsReserved4=0x14,
1.721 + /** Reserved. */
1.722 + ESmsReserved5=0x15,
1.723 + /** Reserved. */
1.724 + ESmsReserved6=0x16,
1.725 + /** Reserved. */
1.726 + ESmsReserved7=0x17,
1.727 + /** Value specific to each SC. */
1.728 + ESmsSCSpecific1=0x18,
1.729 + /** Value specific to each SC. */
1.730 + ESmsSCSpecific2=0x19,
1.731 + /** Value specific to each SC. */
1.732 + ESmsSCSpecific3=0x1A,
1.733 + /** Value specific to each SC. */
1.734 + ESmsSCSpecific4=0x1B,
1.735 + /** Value specific to each SC. */
1.736 + ESmsSCSpecific5=0x1C,
1.737 + /** Value specific to each SC. */
1.738 + ESmsSCSpecific6=0x1D,
1.739 + /** Value specific to each SC. */
1.740 + ESmsSCSpecific7=0x1E,
1.741 + /** Value specific to each SC. */
1.742 + ESmsGsmMobileStation=0x1F,
1.743 +
1.744 + /** Mask for telematic device type bits. */
1.745 + ESmsTelematicDeviceTypeMask=0x1F
1.746 + };
1.747 +
1.748 +/** SM-AL protocol flag. No Telematic Interworking. Bits 4-0 - When Bit 5 = 0*/
1.749 + enum TSmsShortMessageALProtocol
1.750 + {
1.751 + /** Mask for SM-AL protocol flag bit. */
1.752 + ESmsShortMessageALProtocolMask=0x0F
1.753 + };
1.754 +
1.755 +/** Short Message Type flags. Bits 5-0 - When Bit 7 = 1, Bit 6 = 0*/
1.756 + enum TSmsShortMessageType
1.757 + {
1.758 + /** Short Message Type 0. */
1.759 + ESmsShortMessageType0=0x00,
1.760 + /** Replace Short Message Type 1. */
1.761 + ESmsReplaceShortMessageType1=0x01,
1.762 + /** Replace Short Message Type 2. */
1.763 + ESmsReplaceShortMessageType2=0x02,
1.764 + /** Replace Short Message Type 3. */
1.765 + ESmsReplaceShortMessageType3=0x03,
1.766 + /** Replace Short Message Type 4. */
1.767 + ESmsReplaceShortMessageType4=0x04,
1.768 + /** Replace Short Message Type 5. */
1.769 + ESmsReplaceShortMessageType5=0x05,
1.770 + /** Replace Short Message Type 6. */
1.771 + ESmsReplaceShortMessageType6=0x06,
1.772 + /** Replace Short Message Type 7. */
1.773 + ESmsReplaceShortMessageType7=0x07,
1.774 +// Reserved values
1.775 +// ....
1.776 +// ....
1.777 + /** Return Call Message. */
1.778 + ESmsReturnCallMesage=0x1F,
1.779 +// Reserved values
1.780 +// ....
1.781 +// ....
1.782 + ESmsAnsi136RData=0x3C,
1.783 + ESmsMEDataDownload=0x3D,
1.784 + /** ME De-personalization Short Message. */
1.785 + ESmsMEDepersonalizationShortMessage=0x3E,
1.786 + /** ME Data download. */
1.787 + ESmsSIMDataDownLoad=0x3F,
1.788 +
1.789 +// ESmsShortMessageTypeMask=0x1F
1.790 + /** Mask for Short Message type bits. */
1.791 + ESmsShortMessageTypeMask=0x3F
1.792 + };
1.793 +public:
1.794 + TSmsProtocolIdentifier();
1.795 + inline TSmsPIDType PIDType() const;
1.796 + inline void SetPIDType(TSmsPIDType aSmsPIDType);
1.797 + TSmsTelematicDeviceIndicator TelematicDeviceIndicator() const;
1.798 + void SetTelematicDeviceIndicator(TSmsTelematicDeviceIndicator aIndicator);
1.799 + TSmsTelematicDeviceType TelematicDeviceType() const;
1.800 + void SetTelematicDeviceType(TSmsTelematicDeviceType aDeviceType);
1.801 + TInt ShortMessageALProtocol() const;
1.802 + void SetShortMessageALProtocol(TSmsShortMessageALProtocol aProtocol);
1.803 + TInt ShortMessageType() const;
1.804 + void SetShortMessageType(TSmsShortMessageType aShortMessageType);
1.805 + };
1.806 +
1.807 +
1.808 +/**
1.809 + * TP-DCS Data Coding Scheme defined in 3GPP TS 23.038.
1.810 + *
1.811 + * The data coding scheme is not always present in an GSM SMS PDU (CSmsPDU).
1.812 + * It is always present for a SUBMIT (CSmsSubmit) and a DELIVER (CSmsDeliver),
1.813 + * and is sometimes present for a DELIVER REPORT (CSmsDeliverReport), a SUBMIT
1.814 + * REPORT (CSmsSubmitReport) or a STATUS REPORT (CSmsStatusReport), depending
1.815 + * on the parameter indicator (TSmsParameterIndicator).
1.816 + * @publishedAll
1.817 + * @released
1.818 + */
1.819 +class TSmsDataCodingScheme : public TSmsOctet
1.820 + {
1.821 +public:
1.822 +/** Flags for bits 7-4, which determine the meaning of the lower order bits. */
1.823 + enum TSmsDCSBits7To4
1.824 + {
1.825 + /** Text is uncompressed, no class information. */
1.826 + ESmsDCSTextUncompressedWithNoClassInfo=0x00,
1.827 + /** Text is uncompressed, class information present. */
1.828 + ESmsDCSTextUncompressedWithClassInfo=0x10,
1.829 + /** Text is compressed, no class information. */
1.830 + ESmsDCSTextCompressedWithNoClassInfo=0x20,
1.831 + /** Text is compressed, class information present. */
1.832 + ESmsDCSTextCompressedWithClassInfo=0x30,
1.833 +
1.834 + /** Auto Deletion, Text is uncompressed, no class information. */
1.835 + ESmsDCSAutoDelNoClassInfoUncompressedText=0x40,
1.836 + /** Auto Deletion, Text is uncompressed, class information present. */
1.837 + ESmsDCSAutoDelClassInfoUncompressedText=0x50,
1.838 + /** Auto Deletion, Text is compressed, no class information. */
1.839 + ESmsDCSAutoDelNoClassInfoCompressedText=0x60,
1.840 + /** Auto Deletion, Text is compressed, class information present. */
1.841 + ESmsDCSAutoDelClassInfoTextCompressedText=0x70,
1.842 +
1.843 + /** Reserved. */
1.844 + ESmsDCSReserved1=0x40,
1.845 + /** Reserved. */
1.846 + ESmsDCSReserved2=0x50,
1.847 + /** Reserved. */
1.848 + ESmsDCSReserved3=0x60,
1.849 + /** Reserved. */
1.850 + ESmsDCSReserved4=0x70,
1.851 + /** Reserved. */
1.852 + ESmsDCSReserved5=0x80,
1.853 + /** Reserved. */
1.854 + ESmsDCSReserved6=0x90,
1.855 + /** Reserved. */
1.856 + ESmsDCSReserved7=0xA0,
1.857 + /** Reserved. */
1.858 + ESmsDCSReserved8=0xB0,
1.859 +
1.860 +
1.861 +
1.862 + /** Message Waiting Indication Group: Discard Message. */
1.863 + ESmsDCSMessageWaitingIndicationDiscardMessage=0xC0,
1.864 +
1.865 + /** Message Waiting Indication Group (7 bit). */
1.866 + ESmsDCSMessageWaitingIndication7Bit=0xD0, // 7 bit User data
1.867 + /** Message Waiting Indication Group (UCS2). */
1.868 + ESmsDCSMessageWaitingIndicationUCS2=0xE0, // unicode User data
1.869 +
1.870 + /** Text uncompressed, 7 bit or 8 bit. */
1.871 + ESmsDCSTextUncompressed7BitOr8Bit=0xF0,
1.872 +
1.873 + /** Masks bits 7 to 4. */
1.874 + ESmsDCSBits7To4Mask=0xF0
1.875 + };
1.876 +
1.877 +/** Message Marked for Automatic Deletion */
1.878 + enum TAutomaticDeletionGroup
1.879 + {
1.880 + ESmsDCSAutomaticDeletion = 0x40,
1.881 + ESmsDCSAutomaticDeletionMask = 0xC0
1.882 + };
1.883 +
1.884 +/** Alphabet bit flags. */
1.885 + enum TSmsAlphabet
1.886 + {
1.887 + /** GSM 7 bit default alphabet. */
1.888 + ESmsAlphabet7Bit=0x00,
1.889 + /** 8-bit data. */
1.890 + ESmsAlphabet8Bit=0x04,
1.891 + /** UCS2. */
1.892 + ESmsAlphabetUCS2=0x08,
1.893 + /** Reserved. */
1.894 + ESmsAlphabetReserved=0x0C,
1.895 +
1.896 + /** Mask for these bit flags. */
1.897 + ESmsAlphabetMask=0x0C,
1.898 + };
1.899 +/** Message Class bit flags. */
1.900 + enum TSmsClass
1.901 + {
1.902 + /** Class 0. */
1.903 + ESmsClass0=0x00,
1.904 + /** Class 1. */
1.905 + ESmsClass1=0x01,
1.906 + /** Class 2. */
1.907 + ESmsClass2=0x02,
1.908 + /** Class 3. */
1.909 + ESmsClass3=0x03,
1.910 +
1.911 + /** Mask for these bit flags. */
1.912 + ESmsClassMask=0x03,
1.913 + };
1.914 +
1.915 +/** Indication Sense bit flags. */
1.916 + enum TSmsIndicationState
1.917 + {
1.918 + /** Indication inactive. */
1.919 + ESmsIndicationInactive=0x00,
1.920 + /** Indication active. */
1.921 + ESmsIndicationActive=0x08,
1.922 +
1.923 + /** Mask for these bit flags. */
1.924 + ESmsIndicationStateMask=0x08
1.925 + };
1.926 +/** Indication Type bit flags. */
1.927 + enum TSmsIndicationType
1.928 + {
1.929 + /** Voicemail Message Waiting. */
1.930 + ESmsVoicemailMessageWaiting=0x00,
1.931 + /** Fax Message Waiting. */
1.932 + ESmsFaxMessageWaiting=0x01,
1.933 + /** Electronic Mail Message Waiting. */
1.934 + ESmsElectronicMailMessageWaiting=0x02,
1.935 + /** Other Message Waiting. */
1.936 + ESmsFaxOtherMessageWaiting=0x03,
1.937 +
1.938 + /** Mask for these bit flags. */
1.939 + ESmsIndicationTypeMask=0x03
1.940 + };
1.941 +
1.942 +public:
1.943 + TSmsDataCodingScheme();
1.944 + inline TSmsDCSBits7To4 Bits7To4() const;
1.945 + inline void SetBits7To4(TSmsDCSBits7To4 aBits7To4);
1.946 +// Normal SMS settings
1.947 + TBool TextCompressed() const;
1.948 + void SetTextCompressed(TBool aCompressed);
1.949 + TSmsAlphabet Alphabet() const;
1.950 + void SetAlphabet(TSmsAlphabet aAlphabet);
1.951 + TBool Class(TSmsClass& aClass) const;
1.952 + void SetClass(TBool aClassDefined,TSmsClass aClass);
1.953 +// Message waiting settings
1.954 + TSmsIndicationState IndicationState() const;
1.955 + void SetIndicationState(TSmsIndicationState aState);
1.956 + TSmsIndicationType IndicationType() const;
1.957 + void SetIndicationType(TSmsIndicationType aType);
1.958 + };
1.959 +
1.960 +
1.961 +/**
1.962 + * Specifies alternative 7bit encoding combinations to use if the default
1.963 + * GSM encoding cannot encode the message as 7bit without data loss.
1.964 + *
1.965 + * @publishedAll
1.966 + * @released
1.967 + */
1.968 +enum TSmsEncoding
1.969 + {
1.970 + /** Default value meaning that no alternative encoding would be used. */
1.971 + ESmsEncodingNone = 0,
1.972 +
1.973 + /**
1.974 + * Allows the use of the Turkish Single Shift table in place of the
1.975 + * default GSM shift table.
1.976 + *
1.977 + * @note If used during encoding there will be a 3 octet cost in the User Data
1.978 + * Header.
1.979 + */
1.980 + ESmsEncodingTurkishSingleShift = 0x11,
1.981 +
1.982 + /**
1.983 + * Allows the use of the Turkish Locking Shift table in place of the
1.984 + * default GSM alphabet table.
1.985 + *
1.986 + * @note If used during encoding there will be a 3 octet cost in the User Data
1.987 + * Header.
1.988 + * @note This encoding should only be used if the relevant national
1.989 + * regulatory body has requested its use.
1.990 + */
1.991 + ESmsEncodingTurkishLockingShift = 0x12,
1.992 +
1.993 + /**
1.994 + * Allows the use of the Turkish Locking Shift and/or the Turkish Single
1.995 + * Shift tables in place of the default GSM alphabet and shift tables.
1.996 + *
1.997 + * @note If used during encoding there will be a 3 or 6 octet cost in the User Data
1.998 + * Header.
1.999 + * @note This encoding should only be used if the relevant national
1.1000 + * regulatory body has requested its use.
1.1001 + */
1.1002 + ESmsEncodingTurkishLockingAndSingleShift = 0x13,
1.1003 +
1.1004 + /**
1.1005 + * Allows the use of the Spanish Single Shift table in place of the
1.1006 + * default GSM shift table.
1.1007 + *
1.1008 + * @note If used during encoding there will be a 3 octet cost in the User Data
1.1009 + * Header.
1.1010 + */
1.1011 + ESmsEncodingSpanishSingleShift = 0x21,
1.1012 +
1.1013 + /**
1.1014 + * Allows the use of the Portuguese Single Shift table in place of the
1.1015 + * default GSM shift table.
1.1016 + *
1.1017 + * @note If used during encoding there will be a 3 octet cost in the User Data
1.1018 + * Header.
1.1019 + */
1.1020 + ESmsEncodingPortugueseSingleShift = 0x31,
1.1021 +
1.1022 + /**
1.1023 + * Allows the use of the Portuguese Locking Shift table in place of the
1.1024 + * default GSM alphabet table.
1.1025 + *
1.1026 + * @note If used during encoding there will be a 3 octet cost in the User Data
1.1027 + * Header.
1.1028 + * @note This encoding should only be used if the relevant national
1.1029 + * regulatory body has requested its use.
1.1030 + */
1.1031 + ESmsEncodingPortugueseLockingShift = 0x32,
1.1032 +
1.1033 + /**
1.1034 + * Allows the use of the Portuguese Locking Shift and/or the Portuguese Single
1.1035 + * Shift tables in place of the default GSM alphabet and shift tables.
1.1036 + *
1.1037 + * @note If used during encoding there will be a 3 or 6 octet cost in the User Data
1.1038 + * Header.
1.1039 + * @note This encoding should only be used if the relevant national
1.1040 + * regulatory body has requested its use.
1.1041 + */
1.1042 + ESmsEncodingPortugueseLockingAndSingleShift = 0x33
1.1043 + };
1.1044 +
1.1045 +
1.1046 +/**
1.1047 + * GSM National Language Identifiers.
1.1048 + *
1.1049 + * @publishedAll
1.1050 + * @released
1.1051 + */
1.1052 +enum TSmsNationalLanguageIdentifier
1.1053 + {
1.1054 + /** Turkish. */
1.1055 + ESmsNationalLanguageIdentifierTurkish = 1,
1.1056 +
1.1057 + /** Spanish. */
1.1058 + ESmsNationalLanguageIdentifierSpanish = 2,
1.1059 +
1.1060 + /** Portuguese. */
1.1061 + ESmsNationalLanguageIdentifierPortuguese = 3
1.1062 + };
1.1063 +
1.1064 +
1.1065 +/**
1.1066 + * Utility to provide piecewise character set conversion to / from unpacked user
1.1067 + * data elements.
1.1068 + * @publishedAll
1.1069 + * @released
1.1070 + */
1.1071 +class CSmsAlphabetConverter : public CBase
1.1072 + {
1.1073 +public:
1.1074 +// Construction and destruction methods
1.1075 + IMPORT_C static CSmsAlphabetConverter* NewLC(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsDataCodingScheme::TSmsAlphabet aSmsAlphabet,TBool aIsBinary);
1.1076 + IMPORT_C ~CSmsAlphabetConverter();
1.1077 +
1.1078 +// Enumerated types and structs
1.1079 +/**
1.1080 + * Indicates whether there is a fixed relationship between the number of characters
1.1081 + * and user data elements.
1.1082 + *
1.1083 + * For example, Unicode characters always map to a single SMS UCS2 character,
1.1084 + * while a Unicode character might map to one, two or more SMS 7-bit User Data
1.1085 + * Elements (extended 7-bit characters).
1.1086 + */
1.1087 + enum TSmsAlphabetWidthConversion
1.1088 + {
1.1089 + /** Fixed relationship. */
1.1090 + ESmsAlphabetWidthConversionFixed,
1.1091 + /** Variable relationship. */
1.1092 + ESmsAlphabetWidthConversionVariable
1.1093 + };
1.1094 +
1.1095 + struct TSmsAlphabetConversionProperties
1.1096 +/**
1.1097 + * Holds the number of user data elements required for conversion from a single
1.1098 + * native character.
1.1099 + *
1.1100 + * This value is applicable only if the iWidthConversion parameter is ESmsAlphabetWidthConversionFixed.
1.1101 + */
1.1102 + {
1.1103 + /** Alphabet width conversion. */
1.1104 + TSmsAlphabetWidthConversion iWidthConversion;
1.1105 + /** Number of user data elements required for conversion from a single native character */
1.1106 + TInt iUDElementsPerNativeCharacter;
1.1107 + };
1.1108 +
1.1109 +public:
1.1110 +// Conversion methods
1.1111 + void ConversionPropertiesL(TSmsAlphabetConversionProperties& aConversionProperties) const;
1.1112 + IMPORT_C TPtrC8 ConvertFromNativeL(const TDesC& aNativeCharacters);
1.1113 + IMPORT_C TPtrC8 ConvertFromNativeL(const TDesC& aNativeCharacters,
1.1114 + TSmsEncoding aEncoding,
1.1115 + TInt& aNumberOfUnconvertibleCharacters,
1.1116 + TInt& aNumberOfDowngradedCharacters);
1.1117 + IMPORT_C TPtrC ConvertToNativeL(const TDesC8& aUDElements);
1.1118 + IMPORT_C TPtrC ConvertToNativeL(const TDesC8& aUDElements, TSmsEncoding aEncoding);
1.1119 +
1.1120 + TBool IsSupportedL(TChar aChar);
1.1121 + TBool IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters,
1.1122 + TInt& aIndexOfFirstUnconvertibleCharacter);
1.1123 +
1.1124 + TBool IsSupportedL(TChar aChar, TSmsEncoding aEncoding, TBool& aIsDowngrade,
1.1125 + TBool& aRequiresAlternativeEncoding);
1.1126 + TBool IsSupportedL(const TDesC& aDes, TSmsEncoding aEncoding,
1.1127 + TInt& aNumberOfUnconvertibleCharacters,
1.1128 + TInt& aNumberOfDowngradedCharacters,
1.1129 + TInt& aNumberRequiringAlternativeEncoding,
1.1130 + TInt& aIndexOfFirstUnconvertibleCharacter);
1.1131 +
1.1132 +// Alternative Encoding methods
1.1133 + TSmsEncoding FindBestAlternativeEncodingL(const TDesC& aNativeCharacters,
1.1134 + TSmsEncoding aSuggestedEncoding);
1.1135 + void ConfirmAlternativeEncoderL(TSmsEncoding aEncoding) const;
1.1136 +
1.1137 +// Unconverted buffer methods
1.1138 + inline void ResetUnconvertedNativeCharacters();
1.1139 + inline void ResetUnconvertedUDElements();
1.1140 + inline TPtrC UnconvertedNativeCharacters();
1.1141 + inline TPtrC8 UnconvertedUDElements();
1.1142 +
1.1143 +// Getter / setters
1.1144 + inline TSmsDataCodingScheme::TSmsAlphabet Alphabet() const;
1.1145 +
1.1146 +private:
1.1147 +// Private construction methods
1.1148 + CSmsAlphabetConverter(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsDataCodingScheme::TSmsAlphabet aSmsAlphabet,TBool aIsBinary);
1.1149 + void ConstructL();
1.1150 +
1.1151 +// Private conversion preparation methods
1.1152 + void PrepareForConversionFromNativeL(TSmsEncoding aEncoding);
1.1153 + void PrepareForConversionToNativeL(TSmsEncoding aEncoding);
1.1154 +
1.1155 +// Private Alternative Encoding methods
1.1156 + void GetAlternativeEncoderIDL(TSmsEncoding aEncoding, TUint& aEncoderID) const;
1.1157 +
1.1158 +// Private buffer helper methods
1.1159 + TPtr16 CheckAllocBufferL(HBufC16** aBuffer,TInt aMaxLength,TInt aUsedLength);
1.1160 + TPtr8 CheckAllocBufferL(HBufC8** aBuffer,TInt aMaxLength,TInt aUsedLength);
1.1161 +
1.1162 +// Private constants
1.1163 + enum
1.1164 + {
1.1165 + KMaxSmsAlphabetConversionRetries=4
1.1166 + };
1.1167 +
1.1168 + enum
1.1169 + {
1.1170 + KMinSmsAlphabetConversionAllocIncrement=4
1.1171 + };
1.1172 +
1.1173 +private:
1.1174 +
1.1175 + CCnvCharacterSetConverter& iCharacterSetConverter;
1.1176 + RFs& iFs;
1.1177 + TSmsDataCodingScheme::TSmsAlphabet iSmsAlphabet;
1.1178 + TBool iIsBinary;
1.1179 + HBufC* iConvertedNativeCharacters;
1.1180 + HBufC8* iConvertedUDElements;
1.1181 + HBufC* iUnconvertedNativeCharacters;
1.1182 + TPtr iUnconvertedNativeCharactersPtr;
1.1183 + HBufC8* iUnconvertedUDElements;
1.1184 + TPtr8 iUnconvertedUDElementsPtr;
1.1185 + };
1.1186 +
1.1187 +
1.1188 +/** Type-of-number, as defined in ETSI 3GPP TS 23.040. */
1.1189 +enum TGsmSmsTypeOfNumber
1.1190 + {
1.1191 + /**
1.1192 + * Unknown, used when the user or network has no a priori information about the
1.1193 + * numbering plan.
1.1194 + * In this case, the Address-Value field is organized according to the network
1.1195 + * dialling plan, e.g. prefix or escape digits might be present.
1.1196 + */
1.1197 + EGsmSmsTONUnknown=0x00,
1.1198 + /**
1.1199 + * International number.
1.1200 + * The international format shall be accepted also when the message is destined
1.1201 + * to a recipient in the same country as the MSC or as the SGSN.
1.1202 + */
1.1203 + EGsmSmsTONInternationalNumber=0x10,
1.1204 + /**
1.1205 + * National number.
1.1206 + * Prefix or escape digits shall not be included.
1.1207 + */
1.1208 + EGsmSmsTONNationalNumber=0x20,
1.1209 + /**
1.1210 + * Network specific number.
1.1211 + * Administration/service number specific to the serving network, e.g. used to
1.1212 + * access an operator.
1.1213 + */
1.1214 + EGsmSmsTONNetworkSpecificNumber=0x30,
1.1215 + /**
1.1216 + * Subscriber number.
1.1217 + * Used when a specific short number representation is stored in one or more
1.1218 + * SCs as part of a higher layer application. (Note that "Subscriber number"
1.1219 + * shall only be used in connection with the proper PID referring to this application).
1.1220 + */
1.1221 + EGsmSmsTONSubscriberNumber=0x40,
1.1222 + /**
1.1223 + * Alpha-numeric.
1.1224 + * Coded according to 3GPP TS 23.038 - GSM 7-bit default alphabet.
1.1225 + */
1.1226 + EGsmSmsTONAlphaNumeric=0x50,
1.1227 + EGsmSmsTONAbbreviatedNumber=0x60, ///< Abbreviated number
1.1228 + EGsmSmsTONReserverved=0x70, ///< Reserved for extension
1.1229 + };
1.1230 +
1.1231 +/** Numbering-plan-identification defined in ETSI 3GPP TS 23.040. */
1.1232 +enum TGsmSmsNumberingPlanIdentification
1.1233 + {
1.1234 + /** Unknown. */
1.1235 + EGsmSmsNPIUnknown=0x00,
1.1236 + /** ISDN telephone numbering plan. */
1.1237 + EGsmSmsNPIISDNTelephoneNumberingPlan=0x01,
1.1238 + /** Data numbering plan. */
1.1239 + EGsmSmsNPIDataNumberingPlan=0x03,
1.1240 + /** Telex numbering plan. */
1.1241 + EGsmSmsNPITelexNumberingPlan=0x04,
1.1242 + /** National numbering plan. */
1.1243 + EGsmSmsNPINationalNumberingPlan=0x08,
1.1244 + /** Private numbering plan. */
1.1245 + EGsmSmsNPIPrivateNumberingPlan=0x09,
1.1246 + /** ERMES numbering plan. */
1.1247 + EGsmSmsNPIERMESNumberingPlan=0x0A,
1.1248 + /** Reserved for extension. */
1.1249 + EGsmSmsNPIReservedForExtension=0x0F,
1.1250 + };
1.1251 +
1.1252 +
1.1253 +/**
1.1254 + * Type-of-address field defined in ETSI 3GPP TS 23.040
1.1255 + * @publishedAll
1.1256 + * @released
1.1257 + */
1.1258 +class TGsmSmsTypeOfAddress : public TSmsOctet
1.1259 + {
1.1260 + public:
1.1261 +
1.1262 + enum
1.1263 + {
1.1264 + EGsmSmsFirstBitMask=0x80,
1.1265 + EGsmSmsTONMask=0x70,
1.1266 + EGsmSmsNPIMask=0x0F
1.1267 + };
1.1268 +
1.1269 + public:
1.1270 +
1.1271 + inline TGsmSmsTypeOfAddress(TInt aValue = EGsmSmsFirstBitMask);
1.1272 + inline TGsmSmsTypeOfAddress(TGsmSmsTypeOfNumber aTon, TGsmSmsNumberingPlanIdentification aNPI);
1.1273 +
1.1274 + inline TGsmSmsTypeOfNumber TON() const;
1.1275 + inline void SetTON(TGsmSmsTypeOfNumber aTON);
1.1276 +
1.1277 + inline TGsmSmsNumberingPlanIdentification NPI() const;
1.1278 + /**
1.1279 + * Sets the numbering plan identification.
1.1280 + * @param aNPI Numbering plan identification
1.1281 + */
1.1282 + inline void SetNPI(TGsmSmsNumberingPlanIdentification aNPI);
1.1283 +
1.1284 + /**
1.1285 + * Converts type of number and numbering plan identification information from
1.1286 + * the type of address parameter to the NMobilePhone::TMobileTON and NMobilePhone::TMobileNPI
1.1287 + * format.
1.1288 + *
1.1289 + * @param aTON On return, type of number
1.1290 + * @param aNPI On return, numbering plan identification
1.1291 + */
1.1292 + IMPORT_C void ConvertToETelMM(NMobilePhone::TMobileTON& aTON, NMobilePhone::TMobileNPI& aNPI) const;
1.1293 + /**
1.1294 + * Sets type of number and numbering plan identification information from values
1.1295 + * specified in NMobilePhone::TMobileTON and NMobilePhone::TMobileNPI formats.
1.1296 + *
1.1297 + * @param aTON Type of number
1.1298 + * @param aNPI Numbering plan identification
1.1299 + */
1.1300 + IMPORT_C void SetFromETelMM(NMobilePhone::TMobileTON aTON, NMobilePhone::TMobileNPI aNPI);
1.1301 + };
1.1302 +
1.1303 +/** Maximum length of a Service Centre address = 21, as defined in ETSI GSM 04.11. */
1.1304 +const TInt TGsmSmsTelNumberMaxLen = 21;
1.1305 +
1.1306 +
1.1307 +/**
1.1308 + * Encapsulation of basic address information
1.1309 + * @publishedAll
1.1310 + * @released
1.1311 + */
1.1312 +class TGsmSmsTelNumber
1.1313 + {
1.1314 + public:
1.1315 + /**
1.1316 + * @internalComponent
1.1317 + * If the address is an alphanumeric address,
1.1318 + * it can represent a voice message waiting indicator
1.1319 + * as defined in the Common PCN Handset Specification
1.1320 + * v4.2. The specification allows other indicators
1.1321 + * to be defined in the future.
1.1322 + */
1.1323 + enum TTypeOfIndicator
1.1324 + {
1.1325 + EVoiceMessageWaitingIndicator = 0
1.1326 + };
1.1327 +
1.1328 + private:
1.1329 + enum TCPHSIndicatorTypeByte
1.1330 + {
1.1331 + ECPSHIndicatorTypeBitMask = 0x7E,
1.1332 + ECPSHVoiceMailId = 0x10,
1.1333 + ECPHSIndicatorSettingBit = 0x01,
1.1334 + ECPHSVoiceMailSettingSpareBit = 0x80
1.1335 + };
1.1336 +
1.1337 + enum TCPHSIndicatorIdByte
1.1338 + {
1.1339 + ECPSHIndicatorIdBitMask = 0x7E,
1.1340 + ECPSHIndicatorId = 0x00,
1.1341 + ECPSHIndicatorIdSettingBit = 0x01,
1.1342 + ECTSHVoiceMailIndicatorSpareBit = 0x80
1.1343 + };
1.1344 +
1.1345 + enum TCPHSByteIndex
1.1346 + {
1.1347 + ECPHSLength = 0,
1.1348 + ECPHSAddressType = 1,
1.1349 + ECPHSAddressIndicatorType = 2,
1.1350 + ECPHSAddressIndicatorId = 3,
1.1351 + ECPHSSizeOfAddressField = 4
1.1352 + };
1.1353 +
1.1354 + public:
1.1355 + inline TGsmSmsTelNumber();
1.1356 +
1.1357 + IMPORT_C TBool IsInstanceOf(TTypeOfIndicator aType);
1.1358 +
1.1359 + public:
1.1360 +
1.1361 + TGsmSmsTypeOfAddress iTypeOfAddress; ///< The type-of-address of iTelNumber
1.1362 + TBuf<TGsmSmsTelNumberMaxLen> iTelNumber; ///< Telephone number, in format of iTypeOfAddress
1.1363 + };
1.1364 +
1.1365 +
1.1366 +/**
1.1367 + * CSmsAddress - address of the recipient or SC
1.1368 + * @publishedAll
1.1369 + * @released
1.1370 + */
1.1371 +class CSmsAddress : public CBase
1.1372 + {
1.1373 +public:
1.1374 + enum
1.1375 + {
1.1376 + KSmsAddressMaxAddressValueLength=10,// octets
1.1377 + KSmsAddressMaxAddressLength = 12 // address length, type and address value
1.1378 + };
1.1379 +public:
1.1380 + static CSmsAddress* NewL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs);
1.1381 + ~CSmsAddress();
1.1382 + TPtrC Address() const;
1.1383 + void SetAddressL(const TDesC& aAddress);
1.1384 + void ParsedAddress(TGsmSmsTelNumber& aParsedAddress) const;
1.1385 + void SetParsedAddressL(const TGsmSmsTelNumber& aParsedAddress);
1.1386 +
1.1387 + void SetRawAddressL(TGsmSmsTypeOfAddress aTypeOfAddress, TPtrC aBuffer);
1.1388 + TGsmSmsTypeOfAddress& TypeOfAddress();
1.1389 +
1.1390 + TUint8 SizeL();
1.1391 +
1.1392 + TUint8* EncodeL(TUint8* aPtr) const;
1.1393 + void DecodeL(TGsmuLex8& aPdu);
1.1394 + void InternalizeL(RReadStream& aStream);
1.1395 + void ExternalizeL(RWriteStream& aStream) const;
1.1396 +private:
1.1397 + CSmsAddress(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs);
1.1398 + void NewBufferL(TInt aLength);
1.1399 + void DoSetParsedAddressL(const TDesC& aAddress);
1.1400 +private:
1.1401 +
1.1402 + CCnvCharacterSetConverter& iCharacterSetConverter;
1.1403 + RFs& iFs;
1.1404 + TGsmSmsTypeOfAddress iTypeOfAddress;
1.1405 + HBufC* iBuffer;
1.1406 + };
1.1407 +
1.1408 +
1.1409 +/**
1.1410 + * TP-SCTS Service Center Time Stamp Found in Deliver, Submit Report, Status Report,
1.1411 + * @publishedAll
1.1412 + * @released
1.1413 + */
1.1414 +class TSmsServiceCenterTimeStamp
1.1415 + {
1.1416 +public:
1.1417 + enum {KSmsMaxTimeZoneNumQuarterHours=79};
1.1418 +/** Time zone offset sign bit. */
1.1419 + enum TSmsTimeZoneSignBit
1.1420 + {
1.1421 + /** Positive offset. */
1.1422 + ESmsTimeZonePositive=0x00,
1.1423 + /** Negative offset. */
1.1424 + ESmsTimeZoneNegative=0x08,
1.1425 +
1.1426 + /** Mask for these bit flags. */
1.1427 + ESmsTimeZoneSignBitMask=0x08
1.1428 + };
1.1429 +public:
1.1430 + TSmsServiceCenterTimeStamp();
1.1431 + inline TInt TimeOffset() const;
1.1432 + void SetTimeOffset(TInt aNumQuarterHours);
1.1433 + inline const TTime& Time() const;
1.1434 + inline void SetTime(const TTime& aTime);
1.1435 + TUint8* EncodeL(TUint8* aPtr) const;
1.1436 + void DecodeL(TGsmuLex8& aPdu, TInt& aTimeError);
1.1437 + void InternalizeL(RReadStream& aStream);
1.1438 + void ExternalizeL(RWriteStream& aStream) const;
1.1439 +private:
1.1440 + TTime iTime;
1.1441 + TInt iTimeZoneNumQuarterHours;
1.1442 + };
1.1443 +
1.1444 +
1.1445 +/**
1.1446 + * TP-VP Validity Period Found in SUBMIT PDUs.
1.1447 + *
1.1448 + * The validy period format is encoded in the first octet of the PDU, so the
1.1449 + * class takes a reference to a TSmsFirstOctet. The validty period specifies
1.1450 + * the length of time the PDU lives in the service center if the PDU cannot be
1.1451 + * immediately delivered.
1.1452 + * @publishedAll
1.1453 + * @released
1.1454 + */
1.1455 +class TSmsValidityPeriod
1.1456 + {
1.1457 +public:
1.1458 +/** Validity period units (in minutes). */
1.1459 + enum TValidityPeriodUnitInMinutes
1.1460 + {
1.1461 + /** Five minutes. */
1.1462 + EFiveMinuteUnitInMinutes=5,
1.1463 + /** 30 minutes. */
1.1464 + EHalfHourUnitInMinutes=30,
1.1465 + /** 1 day. */
1.1466 + EOneDayUnitInMinutes=1440,
1.1467 + /** 1 week. */
1.1468 + EOneWeekUnitInMinutes=7*EOneDayUnitInMinutes
1.1469 + };
1.1470 +/** Limits for validity period units (in minutes). */
1.1471 + enum TValidityPeriodUnitLimitInMinutes
1.1472 + {
1.1473 + /** Limit for 5 minute validity period unit. */
1.1474 + EFiveMinuteUnitLimitInMinutes=24*EHalfHourUnitInMinutes,
1.1475 + /** Limit for 30 minute validity period unit. */
1.1476 + EHalfHourUnitLimitInMinutes=EOneDayUnitInMinutes,
1.1477 + /** Limit for 1 day validity period unit. */
1.1478 + EOneDayUnitLimitInMinutes=30*EOneDayUnitInMinutes,
1.1479 + /** Limit for 1 week validity period unit. */
1.1480 + EOneWeekUnitLimitInMinutes=63*EOneWeekUnitInMinutes
1.1481 + };
1.1482 +/** Limits for validity period units. */
1.1483 + enum TValidityPeriodLimit
1.1484 + {
1.1485 + /** Limit for 5 minute validity period unit. */
1.1486 + EFiveMinuteUnitLimit=143,
1.1487 + /** Limit for 30 minute validity period unit. */
1.1488 + EHalfHourUnitLimit=167,
1.1489 + /** Limit for 1 day validity period unit. */
1.1490 + EOneDayUnitLimit=196,
1.1491 + /** Limit for 1 week validity period unit. */
1.1492 + EOneWeekUnitLimit=255
1.1493 + };
1.1494 +public:
1.1495 + TSmsValidityPeriod(TSmsFirstOctet& aFirstOctet);
1.1496 + inline TSmsFirstOctet::TSmsValidityPeriodFormat ValidityPeriodFormat() const;
1.1497 + inline void SetValidityPeriodFormat(TSmsFirstOctet::TSmsValidityPeriodFormat aValidityPeriodFormat);
1.1498 + inline const TTimeIntervalMinutes& TimeIntervalMinutes() const;
1.1499 + inline void SetTimeIntervalMinutes(const TTimeIntervalMinutes& aTimeIntervalMinutes);
1.1500 + TTime Time() const;
1.1501 + TUint8* EncodeL(TUint8* aPtr) const;
1.1502 + void DecodeL(TGsmuLex8& aPdu);
1.1503 + void InternalizeL(RReadStream& aStream);
1.1504 + void ExternalizeL(RWriteStream& aStream) const;
1.1505 +private:
1.1506 + TSmsFirstOctet& iFirstOctet;
1.1507 + TTimeIntervalMinutes iTimeIntervalMinutes;
1.1508 + };
1.1509 +
1.1510 +class CEmsInformationElement;
1.1511 +
1.1512 +/**
1.1513 + * SMS element defined in TP-UD octet.
1.1514 + *
1.1515 + * This element is found in Deliver, Deliver Report, Submit, Submit Report, Status
1.1516 + * Report and Command type messages.
1.1517 + * @publishedAll
1.1518 + * @released
1.1519 + */
1.1520 +class CSmsInformationElement : public CBase
1.1521 + {
1.1522 +public:
1.1523 +/** TP-UD Information Element Identifier. */
1.1524 + enum TSmsInformationElementIdentifier
1.1525 + {
1.1526 + /** Concatenated short messages, 8-bit reference number. */
1.1527 + ESmsIEIConcatenatedShortMessages8BitReference=0x00,
1.1528 + /** Special SMS Message Indication. */
1.1529 + ESmsIEISpecialSMSMessageIndication=0x01,
1.1530 + /** Reserved. */
1.1531 + ESmsIEIReserved=0x02,
1.1532 + /** Value not used to avoid misinterpretation as line feed character. */
1.1533 + ESmsIEIValueNotUsed=0x03,
1.1534 + /** Application port addressing scheme, 8 bit address. */
1.1535 + ESmsIEIApplicationPortAddressing8Bit=0x04,
1.1536 + /** Application port addressing scheme, 16 bit address */
1.1537 + ESmsIEIApplicationPortAddressing16Bit=0x05,
1.1538 + /** SMSC Control Parameters. */
1.1539 + ESmsIEISMSCControlParameters=0x06,
1.1540 + /** UDH Source Indicator. */
1.1541 + ESmsIEIUDHSourceIndicator=0x07,
1.1542 + /** Concatenated short message, 16-bit reference number. */
1.1543 + ESmsIEIConcatenatedShortMessages16BitReference=0x08,
1.1544 + /** Wireless Control Message Protocol. */
1.1545 + ESmsIEIWirelessControlMessageProtocol=0x09,
1.1546 + ESmsIEIRFC822EmailHeader=0x20,
1.1547 +
1.1548 +
1.1549 +// Enhanced SMS IE
1.1550 + ESmsEnhancedTextFormatting=0x0A,
1.1551 + ESmsEnhancedPredefinedSound=0x0B,
1.1552 + ESmsEnhancedUserDefinedSound=0x0C,
1.1553 + ESmsEnhancedPredefinedAnimation=0x0D,
1.1554 + ESmsEnhancedLargeAnimation=0x0E,
1.1555 + ESmsEnhancedSmallAnimation=0x0F,
1.1556 + ESmsEnhancedLargePicture=0x10,
1.1557 + ESmsEnhancedSmallPicture=0x11,
1.1558 + ESmsEnhancedVariablePicture=0x12,
1.1559 + ESmsEnhancedUserPromptIndicator=0x13,
1.1560 + ESmsEnhancedExtendedObject=0x14,
1.1561 + ESmsEnhancedReusedExtendedObject=0x15,
1.1562 + ESmsEnhancedCompressionControl=0x16,
1.1563 + ESmsEnhancedODI=0x17,
1.1564 + ESmsEnhancedStandardWVG=0x18,
1.1565 + ESmsEnhancedCharacterSizeWVG=0x19,
1.1566 + ESmsEnhancedextendedObjectDataRequest=0x1A,
1.1567 +
1.1568 +// Control Information Elements
1.1569 +
1.1570 + ESmsHyperLinkFormat = 0x21,
1.1571 + ESmsReplyAddressFormat = 0x22,
1.1572 + ESmsEnhanceVoiceMailInformation = 0x23,
1.1573 + ESmsNationalLanguageSingleShift = 0x24,
1.1574 + ESmsNationalLanguageLockingShift = 0x25,
1.1575 +
1.1576 +// Reserved values
1.1577 +// ....
1.1578 +// ....
1.1579 + /** SIM Toolkit Security Header 1. */
1.1580 + ESmsIEISIMToolkitSecurityHeaders1=0x70,
1.1581 + /** SIM Toolkit Security Header 2. */
1.1582 + ESmsIEISIMToolkitSecurityHeaders2=0x71,
1.1583 + /** SIM Toolkit Security Header 3. */
1.1584 + ESmsIEISIMToolkitSecurityHeaders3=0x72,
1.1585 + /** SIM Toolkit Security Header 4. */
1.1586 + ESmsIEISIMToolkitSecurityHeaders4=0x73,
1.1587 + /** SIM Toolkit Security Header 5. */
1.1588 + ESmsIEISIMToolkitSecurityHeaders5=0x74,
1.1589 + /** SIM Toolkit Security Header 6. */
1.1590 + ESmsIEISIMToolkitSecurityHeaders6=0x75,
1.1591 + /** SIM Toolkit Security Header 7. */
1.1592 + ESmsIEISIMToolkitSecurityHeaders7=0x76,
1.1593 + /** SIM Toolkit Security Header 8. */
1.1594 + ESmsIEISIMToolkitSecurityHeaders8=0x77,
1.1595 + /** SIM Toolkit Security Header 9. */
1.1596 + ESmsIEISIMToolkitSecurityHeaders9=0x78,
1.1597 + /** SIM Toolkit Security Header 10. */
1.1598 + ESmsIEISIMToolkitSecurityHeaders10=0x79,
1.1599 + /** SIM Toolkit Security Header 11. */
1.1600 + ESmsIEISIMToolkitSecurityHeaders11=0x7A,
1.1601 + /** SIM Toolkit Security Header 12. */
1.1602 + ESmsIEISIMToolkitSecurityHeaders12=0x7B,
1.1603 + /** SIM Toolkit Security Header 13. */
1.1604 + ESmsIEISIMToolkitSecurityHeaders13=0x7C,
1.1605 + /** SIM Toolkit Security Header 14. */
1.1606 + ESmsIEISIMToolkitSecurityHeaders14=0x7D,
1.1607 + /** SIM Toolkit Security Header 15. */
1.1608 + ESmsIEISIMToolkitSecurityHeaders15=0x7E,
1.1609 + /** SIM Toolkit Security Header 16. */
1.1610 + ESmsIEISIMToolkitSecurityHeaders16=0x7F,
1.1611 + /** SME to SME specific use 1. */
1.1612 + ESmsIEISMEToSMESpecificUse1=0x80,
1.1613 + /** SME to SME specific use 2. */
1.1614 + ESmsIEISMEToSMESpecificUse2=0x81,
1.1615 + /** SME to SME specific use 3. */
1.1616 + ESmsIEISMEToSMESpecificUse3=0x82,
1.1617 + /** SME to SME specific use 4. */
1.1618 + ESmsIEISMEToSMESpecificUse4=0x83,
1.1619 + /** SME to SME specific use 5. */
1.1620 + ESmsIEISMEToSMESpecificUse5=0x84,
1.1621 + /** SME to SME specific use 6. */
1.1622 + ESmsIEISMEToSMESpecificUse6=0x85,
1.1623 + /** SME to SME specific use 7. */
1.1624 + ESmsIEISMEToSMESpecificUse7=0x86,
1.1625 + /** SME to SME specific use 8. */
1.1626 + ESmsIEISMEToSMESpecificUse8=0x87,
1.1627 + /** SME to SME specific use 9. */
1.1628 + ESmsIEISMEToSMESpecificUse9=0x88,
1.1629 + /** SME to SME specific use 10. */
1.1630 + ESmsIEISMEToSMESpecificUse10=0x89,
1.1631 + /** SME to SME specific use 11. */
1.1632 + ESmsIEISMEToSMESpecificUse11=0x8A,
1.1633 + /** SME to SME specific use 12. */
1.1634 + ESmsIEISMEToSMESpecificUse12=0x8B,
1.1635 + /** SME to SME specific use 13. */
1.1636 + ESmsIEISMEToSMESpecificUse13=0x8C,
1.1637 + /** SME to SME specific use 14. */
1.1638 + ESmsIEISMEToSMESpecificUse14=0x8D,
1.1639 + /** SME to SME specific use 15. */
1.1640 + ESmsIEISMEToSMESpecificUse15=0x8E,
1.1641 + /** SME to SME specific use 16. */
1.1642 + ESmsIEISMEToSMESpecificUse16=0x8F,
1.1643 + /** SME to SME specific use 17. */
1.1644 + ESmsIEISMEToSMESpecificUse17=0x90,
1.1645 + /** SME to SME specific use 18. */
1.1646 + ESmsIEISMEToSMESpecificUse18=0x91,
1.1647 + /** SME to SME specific use 19. */
1.1648 + ESmsIEISMEToSMESpecificUse19=0x92,
1.1649 + /** SME to SME specific use 20. */
1.1650 + ESmsIEISMEToSMESpecificUse20=0x93,
1.1651 + /** SME to SME specific use 21. */
1.1652 + ESmsIEISMEToSMESpecificUse21=0x94,
1.1653 + /** SME to SME specific use 22. */
1.1654 + ESmsIEISMEToSMESpecificUse22=0x95,
1.1655 + /** SME to SME specific use 23. */
1.1656 + ESmsIEISMEToSMESpecificUse23=0x96,
1.1657 + /** SME to SME specific use 24. */
1.1658 + ESmsIEISMEToSMESpecificUse24=0x97,
1.1659 + /** SME to SME specific use 25. */
1.1660 + ESmsIEISMEToSMESpecificUse25=0x98,
1.1661 + /** SME to SME specific use 26. */
1.1662 + ESmsIEISMEToSMESpecificUse26=0x99,
1.1663 + /** SME to SME specific use 27. */
1.1664 + ESmsIEISMEToSMESpecificUse27=0x9A,
1.1665 + /** SME to SME specific use 28. */
1.1666 + ESmsIEISMEToSMESpecificUse28=0x9B,
1.1667 + /** SME to SME specific use 29. */
1.1668 + ESmsIEISMEToSMESpecificUse29=0x9C,
1.1669 + /** SME to SME specific use 30. */
1.1670 + ESmsIEISMEToSMESpecificUse30=0x9D,
1.1671 + /** SME to SME specific use 31. */
1.1672 + ESmsIEISMEToSMESpecificUse31=0x9E,
1.1673 + /** SME to SME specific use 32. */
1.1674 + ESmsIEISMEToSMESpecificUse32=0x9F,
1.1675 +// Reserved values
1.1676 +// ....
1.1677 +// ....
1.1678 + /** SC specific use 1. */
1.1679 + ESmsIEISCSpecificUse1=0xC0,
1.1680 + /** SC specific use 2. */
1.1681 + ESmsIEISCSpecificUse2=0xC1,
1.1682 + /** SC specific use 3. */
1.1683 + ESmsIEISCSpecificUse3=0xC2,
1.1684 + /** SC specific use 4. */
1.1685 + ESmsIEISCSpecificUse4=0xC3,
1.1686 + /** SC specific use 5. */
1.1687 + ESmsIEISCSpecificUse5=0xC4,
1.1688 + /** SC specific use 6. */
1.1689 + ESmsIEISCSpecificUse6=0xC5,
1.1690 + /** SC specific use 7. */
1.1691 + ESmsIEISCSpecificUse7=0xC6,
1.1692 + /** SC specific use 8. */
1.1693 + ESmsIEISCSpecificUse8=0xC7,
1.1694 + /** SC specific use 9. */
1.1695 + ESmsIEISCSpecificUse9=0xC8,
1.1696 + /** SC specific use 10. */
1.1697 + ESmsIEISCSpecificUse10=0xC9,
1.1698 + /** SC specific use 11. */
1.1699 + ESmsIEISCSpecificUse11=0xCA,
1.1700 + /** SC specific use 12. */
1.1701 + ESmsIEISCSpecificUse12=0xCB,
1.1702 + /** SC specific use 13. */
1.1703 + ESmsIEISCSpecificUse13=0xCC,
1.1704 + /** SC specific use 14. */
1.1705 + ESmsIEISCSpecificUse14=0xCD,
1.1706 + /** SC specific use 15. */
1.1707 + ESmsIEISCSpecificUse15=0xCE,
1.1708 + /** SC specific use 16. */
1.1709 + ESmsIEISCSpecificUse16=0xCF,
1.1710 + /** SC specific use 17. */
1.1711 + ESmsIEISCSpecificUse17=0xD0,
1.1712 + /** SC specific use 18. */
1.1713 + ESmsIEISCSpecificUse18=0xD1,
1.1714 + /** SC specific use 19. */
1.1715 + ESmsIEISCSpecificUse19=0xD2,
1.1716 + /** SC specific use 20. */
1.1717 + ESmsIEISCSpecificUse20=0xD3,
1.1718 + /** SC specific use 21. */
1.1719 + ESmsIEISCSpecificUse21=0xD4,
1.1720 + /** SC specific use 22. */
1.1721 + ESmsIEISCSpecificUse22=0xD5,
1.1722 + /** SC specific use 23. */
1.1723 + ESmsIEISCSpecificUse23=0xD6,
1.1724 + /** SC specific use 24. */
1.1725 + ESmsIEISCSpecificUse24=0xD7,
1.1726 + /** SC specific use 25. */
1.1727 + ESmsIEISCSpecificUse25=0xD8,
1.1728 + /** SC specific use 26. */
1.1729 + ESmsIEISCSpecificUse26=0xD9,
1.1730 + /** SC specific use 27. */
1.1731 + ESmsIEISCSpecificUse27=0xDA,
1.1732 + /** SC specific use 28. */
1.1733 + ESmsIEISCSpecificUse28=0xDB,
1.1734 + /** SC specific use 29. */
1.1735 + ESmsIEISCSpecificUse29=0xDC,
1.1736 + /** SC specific use 30. */
1.1737 + ESmsIEISCSpecificUse30=0xDD,
1.1738 + /** SC specific use 31. */
1.1739 + ESmsIEISCSpecificUse31=0xDE,
1.1740 + /** SC specific use 32. */
1.1741 + ESmsIEISCSpecificUse32=0xDF,
1.1742 + /**
1.1743 + * @internalComponent
1.1744 + */
1.1745 + ESmsIEMaximum = 0xFF
1.1746 + };
1.1747 +
1.1748 +public:
1.1749 + // Exported functions
1.1750 + IMPORT_C TSmsInformationElementIdentifier Identifier() const;
1.1751 + IMPORT_C TPtr8 Data();
1.1752 + IMPORT_C const TDesC8& Data() const;
1.1753 +public:
1.1754 + static CSmsInformationElement* NewL(TSmsInformationElementIdentifier aIdentifier,const TDesC8& aData);
1.1755 + static CSmsInformationElement* NewL();
1.1756 + ~CSmsInformationElement();
1.1757 +
1.1758 + TUint8* EncodeL(TUint8* aPtr) const;
1.1759 + void DecodeL(TGsmuLex8& aPdu);
1.1760 + void InternalizeL(RReadStream& aStream);
1.1761 + void ExternalizeL(RWriteStream& aStream) const;
1.1762 + void ConstructL(const TDesC8& aData);
1.1763 + TUint Length() const;
1.1764 +protected:
1.1765 + void NewDataL(TInt aLength);
1.1766 + inline CSmsInformationElement(TSmsInformationElementIdentifier aInformationElementIdentifier);
1.1767 +protected:
1.1768 + TSmsOctet iIdentifier;
1.1769 + HBufC8* iData;
1.1770 + };
1.1771 +
1.1772 +
1.1773 +/**
1.1774 + * @internalComponent
1.1775 + *
1.1776 + * TSmsInformationElementCategories
1.1777 + *
1.1778 + * This class specifies where information elements are located SMS Messages.
1.1779 + *
1.1780 + * It specifies which PDUs each information element can be located in.
1.1781 + *
1.1782 + * The SMS stack uses this information when encoding and decoding SMS messages.
1.1783 + */
1.1784 +class TSmsInformationElementCategories
1.1785 + {
1.1786 +public:
1.1787 +
1.1788 + // Comment, table approach probably is not necessary here.
1.1789 + // Simply use a switch statement as cannot index directly into table.
1.1790 +
1.1791 + enum TInformationElementCategory
1.1792 + {
1.1793 + EEmsInformationElement,
1.1794 + ECtrlMandatoryInEveryPDUAndWithIdenticalValues, // e.g. Port Addresses
1.1795 + ECtrlMandatoryInEveryPDUMultipleInstancesPerPDU, // e.g. Special SMS Message Indication
1.1796 + ECtrlMandatoryInEveryPDUButWithValueSpecificToPDU, // e.g. Email Header / Concatenation Elements, SMSC Parameters
1.1797 + ECtrlMandatoryIn1stPDUOnly, // e.g. Reply Address
1.1798 + ECtrlSingleInstanceOnly, // e.g. Enhanced Voice Mail
1.1799 + ECtrlMultipleInstancesAllowed, // e.g. Hyperlink format
1.1800 + ENumberOfCategories
1.1801 + };
1.1802 +
1.1803 +typedef CSmsInformationElement::TSmsInformationElementIdentifier TInformationElementId;
1.1804 +
1.1805 +private:
1.1806 + enum TIndexToCategory
1.1807 + {
1.1808 + EIndexEmsInformationElement,
1.1809 + EIndexCtrlMandatoryInEveryPDUAndWithIdenticalValues,
1.1810 + EIndexCtrlMandatoryInEveryPDUMultipleInstancesPerPDU,
1.1811 + EIndexCtrlMandatoryInEveryPDUButWithValueSpecificToPDU,
1.1812 + EIndexCtrlMandatoryIn1stPDUOnly,
1.1813 + EIndexCtrlSingleInstanceOnly,
1.1814 + EIndexCtrlMultipleInstancesAllowed,
1.1815 + EIndexCtrlOptionalInEveryPDUWithValueSpecificToPDU,
1.1816 + ENumberOfIndices
1.1817 + };
1.1818 +
1.1819 +public:
1.1820 + static TBool GetCategoryDefinition(TInformationElementId aId, TInformationElementCategory& aCategory);
1.1821 +private:
1.1822 + static TBool TranslateCategoryToIndex(TInformationElementId aId, TInt& index);
1.1823 + TSmsInformationElementCategories() {};
1.1824 + ~TSmsInformationElementCategories() {};
1.1825 + void operator=(TSmsInformationElementCategories& aCategory) {(void) aCategory; };
1.1826 + TBool operator==(TSmsInformationElementCategories& aCategory){(void) aCategory; return EFalse; };
1.1827 + static const TInformationElementCategory categories[ENumberOfIndices];
1.1828 + };
1.1829 +
1.1830 +
1.1831 +/**
1.1832 + * @internalComponent
1.1833 + */
1.1834 +typedef CSmsInformationElement::TSmsInformationElementIdentifier TSmsId;
1.1835 +
1.1836 +
1.1837 +/**
1.1838 + * Mobile originated SMS sent to the network requesting an action or information
1.1839 + * on the status of a previously sent SUBMIT.
1.1840 + *
1.1841 + * This is internal and not intended for use.
1.1842 + * @publishedAll
1.1843 + * @released
1.1844 + */
1.1845 +class CSmsCommandData : public CBase
1.1846 + {
1.1847 +public:
1.1848 + enum {KSmsMaxDataSize=157};
1.1849 +public:
1.1850 + static CSmsCommandData* NewL(TSmsFirstOctet& aFirstOctet);
1.1851 + ~CSmsCommandData();
1.1852 +
1.1853 + inline TInt NumInformationElements() const;
1.1854 + CSmsInformationElement& InformationElement(TInt aIndex) const;
1.1855 + CSmsInformationElement*& InformationElementPtr(TInt aIndex);
1.1856 + TBool InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,
1.1857 + TInt& aIndex) const;
1.1858 + void AddInformationElementL(const TSmsId aIdentifier,const TDesC8& aData);
1.1859 + void RemoveInformationElement(TInt aIndex);
1.1860 +
1.1861 + inline TInt MaxDataLength() const;
1.1862 + TPtrC8 Data() const;
1.1863 + void SetDataL(const TDesC8& aData);
1.1864 +
1.1865 + TUint8* EncodeL(TUint8* aPtr) const;
1.1866 + void DecodeL(TGsmuLex8& aPdu);
1.1867 + void InternalizeL(RReadStream& aStream);
1.1868 + void ExternalizeL(RWriteStream& aStream) const;
1.1869 +private:
1.1870 + CSmsCommandData(TSmsFirstOctet& aFirstOctet);
1.1871 +
1.1872 + TInt HeaderLength() const;
1.1873 + TInt TotalHeaderLengthInUDLUnits() const;
1.1874 +
1.1875 + TBool HeaderPresent() const;
1.1876 + void SetHeaderPresent(TBool aHeaderPresent);
1.1877 +
1.1878 +private:
1.1879 + TSmsFirstOctet& iFirstOctet;
1.1880 + CArrayPtrFlat <CSmsInformationElement> iInformationElementArray;
1.1881 + HBufC8* iBuffer;
1.1882 + };
1.1883 +
1.1884 +
1.1885 +/**
1.1886 + * Enumerations and operations for SMS commands.
1.1887 + * @publishedAll
1.1888 + * @released
1.1889 + */
1.1890 +class TSmsCommandType : public TSmsOctet
1.1891 + {
1.1892 +public:
1.1893 +/** Command types. */
1.1894 + enum TSmsCommandTypeValue
1.1895 + {
1.1896 + /** Enquiry. */
1.1897 + ESmsCommandTypeEnquiry=0x00,
1.1898 + /** Cancel. */
1.1899 + ESmsCommandTypeCancel=0x01,
1.1900 + /** Delete. */
1.1901 + ESmsCommandTypeDelete=0x02,
1.1902 + /** Enable Status Report Request. */
1.1903 + ESmsCommandTypeEnableStatusReportRequest=0x03
1.1904 +// Reserved values
1.1905 +// ....
1.1906 +// ....
1.1907 + };
1.1908 +public:
1.1909 + TSmsCommandType();
1.1910 + inline TInt CommandType() const;
1.1911 + inline void SetCommandType(TSmsCommandTypeValue aType);
1.1912 + };
1.1913 +
1.1914 +
1.1915 +/**
1.1916 + * Operations on the User Data described in TP-UD.
1.1917 + * @publishedAll
1.1918 + * @released
1.1919 + */
1.1920 +class CSmsUserData : public CBase
1.1921 + {
1.1922 +public:
1.1923 + enum {KSmsMaxUserDataSize=140};
1.1924 +
1.1925 +public:
1.1926 + static CSmsUserData* NewL(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsFirstOctet& aFirstOctet,const TSmsDataCodingScheme& aDataCodingScheme);
1.1927 + ~CSmsUserData();
1.1928 +
1.1929 + inline TInt NumInformationElements() const;
1.1930 + IMPORT_C CSmsInformationElement& InformationElement(TInt aIndex) const;
1.1931 + IMPORT_C TBool InformationElementIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,TInt& aIndex) const;
1.1932 + IMPORT_C TBool InformationElementLastIndex(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier,TInt& aIndex) const;
1.1933 + IMPORT_C void AddInformationElementL(TSmsId aIdentifier,const TDesC8& aData);
1.1934 + IMPORT_C void RemoveInformationElement(TInt aIndex);
1.1935 + void InformationElementIndicesL(CSmsInformationElement::TSmsInformationElementIdentifier aIdentifier, CArrayFixFlat<TInt>& aIndices) const;
1.1936 +
1.1937 + // EMS related methods
1.1938 + void AddEmsInformationElementL(CEmsInformationElement* aIe); // takes ownership od aIe;
1.1939 + TBool EmsInformationElementWillFitL(CEmsInformationElement* aIe,CSmsEMSBufferSegmenter& aSeg,TUint& aCharsAddedToCurrentPDU);
1.1940 + // Control Information Element related methods
1.1941 + TBool ControlInformationElementWillFitL(CSmsInformationElement* aIe);
1.1942 + void UpdateInformationElementArrayL(TSmsId aIdentifier,const TDesC8& aData);
1.1943 + CSmsInformationElement*& InformationElementPtr(TInt aIndex);
1.1944 +
1.1945 + TInt MaxPackedUDUnitsInBodyRemaining() const;
1.1946 + TInt MaxPackedUDUnitsInBodyRemaining(TUint totalHeaderLengthInUDLUnits) const;
1.1947 +
1.1948 + IMPORT_C TInt MaxBodyLengthInChars() const;
1.1949 + IMPORT_C TPtrC8 Body() const;
1.1950 + IMPORT_C void SetBodyL(const TDesC8& aBody);
1.1951 + void AppendBodyL(const TDesC8& aExtraBody);
1.1952 +
1.1953 + IMPORT_C TBool IsSupportedL(TChar aChar);
1.1954 + IMPORT_C TBool IsSupportedL(const TDesC& aDes, TInt& aNumberOfUnconvertibleCharacters,
1.1955 + TInt& aIndexOfFirstUnconvertibleCharacter) const;
1.1956 +
1.1957 + IMPORT_C TBool IsSupportedL(const TDesC& aDes, TSmsEncoding aEncoding,
1.1958 + TInt& aNumberOfUnconvertibleCharacters,
1.1959 + TInt& aNumberOfDowngradedCharacters,
1.1960 + TInt& aNumberRequiringAlternativeEncoding,
1.1961 + TInt& aIndexOfFirstUnconvertibleCharacter) const;
1.1962 +
1.1963 + TBool IsBinaryData() const;
1.1964 +
1.1965 + TUint8* EncodeL(TUint8* aPtr) const;
1.1966 + void DecodeL(TGsmuLex8& aPdu);
1.1967 + void DecodeL(TGsmuLex8& aPdu, TBool aAcceptTruncation);
1.1968 + void InternalizeL(RReadStream& aStream);
1.1969 + void ExternalizeL(RWriteStream& aStream) const;
1.1970 +private:
1.1971 + CSmsUserData(CCnvCharacterSetConverter& aCharacterSetConverter,RFs& aFs,TSmsFirstOctet& aFirstOctet,const TSmsDataCodingScheme& aDataCodingScheme);
1.1972 + void ConstructL();
1.1973 + TInt HeaderLength() const;
1.1974 + TInt TotalHeaderLengthInUDLUnits() const;
1.1975 + TInt BodyLengthInUDLUnits() const;
1.1976 + void NewBodyL(TInt aLengthInChars);
1.1977 + TBool HeaderPresent() const;
1.1978 + void SetHeaderPresent(TBool aHeaderPresent);
1.1979 + TInt TotalHeaderLengthInUDLUnits(TInt aIElen) const;
1.1980 +
1.1981 +private:
1.1982 +
1.1983 + CCnvCharacterSetConverter& iCharacterSetConverter;
1.1984 + RFs& iFs;
1.1985 +
1.1986 + TSmsFirstOctet& iFirstOctet;
1.1987 + const TSmsDataCodingScheme& iDataCodingScheme;
1.1988 + CArrayPtrFlat<CSmsInformationElement> iInformationElementArray;
1.1989 + HBufC8* iBody;
1.1990 + };
1.1991 +
1.1992 + enum TSmsMessageIndicationType
1.1993 + {
1.1994 + EGsmSmsVoiceMessageWaiting =0x00,
1.1995 + EGsmSmsFaxMessageWaiting =0x01,
1.1996 + EGsmSmsElectronicMailMessageWaiting =0x02,
1.1997 + EGsmSmsExtendedMessageTypeWaiting =0x03,
1.1998 + };
1.1999 +
1.2000 + enum TExtendedSmsIndicationType
1.2001 + {
1.2002 + EGsmSmsNoExtendedMessageTypeIndication=0x00,
1.2003 + EGsmSmsVideoMessageWaiting =0x01,
1.2004 + EGsmSmsExtendedIndicationType2 =0x02,
1.2005 + EGsmSmsExtendedIndicationType3 =0x03,
1.2006 + EGsmSmsExtendedIndicationType4 =0x04,
1.2007 + EGsmSmsExtendedIndicationType5 =0x05,
1.2008 + EGsmSmsExtendedIndicationType6 =0x06,
1.2009 + EGsmSmsExtendedIndicationType7 =0x07
1.2010 + };
1.2011 +
1.2012 +enum TSmsSpecialMessageIndicationTypeMask
1.2013 + {
1.2014 + /** Define a mask for the bits representing */
1.2015 + /** the TSmsMessageIndicationType and the */
1.2016 + /** TExtendedSmsIndicationType */
1.2017 + EGsmSmsSpecialMessageIndicationTypeMask = 0x1F
1.2018 + };
1.2019 +
1.2020 + enum TSmsMessageProfileType
1.2021 + {
1.2022 + EGsmSmsProfileId1 =0x00,
1.2023 + EGsmSmsProfileId2 =0x01,
1.2024 + EGsmSmsProfileId3 =0x02,
1.2025 + EGsmSmsProfileId4 =0x03
1.2026 + };
1.2027 +
1.2028 + enum TVoiceMailInfoType
1.2029 + {
1.2030 + EGsmSmsVoiceMailNotification = 0x00,
1.2031 + EGsmSmsVoiceMailDeleteConfirmation = 0x01
1.2032 + };
1.2033 +
1.2034 + /** SMSC Control Parameters Selective Status Report For Each Segment. Found in Submit. */
1.2035 + enum TSmsSMSCControlParameters
1.2036 + {
1.2037 + /** Status Report for short message transaction completed. */
1.2038 + ESmsStatusReportTransactionCompleted=0x01,
1.2039 + /** Status Report for permanent error when Service Centre is not making any more transfer attempts. */
1.2040 + ESmsStatusReportPermanentError=0x02,
1.2041 + /** Status Report for temporary error when Service Centre is not making any more transfer attempts. */
1.2042 + ESmsStatusReportTemporaryError=0x04,
1.2043 + /** Status Report for temporary error when Service Centre is still trying to transfer message segment. */
1.2044 + ESmsStatusReportTemporaryErrorSCTrying=0x08,
1.2045 + /** This is not Supported.
1.2046 + Reserved for future use. */
1.2047 + ESmsStatusReportForFutureUse1=0x10,
1.2048 + /** This is not Supported.
1.2049 + Reserved for future use. */
1.2050 + ESmsStatusReportForFutureUse2=0x20,
1.2051 + /** This is not Supported.
1.2052 + A Status Report generated by this Short Message, due to a permanent error or last temporary error,
1.2053 + cancels the SRR of the rest of the Short Messages in a concatenated message. */
1.2054 + ESmsStatusReportCancelRestSRR=0x40,
1.2055 + /** This is not Supported.
1.2056 + Include original UDH into the Status Report. */
1.2057 + ESmsStatusReportIncludeOriginalUDH=0x80,
1.2058 + /** Mask. The 4 least significant bits, which are supported, are set. */
1.2059 + ESmsSMSCControlParametersMask=0x0F
1.2060 + };
1.2061 +
1.2062 +
1.2063 +/** Non Information Element Identifiers. */
1.2064 + enum TSmsNonIEIdentifier
1.2065 + {
1.2066 + ESmsTPSRRParameter = 0x00,
1.2067 + ESmsIncompleteClass0MessageParameter = 0x01
1.2068 + };
1.2069 +
1.2070 +
1.2071 +/** Status Report Scheme*/
1.2072 +enum TSmsStatusReportScheme
1.2073 + {
1.2074 + EDefaultScheme = 0x00,
1.2075 + ETPSRRScheme = 0x01,
1.2076 + EControlParametersScheme = 0x10
1.2077 + };
1.2078 +
1.2079 +
1.2080 +/**
1.2081 + * This is the base class for Enhanced Voice Mail Notifications and
1.2082 + * Enhanced Voice Mail Delete Confirmations. It encapsulates
1.2083 + * the attributes and encoding / decoding algorithms common to
1.2084 + * both types of Enhanced Voice Mail Information Element.
1.2085 + *
1.2086 + * @publishedAll
1.2087 + */
1.2088 +class CEnhancedVoiceMailBoxInformation : public CBase
1.2089 +{
1.2090 +public:
1.2091 + enum {KSmsMaxEnhancedVoiceMailSize = CSmsUserData::KSmsMaxUserDataSize - 3};
1.2092 + // allow space in user data for the following bytes: user data header length, IE ID, IE Length
1.2093 +public:
1.2094 + IMPORT_C TVoiceMailInfoType Type() const;
1.2095 + IMPORT_C void SetProfile(TSmsMessageProfileType aProfile);
1.2096 + IMPORT_C TSmsMessageProfileType Profile() const;
1.2097 + IMPORT_C void SetStorage(TBool aIsStored);
1.2098 + IMPORT_C TBool Store() const;
1.2099 + IMPORT_C void SetAlmostMaximumCapacity(TBool aIsAlmostFull);
1.2100 + IMPORT_C TBool AlmostMaximumCapacity() const;
1.2101 + IMPORT_C void SetMaximumCapacity(TBool aIsFull);
1.2102 + IMPORT_C TBool MaximumCapacity() const;
1.2103 + IMPORT_C TBool ExtensionIndicator() const;
1.2104 + IMPORT_C void SetAccessAddressL(const TDesC& aParsedAddress);
1.2105 + IMPORT_C void SetParsedAccessAddressL(const TGsmSmsTelNumber& aParsedAddress);
1.2106 + IMPORT_C TPtrC AccessAddress() const;
1.2107 + IMPORT_C void ParsedAccessAddress(TGsmSmsTelNumber& aParsedAddress) const;
1.2108 + IMPORT_C void SetNumberOfVoiceMessages(TUint8 aNumber);
1.2109 + IMPORT_C TUint8 NumberOfVoiceMessages() const;
1.2110 +
1.2111 + static CEnhancedVoiceMailBoxInformation* NewL();
1.2112 + virtual ~CEnhancedVoiceMailBoxInformation();
1.2113 +
1.2114 + virtual TUint8* EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const;
1.2115 + virtual void DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
1.2116 +protected:
1.2117 + CEnhancedVoiceMailBoxInformation();
1.2118 + CEnhancedVoiceMailBoxInformation(TVoiceMailInfoType aTVoiceMailInfoType);
1.2119 +
1.2120 + CEnhancedVoiceMailBoxInformation(const CEnhancedVoiceMailBoxInformation&);
1.2121 + TBool operator==(const CEnhancedVoiceMailBoxInformation&);
1.2122 + void operator=(const CEnhancedVoiceMailBoxInformation&);
1.2123 +
1.2124 + void ConstructL();
1.2125 + void NewBufferL(TInt aLength);
1.2126 + void DoSetParsedAddressL(const TDesC& aAddress);
1.2127 +protected:
1.2128 + TVoiceMailInfoType iType;
1.2129 + TBool iOctet1Bit1;
1.2130 + TSmsMessageProfileType iProfile;
1.2131 + TBool iStorage;
1.2132 + TBool iAlmostFull;
1.2133 + TBool iFull;
1.2134 + TBool iExtensionIndicator;
1.2135 +
1.2136 + HBufC* iAccessAddress;
1.2137 + TGsmSmsTypeOfAddress iTypeOfAddress;
1.2138 +
1.2139 + TUint8 iNumberOfVoiceMessages;
1.2140 +private:
1.2141 +enum TBitMasks
1.2142 + {
1.2143 + EMask1Bit = 0x01,
1.2144 + EMask2Bits = 0x03,
1.2145 + EMask4Bits = 0x0F
1.2146 + };
1.2147 +};
1.2148 +
1.2149 +
1.2150 +/**
1.2151 + * This class encapsulates the attributes of a VM Notification as described in 23.040 V6.5.0.
1.2152 + * It is used as one of the attributes a Enhanced Voice Mail Notification.
1.2153 + *
1.2154 + * @publishedAll
1.2155 + */
1.2156 +class CVoiceMailNotification : public CBase
1.2157 +{
1.2158 +public:
1.2159 + IMPORT_C void SetMessageId(TUint16 aMessageId);
1.2160 + IMPORT_C TUint16 MessageId() const;
1.2161 + IMPORT_C void SetMessageLength(TUint8 aLength);
1.2162 + IMPORT_C TUint8 MessageLength() const;
1.2163 + IMPORT_C void SetRetentionDays(TUint8 aDays);
1.2164 + IMPORT_C TUint8 RetentionDays() const;
1.2165 + IMPORT_C void SetPriorityIndication(TBool aPriority);
1.2166 + IMPORT_C TBool PriorityIndication() const;
1.2167 + IMPORT_C TBool MessageExtensionIndication() const;
1.2168 + IMPORT_C void SetCallingLineIdentityL(TDesC& aLineIdentity);
1.2169 + IMPORT_C TPtrC CallingLineIdentity() const;
1.2170 + IMPORT_C void SetParsedCallingLineIdentityL(TGsmSmsTelNumber& aParsedAddress);
1.2171 + IMPORT_C void ParsedCallingLineIdentity(TGsmSmsTelNumber& aParsedAddress) const;
1.2172 +
1.2173 + IMPORT_C static CVoiceMailNotification* NewL();
1.2174 + IMPORT_C virtual ~CVoiceMailNotification();
1.2175 +
1.2176 + TUint8 SizeL(CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
1.2177 +
1.2178 + virtual TUint8* EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const;
1.2179 + virtual void DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
1.2180 +protected:
1.2181 + CVoiceMailNotification();
1.2182 + CVoiceMailNotification(const CVoiceMailNotification&);
1.2183 + TBool operator==(const CVoiceMailNotification&);
1.2184 + void operator=(const CVoiceMailNotification&);
1.2185 + void ConstructL();
1.2186 + void NewBufferL(TInt aLength);
1.2187 + void NewExtensionL(TInt aLength);
1.2188 +
1.2189 + void DoSetParsedAddressL(const TDesC& aAddress);
1.2190 +protected:
1.2191 + TUint16 iMessageId;
1.2192 + TUint8 iMessageLength;
1.2193 + TUint8 iRetentionDays;
1.2194 + TBool iOctetN8Bit1;
1.2195 + TBool iPriorityIndication;
1.2196 + TBool iMessageExtensionIndicator;
1.2197 +
1.2198 + HBufC* iCallingLineIdentity;
1.2199 + TGsmSmsTypeOfAddress iTypeOfAddress;
1.2200 +
1.2201 + HBufC* iExtension;
1.2202 +private:
1.2203 + enum TBitMasks
1.2204 + {
1.2205 + EMask1Bit = 0x01,
1.2206 + EMask2Bits = 0x03,
1.2207 + EMask4Bits = 0x0F,
1.2208 + EMask5Bits = 0x1F
1.2209 + };
1.2210 +};
1.2211 +
1.2212 +
1.2213 +/**
1.2214 + * This class encapsulates the attributes of an Enhanced Voice Mail Notification as described in
1.2215 + * 9.2.3.24.13.1. An enhanced voice mail notification is added to a CSmsMessage using the
1.2216 + * interface provided by the class CSmsEnhancedVoiceMailOperations.
1.2217 + *
1.2218 + * Clients should be aware that 23.040 v6.5.0 specifies that this information element must fit into the
1.2219 + * user data field of a single PDU. The amount of space available in the user data field depends on both
1.2220 + * the number and size of the mandatory information elements that must also be present.
1.2221 + * Intuitively the largest Enhanced Voice Mail information element can be added when no mandatory information
1.2222 + * elements need to be encoded in the PDU. To achieve this, the CSmsMessage must be configured with
1.2223 + * only the Enhanced Voice Mail Information Element and no other information elements or text.
1.2224 + *
1.2225 + * @publishedAll
1.2226 + */
1.2227 +class CEnhancedVoiceMailNotification : public CEnhancedVoiceMailBoxInformation
1.2228 +{
1.2229 +public:
1.2230 + enum {KMaxNumberOfNotifications = 15};
1.2231 +protected:
1.2232 + enum {KSmsNotificationBitMask = 0x0F};
1.2233 + // bits mask for bit representing the number of voice mail notifications.
1.2234 +public:
1.2235 + IMPORT_C TUint8 NumberOfVoiceMails();
1.2236 + IMPORT_C RPointerArray<CVoiceMailNotification>& GetVoiceMailNotifications();
1.2237 +
1.2238 + IMPORT_C static CEnhancedVoiceMailNotification* NewL();
1.2239 + IMPORT_C ~CEnhancedVoiceMailNotification();
1.2240 +
1.2241 + TUint8* EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const;
1.2242 + void DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
1.2243 +protected:
1.2244 + CEnhancedVoiceMailNotification();
1.2245 + CEnhancedVoiceMailNotification(const CEnhancedVoiceMailNotification&);
1.2246 + TBool operator==(const CEnhancedVoiceMailNotification&);
1.2247 + void operator=(const CEnhancedVoiceMailNotification&);
1.2248 + void NewExtensionL(TInt aLength);
1.2249 + void ConstructL();
1.2250 +protected:
1.2251 + TUint iNumberOfVMNotifications;
1.2252 + HBufC* iExtension;
1.2253 + RPointerArray<CVoiceMailNotification>* iNotifications;
1.2254 +};
1.2255 +
1.2256 +
1.2257 +/**
1.2258 + * This class encapsulates the attributes of a VM Deletion as described in 23.040 V6.5.0.
1.2259 + * 9.2.3.24.13.1.
1.2260 + *
1.2261 + * It is used as one of the attributes of a Enhanced Voice Mail Delete Confirmation.
1.2262 + *
1.2263 + * @publishedAll
1.2264 + */
1.2265 +class CVoiceMailDeletion : public CBase
1.2266 +{
1.2267 +public:
1.2268 + IMPORT_C void SetMessageId(TUint16 aMessageId);
1.2269 + IMPORT_C TUint16 MessageId() const;
1.2270 + IMPORT_C TBool MessageExtensionIndication() const;
1.2271 +
1.2272 + IMPORT_C static CVoiceMailDeletion* NewL();
1.2273 + IMPORT_C virtual ~CVoiceMailDeletion();
1.2274 + TUint8 SizeL();
1.2275 +
1.2276 + virtual TUint8* EncodeL(TUint8* aPtr) const;
1.2277 + virtual void DecodeL(TGsmuLex8& aVoiceMailInfo);
1.2278 +protected:
1.2279 + CVoiceMailDeletion();
1.2280 + CVoiceMailDeletion(const CVoiceMailDeletion&);
1.2281 + TBool operator==(const CVoiceMailDeletion&);
1.2282 + void operator=(const CVoiceMailDeletion&);
1.2283 +
1.2284 + void ConstructL();
1.2285 + void NewBufferL(TInt aLength);
1.2286 +protected:
1.2287 + TUint iMessageId;
1.2288 + TBool iExtensionIndicator;
1.2289 + HBufC* iExtension;
1.2290 +};
1.2291 +
1.2292 +
1.2293 +/**
1.2294 + * This class encapsulates the attributes of an Enhanced Voice Delete Confirmation as described in
1.2295 + * 9.2.3.24.13.2. An enhanced voice delete confirmation is added to a CSmsMessage using the
1.2296 + * interface provided by the class CSmsEnhancedVoiceMailOperations.
1.2297 + *
1.2298 + * @publishedAll
1.2299 + */
1.2300 +class CEnhancedVoiceMailDeleteConfirmations : public
1.2301 + CEnhancedVoiceMailBoxInformation
1.2302 +{
1.2303 +public:
1.2304 + enum {KMaxNumberOfNotifications = 31};
1.2305 +protected:
1.2306 + enum {KSmsNotificationBitMask = 0x1F};
1.2307 + // bits mask for bit representing the number of voice mail deletions.
1.2308 +public:
1.2309 + IMPORT_C TUint8 NumberOfDeletes();
1.2310 + IMPORT_C RPointerArray<CVoiceMailDeletion>& GetVoiceMailDeletions();
1.2311 +
1.2312 + IMPORT_C static CEnhancedVoiceMailDeleteConfirmations* NewL();
1.2313 + IMPORT_C ~CEnhancedVoiceMailDeleteConfirmations();
1.2314 +
1.2315 + TUint8* EncodeL(TUint8* aPtr, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs) const;
1.2316 + void DecodeL(TGsmuLex8& aVoiceMailInfo, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
1.2317 +protected:
1.2318 + CEnhancedVoiceMailDeleteConfirmations();
1.2319 + CEnhancedVoiceMailDeleteConfirmations(const CEnhancedVoiceMailDeleteConfirmations&);
1.2320 + TBool operator==(const CEnhancedVoiceMailDeleteConfirmations&);
1.2321 + void operator=(const CEnhancedVoiceMailDeleteConfirmations&);
1.2322 +
1.2323 + void ConstructL();
1.2324 + void NewExtensionL(TInt aLength);
1.2325 +protected:
1.2326 + HBufC* iExtension;
1.2327 + RPointerArray<CVoiceMailDeletion>* iVoiceMailDeletions;
1.2328 +};
1.2329 +
1.2330 +
1.2331 +#include <gsmuelem.inl>
1.2332 +
1.2333 +#endif // !defined __GSMUELEM_H__