1.1 --- a/epoc32/include/sipacceptlanguageheader.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/sipacceptlanguageheader.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,178 @@
1.4 -sipacceptlanguageheader.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 : sipacceptlanguageheader.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 CSIPACCEPTLANGUAGEHEADER_H
1.30 +#define CSIPACCEPTLANGUAGEHEADER_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-Language" header.
1.46 +*
1.47 +* @lib sipcodec.lib
1.48 +*/
1.49 +class CSIPAcceptLanguageHeader : public CSIPParameterHeaderBase
1.50 + {
1.51 + public: // Constructors and destructor
1.52 +
1.53 + /**
1.54 + * Constructs a CSIPAcceptLanguageHeader from textual representation
1.55 + * of the header's value part.
1.56 + * @param aValue a value part of a "Accept-Language"-header
1.57 + * @return an array containing one to many instances of
1.58 + * CSIPAcceptLanguageHeader.
1.59 + */
1.60 + IMPORT_C static RPointerArray<CSIPAcceptLanguageHeader>
1.61 + DecodeL(const TDesC8& aValue);
1.62 +
1.63 + /**
1.64 + * Creates a new instance of CSIPAcceptLanguageHeader
1.65 + * @param aLanguageRange a language-range to set
1.66 + * @return a new instance of CSIPAcceptLanguageHeader
1.67 + */
1.68 + IMPORT_C static CSIPAcceptLanguageHeader*
1.69 + NewL(const TDesC8& aLanguageRange);
1.70 +
1.71 + /**
1.72 + * Creates a new instance of CSIPAcceptLanguageHeader and puts it onto
1.73 + * the cleanup stack
1.74 + * @param aLanguageRange a language-range to set
1.75 + * @return a new instance of CSIPAcceptLanguageHeader
1.76 + */
1.77 + IMPORT_C static CSIPAcceptLanguageHeader*
1.78 + NewLC(const TDesC8& aLanguageRange);
1.79 +
1.80 + /**
1.81 + * Destructor, deletes the resources of CSIPAcceptLanguageHeader.
1.82 + */
1.83 + IMPORT_C ~CSIPAcceptLanguageHeader();
1.84 +
1.85 +
1.86 + public: // New functions
1.87 +
1.88 + /**
1.89 + * Gets the language-range from the "Accept-Language" header
1.90 + * @return a language-range
1.91 + */
1.92 + IMPORT_C const TDesC8& LanguageRange() const;
1.93 +
1.94 + /**
1.95 + * Sets the language-range in the "Accept-Language" header
1.96 + * @param aLanguageRange a language-range
1.97 + */
1.98 + IMPORT_C void SetLanguageRangeL(const TDesC8& aLanguageRange);
1.99 +
1.100 + /**
1.101 + * Gets the value of "q"-parameter
1.102 + * @return the "q"-parameter value
1.103 + */
1.104 + IMPORT_C TReal QParameter() const;
1.105 +
1.106 + /**
1.107 + * Sets the "q"-parameter value
1.108 + * @param aQValue a "q"-parameter value to set
1.109 + */
1.110 + IMPORT_C void SetQParameterL(TReal aQValue);
1.111 +
1.112 + /**
1.113 + * Constructs an instance of a CSIPAcceptLanguageHeader from a RReadStream
1.114 + * @param aReadStream a stream containing the value of the
1.115 + * externalized header object (header name not included).
1.116 + * @return an instance of a CSIPAcceptLanguageHeader
1.117 + */
1.118 + IMPORT_C static CSIPHeaderBase*
1.119 + InternalizeValueL(RReadStream& aReadStream);
1.120 +
1.121 +
1.122 + public: // From CSIPHeaderBase
1.123 +
1.124 + /**
1.125 + * From CSIPHeaderBase CloneL
1.126 + */
1.127 + IMPORT_C CSIPHeaderBase* CloneL() const;
1.128 +
1.129 + /**
1.130 + * From CSIPHeaderBase Name
1.131 + */
1.132 + IMPORT_C RStringF Name() const;
1.133 +
1.134 +
1.135 + public: // From CSIPHeaderBase, for internal use
1.136 +
1.137 + /**
1.138 + * @internalComponent
1.139 + */
1.140 + TBool MoreThanOneAllowed() const;
1.141 +
1.142 + /**
1.143 + * @internalComponent
1.144 + */
1.145 + TPreferredPlace PreferredPlaceInMessage() const;
1.146 +
1.147 + public: // New functions, for internal use
1.148 +
1.149 + static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
1.150 +
1.151 + private: // From CSIPHeaderBase
1.152 +
1.153 + void ExternalizeValueL(RWriteStream& aWriteStream) const;
1.154 +
1.155 + private: // From CSIPParameterHeaderBase
1.156 +
1.157 + HBufC8* ToTextMandatoryPartLC() const;
1.158 + void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
1.159 + const CSIPParamContainerBase& Params() const;
1.160 + CSIPParamContainerBase& Params();
1.161 +
1.162 + private: // New functions
1.163 +
1.164 + CSIPAcceptLanguageHeader();
1.165 + void ConstructL();
1.166 + void ConstructL(const TDesC8& aLanguageRange);
1.167 + void ConstructL(const CSIPAcceptLanguageHeader& aAcceptLanguageHeader);
1.168 + void DoInternalizeValueL(RReadStream& aReadStream);
1.169 +
1.170 + private: // Data
1.171 +
1.172 + HBufC8* iLanguageRange;
1.173 + CSIPAcceptHeaderParams* iParams;
1.174 +
1.175 + private: // For testing purposes
1.176 +
1.177 + UNIT_TEST(CSIPAcceptLanguageHeaderTest)
1.178 + };
1.179 +
1.180 +#endif // CSIPACCEPTLANGUAGEHEADER_H
1.181 +
1.182 +// End of File