appinstaller/AppinstUi/Daemon/Inc/uninstaller.h
changeset 0 ba25891c3a9e
child 25 7333d7932ef7
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2004 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef UNINSTALLER_H
       
    20 #define UNINSTALLER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 #include <apgcli.h>
       
    25 
       
    26 #include "programstatus.h"
       
    27 #include "silentuninstaller.h"
       
    28     
       
    29 namespace Swi
       
    30 { 
       
    31 class CVersionRevisor;
       
    32 class CDialogWrapper;
       
    33 /**
       
    34  *  CSisPkgUninstaller class handles asyncronous uninstalling for sisx. 
       
    35  *
       
    36  *  @since S60 3.2
       
    37  */
       
    38 class CSisPkgUninstaller : public CActive
       
    39     {
       
    40     public:
       
    41 
       
    42         // Uninstaller state.
       
    43         enum TUninstallerState
       
    44             {           
       
    45             EUninstallerStateUninstalling,
       
    46             EUninstallerStateIdle, 
       
    47             EUninstallerStateBusy           
       
    48             };        
       
    49       
       
    50         /**
       
    51          * Two-phased constructor.
       
    52          */    
       
    53         static CSisPkgUninstaller* NewL( 
       
    54                 CProgramStatus& aMainStatus, 
       
    55                 CVersionRevisor& aRevisor );
       
    56         
       
    57         /**
       
    58          * C++ destructor
       
    59          */
       
    60         ~CSisPkgUninstaller();
       
    61                 
       
    62         /**
       
    63           * This function starts uninstall process for sisx. Leavs if 
       
    64           * there is nothing to uninstall.
       
    65           * 
       
    66           * @since 3.2      
       
    67           */   
       
    68         void StartUninstallL(); 
       
    69         
       
    70         /**
       
    71          * This function adds sis pkg UID to uninstall array. Uninstaller 
       
    72          * sends UIDs to SWI uninstaller.
       
    73          * 
       
    74          * @since 3.2 
       
    75          * @param aUID Package UID to be added to array.
       
    76          */        
       
    77         void AddUidToListL( const TUid& aUID );
       
    78 
       
    79     private: // From CActive
       
    80     
       
    81         /**
       
    82          * Called by Cancel when a request is outstanding.   
       
    83          * 
       
    84          * @since 3.2     
       
    85          */
       
    86         void DoCancel();
       
    87                 
       
    88         /**
       
    89          * Asynchronous uninstall request processing. 
       
    90          * 
       
    91          * @since 3.2        
       
    92          */
       
    93         void RunL();
       
    94     
       
    95         /**
       
    96          * Handles any Leaves from the RunL.  
       
    97          * 
       
    98          * @since 3.2 
       
    99          * @param aError Error code
       
   100          * @return TInt Error code     
       
   101          */
       
   102         TInt RunError( TInt aError );
       
   103 
       
   104     private:
       
   105         /**
       
   106          * C++ constructor
       
   107          */
       
   108         CSisPkgUninstaller();
       
   109     
       
   110         /**
       
   111          * 2nd phase constructor
       
   112          * 
       
   113          * @param aMainStatus SWI Daemon program main status.
       
   114          * @param aReviso Pointer to CVersionRevisor instance.
       
   115          */
       
   116         void ConstructL( CProgramStatus& aMainStatus, CVersionRevisor& aRevisor );
       
   117           
       
   118         /**
       
   119          * Self request completion.
       
   120          * 
       
   121          * @since 3.2         
       
   122          */
       
   123         void CompleteSelf();
       
   124 
       
   125         /**
       
   126          * This is called after all uids are uninstalled.
       
   127          * 
       
   128          * @since 3.2 
       
   129          * @param aResult Result of uninstall process.
       
   130          */
       
   131         void UninstallationCompleted( TInt /*aResult*/ );
       
   132         
       
   133         /**
       
   134          * Stop running and exit. Uninstaller calls this when all
       
   135          * tasks are done. Function calls CVersionRevisor::Exit() for destruction.
       
   136          * 
       
   137          * @since 3.2 
       
   138          */       
       
   139         void ExitUninstaller();
       
   140                                              
       
   141     private:
       
   142                 
       
   143         RFs iFs;
       
   144         // Internal wait timer. Used for waiting of install process etc.        
       
   145         RTimer iTimer;        
       
   146         // Array for sis package uids.
       
   147         RArray<TUid> iPkgUidArray;                
       
   148         RApaLsSession iApaSession; 
       
   149         // Uninstaller AO state.
       
   150         TUninstallerState iState;
       
   151         // Defines SWI Daemon main state (installing, uninstallin, idle).        
       
   152         TInt iGeneralProcessStatus;
       
   153         // Current array index.
       
   154         TInt iUidArrayIndex;
       
   155         // Current sis pkg uid.
       
   156         TUid iUID;
       
   157         // Not own. CProgramStatus instance, which holds Daemon's main status. 
       
   158         CProgramStatus* iProgramStatus;
       
   159         // Class to controll uninstalling process.
       
   160         CSilentUninstaller* iSilentUninstaller;
       
   161         // Not own. CVersionRevisor instance, which starts uninstall.
       
   162         CVersionRevisor* iRevisor;
       
   163         // Uninstaller dialog.        
       
   164         CDialogWrapper* iDialogs;
       
   165         // Descriptor for mime type.
       
   166         HBufC8* iMime;                 
       
   167     };      
       
   168 
       
   169 } //namespace Swi
       
   170 
       
   171 #endif /*UNINSTALLER_H*/
       
   172 
       
   173 //EOF
       
   174