emailuis/emailui/src/FSHtmlReloadAO.cpp
branchRCL_3
changeset 64 3533d4323edc
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Asynchronous reloading of web page
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "FSHtmlReloadAO.h"
       
    21 #include "FreestyleEmailUiHtmlViewerView.h"
       
    22 
       
    23 CFSHtmlReloadAO* CFSHtmlReloadAO::NewL(  CFsEmailUiHtmlViewerView& aView  )
       
    24     {
       
    25     CFSHtmlReloadAO* self = new( ELeave ) CFSHtmlReloadAO( aView );
       
    26     CleanupStack::PushL( self );
       
    27     self->ConstructL();
       
    28     CleanupStack::Pop( self );
       
    29     return self;
       
    30     }
       
    31 CFSHtmlReloadAO::CFSHtmlReloadAO( CFsEmailUiHtmlViewerView& aView  )
       
    32         : CActive( CActive::EPriorityStandard ), iView( aView )
       
    33     {
       
    34     CActiveScheduler::Add( this );
       
    35     }
       
    36 
       
    37 CFSHtmlReloadAO::~CFSHtmlReloadAO()
       
    38     {
       
    39     Cancel();
       
    40     }
       
    41 
       
    42 
       
    43 void CFSHtmlReloadAO::ReloadPageAysnc()
       
    44     {
       
    45     if ( !IsActive() )
       
    46         {
       
    47         //Complete request immediately
       
    48         TRequestStatus* status = &iStatus;
       
    49         User::RequestComplete( status, KErrNone );
       
    50         SetActive();
       
    51         }
       
    52     }
       
    53 
       
    54 
       
    55 
       
    56 void CFSHtmlReloadAO::ConstructL()
       
    57     {
       
    58     // Do nothing
       
    59     }
       
    60 
       
    61 // pure virtuals from CActive implemented in this derived class
       
    62 void CFSHtmlReloadAO::RunL()
       
    63     {
       
    64     if ( iStatus.Int() == KErrNone )
       
    65         {
       
    66         iView.ReloadPageL();
       
    67         }
       
    68     }
       
    69 
       
    70 void CFSHtmlReloadAO::DoCancel()
       
    71     {
       
    72     }