epoc32/include/mw/http/rhttpheaders.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // 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
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 //
    14 //
    15 
    15 
    16 
       
    17 
       
    18 /**
    16 /**
    19  @file RHTTPHeaders.h
    17  @file
    20  @warning : This file contains Rose Model ID comments - please do not delete
    18  @warning : This file contains Rose Model ID comments - please do not delete
    21 */
    19 */
    22 
    20 
    23 #ifndef	__RHTTPHEADERS_H__
    21 #ifndef	__RHTTPHEADERS_H__
    24 #define	__RHTTPHEADERS_H__
    22 #define	__RHTTPHEADERS_H__
    73 				specifed field name
    71 				specifed field name
    74 	*/
    72 	*/
    75 	//##ModelId=3C4C18800079
    73 	//##ModelId=3C4C18800079
    76 	IMPORT_C TInt GetField(RStringF aFieldName, 
    74 	IMPORT_C TInt GetField(RStringF aFieldName, 
    77 								  TInt aPartIdx, THTTPHdrVal& aHeaderValue) const;
    75 								  TInt aPartIdx, THTTPHdrVal& aHeaderValue) const;
    78 
    76 	
    79 	/** Obtain an Raw representation of the named header
    77 	/** Obtain an Raw representation of the named header
    80 		field's value.  Note that general client use of this method is
    78 		field's value.  Note that general client use of this method is
    81 		strongly discouraged since it exposes the Raw representation of particular headers.  
    79 		strongly discouraged since it exposes the Raw representation of particular headers.  
    82 		However it may be needed for some cases where received headers could not be
    80 		However it may be needed for some cases where received headers could not be
    83 		decoded by HTTP.  It will normally be used internally when
    81 		decoded by HTTP.  It will normally be used internally when
    89 				specifed field name
    87 				specifed field name
    90 	*/
    88 	*/
    91 	//##ModelId=3C4C18800076
    89 	//##ModelId=3C4C18800076
    92 	IMPORT_C TInt GetRawField(RStringF aFieldName, 
    90 	IMPORT_C TInt GetRawField(RStringF aFieldName, 
    93 							   TPtrC8& aRawFieldData) const;
    91 							   TPtrC8& aRawFieldData) const;
    94 
    92 	
       
    93 	IMPORT_C void GetRawFieldL(RStringF aFieldName, TPtrC8& aRawFieldData) const;
       
    94 	
    95 	/** Obtain the value of a named parameter, associated with the
    95 	/** Obtain the value of a named parameter, associated with the
    96 		named header field.  An optional index to a part within the
    96 		named header field.  An optional index to a part within the
    97 		header field may be supplied, if not it is assumed that it is
    97 		header field may be supplied, if not it is assumed that it is
    98 		the first part.
    98 		the first part.
    99 		@param aFieldName The header name
    99 		@param aFieldName The header name
   129 		hold the supplied value.
   129 		hold the supplied value.
   130 		@param aFieldName The field name, e.g, 'Content-Type'
   130 		@param aFieldName The field name, e.g, 'Content-Type'
   131 		@param aFieldValue The field value, e.g. 'text/html' */
   131 		@param aFieldValue The field value, e.g. 'text/html' */
   132 	//##ModelId=3C4C18800060
   132 	//##ModelId=3C4C18800060
   133 	IMPORT_C void SetFieldL(RStringF aFieldName, THTTPHdrVal aFieldValue);
   133 	IMPORT_C void SetFieldL(RStringF aFieldName, THTTPHdrVal aFieldValue);
   134 
   134 	IMPORT_C TInt SetField(RStringF aFieldName, THTTPHdrVal aFieldValue);
       
   135 	
   135 	/** Set a named field in the header, and associate with it the
   136 	/** Set a named field in the header, and associate with it the
   136 		supplied parameter. If the field doesn't already exist it will
   137 		supplied parameter. If the field doesn't already exist it will
   137 		be created along with a parameter; if it does exist, then a
   138 		be created along with a parameter; if it does exist, then a
   138 		new part will be created along with the parameter.
   139 		new part will be created along with the parameter.
   139 		@param aFieldName The field name, e.g. 'Accept'
   140 		@param aFieldName The field name, e.g. 'Accept'
   141 		@param aParamName The parameter name, e.g. 'q'
   142 		@param aParamName The parameter name, e.g. 'q'
   142 		@param aParamValue The parameter value, e.g. '0.3' */
   143 		@param aParamValue The parameter value, e.g. '0.3' */
   143 	//##ModelId=3C4C18800063
   144 	//##ModelId=3C4C18800063
   144 	IMPORT_C void SetFieldL(RStringF aFieldName, THTTPHdrVal aFieldValue,
   145 	IMPORT_C void SetFieldL(RStringF aFieldName, THTTPHdrVal aFieldValue,
   145 							RStringF aParamName, THTTPHdrVal aParamValue);
   146 							RStringF aParamName, THTTPHdrVal aParamValue);
   146 
   147 	IMPORT_C TInt SetField(RStringF aFieldName, THTTPHdrVal aFieldValue,
       
   148                             RStringF aParamName, THTTPHdrVal aParamValue);
   147 	/** Set a parameter in an existing header. 
   149 	/** Set a parameter in an existing header. 
   148 		@param aFieldName The field name, e.g. 'Accept'
   150 		@param aFieldName The field name, e.g. 'Accept'
   149 		@param aPartIdx The part of the header to add the parameter to
   151 		@param aPartIdx The part of the header to add the parameter to
   150 		@param aParamName The parameter name, e.g. 'q'
   152 		@param aParamName The parameter name, e.g. 'q'
   151 		@param aParamValue The parameter value, e.g. '0.3'
   153 		@param aParamValue The parameter value, e.g. '0.3'
   169 	*/
   171 	*/
   170 	//##ModelId=3C4C1880004F
   172 	//##ModelId=3C4C1880004F
   171 	IMPORT_C void SetRawFieldL(RStringF aFieldName, 
   173 	IMPORT_C void SetRawFieldL(RStringF aFieldName, 
   172 							   const TDesC8& aRawFieldData,
   174 							   const TDesC8& aRawFieldData,
   173 							   const TDesC8& aFieldSeparator);
   175 							   const TDesC8& aFieldSeparator);
   174 
   176 	
       
   177 	IMPORT_C TInt SetRawField(RStringF aFieldName, const TDesC8& aRawFieldData, const TDesC8& aFieldSeparator);
   175 	/** Remove, entirely, the named header field from the header
   178 	/** Remove, entirely, the named header field from the header
   176 		collection. All its parts and associated parameters (where
   179 		collection. All its parts and associated parameters (where
   177 		they exist) are also removed.
   180 		they exist) are also removed.
   178 		@param aFieldName The field name.
   181 		@param aFieldName The field name.
   179 		@return KErrNone if the removal is successful; KErrNotFound if
   182 		@return KErrNone if the removal is successful; KErrNotFound if
   198 	//@}
   201 	//@}
   199 
   202 
   200 
   203 
   201 private:
   204 private:
   202 	friend class CHeaders;
   205 	friend class CHeaders;
       
   206 	friend class CHttpClientTransaction;
       
   207 	friend class CHttpClientTransactionImpl;
   203 	//##ModelId=3C4C1880003A
   208 	//##ModelId=3C4C1880003A
   204 	CHeaders* iImplementation;
   209 	CHeaders* iImplementation;
   205 	};
   210 	};
   206 
   211 
   207 
   212