browserutilities/feedsengine/FeedsServer/UrlHandler/inc/ServerHttpConnection.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 14 Apr 2010 17:06:56 +0300
branchRCL_3
changeset 37 ac77f89b1d9e
parent 0 dd21522fd290
child 48 79859ed3eea9
permissions -rw-r--r--
Revision: 201013 Kit: 201015

/*
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  A class that holds the shared connection to a access point.
*
*/


#ifndef SERVER_HTTP_CONNECTION_H
#define SERVER_HTTP_CONNECTION_H


// INCLUDES
#include "httpconnection.h"
#include "browser_platform_variant.hrh"
// CONSTANTS

// MACROS

// DATA TYPES

// FUNCTION PROTOTYPES

// FORWARD DECLARATIONS
class CInternetConnectionManager;

// CLASS DECLARATION


/**
*  A class that holds the shared connection to a access point.
*
*  \b Library: FeedsEngine.lib
*
*  @since 3.0
*/
class CServerHttpConnection: public CHttpConnection
    {
    public:  // Constructors and destructor
        /**
        * Two-phased constructor.
        */
        static CServerHttpConnection* NewL( TUint32 iDefaultAccessPoint );
        
        /**
        * Destructor.
        */        
        virtual ~CServerHttpConnection();
        
        
    public: // From MConnectionCallback        
        /**
        * It propagates the connection callback to the browser client.
        *
        * @since 3.0
        * @param aConnectionPtr Connection ptr
        * @param aSockSvrHandle Socket server handle
        * @param aNewConn ETrue, if this is a new connection
        * @param aBearerType Bearer type
        * @return OS wide error code
        */
        virtual TInt CreateConnection(TInt* aConnectionPtr, TInt* aSockSvrHandle, 
                TBool* aNewConn, TApBearerType* aBearerType);
        
        
    public:  // from CHttpConnection
        /**
        * Returns whether or not the connection is active.
        *
        * @since 3.0
        * @return void.
        */
        TBool IsConnected();

        /**
        * Closes the connection.
        *
        * @since 3.0
        * @return void.
        */
        void Disconnect();


    public:  // New methods.
        /**
        * Sets the new access point.
        *
        * @since 3.0
        * @param aAccessPoint The access point.
        * @return Void
        */
        void SetAccessPointL( TUint32 aAccessPoint );
#ifdef BRDO_OCC_ENABLED_FF
        TBool IsPhoneOfflineL();
#endif

    private:
        /**
        * C++ default constructor.
        */
        CServerHttpConnection( TUint32 iDefaultAccessPoint );
        
        /**
        * By default Symbian 2nd phase constructor is private.
        */
        void ConstructL();


    private:
        TLeakTracker                 iLeakTracker;
        
        CInternetConnectionManager*  iConMgr;
        TUint32                      iDefaultAccessPoint;
    };

#endif      // SERVER_HTTP_CONNECTION_H
            
// End of File