webengine/osswebengine/WebCore/platform/network/symbian/ResolvedConnection.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 09 Jun 2010 10:52:50 +0300
branchRCL_3
changeset 42 a1a5d4e727e8
parent 26 cb62a4f66ebe
child 48 79859ed3eea9
permissions -rw-r--r--
Revision: 201021 Kit: 2010123

/*
* Copyright (c) 2007 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:  
*
*/

#ifndef __RESOLVEDCONNECTION_H__
#define __RESOLVEDCONNECTION_H__

#include <e32base.h>
#include "UrlConnection.h"
#include <brctldefs.h>
#include <brctllinkresolver.h>

namespace WebCore {
    class Frame;
};

class CPeriodic;

class ResolvedConnection : public MUrlConnection, public MBrCtlLinkContent
{
    public: // new functions
        ResolvedConnection(WebCore::ResourceHandle* handle, WebCore::Frame* frame);
        virtual ~ResolvedConnection();
    public: // from MUrlConnection
        virtual int submit();
        virtual void cancel();
        /**
        */
        virtual void download(WebCore::ResourceHandle* handle, const WebCore::ResourceRequest& request, const WebCore::ResourceResponse& response);
        virtual int totalContentSize() { return m_maxSize; }

    public: // from MBrCtlLinkContent
        /**
        * Resolver calls this method when content is resolved.
        * @param aContentType The content type of the response
        * @param aCharset The charset of the response. May be empty in case of image
        * @param aContentBuf content data. Ownership is not transfered
        * @return void
        */
        virtual void HandleResolveComplete(const TDesC& aContentType,
                                           const TDesC& aCharset,
                                           const HBufC8* aContentBuf);

        /**
        * This method is called if there is some error while resolving the content
        * @param aError system wide error code.
        * @return void
        */
        virtual void HandleResolveError(TInt aError);
        void processResponse();

    private:
        void complete(int error);

    private:
        WebCore::Frame* m_frame;
        bool m_didSubmit;
        CPeriodic* m_scheduler;
        HBufC* m_contentType;
        HBufC* m_charset;
        HBufC8* m_contentBuf;
        int m_maxSize;
};



#endif // __RESOLVEDCONNECTION_H__
// end of file