2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Name : sipacceptcontactheader.h
17 * Interface : SDK API, SIP Codec API
25 #ifndef CSIPACCEPTCONTACTHEADER_H
26 #define CSIPACCEPTCONTACTHEADER_H
29 #include "sipparameterheaderbase.h"
31 // FORWARD DECLARATIONS
32 class CSIPAcceptContactHeaderParams;
39 * Class provides functions for setting and getting parameters in SIP
40 * "Accept-Contact" header.
44 class CSIPAcceptContactHeader : public CSIPParameterHeaderBase
46 public: // Constructors and destructor
49 * Constructs a CSIPAcceptContactHeader from textual representation
50 * of the header's value part.
51 * @param aValue a value part of a "Accept-Contact"-header
52 * (e.g. "*;param=value")
53 * @return an array containing one to many instances
54 * of CSIPAcceptContactHeader
56 IMPORT_C static RPointerArray<CSIPAcceptContactHeader>
57 DecodeL(const TDesC8& aValue);
60 * Creates a new instance of CSIPAcceptContactHeader
61 * @return a new instance of CSIPAcceptContactHeader
63 IMPORT_C static CSIPAcceptContactHeader* NewL();
66 * Creates a new instance of CSIPAcceptContactHeader
67 * On return the new instance has left to the CleanupStack.
68 * @return a new instance of CSIPAcceptContactHeader
70 IMPORT_C static CSIPAcceptContactHeader* NewLC();
73 * Destructor, deletes the resources of CSIPAcceptContactHeader.
75 IMPORT_C virtual ~CSIPAcceptContactHeader();
78 public: // New functions
81 * Compares this instance to another "Accept-Contact" header object.
82 * Two Accept-Contact-headers are equal,
83 * if both contain exactly the same parameters.
84 * The order of the parameters is not sufficient.
85 * @param aHeader a header to compare to
86 * @return ETrue, if the objects are equal otherwise EFalse
88 IMPORT_C TBool operator==(const CSIPAcceptContactHeader& aHeader) const;
91 * Constructs an instance of a CSIPAcceptContactHeader from a RReadStream
92 * @param aReadStream a stream containing the value of the
93 * externalized object (header name not included).
94 * @return an instance of a CSIPAcceptContactHeader
96 IMPORT_C static CSIPHeaderBase*
97 InternalizeValueL(RReadStream& aReadStream);
100 public: // From CSIPHeaderBase
103 * From CSIPHeaderBase CloneL
105 IMPORT_C CSIPHeaderBase* CloneL() const;
108 * From CSIPHeaderBase Name
110 IMPORT_C RStringF Name() const;
113 public: // From CSIPHeaderBase, for internal use
118 TBool HasCompactName() const;
123 RStringF CompactName() const;
128 TBool MoreThanOneAllowed() const;
133 TPreferredPlace PreferredPlaceInMessage() const;
135 public: // New functions, for internal use
137 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
139 private: // From CSIPHeaderBase
141 void ExternalizeValueL(RWriteStream& aWriteStream) const;
143 private: // From CSIPParameterHeaderBase
145 HBufC8* ToTextMandatoryPartLC() const;
146 void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
147 const CSIPParamContainerBase& Params() const;
148 CSIPParamContainerBase& Params();
150 private: // Constructors
152 CSIPAcceptContactHeader();
154 void ConstructL(const CSIPAcceptContactHeader& aAcceptContactHeader);
156 private: // New functions
158 void DoInternalizeValueL(RReadStream& aReadStream);
162 CSIPAcceptContactHeaderParams* iParams;
164 private: // For testing purposes
166 friend class CSIPAcceptContactHeaderTest;
170 #endif // CSIPACCEPTCONTACTHEADER_H