ncdengine/inc/ncdnodeinstall.h
changeset 0 ba25891c3a9e
child 25 7333d7932ef7
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006 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:   Contains MNcdNodeInstall interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_NCD_NODE_INSTALL_H
       
    20 #define M_NCD_NODE_INSTALL_H
       
    21 
       
    22 #include <f32file.h>
       
    23 #include <e32cmn.h>
       
    24 
       
    25 #include "catalogsbase.h"
       
    26 #include "catalogsarray.h"
       
    27 #include "ncdinterfaceids.h"
       
    28 
       
    29 
       
    30 class MNcdInstallOperation;
       
    31 class MNcdInstallOperationObserver;
       
    32 class MDesCArray;
       
    33 class MNcdInstalledContent;
       
    34 
       
    35 // Forward declaration for SwiUI::TInstallOptions
       
    36 // SwiUI namespace contains install options 
       
    37 // that are used for the silent install.
       
    38 // #include <SWInstDefs.h> 
       
    39 // is required when SwiUI::TInstallOptions is created 
       
    40 // in the implementation code.
       
    41 namespace SwiUI
       
    42     {
       
    43     class TInstallOptions;    
       
    44     }
       
    45 
       
    46 
       
    47 /**
       
    48  *  Provides functions that can be used to install the node object.
       
    49  *  Before installing, the data should have been downloaded using
       
    50  *  download interface.
       
    51  *
       
    52  *  @see MNcdNodeDownload
       
    53  *  @see MNcdNodeUriContent
       
    54  *
       
    55  *  
       
    56  */
       
    57 class MNcdNodeInstall : public virtual MCatalogsBase
       
    58     {
       
    59 public:
       
    60 
       
    61     /**
       
    62      * Unique identifier for the interface, required for all MCatalogsBase interfaces.
       
    63      *
       
    64      * 
       
    65      */
       
    66     enum { KInterfaceUid = ENcdNodeInstallUid };
       
    67 
       
    68 
       
    69     /**
       
    70      * Starts the installing operation of the node object.
       
    71      * 
       
    72      * @note The reference count of the operation object is increased by one. So, Release()
       
    73      * function of the operation should be called when operation is not needed anymore.
       
    74      * 
       
    75      * 
       
    76      * @param aObserver Observer for the operation.
       
    77      * @return The operation that handles the installation. 
       
    78      * This operation can be used to check the progressing of the installation. Counted,
       
    79      * Release() must be called after use.
       
    80      * @exception Leave System wide error code.
       
    81      *  Leaves with KNcdErrorParallelOperationNotAllowed if a parallel client is running
       
    82      *  an operation for the same metadata. See MNcdOperation for full explanation.
       
    83      */
       
    84     virtual MNcdInstallOperation* InstallL( MNcdInstallOperationObserver& aObserver ) = 0;
       
    85 
       
    86 
       
    87     /**
       
    88      * Starts the silent installing operation of the node object.
       
    89      * Because installation is silent, normal installation query dialogs are not shown.
       
    90      * But, the caller of this function may use aInstallOptions parameter to define that 
       
    91      * text files that are included in SIS packages will be shown in query dialogs during installation.
       
    92      * This may be required, for example, to show disclaimers that are included in the SIS packages
       
    93      * as text files.
       
    94      * 
       
    95      * @note The reference count of the operation object is increased by one. So, Release()
       
    96      * function of the operation should be called when operation is not needed anymore.
       
    97      * 
       
    98      * @note Requires TrustedUI capabilities
       
    99      * @note Only SIS packages and Java archives are installed silently, other content
       
   100      * is installed exactly like with InstallL
       
   101      * 
       
   102      * @param aObserver Observer for the operation.
       
   103      * @param aInstallOptions These install options are used by the silent install.
       
   104      * @return The operation that handles the installation. 
       
   105      * This operation can be used to check the progressing of the installation. Counted,
       
   106      * Release() must be called after use.
       
   107      * @exception Leave System wide error code.
       
   108      * Leaves with KErrPermissionDenied if UI does not have TrustedUI capability.
       
   109      * Leaves with KNcdErrorParallelOperationNotAllowed if a parallel client is running
       
   110      *  an operation for the same metadata. See MNcdOperation for full explanation.
       
   111      */
       
   112     virtual MNcdInstallOperation* SilentInstallL( MNcdInstallOperationObserver& aObserver,
       
   113                                                   const SwiUI::TInstallOptions& aInstallOptions ) = 0;
       
   114 
       
   115 
       
   116     /**
       
   117      * Checks if the item content has already been installed and is currently present in the
       
   118      * device.
       
   119      *
       
   120      * @note This returns EFalse if some of the content is missing, eg. if one of several
       
   121      * image files has been deleted.
       
   122      *
       
   123      * 
       
   124      * @return ETrue if the item content has been installed, EFalse otherwise.
       
   125      * @exception Leave System wide error code.     
       
   126      */
       
   127     virtual TBool IsInstalledL() const = 0;
       
   128 
       
   129     
       
   130     /**
       
   131      * Checks if the item is allowed to be launched. 
       
   132      *
       
   133      * @note This returns ETrue if at least one of installed themes/applications/files 
       
   134      * is launchable
       
   135      *
       
   136      * 
       
   137      * @return ETrue if the item can be launched.
       
   138      * @note This method does not check if the item has been installed or if it's
       
   139      * currently present.
       
   140      */
       
   141     virtual TBool IsLaunchable() const = 0;
       
   142     
       
   143     
       
   144     
       
   145     /**
       
   146      * Returns an array of content installed from the item
       
   147      * 
       
   148      * @return Array of installed content
       
   149      * @exception Leave System wide error code.     
       
   150      */
       
   151     virtual RCatalogsArray<MNcdInstalledContent> InstalledContentL() = 0;
       
   152 
       
   153 
       
   154     /**
       
   155      * This function may be used to update install information of the node if the 
       
   156      * node content has been externally installed.
       
   157      * 
       
   158      * @note The use of this function should be avoided in normal install cases.
       
   159      * In normal install cases, all the necessary actions are done automatically. 
       
   160      * This function should only be used if node content is installed externally 
       
   161      * and the content can not be installed by using other functions provided in 
       
   162      * this interface. This function is meant only for the application content.
       
   163      * The content has to be downloaded by using MNcdNodeDownload interface before
       
   164      * using this function.
       
   165      *
       
   166      * @note When this function is called with KErrNone parameter, the node content 
       
   167      * is assumed to be succesfully installed. Therefore, possible content installation 
       
   168      * files will be deleted as in normal succesfull install cases. The purchase history 
       
   169      * details and installation report information are updated to correspond the given 
       
   170      * error code information.
       
   171      *
       
   172      * @param aErrorCode The error code describes the success of the install.
       
   173      * If KErrNone is given, then the installation is assumed to be a success. 
       
   174      * If some other error code is given, then the installation is assumed to fail in some way.
       
   175      * The details related to the installations are updated according to the error code.
       
   176      * @exception Leave System wide error code.     
       
   177      */
       
   178     virtual void SetApplicationInstalledL( TInt aErrorCode ) = 0;
       
   179 
       
   180 
       
   181 protected:
       
   182 
       
   183     /**
       
   184      * Destructor.
       
   185      * 
       
   186      * @see MCatalogsBase::~MCatalogsBase()
       
   187      */
       
   188     virtual ~MNcdNodeInstall() {}
       
   189 
       
   190     };
       
   191 
       
   192 
       
   193 #endif // M_NCD_NODE_INSTALL_H