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.
31 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
32 #include <tmsvsmsentry.h>
36 class RMsvWriteStream;
38 class CSmsEmailFields;
41 The SMS MTM encapsulation of an SMS message.
43 This class allows a messaging client to access the lower-level message encapsulation
44 used by the SMS stack.
46 It also provides functionality to restore and store an SMS message from/to the
49 An SMS message is encapsulated in a Protocol Data Unit (PDU). In GSM there are
50 six types of SMS message PDU. In the descriptions below, SC means Service Center
51 and MS means Mobile Station (the phone).
53 1. SMS-DELIVER - sent from SC to MS
55 2. SMS-DELIVER-REPORT - sent from MS to SC
57 3. SMS-SUBMIT - sent from MS to SC
59 4. SMS-SUBMIT-REPORT - sent from SC to MS
61 5. SMS-STATUS-REPORT - sent from SC to MS
63 6. SMS-COMMAND - sent from MS to SC
68 NONSHARABLE_CLASS (CSmsHeader) : public CBase
72 IMPORT_C static CSmsHeader* NewL(CSmsPDU::TSmsPDUType aType,CEditableText& aText);
73 IMPORT_C static CSmsHeader* NewL(CSmsPDU::TSmsPDUType aType,CEditableText& aText,RFs& aFs);
74 IMPORT_C static CSmsHeader* NewL(CSmsMessage* aMessage);
75 IMPORT_C ~CSmsHeader();
77 inline CSmsPDU::TSmsPDUType Type() const;
79 inline CSmsSubmit& Submit();
80 inline const CSmsSubmit& Submit() const;
81 inline CSmsDeliver& Deliver();
82 inline const CSmsDeliver& Deliver() const;
83 inline CSmsCommand& Command();
84 inline const CSmsCommand& Command() const;
85 inline CSmsStatusReport& StatusReport();
86 inline const CSmsStatusReport& StatusReport() const;
88 inline CSmsMessage& Message();
89 inline const CSmsMessage& Message() const;
91 inline TBool ReplyPathProvided() const;
92 inline void SetReplyPathProvided(TBool aReplyPathProvided);
94 inline TBioMsgIdType BioMsgIdType() const;
95 inline void SetBioMsgIdType(TBioMsgIdType aBioMsgIdType = EBioMsgIdNbs);
97 inline TPtrC ServiceCenterAddress() const;
98 inline void SetServiceCenterAddressL(const TDesC& aAddress);
100 IMPORT_C void SetSmsSettingsL(const CSmsMessageSettings& aSmsSettings);
101 IMPORT_C void GetSmsSettingsL(CSmsMessageSettings& aSmsSettings) const;
103 inline const CArrayPtrFlat<CSmsNumber>& Recipients() const;
104 inline CArrayPtrFlat<CSmsNumber>& Recipients();
106 inline void SetFromAddressL(const TDesC& aAddress);
107 inline TPtrC FromAddress() const;
109 TPtrC ReplyAddressL() const;
111 IMPORT_C void SetEmailFieldsL(const CSmsEmailFields& aEmailFields);
112 void SetReplyEmailFieldsL(const CSmsEmailFields& aEmailFields, const TDesC& aReplySubjectFormat);
113 void SetForwardEmailFieldsL(const CSmsEmailFields& aEmailFields, const TDesC& aForwardSubjectFormat);
114 IMPORT_C const CSmsEmailFields& EmailFields() const;
116 IMPORT_C void InternalizeL( RMsvReadStream& aStream);
117 IMPORT_C void ExternalizeL( RMsvWriteStream& aStream) const;
119 IMPORT_C void RestoreL(CMsvStore& aStore);
120 IMPORT_C void StoreL(CMsvStore& aStore) const;
122 IMPORT_C TBool ContainsSmsHeaderL(const CMsvStore& aStore);
126 CSmsHeader(CSmsMessage* aSmsMessage = NULL);
127 void ConstructL(CSmsPDU::TSmsPDUType aType, CEditableText& aText);
128 void ConstructL(CSmsPDU::TSmsPDUType aType, CEditableText& aText, RFs& aFs);
133 ESmsHeaderNoFlags = 0x00,
134 ESmsHeaderReplyPathProvided = 0x01,
135 ESmsHeaderCanConcatenate = 0x02
138 TBool CanConcatenate() const;
139 void SetCanConcatenate(TBool aCanConcatenate);
141 void SetEmailReplyForwardSubjectL(CSmsEmailFields* aEmailFields, const TDesC& aSubject, const TDesC& aSubjectFormat);
143 #if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
144 void StoreDbL(CMsvStore& aStore) const;
145 void ReStoreDBL(CMsvStore& aStore);
146 void GetRecipientL(TDesC16& aRecipientStrList);
147 TInt ConvertToTInt(TDesC16& aStr);
151 CArrayPtrFlat<CSmsNumber> iRecipients;
152 CSmsMessage* iMessage;
156 // iBioMsgIdType is only used during sending and will be ignored if the
157 // TMsvEntry.iBioType == 0. The default is EBioMsgIdNbs.
158 TBioMsgIdType iBioMsgIdType;
159 CSmsEmailFields* iEmailFields;
163 #include <smuthdr.inl>
165 #endif // __SMUTHDR_H__