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 : siptoheader.h
17 * Interface : SDK API, SIP Codec API
25 #ifndef CSIPTOHEADER_H
26 #define CSIPTOHEADER_H
29 #include "sipfromtoheaderbase.h"
36 * Class provides functions for setting and getting SIP "To" header fields.
40 class CSIPToHeader : public CSIPFromToHeaderBase
42 public: // Constructors and destructor
45 * Constructs a CSIPToHeader from textual representation
46 * of the header's value part.
47 * @param aValue a value part of a "To"-header (e.g. "User <user@host>")
48 * @return a new instance of CSIPToHeader
50 IMPORT_C static CSIPToHeader* DecodeL(const TDesC8& aValue);
53 * Creates a new instance of CSIPToHeader
54 * @pre aSIPAddress != 0
55 * @param aSIPAddress a name-address, the ownership is transferred,
56 * @return a new instance of CSIPToHeader
58 IMPORT_C static CSIPToHeader* NewL(CSIPAddress* aSIPAddress);
61 * Creates a new instance of CSIPToHeader 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 CSIPToHeader
66 IMPORT_C static CSIPToHeader* NewLC(CSIPAddress* aSIPAddress);
69 * Creates a deep-copy of a CSIPFromToHeaderBase
70 * Note that this function can be used for creating a To-header
71 * using an existing From-header.
72 * @param aHeader CSIPFromToHeaderBase to be copied
73 * @return a new instance of CSIPToHeader
76 IMPORT_C static CSIPToHeader*
77 NewL(const CSIPFromToHeaderBase& aHeader);
80 * Creates a deep-copy of a CSIPFromToHeaderBase and
81 * puts it to CleanupStack
82 * Note that this function can be used for creating a To-header
83 * using an existing From-header.
84 * @param aHeader CSIPFromToHeaderBaseto to be copied
85 * @return a new instance of CSIPToHeader
87 IMPORT_C static CSIPToHeader*
88 NewLC(const CSIPFromToHeaderBase& aHeader);
91 * Destructor, deletes the resources of CSIPToHeader.
93 IMPORT_C ~CSIPToHeader();
96 public: // New functions
99 * Constructs an instance of a CSIPToHeader from a RReadStream
100 * @param aReadStream a stream containing the value of the
101 * externalized object (header name not included).
102 * @return an instance of a CSIPToHeader
104 IMPORT_C static CSIPHeaderBase*
105 InternalizeValueL(RReadStream& aReadStream);
108 public: // From CSIPHeaderBase
111 * From CSIPHeaderBase CloneL
113 IMPORT_C CSIPHeaderBase* CloneL() const;
116 * From CSIPHeaderBase Name
118 IMPORT_C RStringF Name() const;
121 public: // From CSIPHeaderBase, for internal use
126 RStringF CompactName() const;
128 public: // New functions, for internal use
130 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
132 private: // Constructors
137 #endif // CSIPTOHEADER_H