iaupdate/IAD/ui/src/iaupdateprogressdialog.cpp
branchRCL_3
changeset 25 7333d7932ef7
parent 24 5cc91383ab1e
child 26 8b7f4e561641
equal deleted inserted replaced
24:5cc91383ab1e 25:7333d7932ef7
     1 /*
       
     2 * Copyright (c) 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:   This file contains the implementation of CIAUpdateProgressDialog
       
    15 *                class member functions.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <eikprogi.h>
       
    23 
       
    24 #include "iaupdateprogressdialog.h"
       
    25 #include "iaupdatewaitdialogobserver.h"
       
    26 
       
    27 
       
    28 
       
    29 // ========================= MEMBER FUNCTIONS ================================
       
    30 
       
    31 // -----------------------------------------------------------------------------
       
    32 // CIAUpdateProgressDialog::CIAUpdateProgressDialog
       
    33 // C++ default constructor can NOT contain any code, that
       
    34 // might leave.
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 CIAUpdateProgressDialog::CIAUpdateProgressDialog( CEikDialog** aSelfPtr, 
       
    38                                                   TBool aVisibilityDelayOff )
       
    39     :CAknProgressDialog( aSelfPtr, aVisibilityDelayOff )
       
    40     {
       
    41     }
       
    42 
       
    43 // -----------------------------------------------------------------------------
       
    44 // CIAUpdateProgressDialog::~CIAUpdateProgressDialog
       
    45 // Destructor
       
    46 // -----------------------------------------------------------------------------
       
    47 //
       
    48 CIAUpdateProgressDialog::~CIAUpdateProgressDialog()
       
    49     {
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // CIAUpdateProgressDialog::OkToExitL()
       
    54 // called by framework when the Softkey is pressed. 
       
    55 // On cancel either stop installation or exit 
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 TBool CIAUpdateProgressDialog::OkToExitL( TInt aButtonId )
       
    59     {
       
    60     TBool result( ETrue );
       
    61     
       
    62     if ( iCallback )
       
    63         {
       
    64         result = iCallback->HandleDialogExitL( aButtonId );
       
    65         }
       
    66 
       
    67     return result;
       
    68     }
       
    69 
       
    70 // ---------------------------------------------------------------------------
       
    71 // CIAUpdateProgressDialog::SetCallback
       
    72 // ---------------------------------------------------------------------------
       
    73 //
       
    74 void CIAUpdateProgressDialog::SetCallback( MIAUpdateWaitDialogObserver* aCallback )
       
    75     {
       
    76     iCallback = aCallback;
       
    77     }
       
    78     
       
    79 // -----------------------------------------------------------------------------
       
    80 // CIAUpdateProgressDialog::SetProgressDialogFinalValueL
       
    81 // Set final value for the progress bar in progress dialog.
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 void CIAUpdateProgressDialog::SetProgressDialogFinalValueL( TInt aValue )
       
    85     {
       
    86     if ( aValue != iMaxProgress )
       
    87         {
       
    88     	CEikProgressInfo* progressInfo = GetProgressInfoL();
       
    89         progressInfo->SetFinalValue( aValue );
       
    90         iMaxProgress = aValue;
       
    91         }
       
    92     }
       
    93 
       
    94 // -----------------------------------------------------------------------------
       
    95 // CIAUpdateProgressDialog::UpdateProgressDialogValueL
       
    96 // Increments the progress bar in progress dialog.
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 void CIAUpdateProgressDialog::UpdateProgressDialogValueL( TInt aValue )
       
   100     {
       
   101     CEikProgressInfo* progressInfo = GetProgressInfoL();
       
   102     progressInfo->SetAndDraw( aValue );
       
   103     }
       
   104 
       
   105 // End of File