1.1 --- a/epoc32/include/sipacceptencodingheader.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/sipacceptencodingheader.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,179 @@
1.4 -sipacceptencodingheader.h
1.5 +/*
1.6 +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +* Name : sipacceptencodingheader.h
1.20 +* Part of : SIP Codec
1.21 +* Interface : SDK API, SIP Codec API
1.22 +* Version : SIP/4.0
1.23 +*
1.24 +*/
1.25 +
1.26 +
1.27 +
1.28 +
1.29 +#ifndef CSIPACCEPTENCODINGHEADER_H
1.30 +#define CSIPACCEPTENCODINGHEADER_H
1.31 +
1.32 +// INCLUDES
1.33 +#include "sipparameterheaderbase.h"
1.34 +#include "_sipcodecdefs.h"
1.35 +
1.36 +// FORWARD DECLARATIONS
1.37 +class CSIPAcceptHeaderParams;
1.38 +
1.39 +// CLASS DECLARATION
1.40 +/**
1.41 +* @publishedAll
1.42 +* @released
1.43 +*
1.44 +* Class provides functions for setting and getting media types and
1.45 +* parameters in SIP "Accept-Encoding" header.
1.46 +*
1.47 +* @lib sipcodec.lib
1.48 +*/
1.49 +class CSIPAcceptEncodingHeader : public CSIPParameterHeaderBase
1.50 + {
1.51 + public: // Constructors and destructor
1.52 +
1.53 + /**
1.54 + * Constructs a CSIPAcceptEncodingHeader from textual representation
1.55 + * of the header's value part.
1.56 + * @param aValue a value part of a "Accept-Encoding"-header
1.57 + * @return An array containing one to many CSIPAcceptEncodingHeader
1.58 + * instances
1.59 + */
1.60 + IMPORT_C static RPointerArray<CSIPAcceptEncodingHeader>
1.61 + DecodeL(const TDesC8& aValue);
1.62 +
1.63 + /**
1.64 + * Creates a new instance of CSIPAcceptEncodingHeader
1.65 + * @param aCodings a codings to set.
1.66 + * @return a new instance of CSIPAcceptEncodingHeader
1.67 + */
1.68 + IMPORT_C static CSIPAcceptEncodingHeader* NewL(const TDesC8& aCodings);
1.69 +
1.70 + /**
1.71 + * Creates a new instance of CSIPAcceptEncodingHeader
1.72 + * and puts it onto the cleanup stack
1.73 + * @param aCodings a codings to set.
1.74 + * @return a new instance of CSIPAcceptEncodingHeader
1.75 + */
1.76 + IMPORT_C static CSIPAcceptEncodingHeader* NewLC(const TDesC8& aCodings);
1.77 +
1.78 + /**
1.79 + * Destructor, deletes the resources of CSIPAcceptEncodingHeader.
1.80 + */
1.81 + IMPORT_C ~CSIPAcceptEncodingHeader();
1.82 +
1.83 +
1.84 + public: // New functions
1.85 +
1.86 + /**
1.87 + * Gets the codings from the "Accept-Encoding" header
1.88 + * @return codings
1.89 + */
1.90 + IMPORT_C const TDesC8& Codings() const;
1.91 +
1.92 + /**
1.93 + * Sets the codings in the "Accept-Encoding" header
1.94 + * @param aCodings the codings
1.95 + */
1.96 + IMPORT_C void SetCodingsL(const TDesC8& aCodings);
1.97 +
1.98 + /**
1.99 + * Gets the value of "q"-parameter
1.100 + * @return the "q"-parameter value
1.101 + */
1.102 + IMPORT_C TReal QParameter() const;
1.103 +
1.104 + /**
1.105 + * Sets the "q"-parameter value
1.106 + * @param aQValue a "q"-parameter value to set´
1.107 + */
1.108 + IMPORT_C void SetQParameterL(TReal aQValue);
1.109 +
1.110 + /**
1.111 + * Constructs an instance of a CSIPAcceptEncodingHeader from a RReadStream
1.112 + * @param aReadStream a stream containing the value of the
1.113 + * externalized header object (header name not included).
1.114 + * @return An instance of a CSIPAcceptEncodingHeader
1.115 + */
1.116 + IMPORT_C static CSIPHeaderBase*
1.117 + InternalizeValueL(RReadStream& aReadStream);
1.118 +
1.119 +
1.120 + public: // From CSIPHeaderBase
1.121 +
1.122 + /**
1.123 + * From CSIPHeaderBase CloneL
1.124 + */
1.125 + IMPORT_C CSIPHeaderBase* CloneL() const;
1.126 +
1.127 + /**
1.128 + * From CSIPHeaderBase Name
1.129 + */
1.130 + IMPORT_C RStringF Name() const;
1.131 +
1.132 +
1.133 + public: // From CSIPHeaderBase, for internal use
1.134 +
1.135 + /**
1.136 + * @internalComponent
1.137 + */
1.138 + TBool MoreThanOneAllowed() const;
1.139 +
1.140 + /**
1.141 + * @internalComponent
1.142 + */
1.143 + TPreferredPlace PreferredPlaceInMessage() const;
1.144 +
1.145 + public: // New functions, for internal use
1.146 +
1.147 + static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
1.148 +
1.149 + private: // From CSIPHeaderBase
1.150 +
1.151 + void ExternalizeValueL(RWriteStream& aWriteStream) const;
1.152 +
1.153 + private: // From CSIPParameterHeaderBase
1.154 +
1.155 + HBufC8* ToTextMandatoryPartLC() const;
1.156 + void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
1.157 + const CSIPParamContainerBase& Params() const;
1.158 + CSIPParamContainerBase& Params();
1.159 +
1.160 + private: // Constructors
1.161 +
1.162 + CSIPAcceptEncodingHeader();
1.163 + void ConstructL();
1.164 + void ConstructL(const TDesC8& aCodings);
1.165 + void ConstructL(const CSIPAcceptEncodingHeader& aAcceptEncodingHeader);
1.166 +
1.167 + private: // New functions
1.168 +
1.169 + void DoInternalizeValueL(RReadStream& aReadStream);
1.170 +
1.171 + private: // Data
1.172 +
1.173 + HBufC8* iCodings;
1.174 + CSIPAcceptHeaderParams* iParams;
1.175 +
1.176 + private: // For testing purposes
1.177 +
1.178 + UNIT_TEST(CSIPAcceptEncodingHeaderTest)
1.179 + };
1.180 +
1.181 +#endif // CSIPACCEPTENCODINGHEADER_H
1.182 +
1.183 +// End of File