1.1 --- a/epoc32/include/sipresponseelements.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/sipresponseelements.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,158 @@
1.4 -sipresponseelements.h
1.5 +/*
1.6 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +* Name : sipresponseelements.h
1.20 +* Part of : SIP Client
1.21 +* Interface : SDK API, SIP API
1.22 +* Version : 1.0
1.23 +*
1.24 +*/
1.25 +
1.26 +
1.27 +
1.28 +#ifndef CSIPRESPONSEELEMENTS_H
1.29 +#define CSIPRESPONSEELEMENTS_H
1.30 +
1.31 +// INCLUDES
1.32 +#include <e32base.h>
1.33 +#include <s32strm.h>
1.34 +#include <stringpool.h>
1.35 +#include "_sipcodecdefs.h"
1.36 +
1.37 +// FORWARD DECLARATIONS
1.38 +class CSIPMessageElements;
1.39 +class CSIPFromHeader;
1.40 +class CSIPToHeader;
1.41 +class CSIPCSeqHeader;
1.42 +
1.43 +// CLASS DECLARATION
1.44 +
1.45 +/**
1.46 +* @publishedAll
1.47 +* @released
1.48 +*
1.49 +* Class provides services for creating and manipulating SIP responses
1.50 +* This class is used for creating and manipulating SIP responses including
1.51 +* status code, reason phrase and optional elements such user headers,
1.52 +* content and its type.
1.53 +*
1.54 +* @lib sipclient.lib
1.55 +*/
1.56 +class CSIPResponseElements : public CBase
1.57 + {
1.58 + public: // Constructors and destructor
1.59 + /**
1.60 + * Two-phased constructor.
1.61 + * @pre aStatusCode > 100 && aStatusCode < 700
1.62 + * @param aStatusCode a known SIP response status code. Cannot be 100.
1.63 + * @param aReasonPhrase a SIP response reason phrase.
1.64 + */
1.65 + IMPORT_C static CSIPResponseElements* NewL(TUint aStatusCode,
1.66 + RStringF aReasonPhrase);
1.67 +
1.68 + /**
1.69 + * Two-phased constructor.
1.70 + * @pre aStatusCode > 100 && aStatusCode < 700
1.71 + * @param aStatusCode a known SIP response status code. Cannot be 100.
1.72 + * @param aReasonPhrase a SIP response reason phrase.
1.73 + */
1.74 + IMPORT_C static CSIPResponseElements* NewLC(TUint aStatusCode,
1.75 + RStringF aReasonPhrase);
1.76 +
1.77 + /**
1.78 + * Destructor.
1.79 + */
1.80 + IMPORT_C ~CSIPResponseElements();
1.81 +
1.82 + public: // New functions
1.83 + /**
1.84 + * Sets a SIP Response extension status code. It is not possible to set
1.85 + * value 100.
1.86 + * @pre aStatusCode > 100 && aStatusCode < 700
1.87 + * @param aStatusCode extension status code
1.88 + * @leave KErrArgument if aStatusCode < 100 or aStatusCode >= 700
1.89 + */
1.90 + IMPORT_C void SetStatusCodeL(TUint aStatusCode);
1.91 +
1.92 + /**
1.93 + * Gets the SIP Response status code
1.94 + * @return SIP Response status code
1.95 + */
1.96 + IMPORT_C TUint StatusCode() const;
1.97 +
1.98 + /**
1.99 + * Sets a SIP Response Reason Phrase.
1.100 + * @param aReasonPhrase a SIP response reason phrase.
1.101 + */
1.102 + IMPORT_C void SetReasonPhraseL(RStringF aReasonPhrase);
1.103 +
1.104 + /**
1.105 + * Gets a SIP Response Reason Phrase.
1.106 + * @return a SIP response reason phrase or an empty string if
1.107 + * the reason phrase is not defined.
1.108 + */
1.109 + IMPORT_C RStringF ReasonPhrase() const;
1.110 +
1.111 + /**
1.112 + * Gets the originator's From-header
1.113 + * @return a From-header or a 0-pointer if not present. Ownership is
1.114 + * not transferred.
1.115 + */
1.116 + IMPORT_C const CSIPFromHeader* FromHeader() const;
1.117 +
1.118 + /**
1.119 + * Gets the recipient's To-header
1.120 + * @return a To-header or a 0-pointer if not present. Ownership is
1.121 + * not transferred.
1.122 + */
1.123 + IMPORT_C const CSIPToHeader* ToHeader() const;
1.124 +
1.125 + /**
1.126 + * Gets CSeq-header
1.127 + * @return a CSeq-header or a 0-pointer if not present. Ownership is
1.128 + * not transferred.
1.129 + */
1.130 + IMPORT_C const CSIPCSeqHeader* CSeqHeader() const;
1.131 +
1.132 + /**
1.133 + * Gets message elements (contains all SIP user headers and content)
1.134 + * @return message elements
1.135 + */
1.136 + IMPORT_C const CSIPMessageElements& MessageElements() const;
1.137 +
1.138 + /**
1.139 + * Gets message elements (contains all SIP user headers and content)
1.140 + * The response elements can be populated with SIP user headers
1.141 + * and content using returned reference to the message elements.
1.142 + * @return message elements
1.143 + */
1.144 + IMPORT_C CSIPMessageElements& MessageElements();
1.145 +
1.146 + public: // New functions, for internal use
1.147 + static CSIPResponseElements* InternalizeL (RReadStream& aReadStream);
1.148 + static CSIPResponseElements* InternalizeLC (RReadStream& aReadStream);
1.149 + void ExternalizeL (RWriteStream& aWriteStream) const;
1.150 +
1.151 + private:
1.152 + CSIPResponseElements();
1.153 + void ConstructL(TUint aStatusCode, RStringF aReasonPhrase);
1.154 + void DoInternalizeL (RReadStream& aReadStream);
1.155 +
1.156 + private: // Data
1.157 + TUint iStatusCode;
1.158 + RStringF iReasonPhrase;
1.159 + CSIPMessageElements* iMessageElements;
1.160 + };
1.161 +
1.162 +#endif // end of CSIPRESPONSEELEMENTS_H