1.1 --- a/epoc32/include/sipacceptheader.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,207 +0,0 @@
1.4 -/*
1.5 -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 -* All rights reserved.
1.7 -* This component and the accompanying materials are made available
1.8 -* 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.9 -* which accompanies this distribution, and is available
1.10 -* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 -*
1.12 -* Initial Contributors:
1.13 -* Nokia Corporation - initial contribution.
1.14 -*
1.15 -* Contributors:
1.16 -*
1.17 -* Description:
1.18 -* Name : sipacceptheader.h
1.19 -* Part of : SIP Codec
1.20 -* Interface : SDK API, SIP Codec API
1.21 -* Version : SIP/4.0
1.22 -*
1.23 -*/
1.24 -
1.25 -
1.26 -
1.27 -
1.28 -#ifndef CSIPACCEPTHEADER_H
1.29 -#define CSIPACCEPTHEADER_H
1.30 -
1.31 -// INCLUDES
1.32 -#include "sipparameterheaderbase.h"
1.33 -#include "_sipcodecdefs.h"
1.34 -
1.35 -// FORWARD DECLARATIONS
1.36 -class CSIPAcceptHeaderParams;
1.37 -
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" header.
1.46 -*
1.47 -* @lib sipcodec.lib
1.48 -*/
1.49 -class CSIPAcceptHeader : public CSIPParameterHeaderBase
1.50 - {
1.51 - public: // Constructors and destructor
1.52 -
1.53 - /**
1.54 - * Constructs a CSIPAcceptHeader from textual representation
1.55 - * of the header's value part.
1.56 - * An empty Accept-header can be created using this function
1.57 - * by passing a KNullDesC8 as a parameter.
1.58 - * @param aValue a value part of a "Accept"-header
1.59 - * @return an array containing one to many instances of CSIPAcceptHeader.
1.60 - */
1.61 - IMPORT_C static RPointerArray<CSIPAcceptHeader>
1.62 - DecodeL(const TDesC8& aValue);
1.63 -
1.64 - /**
1.65 - * Creates a new instance of CSIPAcceptHeader
1.66 - * @param aMediaType a media type to set. For example "application"
1.67 - * @param aMediaSubtype a media subtype to set. For example "sdp"
1.68 - * @return a new instance of CSIPAcceptHeader
1.69 - */
1.70 - IMPORT_C static CSIPAcceptHeader* NewL(const TDesC8& aMediaType,
1.71 - const TDesC8& aMediaSubtype);
1.72 -
1.73 - /**
1.74 - * Creates a new instance of CSIPAcceptHeader and puts it into
1.75 - * the cleanup stack
1.76 - * @param aMediaType a media type to set. For example "application"
1.77 - * @param aMediaSubtype a media subtype to set. For example "sdp"
1.78 - * @return a new instance of CSIPAcceptHeader
1.79 - */
1.80 - IMPORT_C static CSIPAcceptHeader* NewLC(const TDesC8& aMediaType,
1.81 - const TDesC8& aMediaSubtype);
1.82 -
1.83 - /**
1.84 - * Destructor, deletes the resources of CSIPAcceptHeader.
1.85 - */
1.86 - IMPORT_C ~CSIPAcceptHeader();
1.87 -
1.88 -
1.89 - public: // New functions
1.90 -
1.91 - /**
1.92 - * Check if the header is empty. If so,
1.93 - * the other getters will not return a meaningful value.
1.94 - * @return ETrue if empty, EFalse otherwise.
1.95 - */
1.96 - IMPORT_C TBool IsEmpty() const;
1.97 -
1.98 - /**
1.99 - * Gets the media type from the "Accept" header
1.100 - * @return a media type
1.101 - */
1.102 - IMPORT_C const TDesC8& MediaType() const;
1.103 -
1.104 - /**
1.105 - * Sets the media type in the "Accept" header
1.106 - * @pre IsEmpty() == EFalse
1.107 - * @param aMediaType a media type
1.108 - */
1.109 - IMPORT_C void SetMediaTypeL(const TDesC8& aMediaType);
1.110 -
1.111 - /**
1.112 - * Gets the media subtype from the "Accept" header
1.113 - * @return a media subtype
1.114 - */
1.115 - IMPORT_C const TDesC8& MediaSubtype() const;
1.116 - /**
1.117 - * Sets the media subtype in the "Accept" header
1.118 - * @pre IsEmpty() == EFalse
1.119 - * @param aMediaSubtype a media subtype
1.120 - */
1.121 - IMPORT_C void SetMediaSubtypeL(const TDesC8& aMediaSubtype);
1.122 -
1.123 - /**
1.124 - * Gets the value of "q"-parameter
1.125 - * @return the "q"-parameter value
1.126 - */
1.127 - IMPORT_C TReal QParameter() const;
1.128 -
1.129 - /**
1.130 - * Sets the "q"-parameter value
1.131 - * @param aQValue a "q"-parameter value to set
1.132 - */
1.133 - IMPORT_C void SetQParameterL(TReal aQValue);
1.134 -
1.135 - /**
1.136 - * Constructs an instance of a CSIPAcceptHeader from a RReadStream
1.137 - * @param aReadStream a stream containing the value of the
1.138 - * externalized header object (header name not included).
1.139 - * @return An instance of a CSIPAcceptHeader
1.140 - */
1.141 - IMPORT_C static CSIPHeaderBase*
1.142 - InternalizeValueL(RReadStream& aReadStream);
1.143 -
1.144 -
1.145 - public: // From CSIPHeaderBase
1.146 -
1.147 - /**
1.148 - * From CSIPHeaderBase CloneL
1.149 - */
1.150 - IMPORT_C CSIPHeaderBase* CloneL() const;
1.151 -
1.152 - /**
1.153 - * From CSIPHeaderBase Name
1.154 - */
1.155 - IMPORT_C RStringF Name() const;
1.156 -
1.157 -
1.158 - public: // From CSIPHeaderBase, for internal use
1.159 -
1.160 - /**
1.161 - * @internalComponent
1.162 - */
1.163 - TBool MoreThanOneAllowed() const;
1.164 -
1.165 - /**
1.166 - * @internalComponent
1.167 - */
1.168 - TPreferredPlace PreferredPlaceInMessage() const;
1.169 -
1.170 - public: // New functions, for internal use
1.171 -
1.172 - static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
1.173 -
1.174 - private: // From CSIPHeaderBase
1.175 -
1.176 - void ExternalizeValueL(RWriteStream& aWriteStream) const;
1.177 -
1.178 - private: // From CSIPParameterHeaderBase
1.179 -
1.180 - HBufC8* ToTextMandatoryPartLC() const;
1.181 - void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
1.182 - const CSIPParamContainerBase& Params() const;
1.183 - CSIPParamContainerBase& Params();
1.184 -
1.185 - private: // Constructors
1.186 -
1.187 - CSIPAcceptHeader(TBool aEmpty=EFalse);
1.188 - void ConstructL();
1.189 - void ConstructL(const TDesC8& aMediaType, const TDesC8& aMediaSubtype);
1.190 - void ConstructL(const CSIPAcceptHeader& aAcceptHeader);
1.191 -
1.192 - private: // New functions
1.193 -
1.194 - void DoInternalizeValueL(RReadStream& aReadStream);
1.195 -
1.196 - private: // Data
1.197 -
1.198 - TBool iEmpty;
1.199 - HBufC8* iMediaType;
1.200 - HBufC8* iMediaSubtype;
1.201 - CSIPAcceptHeaderParams* iParams;
1.202 -
1.203 - private: // For testing purposes
1.204 -
1.205 - UNIT_TEST(CSIPAcceptHeaderTest)
1.206 - };
1.207 -
1.208 -#endif // CSIPACCEPTHEADER_H
1.209 -
1.210 -// End of File