iaupdate/IAD/ui/inc/iaupdateengine.h
changeset 42 d17dc5398051
parent 33 8110bf1194d1
child 44 329d304c1aa1
child 52 92f864ef0288
equal deleted inserted replaced
37:6e7b00453237 42:d17dc5398051
    28 class IAUpdateServiceProvider;
    28 class IAUpdateServiceProvider;
    29 class CIAUpdateUiController;
    29 class CIAUpdateUiController;
    30 class CIAUpdateFWUpdateHandler;
    30 class CIAUpdateFWUpdateHandler;
    31 class CIAUpdateParameters;
    31 class CIAUpdateParameters;
    32 class CIAUpdateGlobalLockHandler;
    32 class CIAUpdateGlobalLockHandler;
       
    33 class CIAUpdateAutomaticCheck;
    33 class MIAUpdateNode;
    34 class MIAUpdateNode;
    34 class MIAUpdateFwNode;
    35 class MIAUpdateFwNode;
    35 class CEikonEnv;
    36 class CEikonEnv;
    36 class RCmManagerExt;
    37 class RCmManagerExt;
    37 class CIdle;
    38 class CIdle;
       
    39 class HbAction;
       
    40 class IAUpdateResultsDialog;
    38 
    41 
    39 class IAUpdateEngine : public QObject,
    42 class IAUpdateEngine : public QObject,
    40                        public MIAUpdateUiControllerObserver
    43                        public MIAUpdateUiControllerObserver
    41     {
    44     {
    42     Q_OBJECT
    45     Q_OBJECT
    43 
    46 
    44 public:
    47 public:
    45     IAUpdateEngine(QObject *parent = 0);
    48     IAUpdateEngine(QObject *parent = 0);
    46     ~IAUpdateEngine();
    49     ~IAUpdateEngine();
    47     
    50     
    48     void StartedByLauncherL( TBool aRefreshFromNetworkDenied );
    51     void StartedByLauncherL( bool aRefreshFromNetworkDenied );
    49      
    52      
    50      /**
    53      /**
    51       * When the update check operation is started through
    54       * When the update check operation is started through
    52       * the API, the session directs the requests for the UI. UI will
    55       * the API, the session directs the requests for the UI. UI will
    53       * handle the operation and inform the observer when the operation is
    56       * handle the operation and inform the observer when the operation is
    55       * @param aFilterParams These parameters are used when update items
    58       * @param aFilterParams These parameters are used when update items
    56       * are filtered for the UI list.
    59       * are filtered for the UI list.
    57       */
    60       */
    58      void CheckUpdatesRequestL( int wgid, 
    61      void CheckUpdatesRequestL( int wgid, 
    59                                 CIAUpdateParameters* aFilterParams, 
    62                                 CIAUpdateParameters* aFilterParams, 
    60                                 TBool aForcedRefresh );
    63                                 bool aForcedRefresh );
    61 
    64 
    62      /**
    65      /**
    63       * When the show update operation is started through
    66       * When the show update operation is started through
    64       * the API, the session directs the requests for the UI. UI will
    67       * the API, the session directs the requests for the UI. UI will
    65       * hanle the operation and inform the observer when the operation is
    68       * hanle the operation and inform the observer when the operation is
    76       * the API, the session directs the requests for the UI. UI will
    79       * the API, the session directs the requests for the UI. UI will
    77       * hanle the operation and inform the observer when the operation is
    80       * hanle the operation and inform the observer when the operation is
    78       * completed.
    81       * completed.
    79       * @param aUid  Uid of the caller of the request
    82       * @param aUid  Uid of the caller of the request
    80       */
    83       */
    81      void ShowUpdateQueryRequestL( int wgid, TUint aUid );
    84      void ShowUpdateQueryRequestL( int wgid, uint aUid );
    82      
    85      
    83      
    86      
    84      void StartUpdate( TBool aFirmwareUpdate );
    87      void StartUpdate( bool aFirmwareUpdate );
    85      /**
    88      /**
    86       * Set this application visible/unvisible
    89       * Set this application visible/unvisible
    87       * @param aVisible If EFalse application is put background and is hidden in FSW 
    90       * @param aVisible If EFalse application is put background and is hidden in FSW 
    88       */
    91       */
    89       void SetVisibleL( TBool aVisible );
    92       void SetVisibleL( bool aVisible );
    90       
    93       
    91       /**
    94       /**
    92       * Set window group id of client application 
    95       * Set window group id of client application 
    93       *
    96       *
    94       * @param aWgId Window group id
    97       * @param aWgId Window group id
    95       */
    98       */
    96       void SetClientWgId( TInt aWgId );
    99       void SetClientWgId( int aWgId );
    97           
   100           
    98       /**
   101       /**
    99       * Is client application in background
   102       * Is client application in background
   100       *
   103       *
   101       * @param True value if client application is in background
   104       * @param True value if client application is in background
   102       */
   105       */
   103       TInt ClientInBackgroundL() const;
   106       bool ClientInBackgroundL() const;
   104     
   107     
   105       //void refresh(int error);
       
   106 signals:
   108 signals:
   107     void toMainView();
   109     void toMainView();
   108     
   110     
   109     /**
   111     /**
   110     * Refreshes main view 
   112     * Refreshes main view 
   112     */              
   114     */              
   113     void refresh(const RPointerArray<MIAUpdateNode>& nodes,
   115     void refresh(const RPointerArray<MIAUpdateNode>& nodes,
   114                  const RPointerArray<MIAUpdateFwNode>& fwNodes,
   116                  const RPointerArray<MIAUpdateFwNode>& fwNodes,
   115                  int error);
   117                  int error);
   116     
   118     
   117     void toHistoryView();
       
   118 
   119 
   119 public slots:    
   120 public slots:    
   120     void handleAllClientsClosed();    
   121     void handleAllClientsClosed();    
       
   122 
       
   123     void dialogFinished(HbAction* action);
   121   
   124   
   122 
   125 
   123 private: // From MIAUpdateUiControllerObserver   
   126 private: // From MIAUpdateUiControllerObserver   
   124     /**
   127     /**
   125     * Called when async engine start-up is completed
   128     * Called when async engine start-up is completed
   166 
   169 
   167     /**
   170     /**
   168     * Show results dialog of update
   171     * Show results dialog of update
   169     */ 
   172     */ 
   170     void ShowResultsDialogL();
   173     void ShowResultsDialogL();
   171         
   174     
   172     /**
   175     
   173     * Starts CIdle. Results dialog is shown in callback function. 
   176     void ShowRebootDialogL();
   174     */ 
   177            
   175     void ShowResultsDialogDeferredL();
       
   176     
       
   177     
       
   178     /**
   178     /**
   179     * Informs an observer that its async request is completed 
   179     * Informs an observer that its async request is completed 
   180     *
   180     *
   181     * @param aError  Error code 
   181     * @param aError  Error code 
   182     */ 
   182     */ 
   183     void InformRequestObserver( TInt aError );
   183     void InformRequestObserver( int aError );
   184     
   184     
   185     /**
   185     /**
   186      * Sets the default connection method used for network access.
   186      * Sets the default connection method used for network access.
   187      * Connection can be set as an accesspoint or as a snap for example.
   187      * Connection can be set as an accesspoint or as a snap for example.
   188      *
   188      *
   192      * again every time it creates the controller.
   192      * again every time it creates the controller.
   193      *
   193      *
   194      * @note Leaves with KErrNotFound if connection method was not
   194      * @note Leaves with KErrNotFound if connection method was not
   195      * set in the repocitory.
   195      * set in the repocitory.
   196      */
   196      */
   197     void SetDefaultConnectionMethodL( TBool aTotalSilent );   
   197     void SetDefaultConnectionMethodL( bool aTotalSilent );   
   198     
   198     
   199      /**
   199      /**
   200      * Choose a usable IAP from all SNAPs
   200      * Choose a usable IAP from all SNAPs
   201      *
   201      *
   202      * @param aCmManagerExt handle of connection manager
   202      * @param aCmManagerExt handle of connection manager
   203      */  
   203      */  
   204     TUint32 GetBestIAPInAllSNAPsL( RCmManagerExt& aCmManagerExt  );
   204     uint GetBestIAPInAllSNAPsL( RCmManagerExt& aCmManagerExt  );
   205         
   205         
   206      /**
   206      /**
   207      * Choose a usable IAP from Internet SNAP
   207      * Choose a usable IAP from Internet SNAP
   208      *
   208      *
   209      * @param aCmManagerExt handle of connection manager
   209      * @param aCmManagerExt handle of connection manager
   210      */
   210      */
   211     TUint32 GetBestIAPInInternetSNAPL( RCmManagerExt& aCmManagerExt  );
   211     uint GetBestIAPInInternetSNAPL( RCmManagerExt& aCmManagerExt  );
   212 
   212 
   213      /**
   213      /**
   214      * Choose the best IAP under the given SNAP
   214      * Choose the best IAP under the given SNAP
   215      *
   215      *
   216      * @param aCmManagerExt handle of connection manager
   216      * @param aCmManagerExt handle of connection manager
   217      * @param aSNAP SNAP ID
   217      * @param aSNAP SNAP ID
   218      */  
   218      */  
   219      TUint32 GetBestIAPInThisSNAPL( RCmManagerExt& aCmManagerExt, TUint32 aSNAP = 0);
   219      uint GetBestIAPInThisSNAPL( RCmManagerExt& aCmManagerExt, uint aSNAP = 0);
   220      
   220      
   221      /**
   221      /**
   222      * Shows update query dialog (now/later) 
   222      * Shows update query dialog (now/later) 
   223      */ 
   223      */ 
   224      void ShowUpdateQueryL();
   224      void ShowUpdateQueryL();
   225 
   225 
   226      void HideApplicationInFSWL( TBool aHide ) const;
   226      void HideApplicationInFSWL( bool aHide ) const;
   227      
   227                
   228      /**
       
   229      * CIdle callback function, that shows status dialog
       
   230      * To be used to guarantee that possible old status dialog is totally 
       
   231      * removed by AVKON before showing new one  
       
   232      *
       
   233      * @param aPtr  Pointer to this instance
       
   234      */ 
       
   235      static TInt ShowResultsDialogCallbackL( TAny* aPtr );
       
   236      
       
   237      
       
   238      /**
   228      /**
   239      * CIdle callback function, that shows update query dialog
   229      * CIdle callback function, that shows update query dialog
   240      * To be used because a client to be informed immediately that its 
   230      * To be used because a client to be informed immediately that its 
   241      * async request is issued. Waiting dialog cannot be shown before responding to a client  
   231      * async request is issued. Waiting dialog cannot be shown before responding to a client  
   242      *
   232      *
   248      * CIdle callback function, that performs automatic update check and query
   238      * CIdle callback function, that performs automatic update check and query
   249      *
   239      *
   250      * @param aPtr  Pointer to this instance
   240      * @param aPtr  Pointer to this instance
   251      */
   241      */
   252      static TInt AutomaticCheckCallbackL( TAny* aPtr );
   242      static TInt AutomaticCheckCallbackL( TAny* aPtr );
   253          
   243      
   254      
   244      void DoPossibleApplicationClose();
   255     
   245  
   256 public: //temp
   246    
   257 //private:
   247 
       
   248 private:
       
   249      
       
   250     enum DialogState
       
   251         {
       
   252         NoDialog,
       
   253         Results,
       
   254         RebootQuery,
       
   255         ShowUpdateQuery
       
   256         };
       
   257      
   258     IAUpdateServiceProvider *mServiceProvider;
   258     IAUpdateServiceProvider *mServiceProvider;
   259     
   259     IAUpdateResultsDialog* mResultsDialog;
   260 private:
   260     
   261     CIAUpdateUiController* iController;
   261     CIAUpdateUiController* iController;
   262     CIAUpdateFWUpdateHandler* iFwUpdateHandler;
   262     CIAUpdateFWUpdateHandler* iFwUpdateHandler;
   263     CIAUpdateGlobalLockHandler* iGlobalLockHandler;
   263     CIAUpdateGlobalLockHandler* iGlobalLockHandler;
       
   264     CIAUpdateAutomaticCheck* iAutomaticCheck;
   264     CEikonEnv* iEikEnv; //not owned
   265     CEikonEnv* iEikEnv; //not owned
   265     CIdle* iIdle;
   266     CIdle* iIdle;
   266     CIdle* iIdleAutCheck;
   267     CIdle* iIdleAutCheck;
   267     
   268     
   268     IAUpdateUiDefines::TIAUpdateUiRequestType iRequestType;
   269     
   269     TBool iUpdateNow;
   270     IAUpdateUiDefines::TIAUpdateUiRequestType mRequestType;
       
   271     bool mUpdateNow;
   270     RArray<TUint32> iDestIdArray;
   272     RArray<TUint32> iDestIdArray;
   271     TBool iRequestIssued;
   273     bool mRequestIssued;
   272     TBool iStartedFromApplication;
   274     bool mStartedFromApplication;
   273     TBool iUiRefreshAllowed;
   275     bool mUiRefreshAllowed;
   274     TUint iUpdatequeryUid;
   276     uint mUpdatequeryUid;
   275     TInt iWgId;
   277     int mWgId;
   276   
   278     DialogState mDialogState;
   277     
   279     HbAction *mPrimaryAction;
       
   280     HbAction *mSecondaryAction;
   278     };
   281     };
   279 
   282 
   280 #endif /* IAUPDATEENGINE_H_ */
   283 #endif /* IAUPDATEENGINE_H_ */