applayerpluginsandutils/httpprotocolplugins/httpclient/chttpconnectioninfo.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     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 
       
    17 #ifndef __CHTTPCONNECTIONINFO_H__
       
    18 #define __CHTTPCONNECTIONINFO_H__
       
    19 
       
    20 #include <e32base.h>
       
    21 #include <stringpool.h>
       
    22 
       
    23 class CHttpConnectionInfo : public CBase
       
    24 	{
       
    25 public:	
       
    26 
       
    27 	enum THttpPersistent
       
    28 		{
       
    29 		EPersistent			= 0,
       
    30 		ENonPersistent
       
    31 		};
       
    32 
       
    33 public:
       
    34 
       
    35 	static CHttpConnectionInfo* NewL(RStringPool aStringPool, const TDesC8& aHost, TUint16 aPort);
       
    36 	virtual ~CHttpConnectionInfo();
       
    37 	
       
    38 	inline void SetSecureState(TBool aIsSecure);
       
    39 	inline void SetPersistentState(THttpPersistent aState);
       
    40 	
       
    41 	inline TBool IsSecure() const;
       
    42 	inline TBool IsNonPersistent() const;
       
    43 
       
    44 	inline const TDesC8& Host() const;
       
    45 	inline TUint16 Port() const;
       
    46 	
       
    47 	TBool HostAndPortMatches(const CHttpConnectionInfo& aConnectionInfo) const;
       
    48 	
       
    49 private:
       
    50 
       
    51 	inline CHttpConnectionInfo(RStringPool aStringPool);
       
    52 	void ConstructL(const TDesC8& aHost, TUint16 aPort);
       
    53 	
       
    54 private:
       
    55     TUint16         iPort;
       
    56     TBool           iIsSecure;
       
    57     TBool           iIsNonPersistent;    	
       
    58 	RStringPool		iStringPool;
       
    59 	RStringF		iHost;	
       
    60 	};
       
    61 
       
    62 inline CHttpConnectionInfo::CHttpConnectionInfo(RStringPool aStringPool)
       
    63 : iStringPool(aStringPool)
       
    64     {
       
    65     }
       
    66 
       
    67 inline void CHttpConnectionInfo::SetSecureState(TBool aIsSecure)
       
    68     {
       
    69     iIsSecure = aIsSecure;
       
    70     }
       
    71 
       
    72 inline void CHttpConnectionInfo::SetPersistentState(THttpPersistent aState)
       
    73     {
       
    74     iIsNonPersistent = (aState == ENonPersistent);
       
    75     }
       
    76 
       
    77 inline TBool CHttpConnectionInfo::IsSecure() const
       
    78     {
       
    79     return iIsSecure;
       
    80     }
       
    81     
       
    82 inline TBool CHttpConnectionInfo::IsNonPersistent() const
       
    83     {
       
    84     return iIsNonPersistent;
       
    85     }
       
    86     
       
    87 inline const TDesC8& CHttpConnectionInfo::Host() const
       
    88     {
       
    89     return iHost.DesC();
       
    90     }
       
    91     
       
    92 inline TUint16 CHttpConnectionInfo::Port() const
       
    93     {
       
    94     return iPort;
       
    95     }
       
    96 
       
    97 #endif	// __CHTTPCONNECTIONINFO_H__