applayerprotocols/httptransportfw/httputils/inc/rexplicithttpsession.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2008-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 /**
       
    17  @file
       
    18  @publishedPartner
       
    19  @released
       
    20 */
       
    21 
       
    22 #ifndef REXPLICITHTTPSESSION_H_
       
    23 #define REXPLICITHTTPSESSION_H_
       
    24 
       
    25 #include <http.h>
       
    26 #include <es_sock.h>
       
    27 
       
    28 
       
    29 /**
       
    30 RExplicitHTTPSession is a wrapper around the RHTTPSession. 
       
    31 This handle provides features which allows the application to prompt the user only once 
       
    32 for the selection of an IAP during muliple connections within a session.
       
    33 
       
    34 @publishedPartner
       
    35 @released
       
    36 */
       
    37 class RExplicitHTTPSession
       
    38 	{
       
    39 public:
       
    40     IMPORT_C RExplicitHTTPSession();
       
    41     IMPORT_C void OpenL(const TUriC8& aUri, TUint32 aIapNumber = 0, TBool aStartConnection = ETrue);
       
    42     IMPORT_C void Close();
       
    43 
       
    44     IMPORT_C void StartConnection(TRequestStatus& aStatus);
       
    45     IMPORT_C void CancelStart();
       
    46  
       
    47     IMPORT_C RHTTPSession& HTTPSession();
       
    48     inline RHTTPSession& operator()();
       
    49 
       
    50 private:
       
    51     void BindConnectionL(TUint32 aIap, TBool aStartConnection);
       
    52     // Returns ETrue if there is a proxy to use for the given scheme; 
       
    53     // aProxyServer gets set
       
    54     TBool UseProxyL(const TDesC8& aScheme, HBufC8*& aProxyServer);
       
    55      
       
    56 private:
       
    57     RSocketServ iSocketServ;
       
    58     RConnection iConnection;
       
    59     RHTTPSession iHTTPSession;
       
    60     TUint32 iIap;
       
    61     };
       
    62 
       
    63 // inline methods
       
    64 inline RHTTPSession& RExplicitHTTPSession::operator()()
       
    65     {
       
    66     return HTTPSession();
       
    67     }
       
    68 
       
    69 #endif /*REXPLICITHTTPSESSION_H_*/