installationservices/swi/test/tasynccancel/installer.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 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  @test
       
    21  @internalComponent
       
    22 */
       
    23 
       
    24 
       
    25 #ifndef INSTALLER_H
       
    26 #define INSTALLER_H
       
    27 
       
    28 #include "common.h"
       
    29 #include "asyncc-tui.h"
       
    30 
       
    31 
       
    32 /**
       
    33  * This class defines the object that is used to start and cancel
       
    34  * the installation process
       
    35  */
       
    36 class CInstaller : public CActive
       
    37 	{
       
    38 
       
    39 	public:
       
    40 	
       
    41 		CInstaller();
       
    42 		static CInstaller* NewLC(CInstallPrefs* aPrefs=NULL);
       
    43 		static CInstaller* NewL(CInstallPrefs* aPrefs=NULL);
       
    44 		~CInstaller();
       
    45 
       
    46 		/**
       
    47  		 * Sets up the installation (but without starting the Active Scheduler)
       
    48  		 * @param aSisToInstall		Full path to sis file to be installed
       
    49  		 */
       
    50 		void StartL(const TDesC& aSisToInstall);
       
    51 		void CancelInstallation();
       
    52 		
       
    53 		TInt CancelationSuccess()
       
    54 			{
       
    55 			return iCancelationSuccess;
       
    56 			}
       
    57 			
       
    58 		TInt FinishedInstallation()
       
    59 			{
       
    60 			return iFinishedInstallation;
       
    61 			}
       
    62 
       
    63 		TInt FinishedCanceling()
       
    64 			{
       
    65 			return iFinishedCanceling;
       
    66 			}
       
    67 		
       
    68 		TInt Status()
       
    69 			{
       
    70 			return iEndStatus;
       
    71 			}
       
    72 		
       
    73 	private:
       
    74 	
       
    75 		// Executed when cancelation finishes
       
    76 		void RunL();
       
    77 		void DoCancel();
       
    78 		void ConstructL(CInstallPrefs* aPrefs=NULL);
       
    79 		
       
    80 		CAsyncLauncher* iLauncher;
       
    81 		CInstallPrefs* iPrefs;
       
    82 		CUIScriptAdaptor* iUiHandler;
       
    83 
       
    84 		TInt iCancelationSuccess;
       
    85 		TInt iFinishedInstallation;
       
    86 		TInt iFinishedCanceling;
       
    87 		
       
    88 		TInt iDeletePrefs;
       
    89 		
       
    90 		TInt iEndStatus;
       
    91 	};
       
    92 
       
    93 #endif
       
    94 // End of file