epoc32/include/gsmunonieoperations.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
       
     1 // Copyright (c) 2006-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This file defines the container class CSmsNonIEOperation and its specialisations.
       
    15 // The classes provide interfaces that allow the client to operate on a number
       
    16 // of features which are not associated with Information Elements.
       
    17 // 
       
    18 //
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file
       
    24 */
       
    25 
       
    26 #ifndef __GSMUNONIEOPERATIONS_
       
    27 #define __GSMUNONIEOPERATIONS_
       
    28 
       
    29 
       
    30 #include <e32base.h>
       
    31 #include <gsmumsg.h>
       
    32 #include <gsmuelem.h>
       
    33 
       
    34 /**
       
    35  *  SMS Stack clients use specialisations of this class to configure a SMS Message with parameters which are not
       
    36  *  a type of Information Element.
       
    37  *
       
    38  *  Each parameter that uses this interface is supported by a class derived from CSmsNonIEOperation.
       
    39  *  The derived class operates on the CSmsMessage, allowing the client to add, remove and access these parameters
       
    40  *  inside the CSmsMessage.
       
    41  *
       
    42  *  The client gets access to an operations class using the following interface:
       
    43  *
       
    44  *  CSmsNonIEOperation& CSmsMessage::GetOperationsForNonIEL(TSmsNonIEIdentifier aId);
       
    45  *
       
    46  *  When the CSmsMessage is deleted, all its associated CSmsNonIEOperations classes are also deleted and references to
       
    47  *  them become stale. Each instance of the CSmsNonIEOperation Class is an attribute of the CSmsMessage itself.
       
    48  *
       
    49  *  @publishedAll
       
    50  */
       
    51 class CSmsNonIEOperation : public CBase
       
    52 {
       
    53 public: 
       
    54 	static CSmsNonIEOperation* NewL(TSmsNonIEIdentifier aId, CSmsMessage& aMessage);
       
    55 	IMPORT_C TSmsNonIEIdentifier Id() const;
       
    56 	virtual ~CSmsNonIEOperation(){};
       
    57 protected:
       
    58 	virtual TBool MessageTypeSupported() const;
       
    59 	virtual void ValidateOperationL() const {};
       
    60 private: 
       
    61     void ConstructL();   
       
    62 private:    
       
    63     TSmsNonIEIdentifier iId;
       
    64 protected:
       
    65     CSmsMessage& iMessage;
       
    66     CSmsNonIEOperation(TSmsNonIEIdentifier aId, CSmsMessage& aMessage);
       
    67     void operator=(const CSmsNonIEOperation&);
       
    68     TBool operator==(const CSmsNonIEOperation&);    
       
    69 };
       
    70 
       
    71 class CSmsCtrlNonIEOperation : public CSmsNonIEOperation
       
    72 {
       
    73 protected:
       
    74     CSmsCtrlNonIEOperation(TSmsNonIEIdentifier aId, CSmsMessage& aMessage);
       
    75     ~CSmsCtrlNonIEOperation(){};
       
    76     void operator=(const CSmsCtrlNonIEOperation&);
       
    77     TBool operator==(const CSmsCtrlNonIEOperation&);
       
    78 };
       
    79 
       
    80 class CSmsTPSRROperations : public CSmsCtrlNonIEOperation
       
    81 	{
       
    82 public:
       
    83 	CSmsTPSRROperations(TSmsNonIEIdentifier aId, CSmsMessage& aMessage);
       
    84     ~CSmsTPSRROperations() {};
       
    85     IMPORT_C TInt GetStatusReport(TUint aSegmentSequenceNum) const;
       
    86     IMPORT_C void SetLastSegmentStatusReportL(TBool aEnable);
       
    87     IMPORT_C TInt SetSegmentStatusReportL(TUint aSegmentSequenceNum, TBool aEnable);
       
    88     IMPORT_C void SetSchemeL();
       
    89     IMPORT_C TSmsStatusReportScheme GetScheme() const;
       
    90    	IMPORT_C void ResetSchemeL();
       
    91    	IMPORT_C void SetDefaultL(TBool aEnable);
       
    92 protected:
       
    93     void ValidateOperationL() const;
       
    94     void operator=(const CSmsTPSRROperations&);
       
    95     TBool operator==(const CSmsTPSRROperations&);
       
    96 	};
       
    97 
       
    98 /**
       
    99  *  This class will store the incomplete class 0 message information.
       
   100  *  
       
   101  *  
       
   102  *  The object of this class will be stored inside CSmsMessageAdditionalAttributes class.
       
   103  *  This class will provide 2 exported functions which will allow the caller of this class 
       
   104  *  to get/set incomplete class 0 message information.
       
   105  *  @publishedAll
       
   106  *  @released 
       
   107  */
       
   108 class CIncompleteClass0MessageInfo : public CSmsNonIEOperation
       
   109 	{
       
   110 public:
       
   111 	CIncompleteClass0MessageInfo(TSmsNonIEIdentifier aId, CSmsMessage& aMessage);
       
   112 	IMPORT_C void GetIncompleteMessageInfoL(TInt& aStartPos, TInt& aEndPos, TBool& aIsLastIncompleteMessage);
       
   113 	IMPORT_C void SetIncompleteMessageInfoL(TInt aStartPos, TInt aEndPos, TBool aIsLastIncompleteMessage);
       
   114 	TInt Version();
       
   115 	void SetVersion(TInt aVersion);
       
   116 	void InternalizeL(RReadStream& aStream);
       
   117 	void ExternalizeL(RWriteStream& aStream) const;
       
   118 
       
   119 protected:
       
   120 	TBool MessageTypeSupported() const;
       
   121 	void ValidateOperationL() const;
       
   122 	void operator=(const CIncompleteClass0MessageInfo&);
       
   123 	TBool operator==(const CIncompleteClass0MessageInfo&);
       
   124 
       
   125 public:
       
   126 /**
       
   127  *  Incomplete Class 0 Message versions
       
   128  */
       
   129 	enum TSmsIncompleteClass0MessageVersion
       
   130 		{
       
   131 		/** The default value. */
       
   132 		ESmsIncompleteClass0MessageV0,
       
   133 		// for all other versions the corresponding enum values would be added i.e. ESmsIncompleteClass0MessageV1, etc.
       
   134 		EMaxSmsIncompleteClass0MessageV
       
   135 		};
       
   136 
       
   137 private:
       
   138 /**
       
   139  *  iVersion is the version of CIncompleteClass0MessageInfo. This parameter will be
       
   140  *  used to identify what iAdditionalInfo points to for that particular
       
   141  *  version of CIncompleteClass0MessageInfo
       
   142  */
       
   143 	TInt iVersion;
       
   144 
       
   145 	TInt iStartPos;
       
   146 	TInt iEndPos;
       
   147 	TBool iIsLastIncompleteMessage;
       
   148 	};
       
   149 
       
   150 #endif