installationservices/swi/inc/progressbar.h
changeset 0 ba25891c3a9e
child 40 f8cf9d484c15
child 44 329d304c1aa1
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2004-2009 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 the License "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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalComponent
       
    22  @released
       
    23 */
       
    24 
       
    25 #ifndef __PROGRESSBAR_H__
       
    26 #define __PROGRESSBAR_H__
       
    27 
       
    28 namespace Swi
       
    29 	{
       
    30 	/// How many increments to update the bar on the uninstall of a file
       
    31 	const static TInt KProgressBarUninstallAmount=1;
       
    32 	
       
    33 	/// How many bytes to copy before updating the progress bar by one increment
       
    34 	const static TInt KProgressBarInstallChunkSize=32767;
       
    35 
       
    36 	/// The extra increment we add onto the end to make there always be some progress.
       
    37 	const static TInt KProgressBarEndIncrement=1;
       
    38 	
       
    39 	/**
       
    40 	 * Utility function to get how much to update the progress bar for a certain
       
    41 	 * size of file copied. The smallest increment is KProgressBarEndIncrement since we always want to show that 
       
    42 	 * some progress has occurred.
       
    43 	 */
       
    44 	TInt ProgressBarFileIncrement(TInt64 aSize);
       
    45 
       
    46 	/**
       
    47 	 * Utility function to get how much to update the progress bar for a certain
       
    48 	 * size of chunk copied. 
       
    49 	 */
       
    50 	TInt ProgressBarChunkIncrement(TInt64 aSize);
       
    51 
       
    52 	inline TInt ProgressBarChunkIncrement(TInt64 aSize)
       
    53 		{
       
    54 		return I64LOW(aSize) / KProgressBarInstallChunkSize;
       
    55 		}
       
    56 
       
    57 	inline TInt ProgressBarFileIncrement(TInt64 aSize)
       
    58 		{
       
    59 		return KProgressBarEndIncrement + ProgressBarChunkIncrement(aSize);
       
    60 		}
       
    61 	}
       
    62 
       
    63 
       
    64 #endif