emailuis/emailui/src/FSHtmlReloadAO.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 13 Oct 2010 14:11:15 +0300
branchRCL_3
changeset 80 726fba06891a
parent 64 3533d4323edc
permissions -rw-r--r--
Revision: 201039 Kit: 201041

/*
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "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:  Asynchronous reloading of web page
*
*/



#include "FSHtmlReloadAO.h"
#include "FreestyleEmailUiHtmlViewerView.h"

CFSHtmlReloadAO* CFSHtmlReloadAO::NewL(  CFsEmailUiHtmlViewerView& aView  )
    {
    CFSHtmlReloadAO* self = new( ELeave ) CFSHtmlReloadAO( aView );
    CleanupStack::PushL( self );
    self->ConstructL();
    CleanupStack::Pop( self );
    return self;
    }
CFSHtmlReloadAO::CFSHtmlReloadAO( CFsEmailUiHtmlViewerView& aView  )
        : CActive( CActive::EPriorityStandard ), iView( aView )
    {
    CActiveScheduler::Add( this );
    }

CFSHtmlReloadAO::~CFSHtmlReloadAO()
    {
    Cancel();
    }


void CFSHtmlReloadAO::ReloadPageAysnc()
    {
    if ( !IsActive() )
        {
        //Complete request immediately
        TRequestStatus* status = &iStatus;
        User::RequestComplete( status, KErrNone );
        SetActive();
        }
    }



void CFSHtmlReloadAO::ConstructL()
    {
    // Do nothing
    }

// pure virtuals from CActive implemented in this derived class
void CFSHtmlReloadAO::RunL()
    {
    if ( iStatus.Int() == KErrNone )
        {
        iView.ReloadPageL();
        }
    }

void CFSHtmlReloadAO::DoCancel()
    {
    }