iaupdate/IAD/engine/controller/inc/iaupdateselfupdaterctrl.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2009 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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef IA_UPDATE_SELF_UPDATER_CTRL_H
       
    21 #define IA_UPDATE_SELF_UPDATER_CTRL_H
       
    22 
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 #include "iaupdaterendezvousobserver.h"
       
    27 
       
    28 class MIAUpdateSelfUpdaterObserver;
       
    29 class CIAUpdaterFileListFile;
       
    30 class CIAUpdaterFileList;
       
    31 class CIAUpdateRestartInfo;
       
    32 class CIAUpdateRendezvous;
       
    33 class MIAUpdateNode;
       
    34 
       
    35 
       
    36 /**
       
    37  * @note If install files are moved and deleted from the private-folders,
       
    38  * then these actions require AllFiles capablility.
       
    39  *
       
    40  * @since S60 v3.2
       
    41  */
       
    42 class CIAUpdateSelfUpdaterCtrl : public CBase,
       
    43                                  public MIAUpdateRendezvousObserver
       
    44     {
       
    45 
       
    46 public:
       
    47 
       
    48     /**
       
    49      *
       
    50      * @since S60 v3.2
       
    51      */
       
    52     static CIAUpdateSelfUpdaterCtrl* NewL( MIAUpdateSelfUpdaterObserver& aObserver );
       
    53 
       
    54     /**
       
    55      *
       
    56      * @since S60 v3.2
       
    57      */
       
    58     static CIAUpdateSelfUpdaterCtrl* NewLC( MIAUpdateSelfUpdaterObserver& aObserver );
       
    59 
       
    60 
       
    61     /**
       
    62      *
       
    63      * @since S60 v3.2
       
    64      */
       
    65     virtual ~CIAUpdateSelfUpdaterCtrl();
       
    66     
       
    67 
       
    68     /**
       
    69      * @see CIAUpdateController::SelfUpdateDataExists
       
    70      * 
       
    71      * @since S60 v3.2
       
    72      */
       
    73     TBool DataExists() const;
       
    74 
       
    75 
       
    76     /**
       
    77      * @see CIAUpdateController::StartL
       
    78      * 
       
    79      * @since S60 v3.2
       
    80      */
       
    81     TBool StartL( TInt aIndex, 
       
    82                   TInt aTotalCount, 
       
    83                   const RPointerArray< MIAUpdateNode >& aPendingNodes,
       
    84                   TBool aSilent );
       
    85 
       
    86 
       
    87     /**
       
    88      * Resets the information in the file list file.
       
    89      * 
       
    90      * @since S60 v3.2
       
    91      */
       
    92     void Reset();
       
    93 
       
    94 
       
    95     /**
       
    96      * @param aFileList Ownership is transferred.
       
    97      * @exception Leaves with system wide error code.
       
    98      * 
       
    99      * @since S60 v3.2
       
   100      */
       
   101     void AddFileListL( CIAUpdaterFileList* aFileList );
       
   102 
       
   103 
       
   104     /**
       
   105      * @see CIAUpdateController::SelfUpdateRestartInfo
       
   106      * 
       
   107      * @since S60 v3.2
       
   108      */
       
   109     CIAUpdateRestartInfo* SelfUpdateRestartInfo();
       
   110 
       
   111 
       
   112 public: // MIAUpdateRendezvousObserver
       
   113 
       
   114     /**
       
   115      * @see MIAUpdateRendezvousObserver::RendezvousComplete
       
   116      */
       
   117     virtual void RendezvousComplete( TInt aErrorCode );
       
   118 
       
   119 
       
   120 private:
       
   121 
       
   122     // Prevent these if not implemented
       
   123     CIAUpdateSelfUpdaterCtrl( const CIAUpdateSelfUpdaterCtrl& aObject );
       
   124     CIAUpdateSelfUpdaterCtrl operator =( const CIAUpdateSelfUpdaterCtrl& aObject );
       
   125 
       
   126 
       
   127     /**
       
   128      * @see CIAUpdateSelfUpdaterCtrl::NewL
       
   129      *
       
   130      * @since S60 v3.2
       
   131      */
       
   132     CIAUpdateSelfUpdaterCtrl( MIAUpdateSelfUpdaterObserver& aObserver );
       
   133 
       
   134     /**
       
   135      *
       
   136      * @since S60 v3.2
       
   137      */
       
   138     void ConstructL();
       
   139 
       
   140 
       
   141     /**
       
   142      *
       
   143      * @since S60 v3.2
       
   144      */    
       
   145     MIAUpdateSelfUpdaterObserver& Observer();
       
   146 
       
   147 
       
   148     /**
       
   149      *
       
   150      * @since S60 v3.2
       
   151      */    
       
   152     CIAUpdaterFileListFile& File();
       
   153 
       
   154 
       
   155     /**
       
   156      *
       
   157      * @since S60 v3.2
       
   158      */    
       
   159     CIAUpdateRendezvous& RendezvousListener();
       
   160 
       
   161 
       
   162     /**
       
   163      *
       
   164      * @since S60 v3.2
       
   165      */    
       
   166     void StartUpdaterProcessL();
       
   167 
       
   168 
       
   169 private: // data    
       
   170 
       
   171     // This observer will be informed when operations progress.
       
   172     MIAUpdateSelfUpdaterObserver& iObserver;
       
   173     
       
   174     // Files that will be installed.
       
   175     CIAUpdaterFileListFile* iFile;
       
   176 
       
   177     // This will listen the rendezvous of the self updater.
       
   178     CIAUpdateRendezvous* iRendezvous;
       
   179     
       
   180     };
       
   181 
       
   182 #endif // IA_UPDATE_SELF_UPDATER_CTRL_H