applayerprotocols/httpservice/inc/chttpnetworkconnectioninfo.h
branchRCL_3
changeset 9 2611c08ee28e
equal deleted inserted replaced
8:fa2fd8b2d6cc 9:2611c08ee28e
       
     1 // Copyright (c) 2003-2010 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 CHTTPNETWORKCONNECTIONINFO_H_
       
    17 #define CHTTPNETWORKCONNECTIONINFO_H_
       
    18 
       
    19 #include <commdbconnpref.h>
       
    20 #include <es_sock.h>
       
    21 #include "chttpservice.h"
       
    22 
       
    23 
       
    24 class CConnectionMonitor;
       
    25 
       
    26 class CHttpNetworkConnection: public CBase
       
    27     {
       
    28     friend class CHttpClientTransactionImpl;    
       
    29     friend class CConnectionMonitor;
       
    30     friend class CHttpService;
       
    31     
       
    32     public:
       
    33         static CHttpNetworkConnection* New();
       
    34         IMPORT_C TInt Start();//start on default connection
       
    35         IMPORT_C TInt Start(TCommDbConnPref aConnPref, TBool aAttachType=EFalse);
       
    36 
       
    37         IMPORT_C void Stop();
       
    38         
       
    39 
       
    40 
       
    41     private:
       
    42         TInt SetupConnection();
       
    43         void AssociateConnectionWithHttpSession();
       
    44         void HandleConnectionEvent(TInt aEvent); //Called whenever there is a connection event
       
    45         void SetHttpService(CHttpService* aService);
       
    46         RConnection Connection()
       
    47             {
       
    48             return iConnInfo->iConnection;
       
    49             }
       
    50         CHttpNetworkConnection();
       
    51         void ConstructL();
       
    52     
       
    53         ~CHttpNetworkConnection();
       
    54 
       
    55     
       
    56     private:
       
    57         class CConnectionInfo: public CBase
       
    58             {
       
    59             public:
       
    60             TBool           iConnectionStatus;
       
    61             TBool           iAttach;
       
    62             TCommDbConnPref iConnPref;
       
    63             RConnection     iConnection;
       
    64             RSocketServ     iSocketServ;
       
    65             };
       
    66         CConnectionMonitor* iConnectionMonitor;
       
    67         CConnectionInfo*    iConnInfo;
       
    68         CHttpService*       iHttpService;
       
    69     };
       
    70 
       
    71 #endif /* CHTTPNETWORKCONNECTIONINFO_H_ */