|
1 /* |
|
2 * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 @publishedPartner |
|
24 */ |
|
25 |
|
26 #ifndef EXPLICITHTTPSESSION_H |
|
27 #define EXPLICITHTTPSESSION_H |
|
28 |
|
29 #include <http.h> |
|
30 #include <es_sock.h> |
|
31 |
|
32 class RExplicitHTTPSession |
|
33 { |
|
34 public: |
|
35 IMPORT_C RExplicitHTTPSession(); |
|
36 IMPORT_C void OpenL(const TUriC8& aUri, TUint32 aIapNumber = 0, TBool aStartConnection = ETrue); |
|
37 IMPORT_C void Close(); |
|
38 |
|
39 IMPORT_C void StartConnection(TRequestStatus& aStatus); |
|
40 IMPORT_C void CancelStart(); |
|
41 |
|
42 IMPORT_C RHTTPSession& HTTPSession(); |
|
43 inline RHTTPSession& operator()(); |
|
44 |
|
45 private: |
|
46 void BindConnectionL(TUint32 aIap, TBool aStartConnection); |
|
47 // Returns ETrue if there is a proxy to use for the given scheme; |
|
48 // aProxyServer gets set |
|
49 TBool UseProxyL(const TDesC8& aScheme, HBufC8*& aProxyServer); |
|
50 |
|
51 private: |
|
52 RSocketServ iSocketServ; |
|
53 RConnection iConnection; |
|
54 RHTTPSession iHTTPSession; |
|
55 TUint32 iIap; |
|
56 }; |
|
57 |
|
58 // inline methods |
|
59 inline RHTTPSession& RExplicitHTTPSession::operator()() |
|
60 { |
|
61 return HTTPSession(); |
|
62 } |
|
63 |
|
64 #endif |