epoc32/include/app/smuthdr.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/app/smuthdr.h	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,270 @@
     1.4 +// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// 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
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __SMUTHDR_H__
    1.20 +#define __SMUTHDR_H__
    1.21 +
    1.22 +#include <e32base.h>
    1.23 +#include <gsmubuf.h>
    1.24 +#include <bif.h>
    1.25 +#include <gsmupdu.h>
    1.26 +#include <msvstd.h>
    1.27 +#include <smutset.h>
    1.28 +
    1.29 +class RMsvReadStream;
    1.30 +class RMsvWriteStream;
    1.31 +class CMsvStore;
    1.32 +class CSmsEmailFields;
    1.33 +
    1.34 +/** 
    1.35 +The SMS MTM encapsulation of an SMS message.
    1.36 +
    1.37 +This class allows a messaging client to access the lower-level message encapsulation 
    1.38 +used by the SMS stack.
    1.39 +
    1.40 +It also provides functionality to restore and store an SMS message from/to the
    1.41 +message store.
    1.42 +
    1.43 +An SMS message is encapsulated in a Protocol Data Unit (PDU). In GSM there are 
    1.44 +six types of SMS message PDU. In the descriptions below, SC means Service Center 
    1.45 +and MS means Mobile Station (the phone).
    1.46 +
    1.47 +1. SMS-DELIVER - sent from SC to MS
    1.48 +
    1.49 +2. SMS-DELIVER-REPORT - sent from MS to SC
    1.50 +
    1.51 +3. SMS-SUBMIT - sent from MS to SC
    1.52 +
    1.53 +4. SMS-SUBMIT-REPORT - sent from SC to MS
    1.54 +
    1.55 +5. SMS-STATUS-REPORT - sent from SC to MS
    1.56 +
    1.57 +6. SMS-COMMAND - sent from MS to SC
    1.58 +
    1.59 +@publishedAll
    1.60 +@released
    1.61 +*/
    1.62 +class CSmsHeader : public CBase
    1.63 +	{
    1.64 +public:
    1.65 +
    1.66 +	IMPORT_C static CSmsHeader* NewL(CSmsPDU::TSmsPDUType aType,CEditableText& aText);
    1.67 +	IMPORT_C static CSmsHeader* NewL(CSmsPDU::TSmsPDUType aType,CEditableText& aText,RFs& aFs);
    1.68 +	IMPORT_C static CSmsHeader* NewL(CSmsMessage* aMessage);
    1.69 +	IMPORT_C ~CSmsHeader();
    1.70 +
    1.71 +	inline CSmsPDU::TSmsPDUType Type() const;
    1.72 +
    1.73 +	inline CSmsSubmit& Submit();
    1.74 +	inline const CSmsSubmit& Submit() const;
    1.75 +	inline CSmsDeliver& Deliver();
    1.76 +	inline const CSmsDeliver& Deliver() const;
    1.77 +	inline CSmsCommand& Command();
    1.78 +	inline const CSmsCommand& Command() const;
    1.79 +	inline CSmsStatusReport& StatusReport();
    1.80 +	inline const CSmsStatusReport& StatusReport() const;
    1.81 +	
    1.82 +	inline CSmsMessage& Message();
    1.83 +	inline const CSmsMessage& Message() const;
    1.84 +
    1.85 +	inline TBool ReplyPathProvided() const;
    1.86 +	inline void SetReplyPathProvided(TBool aReplyPathProvided);
    1.87 +
    1.88 +	inline TBioMsgIdType BioMsgIdType() const;
    1.89 +	inline void SetBioMsgIdType(TBioMsgIdType aBioMsgIdType = EBioMsgIdNbs);
    1.90 +	
    1.91 +	inline TPtrC ServiceCenterAddress() const;
    1.92 +	inline void SetServiceCenterAddressL(const TDesC& aAddress);
    1.93 +
    1.94 +	IMPORT_C void SetSmsSettingsL(const CSmsMessageSettings& aSmsSettings);
    1.95 +	IMPORT_C void GetSmsSettingsL(CSmsMessageSettings& aSmsSettings) const;
    1.96 +
    1.97 +	inline const CArrayPtrFlat<CSmsNumber>& Recipients() const;
    1.98 +	inline CArrayPtrFlat<CSmsNumber>& Recipients();
    1.99 +
   1.100 +	inline void SetFromAddressL(const TDesC& aAddress);
   1.101 +	inline TPtrC FromAddress() const;
   1.102 +	
   1.103 +	TPtrC ReplyAddressL() const;
   1.104 +	
   1.105 +	IMPORT_C void SetEmailFieldsL(const CSmsEmailFields& aEmailFields);
   1.106 +	void SetReplyEmailFieldsL(const CSmsEmailFields& aEmailFields, const TDesC& aReplySubjectFormat);
   1.107 +	void SetForwardEmailFieldsL(const CSmsEmailFields& aEmailFields, const TDesC& aForwardSubjectFormat);
   1.108 +	IMPORT_C const CSmsEmailFields& EmailFields() const;
   1.109 +
   1.110 +	IMPORT_C void InternalizeL( RMsvReadStream& aStream);
   1.111 +	IMPORT_C void ExternalizeL( RMsvWriteStream& aStream) const;
   1.112 +
   1.113 +	IMPORT_C void RestoreL(CMsvStore& aStore);
   1.114 +	IMPORT_C void StoreL(CMsvStore& aStore) const;
   1.115 +
   1.116 +	IMPORT_C  TBool ContainsSmsHeaderL(const CMsvStore& aStore); 
   1.117 +	
   1.118 +private:
   1.119 +	CSmsHeader(CSmsMessage* aSmsMessage = NULL);
   1.120 +	void ConstructL(CSmsPDU::TSmsPDUType aType, CEditableText& aText);
   1.121 +	void ConstructL(CSmsPDU::TSmsPDUType aType, CEditableText& aText, RFs& aFs);
   1.122 +	void ConstructL();
   1.123 +
   1.124 +	enum TSmsHeaderFlags
   1.125 +		{
   1.126 +		ESmsHeaderNoFlags			= 0x00,
   1.127 +		ESmsHeaderReplyPathProvided = 0x01,
   1.128 +		ESmsHeaderCanConcatenate	= 0x02
   1.129 +		};
   1.130 +
   1.131 +	TBool CanConcatenate() const;
   1.132 +	void SetCanConcatenate(TBool aCanConcatenate);
   1.133 +	
   1.134 +	void SetEmailReplyForwardSubjectL(CSmsEmailFields* aEmailFields, const TDesC& aSubject, const TDesC& aSubjectFormat);
   1.135 +	
   1.136 +private:
   1.137 +	CArrayPtrFlat<CSmsNumber> iRecipients;
   1.138 +	CSmsMessage* iMessage;
   1.139 +	TUint32 iFlags;
   1.140 +	RFs iFs;
   1.141 +
   1.142 +	// iBioMsgIdType is only used during sending and will be ignored if the 
   1.143 +	// TMsvEntry.iBioType == 0. The default is EBioMsgIdNbs.
   1.144 +	TBioMsgIdType iBioMsgIdType;
   1.145 +	CSmsEmailFields*	iEmailFields;
   1.146 +	TBool			iCloseFs;
   1.147 +	};
   1.148 +	
   1.149 +/**
   1.150 +A specialisation of the message server index class for SMS message entries.
   1.151 +
   1.152 +It provides accessers for SMS message specific data, for instance the class type
   1.153 +of the SMS message.
   1.154 +
   1.155 +@publishedPartner
   1.156 +@released
   1.157 +*/
   1.158 +class TMsvSmsEntry : public TMsvEntry
   1.159 +	{
   1.160 +public:
   1.161 +
   1.162 +/**
   1.163 +Defines a set flags used to access message entry data specific to an SMS message.
   1.164 +
   1.165 +@internalTechnology
   1.166 +@released
   1.167 +
   1.168 +*/
   1.169 +	enum TMsvSmsEntryFlags
   1.170 +		{
   1.171 +/**
   1.172 +Clears the entire set of SMS flags.
   1.173 +*/
   1.174 +		EMsvSmsEntryClearFlag				= 0x00000000,
   1.175 +/**
   1.176 +Mask for the protocol identifier data.
   1.177 +*/
   1.178 +		EMsvSmsEntryProtocolIdentifier		= 0x000000FF,
   1.179 +/**
   1.180 +Mask for the User Prompt Indicator flag.
   1.181 +*/
   1.182 +		EMsvSmsEntryUserPromptIndicator 	= 0x00000100,
   1.183 +/**
   1.184 +Mask for the SMS class data.
   1.185 +*/
   1.186 +		EMsvSmsEntryClass					= 0x00000E00,
   1.187 +/**
   1.188 +Mask for the flag indicating whether the class data has been defined.
   1.189 +*/
   1.190 +		EMsvSmsEntryClassDefined			= 0x00001000,
   1.191 +/**
   1.192 +Mask for the flag indicating whether the message ID is valid. 
   1.193 +*/
   1.194 +		EMsvSmsMessageValid					= 0x00002000,
   1.195 +/**
   1.196 +Mask for the delivery acknowledgement information.
   1.197 +*/
   1.198 +		EMsvSmsEntryDeliveryAckSummary		= 0x0001C000,
   1.199 +/**
   1.200 +Parameter defining the number of bits to be shifted in order for the SMS class
   1.201 +data to be at the LSB of the data block.
   1.202 +*/
   1.203 +		EMsvSmsEntryClassShift				= 9,
   1.204 +/**
   1.205 +Parameter defining the number of bits to be shifted in order for the delivery
   1.206 +acknowlwdgement information to be at the LSB of the data block.
   1.207 +*/
   1.208 +		EMsvSmsEntryDeliveryAckSummaryShift	= 14
   1.209 +		};
   1.210 +
   1.211 +/**
   1.212 +Defines the summary acknowledgement information.
   1.213 +
   1.214 +This information indicates whether the SMS message is not supplying a summary 
   1.215 +for an acknowledgement, is still expecting acknowledgments or it has received 
   1.216 +all expected acknowledgements.
   1.217 +
   1.218 +If all acknowledgements have been received the summary indicates whether all 
   1.219 +the recipients have successfully acknowledged the message, all failed or there
   1.220 +was a mixture of successful and failed acknowledgements from the recipients. 
   1.221 +*/
   1.222 +	enum TMsvSmsEntryAckSummary
   1.223 +		{
   1.224 +/**
   1.225 +No summary information is being formed.
   1.226 +*/
   1.227 +		ENoAckSummary			= 0,
   1.228 +/**
   1.229 +The message is waiting for acknowledgements to be received for all recipients
   1.230 +of this message. Some recipients may have received their acknowledgements but
   1.231 +there are still some recipients that have not.
   1.232 +*/
   1.233 +		EPendingAcks,
   1.234 +/**
   1.235 +The summary indicates that the message was successfully acknowledged by all recipients.
   1.236 +*/
   1.237 +		EAllSuccessful,
   1.238 +/**
   1.239 +The summary indicates that the message failed to be acknowledged by all recipients.
   1.240 +*/
   1.241 +		EAllFailed,
   1.242 +/**
   1.243 +The summary indicates a mixture of successful and failed acknowledgements from 
   1.244 +the recipients of the message. All recipients of this message have received 
   1.245 +their acknowledgements.
   1.246 +*/
   1.247 +		EMixed
   1.248 +		};
   1.249 +
   1.250 +public:
   1.251 +	inline TMsvSmsEntry();
   1.252 +	inline TMsvSmsEntry(const TMsvEntry& aEntry);
   1.253 +
   1.254 +	inline void SetUserPromptIndicator(TBool aUPI);
   1.255 +	inline TBool UserPromptIndicator() const;
   1.256 +
   1.257 +	inline TUint8 ProtocolIdentifier() const;
   1.258 +	inline void SetProtocolIdentifier(TSmsProtocolIdentifier aPID);
   1.259 +	inline void SetProtocolIdentifier(TUint8 aPID);
   1.260 +
   1.261 +	inline TBool Class(TSmsDataCodingScheme::TSmsClass& aClass) const;
   1.262 +	inline void SetClass(TBool aClassDefined,TSmsDataCodingScheme::TSmsClass aClass = TSmsDataCodingScheme::ESmsClass0);
   1.263 +
   1.264 +	IMPORT_C TMsvSmsEntryAckSummary AckSummary(TSmsAckType aAckType) const;
   1.265 +	IMPORT_C void SetAckSummary(TSmsAckType aAckType, TMsvSmsEntryAckSummary aAckSummary);
   1.266 +
   1.267 +	IMPORT_C TBool MessageId(TInt32& aMessageId) const;
   1.268 +	IMPORT_C void SetMessageId(TInt32 aMessageId, TBool aIsValid);
   1.269 +	};
   1.270 +
   1.271 +#include <smuthdr.inl>
   1.272 +
   1.273 +#endif	// __SMUTHDR_H__