1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
29 class CSmsServiceCenter;
30 class CSmsEmailFields;
32 // Both the recipient's number and SC number (TP-Destination-Address and RP-Destination-Address)
33 // can be 12 octets which means that there can be 21 characters (including + sign) in the number string.
36 The maximum length of recipient's number.
38 The number returned by CSmsNumber::Address() and CSmsServiceCenter::Address() is limited this maximum length.
40 @see CSmsNumber::Address
41 @see CSmsServiceCenter::Address
46 const TInt KSmcmSmsNumberMaxNumberLength = 21;
49 The maximum length of recipient's name.
51 The number returned by CSmsNumber::Name() and CSmsServiceCenter::Name() is limited this maximum length.
54 @see CSmsServiceCenter::Name
59 const TInt KSmcmSmsNumberMaxNameLength = 256;
62 Defines the possible forms in which an SMS message should be delivered to the
63 recipient by the service centre.
65 The specified format may or may not actually be supported by the service centre.
66 Note that the format of the recipient address(es) may need to be different
67 to a normal telephone number if the conversion is set to any other value than
68 ESmsConvPIDNone, ESmsConvFax, ESmsConvPaging or ESmsConvErmes.
73 enum TSmsPIDConversion
76 No conversion (i.e. use SMS itself).
78 ESmsConvPIDNone = TSmsProtocolIdentifier::ESmsNoTelematicDevice,
82 ESmsConvFax = TSmsProtocolIdentifier::ESmsGroup3TeleFax,
86 ESmsConvX400 = TSmsProtocolIdentifier::ESmsX400MessageHandlingSystem,
88 Convert to pager message.
90 ESmsConvPaging = TSmsProtocolIdentifier::ESmsNationalPagingSystem,
92 Convert to Internet email.
94 ESmsConvMail = TSmsProtocolIdentifier::ESmsInternetElectronicMail,
96 Convert to ERMES paging.
98 ESmsConvErmes = TSmsProtocolIdentifier::ESmsERMES,
102 ESmsConvSpeech = TSmsProtocolIdentifier::ESmsVoiceTelephone
106 Defines the set of possible validity periods for mobile originated messages.
108 Mobile originated messages have a PDU type of SMS-SUBMIT.
113 enum TSmcmValidityPeriod
116 Validity period of an hour.
118 ESmsVPHour = TSmsValidityPeriod::EHalfHourUnitInMinutes*2,
120 Validity period of six hours.
122 ESmsVPSixHours = TSmsValidityPeriod::EHalfHourUnitInMinutes*12,
124 Validity period of 24 hours.
126 ESmsVP24Hours = TSmsValidityPeriod::EOneDayUnitInMinutes,
128 Validity period of a week.
130 ESmsVPWeek = TSmsValidityPeriod::EOneWeekUnitInMinutes,
132 The maximum validity period - currently set as 63 weeks.
134 ESmsVPMaximum = TSmsValidityPeriod::EOneWeekUnitInMinutes*63,
136 An enum that specifies that a validity period is not supported.
138 ESmsVPNotSupported = KErrNotSupported,
140 The default validy period - currently set to a week.
142 ESmsVPDefault = ESmsVPWeek
146 Defines options for the preferred default sending schedule type of a new message
147 created using the SMS client MTM.
149 The option has no direct effect on the SMS MTM. When it is sending an SMS
150 message it automatically appends other SMS messages in the outbox whose send
151 states are marked as KMsvSendStatewaiting or KMsvSendSateUnknown.
153 Therefore it is the responsibility of the messaging client to set the correct
154 send state of new SMS messages correctly given the preferred sending schedule.
162 Send message immediately. The message send state should be set to KMsvSendStateWaiting.
164 ESmsDeliveryImmediately,
166 Send message when client requests. The message send state should be set to KMsvSendStateUponRequest.
168 ESmsDeliveryUponRequest,
170 Send message at scheduled time. The message send state should be set to KMsvSendStateScheduled.
172 ESmsDeliveryScheduled
176 Defines the flags and masks for some of the message settings.
178 The settings classes CSmsMessageSettings and CSmsSettings use these flags to
179 store the specified information.
184 enum TSmsSettingsFlags
187 Mask that resets the flags.
189 ESmsSettingsNoFlags =0x00000000,
191 Flag that indicates if messages can be concatenated.
193 If true, the UI should pass a long message in one piece to the MTM. If false,
194 it should split the message manually into 140 byte parts. The value of this
195 flag does not affect the behaviour of the SMS MTM.
197 ESmsSettingsCanConcatenate =0x00000001,
199 Flag that indicates whether the original message should be included in relpy
202 If true, the received message should be quoted at the beginning of the reply
203 message. If false, reply messages should be initially empty.
205 ESmsSettingsReplyQuoted =0x00000002,
207 Flag that indicates whether duplicate messages should be rejected.
209 ESmsSettingsRejectDuplicate =0x00000004,
211 Flag that indicates if a status report (TP-SRR in GSM spec 03.40) should be
212 requested from the Service Centre.
214 ESmsSettingsDeliveryReport =0x00000008,
216 Flag that indicates if the reply path (Service Centre address) should be included
217 in the delivered message (TP-RP in GSM spec 03.40).
219 ESmsSettingsReplyPathRequested =0x00000010,
221 Flag that indicates if a status report (TP-SRR in GSM spec 03.40) for the last segment
222 should be requested from the Service Centre.
224 ESmsSettingsLastSegmentDeliveryReport =0x00000020 ,
227 Flag that indicates if a status report (TP-SRR in GSM spec 03.40) for the last segment
228 is not requested from the Service Centre.
230 ENoSmsSettingsLastSegmentDeliveryReport =0x00000040,
232 Flag that indicates that the service center time stamp should be used for the date
233 field in any TMsvEntry that corresponds to a SMS message.
235 ESmsSettingsUseServiceCenterTimeStamp =0x00000080,
237 Flag that indicates if message received from unknown port,
238 discard the message without indicating the user.
240 ESmsSettingsDiscardUnknownPortMsgs =0x00000100,
242 Mask for the set of flags defined.
244 ESmsSettingsMask =0x000000FF,
249 Defines the types of acknowledgements that can be received from recipients.
254 Acknowlwdgement of delivery to a recipient.
256 ESmsAckTypeDelivery =0
260 Progress information for SMS MTM operations.
262 This information is returned by CMsvOperation::ProgressL() in a TSmsProgressBuf
265 @see CMsvOperation::ProgressL
274 Defines type of operation for which progress information is being given.
276 These types correspond to the commands defined in TSmsMtmCommand.
280 enum TSmsProgressType
283 The default operation type - no operation.
285 ESmsProgressTypeDefault,
287 Reading SIM parameters.
289 Pre v7.0, this was named ESmsProgressTypeReadingServiceCenterAddress.
291 ESmsProgressTypeReadSimParams,
293 Writing SIM parameters.
295 Pre v7.0 this was named ESmsProgressTypeWritingServiceCenterAddress.
297 ESmsProgressTypeWriteSimParams,
301 ESmsProgressTypeSending,
303 Scheduling sending messages.
305 ESmsProgressTypeScheduling,
307 Enumerating phone stores.
309 Pre v7.0, this was named ESmsProgressTypeEnumeratingSim.
311 ESmsProgressTypeEnumeratingPhoneStores,
313 Copying messages from phone stores.
315 Pre v7.0, this was named ESmsProgressTypeCopyFromSim.
317 ESmsProgressTypeCopyFromPhoneStore,
319 Moving messages from phone stores.
321 Pre v7.0, this was named ESmsProgressTypeMoveFromSim.
323 ESmsProgressTypeMoveFromPhoneStore,
325 Deleting messages from phone stores.
327 Pre v7.0, this was named ESmsProgressTypeDeleteFromSim.
329 ESmsProgressTypeDeleteFromPhoneStore,
331 Removing all messages from the task scheduler list.
333 ESmsProgressTypeDeleteSchedule,
335 Checking the current scheduled status of the messages.
337 ESmsProgressTypeCheckSchedule,
339 Recursively deleting messages.
341 ESmsProgressTypeDeleteAll,
343 Copying messages to a phone store.
345 Pre v7.0, this was named ESmsProgressTypeCopyToSim.
347 ESmsProgressTypeCopyToPhoneStore,
349 Moving messages to a phone store.
351 Pre v7.0, this was named ESmsProgressTypeMoveToSim.
353 ESmsProgressTypeMoveToPhoneStore,
355 Moving message entries.
357 This is the second part of ESmsProgressTypeMoveFromPhoneStore. The first part
358 deletes the messages from the phone storageSIM. This second part moves the
359 messages from the folder that represents the phone storage to the specified
362 ESmsProgressTypeMovingEntries
365 inline TSmsProgress(TSmsProgressType aType = ESmsProgressTypeDefault);
374 The type of operation.
376 @see TSmsProgress::TSmsProgressType
378 TSmsProgressType iType;
380 The state of the operation.
384 The number of recipients processed so far for the current message.
388 The total number of recipients in the current message.
392 The nmber of messages processed so far for the current operation.
396 The total number of messages for the current operation.
400 The Service Centre address.
402 This is set by the command ESmsMtmCommandReadServiceCenter.
405 This is no longer used since v7.0.
407 TBuf<14> iServiceCenterAddress;
409 The invisible folder that contains the messages read from the SIM by the command
410 ESmsMtmCommandEnumeratePhoneStores.
412 TMsvId iEnumerateFolder;
416 Package buffer for TSmsProgress.
423 typedef TPckgBuf<TSmsProgress> TSmsProgressBuf;
427 The SMS settings that are relevant on a per message basis.
429 Each SMS message has its own settings. Initially they have a default set of
430 values derived from the SMS service settings. They can be changed on an
431 individual message basis. For instance, a messaging application may allow a
432 user to specify/not specify status reports individually for each message.
434 These settings are only relevant to mobile originated messages - those of
440 NONSHARABLE_CLASS(CSmsMessageSettings): public CBase
443 IMPORT_C virtual void InternalizeL(RReadStream& aReadStream);
444 IMPORT_C virtual void ExternalizeL(RWriteStream& aWriteStream) const;
446 inline const TTimeIntervalMinutes& ValidityPeriod() const;
447 inline void SetValidityPeriod(TTimeIntervalMinutes);
449 inline void SetValidityPeriodFormat(TSmsFirstOctet::TSmsValidityPeriodFormat aValidityPeriodFormat);
450 inline const TSmsFirstOctet::TSmsValidityPeriodFormat ValidityPeriodFormat() const;
452 inline TBool RejectDuplicate() const;
453 inline void SetRejectDuplicate(TBool);
455 inline TBool DeliveryReport() const;
456 inline void SetDeliveryReport(TBool);
458 inline TBool ReplyPath() const;
459 inline void SetReplyPath(TBool);
461 inline TSmsPIDConversion MessageConversion() const;
462 inline void SetMessageConversion(TSmsPIDConversion);
464 inline TBool CanConcatenate() const;
465 inline void SetCanConcatenate(TBool);
467 inline enum TSmsDataCodingScheme::TSmsAlphabet CharacterSet() const;
468 inline void SetCharacterSet(TSmsDataCodingScheme::TSmsAlphabet);
470 IMPORT_C virtual void CopyL(const CSmsMessageSettings& aSettings);
472 TUint32 MessageFlags() const;
473 void SetMessageFlags(TUint32 aMsgFlags);
474 inline TBool LastSegmentDeliveryReport() const;
475 inline void SetLastSegmentDeliveryReport(TBool);
477 inline void SetUseServiceCenterTimeStampForDate(TBool aUseServiceCenterTimestamp);
478 inline TBool UseServiceCenterTimeStampForDate() const;
482 CSmsMessageSettings();
487 TSmsPIDConversion iMessageConversion;
488 TSmsDataCodingScheme::TSmsAlphabet iAlphabet;
489 TTimeIntervalMinutes iValidityPeriod;
490 TSmsFirstOctet::TSmsValidityPeriodFormat iValidityPeriodFormat;
494 The SMS Service settings.
496 An SMS service entry stores an object of this type in its message store. These
497 settings define the default settings for mobile originated messages (SMS-SUBMIT
498 type messages). They also provide some global settings that are applied to all
499 messages, both outward going and received messages.
501 The SMS service also uses this class to store the set of avilable Servive Centre
502 numbers. The default Service Centre is defined from this set.
507 NONSHARABLE_CLASS(CSmsSettings): public CSmsMessageSettings
512 Defines the ways in which status reports that are received by the watcher may
515 This can be applied to both SMS-STATUS-REPORT type messages and Special Messages
516 (e.g. Voice Mail Indication messages).
518 enum TSmsReportHandling
521 The reports are put in the inbox and made invisible.
523 EMoveReportToInboxInvisible,
525 The reports are put in the inbox and made visible.
527 EMoveReportToInboxVisible,
529 The reports are deleted.
535 EDoNotWatchForReport,
537 Reports are put in the inbox and made invisible. The status report
538 is matched against the sent mesasge and its summary info updated.
540 EMoveReportToInboxInvisibleAndMatch,
542 Reports are put in the inbox and made visible. The status report
543 is matched against the sent mesasge and its summary info updated.
545 EMoveReportToInboxVisibleAndMatch,
547 Reports are deleted. The status report is matched against the sent
548 mesasge and its summary info updated.
550 EDiscardReportAndMatch
554 Sets whether the service settings should be used to update the communications
557 If the update is specified, it is done when the Service settings are stored into
560 enum TSmsSettingsCommDbAction
563 The comms database should not be updated.
567 Use the Service settings to update the comms datebase.
572 /** Defines the SMS bearer.
574 enum TMobileSmsBearer
576 /** SMS messages will only be sent over a packet-switched (GPRS) network. */
577 ESmsBearerPacketOnly,
578 /** SMS messages will only be sent over a circuit-switched (GSM) network. */
579 ESmsBearerCircuitOnly,
580 /** SMS messages will be sent over the packet-switched (GPRS) network if possible,
581 otherwise over circuit-switched (GSM) network. */
582 ESmsBearerPacketPreferred,
583 /** SMS messages will be sent over the circuit-switched (GSM) network if possible,
584 otherwise over packet-switched (GPRS) network. */
585 ESmsBearerCircuitPreferred
590 IMPORT_C static CSmsSettings* NewL();
591 IMPORT_C static CSmsSettings* NewLC();
592 IMPORT_C virtual ~CSmsSettings();
594 IMPORT_C TInt ServiceCenterCount() const;
595 IMPORT_C CSmsServiceCenter& GetServiceCenter(TInt aIndex) const;
596 IMPORT_C void AddServiceCenterL(const TDesC& aName,const TDesC& aNumber);
597 IMPORT_C void RemoveServiceCenter(TInt aIndex);
598 IMPORT_C TInt DefaultServiceCenter() const;
599 IMPORT_C void SetDefaultServiceCenter(TInt aDefaultSC);
600 inline TSmsDelivery Delivery() const;
601 inline void SetDelivery(TSmsDelivery);
603 inline TBool ReplyQuoted() const;
604 inline void SetReplyQuoted(TBool);
606 IMPORT_C void CopyL(const CSmsSettings& aSmsSettings);
608 inline TSmsReportHandling StatusReportHandling() const;
609 inline void SetStatusReportHandling(TSmsReportHandling aStatusReportHandling);
610 inline TSmsReportHandling SpecialMessageHandling() const;
611 inline void SetSpecialMessageHandling(TSmsReportHandling aSpecialMessageHandling);
613 inline void SetCommDbAction(TSmsSettingsCommDbAction aCommDbAction);
614 inline TSmsSettingsCommDbAction CommDbAction() const;
616 inline void SetSmsBearerAction(TSmsSettingsCommDbAction aSmsBearerAction);
617 inline TSmsSettingsCommDbAction SmsBearerAction() const;
619 inline void SetSmsBearer(TMobileSmsBearer aSmsBearer);
620 inline TMobileSmsBearer SmsBearer() const;
622 inline void SetClass2Folder(TMsvId aId);
623 inline TMsvId Class2Folder() const;
625 inline void SetDescriptionLength(TInt aLength);
626 inline TInt DescriptionLength() const;
628 inline TBool DiscardUnknownPortMessage() const;
629 inline void SetDiscardUnknownPortMessage(TBool aDeleteMessage);
630 TUint32 SettingsFlags() const;
631 void SetSettingsFlags(TUint32 aSetFlags);
633 void RemoveSCAddresses();
634 void StoreToCommDbL() const;
644 CArrayPtrFlat<CSmsServiceCenter> *iServiceCenters;
645 TSmsDelivery iDelivery;
647 TSmsReportHandling iStatusReportHandling;
648 TSmsReportHandling iSpecialMessageHandling;
649 TSmsSettingsCommDbAction iCommDbAction;
650 TSmsSettingsCommDbAction iSmsBearerAction;
651 TMobileSmsBearer iSmsBearer;
652 TMsvId iClass2Folder;
653 TInt iDescriptionLength;
657 Recipient information for an SMS message.
659 A SMS-SUBMIT message may have several recipients
664 NONSHARABLE_CLASS(CSmsNumber): public CMsvRecipient
669 Defines the status of an acknowledgement for a recipient.
674 An acknowledgement for this recipient has not been requested.
678 The delivery status for this recipient has been requested, but the status report
679 has not yet been received.
683 A successful acknowledgement for this recipient has been received.
687 A failed acknowledgement for this recipient has been received.
694 IMPORT_C static CSmsNumber* NewL();
695 IMPORT_C static CSmsNumber* NewL(const CSmsNumber& aSmsNumber);
696 IMPORT_C virtual ~CSmsNumber();
698 IMPORT_C void InternalizeL(RReadStream& aStream);
699 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
701 IMPORT_C TPtrC Address() const;
702 IMPORT_C void SetAddressL(const TDesC& aAddress);
703 void SetEmailAddressL(const TDesC& aAddress, CSmsEmailFields* aEmailFields, const TDesC& aAlias);
705 IMPORT_C TPtrC Name() const;
706 IMPORT_C void SetNameL(const TDesC& aName);
708 inline TLogId LogId() const;
709 inline void SetLogId(TLogId aLogId);
711 IMPORT_C CSmsNumber& CopyL(const CSmsNumber& aSmsNumber);
713 IMPORT_C TSmsAckStatus AckStatus(TSmsAckType aAckType) const;
714 IMPORT_C void SetAckStatus(TSmsAckType aAckType, TSmsAckStatus aAckStatus);
719 TPtrC LimitStringSize(const TPtrC& aString, TInt aMaxLength) const;
726 TSmsAckStatus iDeliveryStatus;
730 Used to store Service Centre numbers and their associated name.
735 NONSHARABLE_CLASS (CSmsServiceCenter) : public CBase
738 IMPORT_C static CSmsServiceCenter* NewL();
739 IMPORT_C static CSmsServiceCenter* NewL(const CSmsServiceCenter& aSmsSC);
740 IMPORT_C ~CSmsServiceCenter();
742 IMPORT_C TPtrC Address() const;
743 IMPORT_C void SetAddressL(const TDesC& aAddress);
745 IMPORT_C TPtrC Name() const;
746 IMPORT_C void SetNameL(const TDesC& aName);
748 IMPORT_C CSmsServiceCenter& CopyL(const CSmsServiceCenter& aSmsSc);
752 TPtrC LimitStringSize(const TPtrC& aString, TInt aMaxLength) const;
759 #include <smutset.inl>
761 #endif // __SMUTSET_H__