00001 /* 00002 * ============================================================================= 00003 * Name : sipacceptheader.h 00004 * Part of : SIP Codec 00005 * Interface : SDK API, SIP Codec API 00006 * Description : 00007 * Version : SIP/4.0 00008 * 00009 * Copyright (c) 2004 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. All rights are reserved. Copying, 00013 * including reproducing, storing, adapting or translating, any 00014 * or all of this material requires the prior written consent of 00015 * Nokia Corporation. This material also contains confidential 00016 * information which may not be disclosed to others without the 00017 * prior written consent of Nokia Corporation. 00018 * ============================================================================= 00019 */ 00020 00021 00022 #ifndef CSIPACCEPTHEADER_H 00023 #define CSIPACCEPTHEADER_H 00024 00025 // INCLUDES 00026 #include "SipParameterHeaderBase.h" 00027 #include "_sipcodecdefs.h" 00028 00029 // FORWARD DECLARATIONS 00030 class CSIPAcceptHeaderParams; 00031 00032 00033 // CLASS DECLARATION 00043 class CSIPAcceptHeader : public CSIPParameterHeaderBase 00044 { 00045 public: // Constructors and destructor 00046 00055 IMPORT_C static RPointerArray<CSIPAcceptHeader> 00056 DecodeL(const TDesC8& aValue); 00057 00064 IMPORT_C static CSIPAcceptHeader* NewL(const TDesC8& aMediaType, 00065 const TDesC8& aMediaSubtype); 00066 00074 IMPORT_C static CSIPAcceptHeader* NewLC(const TDesC8& aMediaType, 00075 const TDesC8& aMediaSubtype); 00076 00080 IMPORT_C ~CSIPAcceptHeader(); 00081 00082 00083 public: // New functions 00084 00090 IMPORT_C TBool IsEmpty() const; 00091 00096 IMPORT_C const TDesC8& MediaType() const; 00097 00103 IMPORT_C void SetMediaTypeL(const TDesC8& aMediaType); 00104 00109 IMPORT_C const TDesC8& MediaSubtype() const; 00115 IMPORT_C void SetMediaSubtypeL(const TDesC8& aMediaSubtype); 00116 00121 IMPORT_C TReal QParameter() const; 00122 00127 IMPORT_C void SetQParameterL(TReal aQValue); 00128 00135 IMPORT_C static CSIPHeaderBase* 00136 InternalizeValueL(RReadStream& aReadStream); 00137 00138 00139 public: // From CSIPHeaderBase 00140 00144 IMPORT_C CSIPHeaderBase* CloneL() const; 00145 00149 IMPORT_C RStringF Name() const; 00150 00151 00152 public: // From CSIPHeaderBase, for internal use 00153 00154 TBool MoreThanOneAllowed() const; 00155 TPreferredPlace PreferredPlaceInMessage() const; 00156 00157 public: // New functions, for internal use 00158 00159 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue); 00160 00161 private: // From CSIPHeaderBase 00162 00163 void ExternalizeValueL(RWriteStream& aWriteStream) const; 00164 00165 private: // From CSIPParameterHeaderBase 00166 00167 HBufC8* ToTextMandatoryPartLC() const; 00168 void ParseMandatoryPartL(const TDesC8& aMandatoryPart); 00169 const CSIPParamContainerBase& Params() const; 00170 CSIPParamContainerBase& Params(); 00171 00172 private: // Constructors 00173 00174 CSIPAcceptHeader(TBool aEmpty=EFalse); 00175 void ConstructL(); 00176 void ConstructL(const TDesC8& aMediaType, const TDesC8& aMediaSubtype); 00177 void ConstructL(const CSIPAcceptHeader& aAcceptHeader); 00178 00179 private: // New functions 00180 00181 void DoInternalizeValueL(RReadStream& aReadStream); 00182 00183 private: // Data 00184 00185 TBool iEmpty; 00186 HBufC8* iMediaType; 00187 HBufC8* iMediaSubtype; 00188 CSIPAcceptHeaderParams* iParams; 00189 00190 private: // For testing purposes 00191 00192 UNIT_TEST(CSIPAcceptHeaderTest) 00193 }; 00194 00195 // CSIPACCEPTHEADER_H 00196 #endif 00197 00198 // End of File