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 : sipfromheader.h
17 * Interface : SDK API, SIP Codec API
25 #ifndef CSIPFROMHEADER_H
26 #define CSIPFROMHEADER_H
29 #include "sipfromtoheaderbase.h"
36 * Class provides functions for setting and getting SIP "From" header.
40 class CSIPFromHeader : public CSIPFromToHeaderBase
42 public: // Constructors and destructor
45 * Constructs a CSIPFromHeader from textual representation
46 * of the header's value part.
47 * @param aValue a value part of a "From"-header (e.g. "<user@host>...")
48 * @return a new instance of CSIPFromHeader
50 IMPORT_C static CSIPFromHeader* DecodeL(const TDesC8& aValue);
53 * Creates a new instance of CSIPFromHeader
54 * @pre aSIPAddress != 0
55 * @param aSIPAddress a name-address, the ownership is transferred.
56 * @return a new instance of CSIPFromHeader
58 IMPORT_C static CSIPFromHeader* NewL(CSIPAddress* aSIPAddress);
61 * Creates a new instance of CSIPFromHeader and puts it to CleanupStack
62 * @pre aSIPAddress != 0
63 * @param aSIPAddress a name-address, the ownership is transferred,
64 * @return a new instance of CSIPFromHeader
66 IMPORT_C static CSIPFromHeader* NewLC(CSIPAddress* aSIPAddress);
69 * Creates a deep-copy of a CSIPFromToHeaderBase
70 * Note that this function can be used for creating a From-header
71 * using an existing To-header.
72 * @param aHeader CSIPFromToHeaderBase to be copied
73 * @return a new instance of CSIPFromHeader
75 IMPORT_C static CSIPFromHeader*
76 NewL(const CSIPFromToHeaderBase& aHeader);
79 * Creates a deep-copy of a CSIPFromToHeaderBase and
80 * puts it to CleanupStack
81 * Note that this function can be used for creating a From-header
82 * using an existing To-header.
83 * @param aHeader CSIPFromToHeaderBase to be copied
84 * @return a new instance of CSIPFromHeader
86 IMPORT_C static CSIPFromHeader*
87 NewLC(const CSIPFromToHeaderBase& aHeader);
90 * Destructor, deletes the resources of CSIPFromHeader.
92 IMPORT_C ~CSIPFromHeader();
95 public: // New functions
98 * Constructs an instance of a CSIPFromHeader from a RReadStream
99 * @param aReadStream a stream containing the value of the
100 * externalized object (header name not included).
101 * @return an instance of a CSIPFromHeader
103 IMPORT_C static CSIPHeaderBase*
104 InternalizeValueL(RReadStream& aReadStream);
107 public: // From CSIPHeaderBase
110 * From CSIPHeaderBase CloneL
112 IMPORT_C CSIPHeaderBase* CloneL() const;
115 * From CSIPHeaderBase Name
117 IMPORT_C RStringF Name() const;
120 public: // From CSIPHeaderBase, for internal use
125 RStringF CompactName() const;
127 public: // New functions, for internal use
129 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
131 private: // Constructors
136 #endif // CSIPFROMHEADER_H