appinstaller/AppinstUi/Server/Inc/SWInstInstallRequest.h
changeset 80 9dcba1ee99f7
parent 77 d1838696558c
equal deleted inserted replaced
77:d1838696558c 80:9dcba1ee99f7
     1 /*
       
     2 * Copyright (c) 2002-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:   This file contains the header file of the CSWInstInstallRequest 
       
    15 *                class 
       
    16 *
       
    17 *                This class implements functionality for install request.
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 #ifndef SWINSTINSTALLREQUEST_H
       
    23 #define SWINSTINSTALLREQUEST_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include <e32base.h>
       
    27 #include <SWInstDefs.h>
       
    28 
       
    29 #include "SWInstRequestObject.h"
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 namespace ContentAccess { class CContent; }
       
    33 
       
    34 namespace SwiUI
       
    35 {
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 
       
    39 class CSWInstUIPluginAPI;
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44 * This class implements functionality for install request.
       
    45 *
       
    46 * @since 3.0
       
    47 */
       
    48 class CSWInstInstallRequest : public CSWInstRequestObject
       
    49     {
       
    50     public:  // Constructors and destructor
       
    51      
       
    52         /**
       
    53         * Two-phased constructor.
       
    54         * @param aMessage - Message object having this request.
       
    55         */
       
    56         static CSWInstInstallRequest* NewL( const RMessage2& aMessage );
       
    57 
       
    58         /**
       
    59         * Two-phased constructor.
       
    60         * @param aMessage - Message object having this request.
       
    61         */
       
    62         static CSWInstInstallRequest* NewL( TInt aObjectId );
       
    63     
       
    64         /**
       
    65         * Destructor.
       
    66         */
       
    67         virtual ~CSWInstInstallRequest();
       
    68 
       
    69     public: // New functions
       
    70 
       
    71         /**
       
    72         * Perform installation
       
    73         * @since 3.0
       
    74         * @param aFile - Handle to the installation package.
       
    75         * @param aParams - install parameters.
       
    76         */
       
    77         void Install( RFile& aFile, const TInstallReq& aParams );
       
    78 
       
    79         /**
       
    80         * Perform installation
       
    81         * @since 3.0
       
    82         * @param aFileName - Path to the installation package.
       
    83         * @param aParams - install parameters.
       
    84         */
       
    85         void Install( const TDesC& aFileName, const TInstallReq& aParams );
       
    86 
       
    87         /**
       
    88         * Perform silent installation
       
    89         * @since 3.0
       
    90         * @param aFile - Handle to the installation package.
       
    91         * @param aParams - install parameters.
       
    92         * @param aOptions - Options for installation
       
    93         */
       
    94         void SilentInstall( RFile& aFile, 
       
    95                              const TInstallReq& aParams, 
       
    96                              const TInstallOptions& aOptions );  
       
    97 
       
    98         /**
       
    99         * Perform silent installation
       
   100         * @since 3.0
       
   101         * @param aFileName - Path to the installation package.
       
   102         * @param aParams - install parameters.
       
   103         * @param aOptions - Options for installation
       
   104         */
       
   105         void SilentInstall( const TDesC& aFileName, 
       
   106                              const TInstallReq& aParams, 
       
   107                              const TInstallOptions& aOptions );          
       
   108 
       
   109     protected: // Functions from base classes
       
   110 
       
   111         /**
       
   112         * From CSWInstRequestObject, Cancels the current request.
       
   113         * @since 3.0
       
   114         */
       
   115         void CancelRequest();
       
   116 
       
   117         /**
       
   118         * From CSWInstRequestObject, Gets called when the request is completed.
       
   119         * @since 3.0
       
   120         */
       
   121         void RequestCompleteL( TInt aResult );
       
   122         
       
   123     private:  // New functions
       
   124         
       
   125         /**
       
   126         * C++ default constructor.
       
   127         * @param aMessage - Message object having this request.
       
   128         */
       
   129         CSWInstInstallRequest( const RMessage2& aMessage );
       
   130 
       
   131         /**
       
   132         * C++ default constructor.
       
   133         * @param aMessage - Message object having this request.
       
   134         */
       
   135         CSWInstInstallRequest( TInt aObjectId );
       
   136 
       
   137         /**
       
   138         * 2nd phase constructor.
       
   139         */
       
   140         void ConstructL();
       
   141 
       
   142         /**
       
   143         * Handles the error when installation of the given package is not supported.
       
   144         * @since 3.0
       
   145         * @param aFileName - File name of the package.
       
   146         */
       
   147         void HandleNotSupportedL( const TDesC& aFileName ) const;
       
   148 
       
   149         /**
       
   150         * Performs the actual installation.
       
   151         * @since 3.0
       
   152         * @param aFile - Handle to the package.
       
   153         */
       
   154         void DoInstallL( RFile& aFile);   
       
   155 
       
   156         /**
       
   157         * Gets MIME type of the package.
       
   158         * @since 3.0
       
   159         * @param aContent - Package content.
       
   160         * @param aMIME - On return contains the MIME type of the package.
       
   161         */
       
   162         void GetMIMETypeL( const ContentAccess::CContent& aContent, TDes8& aMIME ); 
       
   163         
       
   164         /**
       
   165         * Helper to handle protected content.
       
   166         * @since 3.0
       
   167         * @param aFile - Handle to the package.
       
   168         * @param 
       
   169         * @return ETrue if rights exist and package can be installed.
       
   170         *         EFalse if the installation needs to be terminated.
       
   171         */
       
   172         TBool HandleProtectedContentL( RFile& aFile );
       
   173         
       
   174     private: // Data
       
   175         
       
   176         TInstallReq iParams;        
       
   177         TInstallOptions iOptions;
       
   178 
       
   179         RFile iFile;
       
   180         RFs iFs;        
       
   181     };
       
   182 }
       
   183 
       
   184 #endif      // SWINSTINSTALLREQUEST_H   
       
   185             
       
   186 // End of File