1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This file defines the container class CSmsIEOperation and its specialisations.
15 // The classes provide interfaces that allow the client to operate on a number
16 // of control information elements.
26 #ifndef __GSMUIEOPERATIONS_
27 #define __GSMUIEOPERATIONS_
36 * SMS Stack clients use specialisations of this class to configure a SMS Message with Control Information Elements
37 * which have been introduced in 23.040 v6.5.0.
39 * The 23.040 v6.5.0 standard defines individual requirements for how each of these control information elements
40 * is to be encoded and decoded. These requirements mean that these control information elements need to be
41 * configured in the CSmsMessage using derivations of this interface, rather than CSmsUserData::AddInformationElementL().
43 * CSmsUserData::AddInformationElement specifies those information elements it supports and those that are supported
44 * by CSmsIEOperation and its derivatives.
46 * Each control information element that uses this interface is supported by a class derived from CSmsIEOperation.
47 * The derived class operates on the CSmsMessage, allowing the client to add, remove and access control information
48 * elements inside the CSmsMessage.
50 * The client gets access to an operations class using the following interface:
52 * CSmsIEOperation& CSmsMessage::GetOperationsForIEL(CSmsInformationElement::TSmsInformationElementIdentifier aId);
54 * When the CSmsMessage is deleted, all its associated CSmsIEOperations classes are also deleted and references to
55 * them become stale. Each instance of the CSmsIEOperation Class is an attributes of the CSmsMessage itself.
59 class CSmsIEOperation : public CBase
62 static CSmsIEOperation* NewL(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage, CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
63 IMPORT_C CSmsInformationElement::TSmsInformationElementIdentifier Id() const;
64 virtual ~CSmsIEOperation(){};
66 virtual TBool MessageTypeSupported() const;
67 virtual void ValidateOperationL() const {};
71 CSmsInformationElement::TSmsInformationElementIdentifier iId;
73 CSmsMessage& iMessage;
74 CSmsIEOperation(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage);
75 void operator=(const CSmsIEOperation&);
76 TBool operator==(const CSmsIEOperation&);
79 class CSmsCtrlOperation : public CSmsIEOperation
82 CSmsCtrlOperation(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage);
83 ~CSmsCtrlOperation(){};
84 void operator=(const CSmsCtrlOperation&);
85 TBool operator==(const CSmsCtrlOperation&);
90 * Clients use this class to configure a CSmsMessage with hyperlinks per 23.040 v6.5.0 section 9.2.3.24.12.
94 class CSmsHyperLinkOperations : public CSmsCtrlOperation
97 IMPORT_C void AddHyperLinkL(TUint aPosition, TUint8 aTitleLength, TUint8 aURLLength) const;
98 IMPORT_C TUint NumberOfHyperLinksL() const;
99 IMPORT_C void CopyHyperLinkAtIndexL(TUint index, TUint& aPosition, TUint8& aTitleLength, TUint8& aURLLength) const;
100 IMPORT_C void RemoveAllHyperLinksL() const;
101 IMPORT_C void RemoveHyperLinkL(TUint aIndex) const;
102 CSmsHyperLinkOperations(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage);
103 ~CSmsHyperLinkOperations(){};
105 void ValidateOperationL() const;
106 void operator=(const CSmsHyperLinkOperations&);
107 TBool operator==(const CSmsHyperLinkOperations&);
112 * Clients use this class to configure a CSmsMessage with a reply address per 23.040 v6.5.0 section 9.2.3.24.10.1.17.
116 class CSmsReplyAddressOperations : public CSmsCtrlOperation
119 static CSmsReplyAddressOperations* NewL(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage,
120 CCnvCharacterSetConverter& iCharacterSetConverter, RFs& iFs);
122 IMPORT_C void AddReplyAddressL(const TDesC& aAddress) const;
123 IMPORT_C void AddParsedReplyAddressL(const TGsmSmsTelNumber& aParsedAddress) const;
124 IMPORT_C TBool ContainsReplyAddressIEL() const;
125 IMPORT_C HBufC* GetReplyAddressL() const;
126 IMPORT_C TInt GetParsedReplyAddressL(TGsmSmsTelNumber& aParsedAddress) const;
127 IMPORT_C void RemoveReplyAddressL() const;
128 CSmsReplyAddressOperations(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage,
129 CCnvCharacterSetConverter& iCharacterSetConverter, RFs& iFs);
130 ~CSmsReplyAddressOperations() {};
132 void ValidateOperationL() const;
133 void operator=(const CSmsReplyAddressOperations&);
134 TBool operator==(const CSmsReplyAddressOperations&);
136 CCnvCharacterSetConverter& iCharacterSetConverter;
142 * Clients use this class to configure a CSmsMessage with a Special SMS Message Indication Information Element per 23.040 v6.5.0
143 * section 9.2.3.24.2.
147 class CSmsSpecialSMSMessageOperations : public CSmsCtrlOperation
150 IMPORT_C void AddSpecialMessageIndicationL(TBool aStore, TSmsMessageIndicationType aMessageIndicationType,
151 TExtendedSmsIndicationType aExtendedType, TSmsMessageProfileType aProfile,
152 TUint8 aMessageCount) const;
153 IMPORT_C TUint GetCountOfSpecialMessageIndicationsL() const;
154 IMPORT_C void GetMessageIndicationIEL(TUint aIndex, TBool& aStore, TSmsMessageIndicationType& aMessageIndicationType,
155 TExtendedSmsIndicationType& aExtendedType, TSmsMessageProfileType& aProfile,
156 TUint8& aMessageCount) const;
157 IMPORT_C void RemoveSpecialMessageIndicationL(TSmsMessageIndicationType aMessageIndicationType, TExtendedSmsIndicationType aExtendedType) const;
158 IMPORT_C void RemoveAllSpecialMessageIndicationsL() const;
159 CSmsSpecialSMSMessageOperations(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage);
160 ~CSmsSpecialSMSMessageOperations() {};
162 void ValidateOperationL() const;
163 void operator=(const CSmsSpecialSMSMessageOperations&);
164 TBool operator==(const CSmsSpecialSMSMessageOperations&);
169 * Clients use this class to configure a CSmsMessage with either an Enhanced Voice Mail Notification or a
170 * Enhanced Voice Mail Delete Confirmation per 23.040 v6.5.0 section 9.2.3.24.13.
172 * Clients should be aware that 23.040 v6.5.0 specifies that this information element must fit into the
173 * user data field of a single PDU. The amount of space available in the user data field depends on both
174 * the number and size of the mandatory information elements that must also be present.
175 * Intuitively the largest Enhanced Voice Mail information element can be added when no mandatory information
176 * elements need to be encoded in the PDU. To achieve this, the CSmsMessage must be configured with
177 * only the Enhanced Voice Mail Information Element and no other information elements or text.
181 class CSmsEnhancedVoiceMailOperations : public CSmsCtrlOperation
184 IMPORT_C void AddEnhancedVoiceMailIEL(const CEnhancedVoiceMailBoxInformation& aEVMI) const;
185 IMPORT_C CEnhancedVoiceMailBoxInformation* RemoveEnhancedVoiceMailIEL() const;
186 IMPORT_C CEnhancedVoiceMailBoxInformation* CopyEnhancedVoiceMailIEL() const;
187 IMPORT_C TBool ContainsEnhancedVoiceMailIEL() const;
188 CSmsEnhancedVoiceMailOperations(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage,
189 CCnvCharacterSetConverter& aCharacterSetConverter, RFs& aFs);
190 ~CSmsEnhancedVoiceMailOperations() {};
192 CEnhancedVoiceMailBoxInformation* GetEnhancedVoiceMailIEL(TBool aRemove) const;
193 void ValidateOperationL() const;
194 void operator=(const CSmsEnhancedVoiceMailOperations&);
195 TBool operator==(const CSmsEnhancedVoiceMailOperations&);
197 CCnvCharacterSetConverter& iCharacterSetConverter;
202 class CSmsSMSCCtrlParameterOperations : public CSmsCtrlOperation
205 CSmsSMSCCtrlParameterOperations(CSmsInformationElement::TSmsInformationElementIdentifier aId, CSmsMessage& aMessage);
206 ~CSmsSMSCCtrlParameterOperations() {};
207 IMPORT_C TInt GetStatusReport(TUint aSegmentSequenceNum, TUint8& aSelectiveStatus) const;
208 IMPORT_C TInt SetStatusReportL(TUint aSegmentSequenceNum, TUint8 aSelectiveStatus);
209 IMPORT_C void SetSchemeL();
210 IMPORT_C TSmsStatusReportScheme GetScheme() const;
211 IMPORT_C void ResetSchemeL();
212 IMPORT_C void SetDefaultL(TUint8 aDefaultSelectiveStatus);
214 void ValidateOperationL() const;
215 TBool ValidateControlParametersL(TUint8& aSelectiveStatus) const;
216 void operator=(const CSmsSMSCCtrlParameterOperations&);
217 TBool operator==(const CSmsSMSCCtrlParameterOperations&);
220 #endif // __GSMUIEOPERATIONS_