appinstaller/AppinstUi/sisxsifplugin/inc/sisxsifpluginactiveimpl.h
branchRCL_3
changeset 25 7333d7932ef7
equal deleted inserted replaced
24:5cc91383ab1e 25:7333d7932ef7
       
     1 /*
       
     2 * Copyright (c) 2010 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:  CSisxSifPluginActiveImpl implements active object that
       
    15 *               handles installation operations requested via
       
    16 *               CSisxSifPlugin interface.
       
    17 *
       
    18 */
       
    19 
       
    20 #ifndef C_SISXSIFPLUGINIMPL_H
       
    21 #define C_SISXSIFPLUGINIMPL_H
       
    22 
       
    23 #include <e32base.h>                    // CActive
       
    24 #include <swi/msisuihandlers.h>         // MUiHandler
       
    25 #include <usif/sif/sifcommon.h>         // TSecurityContext, COpaqueNamedParams
       
    26 #include <usif/usiferror.h>             // TErrorCategory
       
    27 #include <f32file.h>                    // RFs, RFile
       
    28 #include <barsc.h>                      // RResourceFile
       
    29 
       
    30 namespace Swi
       
    31 {
       
    32     class CAsyncLauncher;
       
    33     class CInstallPrefs;
       
    34 }
       
    35 
       
    36 namespace Usif
       
    37 {
       
    38     class CComponentEntry;
       
    39     class CSisxSifPluginUiHandlerBase;
       
    40     class CSisxSifPluginInstallParams;
       
    41     class CSisxSifPluginErrorHandler;
       
    42     
       
    43     /**
       
    44      *  SISX SIF plugin active implementation
       
    45      *  Universal Software Install Framework (USIF) plugin for native SISX
       
    46      *  installation. CSisxSifPluginActiveImpl is active object that takes
       
    47      *  care of SISX installation operations.
       
    48      */
       
    49     class CSisxSifPluginActiveImpl : public CActive
       
    50         {
       
    51     public:     // constructors and destructor
       
    52         static CSisxSifPluginActiveImpl* NewL();
       
    53         ~CSisxSifPluginActiveImpl();
       
    54 
       
    55     public:     // from CActive
       
    56         void DoCancel();
       
    57         void RunL();
       
    58         TInt RunError( TInt aError );
       
    59 
       
    60     public:     // new functions
       
    61         void GetComponentInfo( const TDesC& aFileName, const TSecurityContext& aSecurityContext,
       
    62                 CComponentInfo& aComponentInfo, TRequestStatus& aStatus );
       
    63         void GetComponentInfo( RFile& aFileHandle, const TSecurityContext& aSecurityContext,
       
    64                 CComponentInfo& aComponentInfo, TRequestStatus& aStatus );
       
    65         void Install( const TDesC& aFileName, const TSecurityContext& aSecurityContext,
       
    66                 const COpaqueNamedParams& aArguments, COpaqueNamedParams& aResults,
       
    67                 TRequestStatus& aStatus );
       
    68         void Install( RFile& aFileHandle, const TSecurityContext& aSecurityContext,
       
    69                 const COpaqueNamedParams& aArguments, COpaqueNamedParams& aResults,
       
    70                 TRequestStatus& aStatus );
       
    71         void Uninstall( TComponentId aComponentId, const TSecurityContext& aSecurityContext,
       
    72                 const COpaqueNamedParams& aArguments, COpaqueNamedParams& aResults,
       
    73                 TRequestStatus& aStatus );
       
    74         void Activate( TComponentId aComponentId, const TSecurityContext& aSecurityContext,
       
    75                 TRequestStatus& aStatus );
       
    76         void Deactivate( TComponentId aComponentId, const TSecurityContext& aSecurityContext,
       
    77                 TRequestStatus& aStatus );
       
    78 
       
    79     private:    // new functions
       
    80         CSisxSifPluginActiveImpl();
       
    81         void ConstructL();
       
    82         void CommonRequestPreambleL( TRequestStatus& aStatus );
       
    83         void CommonRequestPreambleL( const COpaqueNamedParams& aInputParams,
       
    84                 COpaqueNamedParams& aOutputParams, TRequestStatus& aStatus );
       
    85         void CompleteSelf( TInt aResult );
       
    86         void CreateUiHandlerL();
       
    87         TBool IsSilentMode();
       
    88         void CompleteClientRequest( TInt aResult );
       
    89         void DoGetComponentInfoL( CComponentInfo& aComponentInfo, TRequestStatus& aStatus );
       
    90         void DoInstallL( const TSecurityContext& aSecurityContext,
       
    91         		const COpaqueNamedParams& aInputParams, COpaqueNamedParams& aOutputParams,
       
    92         		TRequestStatus& aStatus );
       
    93         void DoUninstallL( TComponentId aComponentId, const COpaqueNamedParams& aInputParams,
       
    94             COpaqueNamedParams& aOutputParams, TRequestStatus& aStatus );
       
    95         void DoActivateL( TComponentId aComponentId, TRequestStatus& aStatus );
       
    96         void DoDeactivateL( TComponentId aComponentId, TRequestStatus& aStatus );
       
    97         void DoHandleErrorL( TInt aError );
       
    98         void SetFileL( const TDesC& aFileName );
       
    99         void SetFile( RFile& aFileHandle );
       
   100         TComponentId GetLastInstalledComponentIdL();
       
   101         void GetComponentAndUidL( TComponentId aComponentId, CComponentEntry& aEntry, TUid& aUid ) const;
       
   102         TBool RequiresUserCapabilityL( const CComponentInfo::CNode& aRootNode );
       
   103         void SetInstallPrefsRevocationServerUriL( const TDesC& aUri );
       
   104         void UpdateInstallPrefsForPerformingOcspL();
       
   105         void StartInstallingL();
       
   106         void StartSilentInstallingL();
       
   107         void StartSilentUninstallingL();
       
   108         void FinalizeInstallationL();
       
   109         void UpdateStartupListL();
       
   110         void FillDeviceSupportedLanguagesL();
       
   111 
       
   112     private:    // data
       
   113         RFs iFs;
       
   114         Swi::CAsyncLauncher* iAsyncLauncher;
       
   115         CSisxSifPluginUiHandlerBase* iUiHandler;
       
   116         Swi::CInstallPrefs* iInstallPrefs;
       
   117         TRequestStatus* iClientStatus;
       
   118         const COpaqueNamedParams* iInputParams;     // not owned
       
   119         COpaqueNamedParams* iOutputParams;      // not owned
       
   120         CSisxSifPluginInstallParams* iInstallParams;
       
   121         CSisxSifPluginErrorHandler* iErrorHandler;
       
   122         CComponentInfo* iComponentInfo;
       
   123         TBool iHasAllFilesCapability;
       
   124         HBufC* iFileName;
       
   125         RFile* iFileHandle;             // not owned
       
   126         enum TOperationType
       
   127             {
       
   128             ENoOperation,
       
   129             EGetComponentInfo,
       
   130             EInstall,
       
   131             EUninstall,
       
   132             EActivate,
       
   133             EDeactivate
       
   134             } iOperation;
       
   135         enum TPhase
       
   136             {
       
   137             ENotActive,
       
   138             EPreprocessing,
       
   139             ERunningOperation,
       
   140             EPostprocessing
       
   141             } iPhase;
       
   142         RArray<TInt> iDeviceSupportedLanguages;
       
   143         };
       
   144 
       
   145 }   // namespace Usif
       
   146 
       
   147 #endif      // C_SISXSIFPLUGINIMPL_H
       
   148