smsprotocols/smsstack/gsmu/inc/gsmumsgadditionalattributes.h
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This file defines the container class CSmsMessageAdditionalAttributes.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20 */
       
    21 
       
    22 
       
    23 #ifndef __GSMUMSGADDITIONALATTRIBUTES_
       
    24 #define __GSMUMSGADDITIONALATTRIBUTES_
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <e32std.h>
       
    28 #include "Gsmuelem.h"
       
    29 #include "gsmuieoperations.h"
       
    30 #include "gsmunonieoperations.h"
       
    31 
       
    32 /**
       
    33  *  @internalComponent
       
    34  *  
       
    35  *  CSmsMessageAdditionalAttributes
       
    36  *  
       
    37  *  This class contains additional attributes that would normally be
       
    38  *  stored in CSmsMessage.
       
    39  *  
       
    40  *  The class contains a collections of control information elements.
       
    41  *  These elements will either be copied into the working PDU for encoding
       
    42  *  or have been copied from the working pdu for decoding.
       
    43  */
       
    44 class CSmsMessageAdditionalAttributes : public CBase
       
    45 {
       
    46 public:
       
    47     typedef TSmsInformationElementCategories::TInformationElementCategory TCategory;
       
    48     typedef CSmsInformationElement::TSmsInformationElementIdentifier TInformationElementId;
       
    49     typedef CSmsInformationElement* CSmsInformationElementPtr;
       
    50 
       
    51 public:
       
    52 	static CSmsMessageAdditionalAttributes* NewL();
       
    53 
       
    54     // client side accessors (intended to be used by CSmsMessage)
       
    55 	void  AddControlInformationElementL(CSmsInformationElement* aIE);
       
    56 	TBool Find1stInstanceOfControlInformationElement(TInformationElementId aId, TUint& index) const;
       
    57     TBool FindNextInstanceOfControlInformationElement(TInformationElementId aId, TUint aStartIndex, TUint& aIndex) const;
       
    58     CSmsInformationElement& GetControlInformationElementL(TInformationElementId aId, TUint aIndex) const;
       
    59     TBool RemoveControlInformationElement(TInformationElementId aId, TUint aIndex, CSmsInformationElementPtr& aIE);
       
    60 
       
    61     // stack side interface / encoding / decoding
       
    62 	void AddControlInformationElementL(TCategory aCategory, CSmsInformationElement* aIE);
       
    63     CSmsInformationElement& GetControlInformationElementL(TCategory aCategory, TUint aIndex) const;
       
    64     TBool RemoveNextControlInformationElement(TCategory aCategory, CSmsInformationElementPtr& aIE);
       
    65     void DeleteControlInformationElement(TCategory aCategory, TUint8 index);
       
    66     TUint NumberOfControlInformationElements(TCategory aCategory) const;
       
    67 
       
    68     CSmsIEOperation& GetIEOperationL(TInformationElementId aId) const;
       
    69     CSmsNonIEOperation& GetNonIEOperationL(TSmsNonIEIdentifier aId) const;
       
    70     void SetIEOperationL(CSmsIEOperation* aOperation);
       
    71     void SetNonIEOperationL(CSmsNonIEOperation* aOperation);
       
    72 
       
    73  	void InternalizeL(RReadStream& aStream, TInt aVersion);
       
    74 	void ExternalizeL(RWriteStream& aStream, TInt aVersion) const;
       
    75 
       
    76     void ResetAttributesL();
       
    77 
       
    78     ~CSmsMessageAdditionalAttributes();
       
    79     
       
    80     class CSmsStatusReportScheme
       
    81     	{
       
    82     	public:
       
    83     		virtual TSmsStatusReportScheme Id() = 0;
       
    84     		virtual ~CSmsStatusReportScheme() {};
       
    85        	};
       
    86     
       
    87     class CControlParametersScheme : public CSmsStatusReportScheme
       
    88     	{
       
    89     	public:
       
    90     		CControlParametersScheme();
       
    91     		~CControlParametersScheme();
       
    92     		TSmsStatusReportScheme Id();
       
    93     	public:
       
    94 			struct TSmsSMSCCtrlParameterStatus
       
    95 				{
       
    96 			/** Message reference. */
       
    97 				TUint iSegmentSequenceNum;
       
    98 			/** Selective Status Report */
       
    99 				TUint8 iSelectiveStatus;
       
   100 				};
       
   101 			RArray<TSmsSMSCCtrlParameterStatus> iControlParametersStatusReport;
       
   102 			TUint8 iDefaultStatusReport;
       
   103 			TInt iNumOfPDUs;
       
   104 		};
       
   105     	
       
   106     class CTPSRRScheme : public CSmsStatusReportScheme
       
   107 		{
       
   108 		public:
       
   109 			CTPSRRScheme();
       
   110 			~CTPSRRScheme();
       
   111     		TSmsStatusReportScheme Id();
       
   112 		public:
       
   113 		    struct TSmsTPSRRStatus
       
   114 				{
       
   115 			/** Message reference. */
       
   116 				TUint iSegmentSequenceNum;
       
   117 			/** TP-SRR Bit. */
       
   118 				TSmsFirstOctet::TSmsStatusReportRequest iTPSRRStatus;
       
   119 				};
       
   120 			RArray<TSmsTPSRRStatus> iTPSRRStatusReport;	
       
   121 			TSmsFirstOctet::TSmsStatusReportRequest iDefaultStatusReport;
       
   122 			TInt iNumOfPDUs;
       
   123 		};
       
   124 		
       
   125 	class CDefaultScheme : public CSmsStatusReportScheme
       
   126 		{
       
   127 		public:
       
   128 			CDefaultScheme();
       
   129 			~CDefaultScheme();
       
   130     		TSmsStatusReportScheme Id();
       
   131 		};
       
   132 		
       
   133 	CSmsStatusReportScheme& GetStatusReportScheme() const;
       
   134 	void SetStatusReportSchemeL(TSmsStatusReportScheme aId);
       
   135 
       
   136 	RPointerArray<CSmsPDU>&  SmsPDUArray() { return iSmsPDUArray; };
       
   137 
       
   138 	TSmsEncoding Alternative7bitEncoding() const;
       
   139 	void SetAlternative7bitEncoding(TSmsEncoding aEncoding);
       
   140 
       
   141 private:
       
   142     void ConstructL();
       
   143     CSmsMessageAdditionalAttributes();
       
   144 
       
   145 private:
       
   146     typedef CArrayPtrFlat<CSmsInformationElement> CArrayOfPointersToControlInformationElements;
       
   147     // comment, not intending to store all categories in additional attributes, some categories will be stored in the working PDU
       
   148     // The following categories will be stored here:
       
   149     // ECtrlMandatoryIn1stPDUOnly,    e.g  Reply Address
       
   150     // ECtrlSingleInstanceOnly,       e.g. Enhanced Voice Mail
       
   151     // ECtrlMultipleInstancesAllowed, e.g. Hyperlink format
       
   152     
       
   153     CArrayOfPointersToControlInformationElements* iCollectionOfPointersToIEArrays[TSmsInformationElementCategories::ENumberOfCategories];
       
   154 
       
   155     CSmsHyperLinkOperations*         iHyperLinkOperations;
       
   156     CSmsReplyAddressOperations*      iReplyAddressOperations;
       
   157     CSmsSpecialSMSMessageOperations* iSpecialSMSMessageOperations;
       
   158     CSmsEnhancedVoiceMailOperations* iEnhancedVoiceMailOperations;
       
   159     CSmsSMSCCtrlParameterOperations* iSMSCCtrlParameterOperations;
       
   160     CSmsTPSRROperations*			 iTPSRROperations;
       
   161     CSmsStatusReportScheme*			 iStatusReportScheme;
       
   162 	CIncompleteClass0MessageInfo*	 iIncompleteClass0MessageInfo;
       
   163 	RPointerArray<CSmsPDU>           iSmsPDUArray;
       
   164 	TSmsEncoding                     iAlternative7bitEncoding;
       
   165 };
       
   166 
       
   167 #endif // __GSMUMSGADDITIONALATTRIBUTES_