iaupdate/IAD/ui/inc/iaupdateengine.h
changeset 42 d17dc5398051
parent 33 8110bf1194d1
child 44 329d304c1aa1
child 52 92f864ef0288
--- a/iaupdate/IAD/ui/inc/iaupdateengine.h	Thu May 27 12:58:35 2010 +0300
+++ b/iaupdate/IAD/ui/inc/iaupdateengine.h	Fri Jun 11 13:45:18 2010 +0300
@@ -30,11 +30,14 @@
 class CIAUpdateFWUpdateHandler;
 class CIAUpdateParameters;
 class CIAUpdateGlobalLockHandler;
+class CIAUpdateAutomaticCheck;
 class MIAUpdateNode;
 class MIAUpdateFwNode;
 class CEikonEnv;
 class RCmManagerExt;
 class CIdle;
+class HbAction;
+class IAUpdateResultsDialog;
 
 class IAUpdateEngine : public QObject,
                        public MIAUpdateUiControllerObserver
@@ -45,7 +48,7 @@
     IAUpdateEngine(QObject *parent = 0);
     ~IAUpdateEngine();
     
-    void StartedByLauncherL( TBool aRefreshFromNetworkDenied );
+    void StartedByLauncherL( bool aRefreshFromNetworkDenied );
      
      /**
       * When the update check operation is started through
@@ -57,7 +60,7 @@
       */
      void CheckUpdatesRequestL( int wgid, 
                                 CIAUpdateParameters* aFilterParams, 
-                                TBool aForcedRefresh );
+                                bool aForcedRefresh );
 
      /**
       * When the show update operation is started through
@@ -78,31 +81,30 @@
       * completed.
       * @param aUid  Uid of the caller of the request
       */
-     void ShowUpdateQueryRequestL( int wgid, TUint aUid );
+     void ShowUpdateQueryRequestL( int wgid, uint aUid );
      
      
-     void StartUpdate( TBool aFirmwareUpdate );
+     void StartUpdate( bool aFirmwareUpdate );
      /**
       * Set this application visible/unvisible
       * @param aVisible If EFalse application is put background and is hidden in FSW 
       */
-      void SetVisibleL( TBool aVisible );
+      void SetVisibleL( bool aVisible );
       
       /**
       * Set window group id of client application 
       *
       * @param aWgId Window group id
       */
-      void SetClientWgId( TInt aWgId );
+      void SetClientWgId( int aWgId );
           
       /**
       * Is client application in background
       *
       * @param True value if client application is in background
       */
-      TInt ClientInBackgroundL() const;
+      bool ClientInBackgroundL() const;
     
-      //void refresh(int error);
 signals:
     void toMainView();
     
@@ -114,10 +116,11 @@
                  const RPointerArray<MIAUpdateFwNode>& fwNodes,
                  int error);
     
-    void toHistoryView();
 
 public slots:    
     void handleAllClientsClosed();    
+
+    void dialogFinished(HbAction* action);
   
 
 private: // From MIAUpdateUiControllerObserver   
@@ -168,19 +171,16 @@
     * Show results dialog of update
     */ 
     void ShowResultsDialogL();
-        
-    /**
-    * Starts CIdle. Results dialog is shown in callback function. 
-    */ 
-    void ShowResultsDialogDeferredL();
     
     
+    void ShowRebootDialogL();
+           
     /**
     * Informs an observer that its async request is completed 
     *
     * @param aError  Error code 
     */ 
-    void InformRequestObserver( TInt aError );
+    void InformRequestObserver( int aError );
     
     /**
      * Sets the default connection method used for network access.
@@ -194,21 +194,21 @@
      * @note Leaves with KErrNotFound if connection method was not
      * set in the repocitory.
      */
-    void SetDefaultConnectionMethodL( TBool aTotalSilent );   
+    void SetDefaultConnectionMethodL( bool aTotalSilent );   
     
      /**
      * Choose a usable IAP from all SNAPs
      *
      * @param aCmManagerExt handle of connection manager
      */  
-    TUint32 GetBestIAPInAllSNAPsL( RCmManagerExt& aCmManagerExt  );
+    uint GetBestIAPInAllSNAPsL( RCmManagerExt& aCmManagerExt  );
         
      /**
      * Choose a usable IAP from Internet SNAP
      *
      * @param aCmManagerExt handle of connection manager
      */
-    TUint32 GetBestIAPInInternetSNAPL( RCmManagerExt& aCmManagerExt  );
+    uint GetBestIAPInInternetSNAPL( RCmManagerExt& aCmManagerExt  );
 
      /**
      * Choose the best IAP under the given SNAP
@@ -216,25 +216,15 @@
      * @param aCmManagerExt handle of connection manager
      * @param aSNAP SNAP ID
      */  
-     TUint32 GetBestIAPInThisSNAPL( RCmManagerExt& aCmManagerExt, TUint32 aSNAP = 0);
+     uint GetBestIAPInThisSNAPL( RCmManagerExt& aCmManagerExt, uint aSNAP = 0);
      
      /**
      * Shows update query dialog (now/later) 
      */ 
      void ShowUpdateQueryL();
 
-     void HideApplicationInFSWL( TBool aHide ) const;
-     
-     /**
-     * CIdle callback function, that shows status dialog
-     * To be used to guarantee that possible old status dialog is totally 
-     * removed by AVKON before showing new one  
-     *
-     * @param aPtr  Pointer to this instance
-     */ 
-     static TInt ShowResultsDialogCallbackL( TAny* aPtr );
-     
-     
+     void HideApplicationInFSWL( bool aHide ) const;
+               
      /**
      * CIdle callback function, that shows update query dialog
      * To be used because a client to be informed immediately that its 
@@ -250,31 +240,44 @@
      * @param aPtr  Pointer to this instance
      */
      static TInt AutomaticCheckCallbackL( TAny* aPtr );
-         
+     
+     void DoPossibleApplicationClose();
+ 
+   
+
+private:
      
+    enum DialogState
+        {
+        NoDialog,
+        Results,
+        RebootQuery,
+        ShowUpdateQuery
+        };
+     
+    IAUpdateServiceProvider *mServiceProvider;
+    IAUpdateResultsDialog* mResultsDialog;
     
-public: //temp
-//private:
-    IAUpdateServiceProvider *mServiceProvider;
-    
-private:
     CIAUpdateUiController* iController;
     CIAUpdateFWUpdateHandler* iFwUpdateHandler;
     CIAUpdateGlobalLockHandler* iGlobalLockHandler;
+    CIAUpdateAutomaticCheck* iAutomaticCheck;
     CEikonEnv* iEikEnv; //not owned
     CIdle* iIdle;
     CIdle* iIdleAutCheck;
     
-    IAUpdateUiDefines::TIAUpdateUiRequestType iRequestType;
-    TBool iUpdateNow;
+    
+    IAUpdateUiDefines::TIAUpdateUiRequestType mRequestType;
+    bool mUpdateNow;
     RArray<TUint32> iDestIdArray;
-    TBool iRequestIssued;
-    TBool iStartedFromApplication;
-    TBool iUiRefreshAllowed;
-    TUint iUpdatequeryUid;
-    TInt iWgId;
-  
-    
+    bool mRequestIssued;
+    bool mStartedFromApplication;
+    bool mUiRefreshAllowed;
+    uint mUpdatequeryUid;
+    int mWgId;
+    DialogState mDialogState;
+    HbAction *mPrimaryAction;
+    HbAction *mSecondaryAction;
     };
 
 #endif /* IAUPDATEENGINE_H_ */