Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2005-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 : siprequestelements.h
16 * Part of : SIP Client
17 * Interface : SDK API, SIP API
24 #ifndef CSIPREQUESTELEMENTS_H
25 #define CSIPREQUESTELEMENTS_H
30 #include <stringpool.h>
32 #include "_sipcodecdefs.h"
34 // FORWARD DECLARATIONS
35 class CSIPMessageElements;
47 * Class provides functions for creation and manipulation of originator's and
48 * recipient's addresses in a SIP request. It also provide functions for
49 * manipulation of SIP method for unknown SIP requests.
52 class CSIPRequestElements : public CBase
54 public: // Constructors and destructor
56 * Two-phased constructor.
57 * If the URI is SIP URI, no SIP URI headers are allowed.
58 * @pre aRemoteURi != 0
59 * @param aRemoteUri Remote target URI that identifies a resource that
60 * the request is addressed to. The ownership is transferred.
62 IMPORT_C static CSIPRequestElements* NewL(CUri8* aRemoteUri);
65 * Two-phased constructor.
66 * If the URI is SIP URI, no SIP URI headers are allowed.
67 * @pre aRemoteURi != 0
68 * @param aRemoteUri Remote target URI that identifies a resource that
69 * the request is addressed to. The ownership is transferred.
71 IMPORT_C static CSIPRequestElements* NewLC(CUri8* aRemoteUri);
76 IMPORT_C ~CSIPRequestElements();
78 public: // New functions
80 * Sets/resets the recipient's To-header
81 * To-header must not contain tag-parameter.
83 * @param aTo a To-header to be set, the ownership is transferred.
85 IMPORT_C void SetToHeaderL(CSIPToHeader* aTo);
88 * Gets the recipient's To-header
89 * @return To-header or a 0-pointer if not present. Ownership is not
92 IMPORT_C const CSIPToHeader* ToHeader() const;
95 * Sets/resets the originator's From-header.
96 * From-header must not contain tag-parameter.
98 * @param aFrom a From-header to be set, the ownership is transferred.
99 * @leave KErrArgument if aFrom == 0
101 IMPORT_C void SetFromHeaderL(CSIPFromHeader* aFrom);
104 * Gets the originator's From-header
105 * @return From-header or a 0-pointer if not present. Ownership is not
108 IMPORT_C const CSIPFromHeader* FromHeader() const;
111 * Gets CSeq-header. Available for only incoming requests.
112 * @return a CSeq-header or a 0-pointer if not present.
113 * Ownership is not transferred.
115 IMPORT_C const CSIPCSeqHeader* CSeqHeader() const;
118 * Sets the remote URI.
119 * If the URI is a SIP URI, no SIP URI headers are allowed.
120 * @pre aRemoteUri != 0
122 * @leave KErrArgument if aRemoteUri==0
124 IMPORT_C void SetRemoteUriL(CUri8* aRemoteUri);
127 * Gets the remote target URI
128 * @return remote target URI
130 IMPORT_C const CUri8& RemoteUri() const;
133 * Sets the SIP request method
134 * @param aMethod a SIP method name.
135 * @leave KErrArgument if method name given is syntactically
138 IMPORT_C void SetMethodL(RStringF aMethod);
141 * Gets the SIP Method for a request
142 * @return a SIP method name or a an empty string if the method
145 IMPORT_C RStringF Method() const;
148 * Gets message elements (contains all SIP user headers and content)
149 * @return message elements
151 IMPORT_C const CSIPMessageElements& MessageElements() const;
154 * Gets message elements (contains all SIP user headers and content)
155 * The response elements can be populated with SIP user headers
156 * and content using returned reference to the message elements.
157 * @return message elements
159 IMPORT_C CSIPMessageElements& MessageElements();
161 public: // New functions, for internal use
162 static CSIPRequestElements* InternalizeL (RReadStream& aReadStream);
163 void ExternalizeL (RWriteStream& aWriteStream) const;
166 CSIPRequestElements();
167 void ConstructL(CUri8* aRemoteUri);
168 void DoInternalizeL(RReadStream& aReadStream);
172 CURIContainer* iRemoteURI;
173 CSIPMessageElements* iMessageElements;
175 private: // For testing purposes
176 UNIT_TEST(CSIPRequestElementsTest)