epoc32/include/mw/chttpservice.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     2
// All rights reserved.
williamr@4
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@4
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     7
//
williamr@4
     8
// Initial Contributors:
williamr@4
     9
// Nokia Corporation - initial contribution.
williamr@4
    10
//
williamr@4
    11
// Contributors:
williamr@4
    12
//
williamr@4
    13
// Description:
williamr@4
    14
//
williamr@4
    15
williamr@4
    16
#ifndef __CHTTPSERVICE_H__
williamr@4
    17
#define __CHTTPSERVICE_H__
williamr@4
    18
williamr@4
    19
#include <e32std.h>
williamr@4
    20
#include <http.h>
williamr@4
    21
#include <in_sock.h>
williamr@4
    22
#include "httpheaderiter.h"
williamr@4
    23
williamr@4
    24
/**
williamr@4
    25
 * CHttpService represent a handle to the HTTP service instance for a set of client 
williamr@4
    26
 * HTTP transactions[a request and its equivalent response]. The application can 
williamr@4
    27
 * specify connection preferences[proxy, max. no of connections allowed in a single
williamr@4
    28
 * HTTP service instance], pipelining, setting request headers that applies to all 
williamr@4
    29
 * transactions that the CHttpService holds etc...
williamr@4
    30
 * 
williamr@4
    31
 * @publishedAll
williamr@4
    32
 * @prototype 
williamr@4
    33
 */
williamr@4
    34
williamr@4
    35
class CHttpService : public CBase
williamr@4
    36
	{
williamr@4
    37
	friend class CHttpClientTransactionImpl;	
williamr@4
    38
	public:
williamr@4
    39
	
williamr@4
    40
	IMPORT_C static CHttpService* NewL();
williamr@4
    41
	IMPORT_C ~CHttpService();
williamr@4
    42
	
williamr@4
    43
	IMPORT_C TInt String(TInt aStringId, TPtrC8& aPtr);
williamr@4
    44
	
williamr@4
    45
	IMPORT_C TInt SetProxy(const TDesC8& aProxyAddress);
williamr@4
    46
	IMPORT_C const TDesC8& ProxyAddress() const;
williamr@4
    47
	
williamr@4
    48
	IMPORT_C void SetMaxConnections(TInt aValue);
williamr@4
    49
	IMPORT_C TInt MaxConnections() const;
williamr@4
    50
	
williamr@4
    51
	IMPORT_C void SetMaxTransactionsToPipeline(TInt aValue);
williamr@4
    52
	IMPORT_C TInt MaxTransactionsToPipeline() const;
williamr@4
    53
	
williamr@4
    54
	IMPORT_C TInt AddRequestHeader(TInt aHeaderId, const THttpHeaderValueVariant& aHeaderValue);		
williamr@4
    55
	IMPORT_C TInt AddCustomRequestHeader(const TDesC8& aHeaderName, const TDesC8& aHeaderValue);
williamr@4
    56
	
williamr@4
    57
	
williamr@4
    58
	private:
williamr@4
    59
	CHttpService();
williamr@4
    60
	void ConstructL();	
williamr@4
    61
	
williamr@4
    62
	class CHttpServiceStruct : public CBase
williamr@4
    63
		{
williamr@4
    64
		public:
williamr@4
    65
		RHTTPSession	 iHttpSession;
williamr@4
    66
		RHTTPHeaders     iSessionHeaders; 
williamr@4
    67
		};
williamr@4
    68
	private:
williamr@4
    69
	   RHTTPSession Session()
williamr@4
    70
	       {
williamr@4
    71
	       return iHttpServiceStruct->iHttpSession;
williamr@4
    72
	       }
williamr@4
    73
	private:
williamr@4
    74
	
williamr@4
    75
	
williamr@4
    76
	   CHttpServiceStruct* iHttpServiceStruct; // Implementation struct
williamr@4
    77
	};
williamr@4
    78
williamr@4
    79
#endif // __CHTTPSERVICE_H__