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