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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Name : sipcontentdispositionheader.h
17 * Interface : SDK API, SIP Codec API
25 #ifndef CSIPCONTENTDISPOSITIONHEADER_H
26 #define CSIPCONTENTDISPOSITIONHEADER_H
29 #include "sipparameterheaderbase.h"
30 #include "_sipcodecdefs.h"
32 // FORWARD DECLARATIONS
33 class CSIPHeaderGenericParams;
40 * Class provides functions for setting and getting parameters in
41 * SIP "Content-Disposition" header.
45 class CSIPContentDispositionHeader : public CSIPParameterHeaderBase
47 public: // Constructors and destructor
50 * Constructs a CSIPContentDispositionHeader from textual representation
51 * of the header's value part.
52 * @param aValue a value part of a "Content-Disposition"-header
53 * @return a new instance of CSIPContentDispositionHeader
55 IMPORT_C static CSIPContentDispositionHeader*
56 DecodeL (const TDesC8& aValue);
59 * Creates a new instance of CSIPContentDispositionHeader
60 * @param aDispType a Disp-Type value
61 * @return a new instance of CSIPContentDispositionHeader
63 IMPORT_C static CSIPContentDispositionHeader*
64 NewL(const TDesC8& aDispType);
67 * Creates a new instance of CSIPContentDispositionHeader
68 * and puts it to CleanupStack
69 * @param aDispType a Disp-Type value
70 * @return a new instance of CSIPContentDispositionHeader
72 IMPORT_C static CSIPContentDispositionHeader*
73 NewLC(const TDesC8& aDispType);
76 * Destructor. deletes the resources of CSIPContentDispositionHeader.
78 IMPORT_C ~CSIPContentDispositionHeader();
81 public: // New functions
84 * Gets the disp-type parameter from the "Content-Disposition" header
85 * @return the disp-type parameter
87 IMPORT_C const TDesC8& DispType() const;
90 * Sets the disp-type parameter in the "Content-Disposition" header;
91 * @param aTag a disp-type parameter to set
93 IMPORT_C void SetDispTypeL(const TDesC8& aDispType);
96 * Constructs an instance of a CSIPContentDispositionHeader
98 * @param aReadStream a stream containing the value of the
99 * externalized object (header name not included).
100 * @return an instance of a CSIPContentDispositionHeader
102 IMPORT_C static CSIPHeaderBase*
103 InternalizeValueL(RReadStream& aReadStream);
106 public: // From CSIPHeaderBase
109 * From CSIPHeaderBase CloneL
111 IMPORT_C CSIPHeaderBase* CloneL() const;
114 * From CSIPHeaderBase Name
116 IMPORT_C RStringF Name() const;
119 public: // From CSIPHeaderBase, for internal use
124 TPreferredPlace PreferredPlaceInMessage() const;
126 public: // New functions, for internal use
128 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
130 private: // From CSIPHeaderBase
132 void ExternalizeValueL(RWriteStream& aWriteStream) const;
134 private: // From CSIPParameterHeaderBase
136 HBufC8* ToTextMandatoryPartLC() const;
137 void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
138 const CSIPParamContainerBase& Params() const;
139 CSIPParamContainerBase& Params();
141 private: // Constructors
143 CSIPContentDispositionHeader();
145 void ConstructL(const TDesC8& aDispType);
146 void ConstructL(const TDesC8& aDispType, const TDesC8& aHandlingParam);
147 void ConstructL(const CSIPContentDispositionHeader& aHeader);
149 private: // New functions
151 void DoInternalizeValueL(RReadStream& aReadStream);
156 CSIPHeaderGenericParams* iParams;
158 private: // For testing purposes
160 UNIT_TEST(CSIPContentDispositionHeaderTest)
163 #endif // CSIPCONTENTDISPOSITIONHEADER_H