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 : siptoheader.h
17 * Interface : SDK API, SIP Codec API
25 #ifndef CSIPTOHEADER_H
26 #define CSIPTOHEADER_H
29 #include "sipfromtoheaderbase.h"
30 #include "_sipcodecdefs.h"
37 * Class provides functions for setting and getting SIP "To" header fields.
41 class CSIPToHeader : public CSIPFromToHeaderBase
43 public: // Constructors and destructor
46 * Constructs a CSIPToHeader from textual representation
47 * of the header's value part.
48 * @param aValue a value part of a "To"-header (e.g. "User <user@host>")
49 * @return a new instance of CSIPToHeader
51 IMPORT_C static CSIPToHeader* DecodeL(const TDesC8& aValue);
54 * Creates a new instance of CSIPToHeader
55 * @pre aSIPAddress != 0
56 * @param aSIPAddress a name-address, the ownership is transferred,
57 * @return a new instance of CSIPToHeader
59 IMPORT_C static CSIPToHeader* NewL(CSIPAddress* aSIPAddress);
62 * Creates a new instance of CSIPToHeader and puts it to CleanupStack
63 * @pre aSIPAddress != 0
64 * @param aSIPAddress a name-address, the ownership is transferred,
65 * @return a new instance of CSIPToHeader
67 IMPORT_C static CSIPToHeader* NewLC(CSIPAddress* aSIPAddress);
70 * Creates a deep-copy of a CSIPFromToHeaderBase
71 * Note that this function can be used for creating a To-header
72 * using an existing From-header.
73 * @param aHeader CSIPFromToHeaderBase to be copied
74 * @return a new instance of CSIPToHeader
77 IMPORT_C static CSIPToHeader*
78 NewL(const CSIPFromToHeaderBase& aHeader);
81 * Creates a deep-copy of a CSIPFromToHeaderBase and
82 * puts it to CleanupStack
83 * Note that this function can be used for creating a To-header
84 * using an existing From-header.
85 * @param aHeader CSIPFromToHeaderBaseto to be copied
86 * @return a new instance of CSIPToHeader
88 IMPORT_C static CSIPToHeader*
89 NewLC(const CSIPFromToHeaderBase& aHeader);
92 * Destructor, deletes the resources of CSIPToHeader.
94 IMPORT_C ~CSIPToHeader();
97 public: // New functions
100 * Constructs an instance of a CSIPToHeader from a RReadStream
101 * @param aReadStream a stream containing the value of the
102 * externalized object (header name not included).
103 * @return an instance of a CSIPToHeader
105 IMPORT_C static CSIPHeaderBase*
106 InternalizeValueL(RReadStream& aReadStream);
109 public: // From CSIPHeaderBase
112 * From CSIPHeaderBase CloneL
114 IMPORT_C CSIPHeaderBase* CloneL() const;
117 * From CSIPHeaderBase Name
119 IMPORT_C RStringF Name() const;
122 public: // From CSIPHeaderBase, for internal use
127 RStringF CompactName() const;
129 public: // New functions, for internal use
131 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
133 private: // Constructors
138 #endif // CSIPTOHEADER_H