1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
27 class CSmsServiceCenter;
28 class CSmsEmailFields;
30 // Both the recipient's number and SC number (TP-Destination-Address and RP-Destination-Address)
31 // can be 12 octets which means that there can be 21 characters (including + sign) in the number string.
34 The maximum length of recipient's number.
36 The number returned by CSmsNumber::Address() and CSmsServiceCenter::Address() is limited this maximum length.
38 @see CSmsNumber::Address
39 @see CSmsServiceCenter::Address
44 const TInt KSmcmSmsNumberMaxNumberLength = 21;
47 The maximum length of recipient's name.
49 The number returned by CSmsNumber::Name() and CSmsServiceCenter::Name() is limited this maximum length.
52 @see CSmsServiceCenter::Name
57 const TInt KSmcmSmsNumberMaxNameLength = 256;
60 Defines the possible forms in which an SMS message should be delivered to the
61 recipient by the service centre.
63 The specified format may or may not actually be supported by the service centre.
64 Note that the format of the recipient address(es) may need to be different
65 to a normal telephone number if the conversion is set to any other value than
66 ESmsConvPIDNone, ESmsConvFax, ESmsConvPaging or ESmsConvErmes.
71 enum TSmsPIDConversion
74 No conversion (i.e. use SMS itself).
76 ESmsConvPIDNone = TSmsProtocolIdentifier::ESmsNoTelematicDevice,
80 ESmsConvFax = TSmsProtocolIdentifier::ESmsGroup3TeleFax,
84 ESmsConvX400 = TSmsProtocolIdentifier::ESmsX400MessageHandlingSystem,
86 Convert to pager message.
88 ESmsConvPaging = TSmsProtocolIdentifier::ESmsNationalPagingSystem,
90 Convert to Internet email.
92 ESmsConvMail = TSmsProtocolIdentifier::ESmsInternetElectronicMail,
94 Convert to ERMES paging.
96 ESmsConvErmes = TSmsProtocolIdentifier::ESmsERMES,
100 ESmsConvSpeech = TSmsProtocolIdentifier::ESmsVoiceTelephone
104 Defines the set of possible validity periods for mobile originated messages.
106 Mobile originated messages have a PDU type of SMS-SUBMIT.
111 enum TSmcmValidityPeriod
114 Validity period of an hour.
116 ESmsVPHour = TSmsValidityPeriod::EHalfHourUnitInMinutes*2,
118 Validity period of six hours.
120 ESmsVPSixHours = TSmsValidityPeriod::EHalfHourUnitInMinutes*12,
122 Validity period of 24 hours.
124 ESmsVP24Hours = TSmsValidityPeriod::EOneDayUnitInMinutes,
126 Validity period of a week.
128 ESmsVPWeek = TSmsValidityPeriod::EOneWeekUnitInMinutes,
130 The maximum validity period - currently set as 63 weeks.
132 ESmsVPMaximum = TSmsValidityPeriod::EOneWeekUnitInMinutes*63,
134 An enum that specifies that a validity period is not supported.
136 ESmsVPNotSupported = KErrNotSupported,
138 The default validy period - currently set to a week.
140 ESmsVPDefault = ESmsVPWeek
144 Defines options for the preferred default sending schedule type of a new message
145 created using the SMS client MTM.
147 The option has no direct effect on the SMS MTM. When it is sending an SMS
148 message it automatically appends other SMS messages in the outbox whose send
149 states are marked as KMsvSendStatewaiting or KMsvSendSateUnknown.
151 Therefore it is the responsibility of the messaging client to set the correct
152 send state of new SMS messages correctly given the preferred sending schedule.
160 Send message immediately. The message send state should be set to KMsvSendStateWaiting.
162 ESmsDeliveryImmediately,
164 Send message when client requests. The message send state should be set to KMsvSendStateUponRequest.
166 ESmsDeliveryUponRequest,
168 Send message at scheduled time. The message send state should be set to KMsvSendStateScheduled.
170 ESmsDeliveryScheduled
174 Defines the flags and masks for some of the message settings.
176 The settings classes CSmsMessageSettings and CSmsSettings use these flags to
177 store the specified information.
182 enum TSmsSettingsFlags
185 Mask that resets the flags.
187 ESmsSettingsNoFlags =0,
189 Flag that indicates if messages can be concatenated.
191 If true, the UI should pass a long message in one piece to the MTM. If false,
192 it should split the message manually into 140 byte parts. The value of this
193 flag does not affect the behaviour of the SMS MTM.
195 ESmsSettingsCanConcatenate =0x00000001,
197 Flag that indicates whether the original message should be included in relpy
200 If true, the received message should be quoted at the beginning of the reply
201 message. If false, reply messages should be initially empty.
203 ESmsSettingsReplyQuoted =0x00000002,
205 Flag that indicates whether duplicate messages should be rejected.
207 ESmsSettingsRejectDuplicate =0x00000004,
209 Flag that indicates if a status report (TP-SRR in GSM spec 03.40) should be
210 requested from the Service Centre.
212 ESmsSettingsDeliveryReport =0x00000008,
214 Flag that indicates if the reply path (Service Centre address) should be included
215 in the delivered message (TP-RP in GSM spec 03.40).
217 ESmsSettingsReplyPathRequested =0x00000010,
219 Flag that indicates if a status report (TP-SRR in GSM spec 03.40) for the last segment
220 should be requested from the Service Centre.
222 ESmsSettingsLastSegmentDeliveryReport =0x00000020 ,
225 Flag that indicates if a status report (TP-SRR in GSM spec 03.40) for the last segment
226 is not requested from the Service Centre.
228 ENoSmsSettingsLastSegmentDeliveryReport =0x00000040,
230 Flag that indicates that the service center time stamp should be used for the date
231 field in any TMsvEntry that corresponds to a SMS message.
233 ESmsSettingsUseServiceCenterTimeStamp =0x00000080,
235 Mask for the set of flags defined.
237 ESmsSettingsMask =0x000000FF,
242 Defines the types of acknowledgements that can be received from recipients.
247 Acknowlwdgement of delivery to a recipient.
249 ESmsAckTypeDelivery =0
253 Progress information for SMS MTM operations.
255 This information is returned by CMsvOperation::ProgressL() in a TSmsProgressBuf
258 @see CMsvOperation::ProgressL
267 Defines type of operation for which progress information is being given.
269 These types correspond to the commands defined in TSmsMtmCommand.
273 enum TSmsProgressType
276 The default operation type - no operation.
278 ESmsProgressTypeDefault,
280 Reading SIM parameters.
282 Pre v7.0, this was named ESmsProgressTypeReadingServiceCenterAddress.
284 ESmsProgressTypeReadSimParams,
286 Writing SIM parameters.
288 Pre v7.0 this was named ESmsProgressTypeWritingServiceCenterAddress.
290 ESmsProgressTypeWriteSimParams,
294 ESmsProgressTypeSending,
296 Scheduling sending messages.
298 ESmsProgressTypeScheduling,
300 Enumerating phone stores.
302 Pre v7.0, this was named ESmsProgressTypeEnumeratingSim.
304 ESmsProgressTypeEnumeratingPhoneStores,
306 Copying messages from phone stores.
308 Pre v7.0, this was named ESmsProgressTypeCopyFromSim.
310 ESmsProgressTypeCopyFromPhoneStore,
312 Moving messages from phone stores.
314 Pre v7.0, this was named ESmsProgressTypeMoveFromSim.
316 ESmsProgressTypeMoveFromPhoneStore,
318 Deleting messages from phone stores.
320 Pre v7.0, this was named ESmsProgressTypeDeleteFromSim.
322 ESmsProgressTypeDeleteFromPhoneStore,
324 Removing all messages from the task scheduler list.
326 ESmsProgressTypeDeleteSchedule,
328 Checking the current scheduled status of the messages.
330 ESmsProgressTypeCheckSchedule,
332 Recursively deleting messages.
334 ESmsProgressTypeDeleteAll,
336 Copying messages to a phone store.
338 Pre v7.0, this was named ESmsProgressTypeCopyToSim.
340 ESmsProgressTypeCopyToPhoneStore,
342 Moving messages to a phone store.
344 Pre v7.0, this was named ESmsProgressTypeMoveToSim.
346 ESmsProgressTypeMoveToPhoneStore,
348 Moving message entries.
350 This is the second part of ESmsProgressTypeMoveFromPhoneStore. The first part
351 deletes the messages from the phone storageSIM. This second part moves the
352 messages from the folder that represents the phone storage to the specified
355 ESmsProgressTypeMovingEntries
358 inline TSmsProgress(TSmsProgressType aType = ESmsProgressTypeDefault);
367 The type of operation.
369 @see TSmsProgress::TSmsProgressType
371 TSmsProgressType iType;
373 The state of the operation.
377 The number of recipients processed so far for the current message.
381 The total number of recipients in the current message.
385 The nmber of messages processed so far for the current operation.
389 The total number of messages for the current operation.
393 The Service Centre address.
395 This is set by the command ESmsMtmCommandReadServiceCenter.
398 This is no longer used since v7.0.
400 TBuf<14> iServiceCenterAddress;
402 The invisible folder that contains the messages read from the SIM by the command
403 ESmsMtmCommandEnumeratePhoneStores.
405 TMsvId iEnumerateFolder;
409 Package buffer for TSmsProgress.
416 typedef TPckgBuf<TSmsProgress> TSmsProgressBuf;
420 The SMS settings that are relevant on a per message basis.
422 Each SMS message has its own settings. Initially they have a default set of
423 values derived from the SMS service settings. They can be changed on an
424 individual message basis. For instance, a messaging application may allow a
425 user to specify/not specify status reports individually for each message.
427 These settings are only relevant to mobile originated messages - those of
433 class CSmsMessageSettings : public CBase
436 IMPORT_C virtual void InternalizeL(RReadStream& aReadStream);
437 IMPORT_C virtual void ExternalizeL(RWriteStream& aWriteStream) const;
439 inline const TTimeIntervalMinutes& ValidityPeriod() const;
440 inline void SetValidityPeriod(TTimeIntervalMinutes);
442 inline void SetValidityPeriodFormat(TSmsFirstOctet::TSmsValidityPeriodFormat aValidityPeriodFormat);
443 inline const TSmsFirstOctet::TSmsValidityPeriodFormat ValidityPeriodFormat() const;
445 inline TBool RejectDuplicate() const;
446 inline void SetRejectDuplicate(TBool);
448 inline TBool DeliveryReport() const;
449 inline void SetDeliveryReport(TBool);
451 inline TBool ReplyPath() const;
452 inline void SetReplyPath(TBool);
454 inline TSmsPIDConversion MessageConversion() const;
455 inline void SetMessageConversion(TSmsPIDConversion);
457 inline TBool CanConcatenate() const;
458 inline void SetCanConcatenate(TBool);
460 inline enum TSmsDataCodingScheme::TSmsAlphabet CharacterSet() const;
461 inline void SetCharacterSet(TSmsDataCodingScheme::TSmsAlphabet);
463 IMPORT_C virtual void CopyL(const CSmsMessageSettings& aSettings);
465 TUint32 MessageFlags() const;
466 void SetMessageFlags(TUint32 aMsgFlags);
467 inline TBool LastSegmentDeliveryReport() const;
468 inline void SetLastSegmentDeliveryReport(TBool);
470 inline void SetUseServiceCenterTimeStampForDate(TBool aUseServiceCenterTimestamp);
471 inline TBool UseServiceCenterTimeStampForDate() const;
475 CSmsMessageSettings();
480 TSmsPIDConversion iMessageConversion;
481 TSmsDataCodingScheme::TSmsAlphabet iAlphabet;
482 TTimeIntervalMinutes iValidityPeriod;
483 TSmsFirstOctet::TSmsValidityPeriodFormat iValidityPeriodFormat;
487 The SMS Service settings.
489 An SMS service entry stores an object of this type in its message store. These
490 settings define the default settings for mobile originated messages (SMS-SUBMIT
491 type messages). They also provide some global settings that are applied to all
492 messages, both outward going and received messages.
494 The SMS service also uses this class to store the set of avilable Servive Centre
495 numbers. The default Service Centre is defined from this set.
500 class CSmsSettings : public CSmsMessageSettings
505 Defines the ways in which status reports that are received by the watcher may
508 This can be applied to both SMS-STATUS-REPORT type messages and Special Messages
509 (e.g. Voice Mail Indication messages).
511 enum TSmsReportHandling
514 The reports are put in the inbox and made invisible.
516 EMoveReportToInboxInvisible,
518 The reports are put in the inbox and made visible.
520 EMoveReportToInboxVisible,
522 The reports are deleted.
528 EDoNotWatchForReport,
530 Reports are put in the inbox and made invisible. The status report
531 is matched against the sent mesasge and its summary info updated.
533 EMoveReportToInboxInvisibleAndMatch,
535 Reports are put in the inbox and made visible. The status report
536 is matched against the sent mesasge and its summary info updated.
538 EMoveReportToInboxVisibleAndMatch,
540 Reports are deleted. The status report is matched against the sent
541 mesasge and its summary info updated.
543 EDiscardReportAndMatch
547 Sets whether the service settings should be used to update the communications
550 If the update is specified, it is done when the Service settings are stored into
553 enum TSmsSettingsCommDbAction
556 The comms database should not be updated.
560 Use the Service settings to update the comms datebase.
565 /** Defines the SMS bearer.
567 enum TMobileSmsBearer
569 /** SMS messages will only be sent over a packet-switched (GPRS) network. */
570 ESmsBearerPacketOnly,
571 /** SMS messages will only be sent over a circuit-switched (GSM) network. */
572 ESmsBearerCircuitOnly,
573 /** SMS messages will be sent over the packet-switched (GPRS) network if possible,
574 otherwise over circuit-switched (GSM) network. */
575 ESmsBearerPacketPreferred,
576 /** SMS messages will be sent over the circuit-switched (GSM) network if possible,
577 otherwise over packet-switched (GPRS) network. */
578 ESmsBearerCircuitPreferred
583 IMPORT_C static CSmsSettings* NewL();
584 IMPORT_C static CSmsSettings* NewLC();
585 IMPORT_C virtual ~CSmsSettings();
587 IMPORT_C TInt ServiceCenterCount() const;
588 IMPORT_C CSmsServiceCenter& GetServiceCenter(TInt aIndex) const;
589 IMPORT_C void AddServiceCenterL(const TDesC& aName,const TDesC& aNumber);
590 IMPORT_C void RemoveServiceCenter(TInt aIndex);
591 IMPORT_C TInt DefaultServiceCenter() const;
592 IMPORT_C void SetDefaultServiceCenter(TInt aDefaultSC);
593 inline TSmsDelivery Delivery() const;
594 inline void SetDelivery(TSmsDelivery);
596 inline TBool ReplyQuoted() const;
597 inline void SetReplyQuoted(TBool);
599 IMPORT_C void CopyL(const CSmsSettings& aSmsSettings);
601 inline TSmsReportHandling StatusReportHandling() const;
602 inline void SetStatusReportHandling(TSmsReportHandling aStatusReportHandling);
603 inline TSmsReportHandling SpecialMessageHandling() const;
604 inline void SetSpecialMessageHandling(TSmsReportHandling aSpecialMessageHandling);
606 inline void SetCommDbAction(TSmsSettingsCommDbAction aCommDbAction);
607 inline TSmsSettingsCommDbAction CommDbAction() const;
609 inline void SetSmsBearerAction(TSmsSettingsCommDbAction aSmsBearerAction);
610 inline TSmsSettingsCommDbAction SmsBearerAction() const;
612 inline void SetSmsBearer(TMobileSmsBearer aSmsBearer);
613 inline TMobileSmsBearer SmsBearer() const;
615 inline void SetClass2Folder(TMsvId aId);
616 inline TMsvId Class2Folder() const;
618 inline void SetDescriptionLength(TInt aLength);
619 inline TInt DescriptionLength() const;
621 TUint32 SettingsFlags() const;
622 void SetSettingsFlags(TUint32 aSetFlags);
624 void RemoveSCAddresses();
625 void StoreToCommDbL() const;
635 CArrayPtrFlat<CSmsServiceCenter> *iServiceCenters;
636 TSmsDelivery iDelivery;
638 TSmsReportHandling iStatusReportHandling;
639 TSmsReportHandling iSpecialMessageHandling;
640 TSmsSettingsCommDbAction iCommDbAction;
641 TSmsSettingsCommDbAction iSmsBearerAction;
642 TMobileSmsBearer iSmsBearer;
643 TMsvId iClass2Folder;
644 TInt iDescriptionLength;
648 Recipient information for an SMS message.
650 A SMS-SUBMIT message may have several recipients
655 class CSmsNumber : public CMsvRecipient
660 Defines the status of an acknowledgement for a recipient.
665 An acknowledgement for this recipient has not been requested.
669 The delivery status for this recipient has been requested, but the status report
670 has not yet been received.
674 A successful acknowledgement for this recipient has been received.
678 A failed acknowledgement for this recipient has been received.
685 IMPORT_C static CSmsNumber* NewL();
686 IMPORT_C static CSmsNumber* NewL(const CSmsNumber& aSmsNumber);
687 IMPORT_C virtual ~CSmsNumber();
689 IMPORT_C void InternalizeL(RReadStream& aStream);
690 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
692 IMPORT_C TPtrC Address() const;
693 IMPORT_C void SetAddressL(const TDesC& aAddress);
694 void SetEmailAddressL(const TDesC& aAddress, CSmsEmailFields* aEmailFields, const TDesC& aAlias);
696 IMPORT_C TPtrC Name() const;
697 IMPORT_C void SetNameL(const TDesC& aName);
699 inline TLogId LogId() const;
700 inline void SetLogId(TLogId aLogId);
702 IMPORT_C CSmsNumber& CopyL(const CSmsNumber& aSmsNumber);
704 IMPORT_C TSmsAckStatus AckStatus(TSmsAckType aAckType) const;
705 IMPORT_C void SetAckStatus(TSmsAckType aAckType, TSmsAckStatus aAckStatus);
710 TPtrC LimitStringSize(const TPtrC& aString, TInt aMaxLength) const;
717 TSmsAckStatus iDeliveryStatus;
721 Used to store Service Centre numbers and their associated name.
726 class CSmsServiceCenter : public CBase
729 IMPORT_C static CSmsServiceCenter* NewL();
730 IMPORT_C static CSmsServiceCenter* NewL(const CSmsServiceCenter& aSmsSC);
731 IMPORT_C ~CSmsServiceCenter();
733 IMPORT_C TPtrC Address() const;
734 IMPORT_C void SetAddressL(const TDesC& aAddress);
736 IMPORT_C TPtrC Name() const;
737 IMPORT_C void SetNameL(const TDesC& aName);
739 IMPORT_C CSmsServiceCenter& CopyL(const CSmsServiceCenter& aSmsSc);
743 TPtrC LimitStringSize(const TPtrC& aString, TInt aMaxLength) const;
750 #include <smutset.inl>
752 #endif // __SMUTSET_H__