epoc32/include/app/smuthdr.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     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
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
       
    14 // SMUTHDR.H
    14 //
    15 //
    15 
    16 /**
       
    17  * @file 
       
    18  * @publishedAll
       
    19  * @released
       
    20  */
    16 #ifndef __SMUTHDR_H__
    21 #ifndef __SMUTHDR_H__
    17 #define __SMUTHDR_H__
    22 #define __SMUTHDR_H__
    18 
    23 
    19 #include <e32base.h>
    24 #include <e32base.h>
    20 #include <gsmubuf.h>
    25 #include <gsmubuf.h>
    21 #include <bif.h>
    26 #include <bif.h>
    22 #include <gsmupdu.h>
    27 #include <gsmupdu.h>
    23 #include <msvstd.h>
    28 #include <msvstd.h>
    24 #include <smutset.h>
    29 #include <smutset.h>
       
    30 
       
    31 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS  
       
    32 #include <tmsvsmsentry.h>
       
    33 #endif
    25 
    34 
    26 class RMsvReadStream;
    35 class RMsvReadStream;
    27 class RMsvWriteStream;
    36 class RMsvWriteStream;
    28 class CMsvStore;
    37 class CMsvStore;
    29 class CSmsEmailFields;
    38 class CSmsEmailFields;
    54 6. SMS-COMMAND - sent from MS to SC
    63 6. SMS-COMMAND - sent from MS to SC
    55 
    64 
    56 @publishedAll
    65 @publishedAll
    57 @released
    66 @released
    58 */
    67 */
    59 class CSmsHeader : public CBase
    68 NONSHARABLE_CLASS (CSmsHeader) : public CBase
    60 	{
    69 	{
    61 public:
    70 public:
    62 
    71 
    63 	IMPORT_C static CSmsHeader* NewL(CSmsPDU::TSmsPDUType aType,CEditableText& aText);
    72 	IMPORT_C static CSmsHeader* NewL(CSmsPDU::TSmsPDUType aType,CEditableText& aText);
    64 	IMPORT_C static CSmsHeader* NewL(CSmsPDU::TSmsPDUType aType,CEditableText& aText,RFs& aFs);
    73 	IMPORT_C static CSmsHeader* NewL(CSmsPDU::TSmsPDUType aType,CEditableText& aText,RFs& aFs);
   109 
   118 
   110 	IMPORT_C void RestoreL(CMsvStore& aStore);
   119 	IMPORT_C void RestoreL(CMsvStore& aStore);
   111 	IMPORT_C void StoreL(CMsvStore& aStore) const;
   120 	IMPORT_C void StoreL(CMsvStore& aStore) const;
   112 
   121 
   113 	IMPORT_C  TBool ContainsSmsHeaderL(const CMsvStore& aStore); 
   122 	IMPORT_C  TBool ContainsSmsHeaderL(const CMsvStore& aStore); 
       
   123 
   114 	
   124 	
   115 private:
   125 private:
   116 	CSmsHeader(CSmsMessage* aSmsMessage = NULL);
   126 	CSmsHeader(CSmsMessage* aSmsMessage = NULL);
   117 	void ConstructL(CSmsPDU::TSmsPDUType aType, CEditableText& aText);
   127 	void ConstructL(CSmsPDU::TSmsPDUType aType, CEditableText& aText);
   118 	void ConstructL(CSmsPDU::TSmsPDUType aType, CEditableText& aText, RFs& aFs);
   128 	void ConstructL(CSmsPDU::TSmsPDUType aType, CEditableText& aText, RFs& aFs);
   127 
   137 
   128 	TBool CanConcatenate() const;
   138 	TBool CanConcatenate() const;
   129 	void SetCanConcatenate(TBool aCanConcatenate);
   139 	void SetCanConcatenate(TBool aCanConcatenate);
   130 	
   140 	
   131 	void SetEmailReplyForwardSubjectL(CSmsEmailFields* aEmailFields, const TDesC& aSubject, const TDesC& aSubjectFormat);
   141 	void SetEmailReplyForwardSubjectL(CSmsEmailFields* aEmailFields, const TDesC& aSubject, const TDesC& aSubjectFormat);
   132 	
   142 
       
   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);
       
   148 #endif
       
   149 
   133 private:
   150 private:
   134 	CArrayPtrFlat<CSmsNumber> iRecipients;
   151 	CArrayPtrFlat<CSmsNumber> iRecipients;
   135 	CSmsMessage* iMessage;
   152 	CSmsMessage* iMessage;
   136 	TUint32 iFlags;
   153 	TUint32 iFlags;
   137 	RFs iFs;
   154 	RFs iFs;
   141 	TBioMsgIdType iBioMsgIdType;
   158 	TBioMsgIdType iBioMsgIdType;
   142 	CSmsEmailFields*	iEmailFields;
   159 	CSmsEmailFields*	iEmailFields;
   143 	TBool			iCloseFs;
   160 	TBool			iCloseFs;
   144 	};
   161 	};
   145 	
   162 	
   146 /**
       
   147 A specialisation of the message server index class for SMS message entries.
       
   148 
       
   149 It provides accessers for SMS message specific data, for instance the class type
       
   150 of the SMS message.
       
   151 
       
   152 @publishedPartner
       
   153 @released
       
   154 */
       
   155 class TMsvSmsEntry : public TMsvEntry
       
   156 	{
       
   157 public:
       
   158 
       
   159 /**
       
   160 Defines a set flags used to access message entry data specific to an SMS message.
       
   161 
       
   162 @internalTechnology
       
   163 @released
       
   164 
       
   165 */
       
   166 	enum TMsvSmsEntryFlags
       
   167 		{
       
   168 /**
       
   169 Clears the entire set of SMS flags.
       
   170 */
       
   171 		EMsvSmsEntryClearFlag				= 0x00000000,
       
   172 /**
       
   173 Mask for the protocol identifier data.
       
   174 */
       
   175 		EMsvSmsEntryProtocolIdentifier		= 0x000000FF,
       
   176 /**
       
   177 Mask for the User Prompt Indicator flag.
       
   178 */
       
   179 		EMsvSmsEntryUserPromptIndicator 	= 0x00000100,
       
   180 /**
       
   181 Mask for the SMS class data.
       
   182 */
       
   183 		EMsvSmsEntryClass					= 0x00000E00,
       
   184 /**
       
   185 Mask for the flag indicating whether the class data has been defined.
       
   186 */
       
   187 		EMsvSmsEntryClassDefined			= 0x00001000,
       
   188 /**
       
   189 Mask for the flag indicating whether the message ID is valid. 
       
   190 */
       
   191 		EMsvSmsMessageValid					= 0x00002000,
       
   192 /**
       
   193 Mask for the delivery acknowledgement information.
       
   194 */
       
   195 		EMsvSmsEntryDeliveryAckSummary		= 0x0001C000,
       
   196 /**
       
   197 Parameter defining the number of bits to be shifted in order for the SMS class
       
   198 data to be at the LSB of the data block.
       
   199 */
       
   200 		EMsvSmsEntryClassShift				= 9,
       
   201 /**
       
   202 Parameter defining the number of bits to be shifted in order for the delivery
       
   203 acknowlwdgement information to be at the LSB of the data block.
       
   204 */
       
   205 		EMsvSmsEntryDeliveryAckSummaryShift	= 14
       
   206 		};
       
   207 
       
   208 /**
       
   209 Defines the summary acknowledgement information.
       
   210 
       
   211 This information indicates whether the SMS message is not supplying a summary 
       
   212 for an acknowledgement, is still expecting acknowledgments or it has received 
       
   213 all expected acknowledgements.
       
   214 
       
   215 If all acknowledgements have been received the summary indicates whether all 
       
   216 the recipients have successfully acknowledged the message, all failed or there
       
   217 was a mixture of successful and failed acknowledgements from the recipients. 
       
   218 */
       
   219 	enum TMsvSmsEntryAckSummary
       
   220 		{
       
   221 /**
       
   222 No summary information is being formed.
       
   223 */
       
   224 		ENoAckSummary			= 0,
       
   225 /**
       
   226 The message is waiting for acknowledgements to be received for all recipients
       
   227 of this message. Some recipients may have received their acknowledgements but
       
   228 there are still some recipients that have not.
       
   229 */
       
   230 		EPendingAcks,
       
   231 /**
       
   232 The summary indicates that the message was successfully acknowledged by all recipients.
       
   233 */
       
   234 		EAllSuccessful,
       
   235 /**
       
   236 The summary indicates that the message failed to be acknowledged by all recipients.
       
   237 */
       
   238 		EAllFailed,
       
   239 /**
       
   240 The summary indicates a mixture of successful and failed acknowledgements from 
       
   241 the recipients of the message. All recipients of this message have received 
       
   242 their acknowledgements.
       
   243 */
       
   244 		EMixed
       
   245 		};
       
   246 
       
   247 public:
       
   248 	inline TMsvSmsEntry();
       
   249 	inline TMsvSmsEntry(const TMsvEntry& aEntry);
       
   250 
       
   251 	inline void SetUserPromptIndicator(TBool aUPI);
       
   252 	inline TBool UserPromptIndicator() const;
       
   253 
       
   254 	inline TUint8 ProtocolIdentifier() const;
       
   255 	inline void SetProtocolIdentifier(TSmsProtocolIdentifier aPID);
       
   256 	inline void SetProtocolIdentifier(TUint8 aPID);
       
   257 
       
   258 	inline TBool Class(TSmsDataCodingScheme::TSmsClass& aClass) const;
       
   259 	inline void SetClass(TBool aClassDefined,TSmsDataCodingScheme::TSmsClass aClass = TSmsDataCodingScheme::ESmsClass0);
       
   260 
       
   261 	IMPORT_C TMsvSmsEntryAckSummary AckSummary(TSmsAckType aAckType) const;
       
   262 	IMPORT_C void SetAckSummary(TSmsAckType aAckType, TMsvSmsEntryAckSummary aAckSummary);
       
   263 
       
   264 	IMPORT_C TBool MessageId(TInt32& aMessageId) const;
       
   265 	IMPORT_C void SetMessageId(TInt32 aMessageId, TBool aIsValid);
       
   266 	};
       
   267 
       
   268 #include <smuthdr.inl>
   163 #include <smuthdr.inl>
   269 
   164 
   270 #endif	// __SMUTHDR_H__
   165 #endif	// __SMUTHDR_H__
       
   166