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 : sipcontentdispositionheader.h
17 * Interface : SDK API, SIP Codec API
25 #ifndef CSIPCONTENTDISPOSITIONHEADER_H
26 #define CSIPCONTENTDISPOSITIONHEADER_H
29 #include "sipparameterheaderbase.h"
31 // FORWARD DECLARATIONS
32 class CSIPHeaderGenericParams;
39 * Class provides functions for setting and getting parameters in
40 * SIP "Content-Disposition" header.
44 class CSIPContentDispositionHeader : public CSIPParameterHeaderBase
46 public: // Constructors and destructor
49 * Constructs a CSIPContentDispositionHeader from textual representation
50 * of the header's value part.
51 * @param aValue a value part of a "Content-Disposition"-header
52 * @return a new instance of CSIPContentDispositionHeader
54 IMPORT_C static CSIPContentDispositionHeader*
55 DecodeL (const TDesC8& aValue);
58 * Creates a new instance of CSIPContentDispositionHeader
59 * @param aDispType a Disp-Type value
60 * @return a new instance of CSIPContentDispositionHeader
62 IMPORT_C static CSIPContentDispositionHeader*
63 NewL(const TDesC8& aDispType);
66 * Creates a new instance of CSIPContentDispositionHeader
67 * and puts it to CleanupStack
68 * @param aDispType a Disp-Type value
69 * @return a new instance of CSIPContentDispositionHeader
71 IMPORT_C static CSIPContentDispositionHeader*
72 NewLC(const TDesC8& aDispType);
75 * Destructor. deletes the resources of CSIPContentDispositionHeader.
77 IMPORT_C ~CSIPContentDispositionHeader();
80 public: // New functions
83 * Gets the disp-type parameter from the "Content-Disposition" header
84 * @return the disp-type parameter
86 IMPORT_C const TDesC8& DispType() const;
89 * Sets the disp-type parameter in the "Content-Disposition" header;
90 * @param aTag a disp-type parameter to set
92 IMPORT_C void SetDispTypeL(const TDesC8& aDispType);
95 * Constructs an instance of a CSIPContentDispositionHeader
97 * @param aReadStream a stream containing the value of the
98 * externalized object (header name not included).
99 * @return an instance of a CSIPContentDispositionHeader
101 IMPORT_C static CSIPHeaderBase*
102 InternalizeValueL(RReadStream& aReadStream);
105 public: // From CSIPHeaderBase
108 * From CSIPHeaderBase CloneL
110 IMPORT_C CSIPHeaderBase* CloneL() const;
113 * From CSIPHeaderBase Name
115 IMPORT_C RStringF Name() const;
118 public: // From CSIPHeaderBase, for internal use
123 TPreferredPlace PreferredPlaceInMessage() const;
125 public: // New functions, for internal use
127 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
129 private: // From CSIPHeaderBase
131 void ExternalizeValueL(RWriteStream& aWriteStream) const;
133 private: // From CSIPParameterHeaderBase
135 HBufC8* ToTextMandatoryPartLC() const;
136 void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
137 const CSIPParamContainerBase& Params() const;
138 CSIPParamContainerBase& Params();
140 private: // Constructors
142 CSIPContentDispositionHeader();
144 void ConstructL(const TDesC8& aDispType);
145 void ConstructL(const TDesC8& aDispType, const TDesC8& aHandlingParam);
146 void ConstructL(const CSIPContentDispositionHeader& aHeader);
148 private: // New functions
150 void DoInternalizeValueL(RReadStream& aReadStream);
155 CSIPHeaderGenericParams* iParams;
157 private: // For testing purposes
159 friend class CSIPContentDispositionHeaderTest;
163 #endif // CSIPCONTENTDISPOSITIONHEADER_H