1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/chttpservice.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,79 @@
1.4 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __CHTTPSERVICE_H__
1.20 +#define __CHTTPSERVICE_H__
1.21 +
1.22 +#include <e32std.h>
1.23 +#include <http.h>
1.24 +#include <in_sock.h>
1.25 +#include "httpheaderiter.h"
1.26 +
1.27 +/**
1.28 + * CHttpService represent a handle to the HTTP service instance for a set of client
1.29 + * HTTP transactions[a request and its equivalent response]. The application can
1.30 + * specify connection preferences[proxy, max. no of connections allowed in a single
1.31 + * HTTP service instance], pipelining, setting request headers that applies to all
1.32 + * transactions that the CHttpService holds etc...
1.33 + *
1.34 + * @publishedAll
1.35 + * @prototype
1.36 + */
1.37 +
1.38 +class CHttpService : public CBase
1.39 + {
1.40 + friend class CHttpClientTransactionImpl;
1.41 + public:
1.42 +
1.43 + IMPORT_C static CHttpService* NewL();
1.44 + IMPORT_C ~CHttpService();
1.45 +
1.46 + IMPORT_C TInt String(TInt aStringId, TPtrC8& aPtr);
1.47 +
1.48 + IMPORT_C TInt SetProxy(const TDesC8& aProxyAddress);
1.49 + IMPORT_C const TDesC8& ProxyAddress() const;
1.50 +
1.51 + IMPORT_C void SetMaxConnections(TInt aValue);
1.52 + IMPORT_C TInt MaxConnections() const;
1.53 +
1.54 + IMPORT_C void SetMaxTransactionsToPipeline(TInt aValue);
1.55 + IMPORT_C TInt MaxTransactionsToPipeline() const;
1.56 +
1.57 + IMPORT_C TInt AddRequestHeader(TInt aHeaderId, const THttpHeaderValueVariant& aHeaderValue);
1.58 + IMPORT_C TInt AddCustomRequestHeader(const TDesC8& aHeaderName, const TDesC8& aHeaderValue);
1.59 +
1.60 +
1.61 + private:
1.62 + CHttpService();
1.63 + void ConstructL();
1.64 +
1.65 + class CHttpServiceStruct : public CBase
1.66 + {
1.67 + public:
1.68 + RHTTPSession iHttpSession;
1.69 + RHTTPHeaders iSessionHeaders;
1.70 + };
1.71 + private:
1.72 + RHTTPSession Session()
1.73 + {
1.74 + return iHttpServiceStruct->iHttpSession;
1.75 + }
1.76 + private:
1.77 +
1.78 +
1.79 + CHttpServiceStruct* iHttpServiceStruct; // Implementation struct
1.80 + };
1.81 +
1.82 +#endif // __CHTTPSERVICE_H__