iaupdate/IAD/engine/inc/iaupdatenode.h
changeset 0 ba25891c3a9e
child 11 3ba40be8e484
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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 MIAUpdateNode class 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef IA_UPDATE_NODE_H
       
    21 #define IA_UPDATE_NODE_H
       
    22 
       
    23 
       
    24 #include <e32cmn.h>
       
    25 #include "iaupdateanynode.h"
       
    26 
       
    27 
       
    28 class MIAUpdateNodeObserver;
       
    29 
       
    30 
       
    31 /**
       
    32  * MIAUpdateNode
       
    33  * Interface for normal nodes.
       
    34  *
       
    35  * @note Implementations of MIAUpdateNode interface will always
       
    36  * return MIAUpdateAnyNode::ENodeTypeNormal for MIAUpdateAnyNode::NodeType 
       
    37  * function call.
       
    38  *
       
    39  * @see MIAUpateAnyNode
       
    40  */
       
    41 class MIAUpdateNode : public MIAUpdateAnyNode
       
    42     {    
       
    43     
       
    44 public:
       
    45 
       
    46     /**
       
    47      * Enumerates the possible types of nodes
       
    48      **/
       
    49     enum TPackageType
       
    50         {
       
    51         
       
    52         /** 
       
    53          * The node content is independent SA package.
       
    54          */
       
    55         EPackageTypeSA,
       
    56 
       
    57         /** 
       
    58          * The node content is an upgrade SP package.
       
    59          */
       
    60         EPackageTypeSP,
       
    61                 
       
    62         /** 
       
    63          * The node content is a patch update PU package.
       
    64          */
       
    65         EPackageTypePU,
       
    66         
       
    67         /** 
       
    68          * The node is a service pack.
       
    69          * So, its content is given as separate packages
       
    70          * that are included in this service pack.
       
    71          */
       
    72         EPackageTypeServicePack
       
    73 
       
    74         };
       
    75 
       
    76 
       
    77     /**
       
    78      * @return TPackageType The type of this node content.
       
    79      **/
       
    80     virtual TPackageType Type() const = 0;
       
    81             
       
    82     /**
       
    83      * This function informs if the content of the node requires self updating.
       
    84      * @return ETrue if the content is self updating. Else EFalse.
       
    85      */
       
    86     virtual TBool IsSelfUpdate() const = 0;
       
    87 
       
    88     /**
       
    89      * @note If hidden files are not included, the hierarchy behind them
       
    90      * is still checked and visible nodes behind hidden nodes are also
       
    91      * always included.
       
    92      *
       
    93      * @param aDependencies Pointer array supplied by the caller. 
       
    94      * Dependency nodes are appended to it.
       
    95      * @param aIncludeHidden ETrue means that hidden nodes are included. 
       
    96      * EFalse means that hidden nodes are not included. Hidden nodes are
       
    97      * not usually meant for UI side. But, in case of checking that
       
    98      * all dependencies are handled correctly, all the nodes may be
       
    99      * required.
       
   100      **/
       
   101     virtual void GetDependenciesL( 
       
   102         RPointerArray< MIAUpdateNode >& aDependencies,
       
   103         TBool aIncludeHidden ) const = 0;
       
   104 
       
   105     /**
       
   106      * @note If hidden files are not included, the hierarchy behind them
       
   107      * is still checked and visible nodes behind hidden nodes are also
       
   108      * always included.
       
   109      *
       
   110      * @param aDependants Pointer array supplied by the caller. 
       
   111      * Dependant nodes are appended to it
       
   112      * @param aIncludeHidden ETrue means that hidden nodes are included. 
       
   113      * EFalse means that hidden nodes are not included. Hidden nodes are
       
   114      * not usually meant for UI side. But, in case of checking that
       
   115      * all dependencies are handled correctly, all the nodes may be
       
   116      * required.
       
   117      **/
       
   118     virtual void GetDependantsL( 
       
   119         RPointerArray< MIAUpdateNode >& aDependants,
       
   120         TBool aIncludeHidden ) const = 0;
       
   121     
       
   122     /**
       
   123      * @return TBool ETrue if the node is downlaoded. Else EFalse.
       
   124      **/
       
   125     virtual TBool IsDownloaded() const = 0;  
       
   126     
       
   127     /**
       
   128      * @return TBool ETrue if the node is installed. Else EFalse.
       
   129      **/
       
   130     virtual TBool IsInstalled() const = 0;
       
   131 
       
   132     /**
       
   133      * Issue an operation for the node. Only one operation can be in progress at a time; 
       
   134      * user has to always wait until previous operation has completed.
       
   135      * 
       
   136      * @param aObserver Observer of the operation
       
   137      **/
       
   138     virtual void DownloadL( MIAUpdateNodeObserver& aObserver ) = 0;
       
   139 
       
   140     /**
       
   141      * Issue an operation for the node. Only one operation can be in progress at a time; 
       
   142      * user has to always wait until previous operation has completed.
       
   143      * 
       
   144      * @param aObserver Observer of the operation
       
   145      **/
       
   146     virtual void InstallL( MIAUpdateNodeObserver& aObserver ) = 0; 
       
   147 
       
   148     /**
       
   149      * Cancel an ongoing operation
       
   150      **/    
       
   151     virtual void CancelOperation() = 0;
       
   152 
       
   153     /**
       
   154      * Dependency hierarchy information may be usefull when dependency or dependant
       
   155      * items are sorted for the operation flow. The dependant node always has smaller
       
   156      * depth than its dependency node.
       
   157      *
       
   158      * @note This depth is counted from the longest dependency chain to the node.
       
   159      * Node may belong to multiple dependency branches. In some of the branches, 
       
   160      * the depth could be less than the greatest value that is given here.
       
   161      *
       
   162      * @return TInt This describes how deep in the dependency hierarchy
       
   163      * this node is. Zero means that node is a root.
       
   164      */
       
   165     virtual TInt Depth() const = 0;
       
   166 
       
   167 
       
   168 protected:
       
   169 
       
   170     virtual ~MIAUpdateNode() { }
       
   171         
       
   172     };
       
   173 
       
   174 #endif  //  IA_UPDATE_NODE_H