author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
parent 3 | e1b950c65cb4 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
/* |
williamr@2 | 2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 3 |
* All rights reserved. |
williamr@2 | 4 |
* This component and the accompanying materials are made available |
williamr@4 | 5 |
* under the terms of "Eclipse Public License v1.0" |
williamr@2 | 6 |
* which accompanies this distribution, and is available |
williamr@4 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@2 | 8 |
* |
williamr@2 | 9 |
* Initial Contributors: |
williamr@2 | 10 |
* Nokia Corporation - initial contribution. |
williamr@2 | 11 |
* |
williamr@2 | 12 |
* Contributors: |
williamr@2 | 13 |
* |
williamr@2 | 14 |
* Description: |
williamr@2 | 15 |
* Name : sipresponseelements.h |
williamr@2 | 16 |
* Part of : SIP Client |
williamr@2 | 17 |
* Interface : SDK API, SIP API |
williamr@2 | 18 |
* Version : 1.0 |
williamr@2 | 19 |
* |
williamr@2 | 20 |
*/ |
williamr@2 | 21 |
|
williamr@2 | 22 |
|
williamr@2 | 23 |
|
williamr@2 | 24 |
#ifndef CSIPRESPONSEELEMENTS_H |
williamr@2 | 25 |
#define CSIPRESPONSEELEMENTS_H |
williamr@2 | 26 |
|
williamr@2 | 27 |
// INCLUDES |
williamr@2 | 28 |
#include <e32base.h> |
williamr@2 | 29 |
#include <s32strm.h> |
williamr@2 | 30 |
#include <stringpool.h> |
williamr@2 | 31 |
|
williamr@2 | 32 |
// FORWARD DECLARATIONS |
williamr@2 | 33 |
class CSIPMessageElements; |
williamr@2 | 34 |
class CSIPFromHeader; |
williamr@2 | 35 |
class CSIPToHeader; |
williamr@2 | 36 |
class CSIPCSeqHeader; |
williamr@2 | 37 |
|
williamr@2 | 38 |
// CLASS DECLARATION |
williamr@2 | 39 |
|
williamr@2 | 40 |
/** |
williamr@2 | 41 |
* @publishedAll |
williamr@2 | 42 |
* @released |
williamr@2 | 43 |
* |
williamr@2 | 44 |
* Class provides services for creating and manipulating SIP responses |
williamr@2 | 45 |
* This class is used for creating and manipulating SIP responses including |
williamr@2 | 46 |
* status code, reason phrase and optional elements such user headers, |
williamr@2 | 47 |
* content and its type. |
williamr@2 | 48 |
* |
williamr@2 | 49 |
* @lib sipclient.lib |
williamr@2 | 50 |
*/ |
williamr@2 | 51 |
class CSIPResponseElements : public CBase |
williamr@2 | 52 |
{ |
williamr@2 | 53 |
public: // Constructors and destructor |
williamr@2 | 54 |
/** |
williamr@2 | 55 |
* Two-phased constructor. |
williamr@2 | 56 |
* @pre aStatusCode > 100 && aStatusCode < 700 |
williamr@2 | 57 |
* @param aStatusCode a known SIP response status code. Cannot be 100. |
williamr@2 | 58 |
* @param aReasonPhrase a SIP response reason phrase. |
williamr@2 | 59 |
*/ |
williamr@2 | 60 |
IMPORT_C static CSIPResponseElements* NewL(TUint aStatusCode, |
williamr@2 | 61 |
RStringF aReasonPhrase); |
williamr@2 | 62 |
|
williamr@2 | 63 |
/** |
williamr@2 | 64 |
* Two-phased constructor. |
williamr@2 | 65 |
* @pre aStatusCode > 100 && aStatusCode < 700 |
williamr@2 | 66 |
* @param aStatusCode a known SIP response status code. Cannot be 100. |
williamr@2 | 67 |
* @param aReasonPhrase a SIP response reason phrase. |
williamr@2 | 68 |
*/ |
williamr@2 | 69 |
IMPORT_C static CSIPResponseElements* NewLC(TUint aStatusCode, |
williamr@2 | 70 |
RStringF aReasonPhrase); |
williamr@2 | 71 |
|
williamr@2 | 72 |
/** |
williamr@2 | 73 |
* Destructor. |
williamr@2 | 74 |
*/ |
williamr@2 | 75 |
IMPORT_C ~CSIPResponseElements(); |
williamr@2 | 76 |
|
williamr@2 | 77 |
public: // New functions |
williamr@2 | 78 |
/** |
williamr@2 | 79 |
* Sets a SIP Response extension status code. It is not possible to set |
williamr@2 | 80 |
* value 100. |
williamr@2 | 81 |
* @pre aStatusCode > 100 && aStatusCode < 700 |
williamr@2 | 82 |
* @param aStatusCode extension status code |
williamr@2 | 83 |
* @leave KErrArgument if aStatusCode < 100 or aStatusCode >= 700 |
williamr@2 | 84 |
*/ |
williamr@2 | 85 |
IMPORT_C void SetStatusCodeL(TUint aStatusCode); |
williamr@2 | 86 |
|
williamr@2 | 87 |
/** |
williamr@2 | 88 |
* Gets the SIP Response status code |
williamr@2 | 89 |
* @return SIP Response status code |
williamr@2 | 90 |
*/ |
williamr@2 | 91 |
IMPORT_C TUint StatusCode() const; |
williamr@2 | 92 |
|
williamr@2 | 93 |
/** |
williamr@2 | 94 |
* Sets a SIP Response Reason Phrase. |
williamr@2 | 95 |
* @param aReasonPhrase a SIP response reason phrase. |
williamr@2 | 96 |
*/ |
williamr@2 | 97 |
IMPORT_C void SetReasonPhraseL(RStringF aReasonPhrase); |
williamr@2 | 98 |
|
williamr@2 | 99 |
/** |
williamr@2 | 100 |
* Gets a SIP Response Reason Phrase. |
williamr@2 | 101 |
* @return a SIP response reason phrase or an empty string if |
williamr@2 | 102 |
* the reason phrase is not defined. |
williamr@2 | 103 |
*/ |
williamr@2 | 104 |
IMPORT_C RStringF ReasonPhrase() const; |
williamr@2 | 105 |
|
williamr@2 | 106 |
/** |
williamr@2 | 107 |
* Gets the originator's From-header |
williamr@2 | 108 |
* @return a From-header or a 0-pointer if not present. Ownership is |
williamr@2 | 109 |
* not transferred. |
williamr@2 | 110 |
*/ |
williamr@2 | 111 |
IMPORT_C const CSIPFromHeader* FromHeader() const; |
williamr@2 | 112 |
|
williamr@2 | 113 |
/** |
williamr@2 | 114 |
* Gets the recipient's To-header |
williamr@2 | 115 |
* @return a To-header or a 0-pointer if not present. Ownership is |
williamr@2 | 116 |
* not transferred. |
williamr@2 | 117 |
*/ |
williamr@2 | 118 |
IMPORT_C const CSIPToHeader* ToHeader() const; |
williamr@2 | 119 |
|
williamr@2 | 120 |
/** |
williamr@2 | 121 |
* Gets CSeq-header |
williamr@2 | 122 |
* @return a CSeq-header or a 0-pointer if not present. Ownership is |
williamr@2 | 123 |
* not transferred. |
williamr@2 | 124 |
*/ |
williamr@2 | 125 |
IMPORT_C const CSIPCSeqHeader* CSeqHeader() const; |
williamr@2 | 126 |
|
williamr@2 | 127 |
/** |
williamr@2 | 128 |
* Gets message elements (contains all SIP user headers and content) |
williamr@2 | 129 |
* @return message elements |
williamr@2 | 130 |
*/ |
williamr@2 | 131 |
IMPORT_C const CSIPMessageElements& MessageElements() const; |
williamr@2 | 132 |
|
williamr@2 | 133 |
/** |
williamr@2 | 134 |
* Gets message elements (contains all SIP user headers and content) |
williamr@2 | 135 |
* The response elements can be populated with SIP user headers |
williamr@2 | 136 |
* and content using returned reference to the message elements. |
williamr@2 | 137 |
* @return message elements |
williamr@2 | 138 |
*/ |
williamr@2 | 139 |
IMPORT_C CSIPMessageElements& MessageElements(); |
williamr@2 | 140 |
|
williamr@2 | 141 |
public: // New functions, for internal use |
williamr@2 | 142 |
static CSIPResponseElements* InternalizeL (RReadStream& aReadStream); |
williamr@2 | 143 |
static CSIPResponseElements* InternalizeLC (RReadStream& aReadStream); |
williamr@2 | 144 |
void ExternalizeL (RWriteStream& aWriteStream) const; |
williamr@2 | 145 |
|
williamr@2 | 146 |
private: |
williamr@2 | 147 |
CSIPResponseElements(); |
williamr@2 | 148 |
void ConstructL(TUint aStatusCode, RStringF aReasonPhrase); |
williamr@2 | 149 |
void DoInternalizeL (RReadStream& aReadStream); |
williamr@2 | 150 |
|
williamr@2 | 151 |
private: // Data |
williamr@2 | 152 |
TUint iStatusCode; |
williamr@2 | 153 |
RStringF iReasonPhrase; |
williamr@2 | 154 |
CSIPMessageElements* iMessageElements; |
williamr@2 | 155 |
}; |
williamr@2 | 156 |
|
williamr@2 | 157 |
#endif // end of CSIPRESPONSEELEMENTS_H |