fotaapplication/fotaserver/inc/FotaServer.h
changeset 73 ae69c2e8bc34
parent 55 1c556dee8eb1
equal deleted inserted replaced
71:d2517372cc44 73:ae69c2e8bc34
    43  * The key is owned by omadmappui**/
    43  * The key is owned by omadmappui**/
    44 const TUint32 KFotaServerActive = 0x0000008;
    44 const TUint32 KFotaServerActive = 0x0000008;
    45 #define __LEAVE_IF_ERROR(x) if(KErrNone!=x) {FLOG(_L("LEAVE in %s: %d"), __FILE__, __LINE__); User::Leave(x); }
    45 #define __LEAVE_IF_ERROR(x) if(KErrNone!=x) {FLOG(_L("LEAVE in %s: %d"), __FILE__, __LINE__); User::Leave(x); }
    46 
    46 
    47 //Forward declarations
    47 //Forward declarations
    48 class FotaFullscreenDialog;
    48 class HbFotaFullscreenDialog;
    49 /** File that stores the firmware version at the start of download. This is in fota's private directory*/
    49 /** File that stores the firmware version at the start of download. This is in fota's private directory*/
    50 _LIT (KSWversionFile, "swv.txt");
    50 _LIT (KSWversionFile, "swv.txt");
    51 
    51 
    52 /** Time and the interval download finalizing retries*/
    52 /** Time and the interval download finalizing retries*/
    53 const TInt KDownloadFinalizerWaitTime(1000000);
    53 const TInt KDownloadFinalizerWaitTime(1000000);
   116             TFotaClient aRequester, TBool aSilent, TBool aUpdateLtr);
   116             TFotaClient aRequester, TBool aSilent, TBool aUpdateLtr);
   117 
   117 
   118     /**
   118     /**
   119      * Pauses ongoing download
   119      * Pauses ongoing download
   120      *
   120      *
   121      * @since   S60   v3.1
   121      * @since   SF4
   122      * @param   none
   122      * @param   none
   123      * @return  none, can leave with system wide errors
   123      * @return  none, can leave with system wide errors
   124      */
   124      */
   125     void PauseDownloadL();
   125     void PauseDownloadL();
   126 
   126 
   162     TPackageState GetStateL(const TInt aPkgId);
   162     TPackageState GetStateL(const TInt aPkgId);
   163 
   163 
   164     /**
   164     /**
   165      * Tries to resume the download.
   165      * Tries to resume the download.
   166      *
   166      *
   167      * @since   S60   v5.2
   167      * @since   SF3
   168      * @param   aClient the client which triggers resume
   168      * @param   aClient the client which triggers resume
   169      * @param   aSilentDl	Whether to query user for resume?
   169      * @param   aSilentDl	Whether to query user for resume?
   170      * @return  None, can leave with system wide errors
   170      * @return  None, can leave with system wide errors
   171      */
   171      */
   172     void TryResumeDownloadL(TFotaClient aClient, TBool aSilentDl);
   172     void TryResumeDownloadL(TFotaClient aClient, TBool aSilentDl);
   187      * @param   aTime       On return, time of last update
   187      * @param   aTime       On return, time of last update
   188      * @return  None, can leave with system wide errors
   188      * @return  None, can leave with system wide errors
   189      */
   189      */
   190     void GetUpdateTimeStampL(TDes16& aTime);
   190     void GetUpdateTimeStampL(TDes16& aTime);
   191 
   191 
       
   192 
       
   193 		/**
       
   194      * Get Name,Version and aSize of the current software.
       
   195      *
       
   196      * @since   S60   v3.1
       
   197      * @param   aName       Name of the software that is last updated.
       
   198      * @param   aVersion    Version of the software that is last updated.
       
   199      * @param   aSize		    Size of the software that is last updated.
       
   200      * @return  None, can leave with system wide errors
       
   201      */
   192     void GetCurrentFwDetailsL(TDes8& aName, TDes8& aVersion, TInt& aSize);
   202     void GetCurrentFwDetailsL(TDes8& aName, TDes8& aVersion, TInt& aSize);
   193 
   203 
   194     /**
   204     /**
   195      * Do cleanup for package
   205      * Do cleanup for package
   196      *
   206      *
   210     void FinalizeDownloadL();
   220     void FinalizeDownloadL();
   211 
   221 
   212     /**
   222     /**
   213      * Callback function to notify the network status
   223      * Callback function to notify the network status
   214      *
   224      *
   215      * @since S60	v3.2
   225      * @since   SF4
   216      * @param Status of network connection
   226      * @param Status of network connection
   217      * @return None
   227      * @return None
   218      */
   228      */
   219     void ReportNetworkStatus(TBool status);
   229     void ReportNetworkStatus(TBool status);
   220 
   230 
   273      *
   283      *
   274      * @since SF4
   284      * @since SF4
   275      * @param none
   285      * @param none
   276      * @return pointer to full screen dialog instance
   286      * @return pointer to full screen dialog instance
   277      */
   287      */
   278     FotaFullscreenDialog* FullScreenDialog();
   288     HbFotaFullscreenDialog* FullScreenDialog();
   279 
   289 
   280     /**
   290     /**
   281      * Sets the phone's startup reason which will used by Fota Startup Pluggin to any decision.
   291      * Sets the phone's startup reason which will used by Fota Startup Pluggin to any decision.
   282      *
   292      *
   283      * @since   S60   v3.2
   293      * @since   SF3
   284      * @param   aReason     Startup reason, either download interrupted
   294      * @param   aReason     Startup reason, either download interrupted
   285      * @return  None
   295      * @return  None
   286      */
   296      */
   287     void SetStartupReason(TInt aReason);
   297     void SetStartupReason(TInt aReason);
   288 
   298 
       
   299 		/**
       
   300      * Brings the fotaserver to the foreground or background according to the paramter aVal Passed.
       
   301      *
       
   302      * @since   SF4
       
   303      * @param   aVal     Value which determines if fotaserver is to be in foreground or in background.
       
   304      * @return  None
       
   305      */
   289     void ConstructApplicationUI(TBool aVal);
   306     void ConstructApplicationUI(TBool aVal);
       
   307     
       
   308     /**
       
   309      * To show that some fotaoperation is taking place in the device. It is used by Device Updatesto disabled
       
   310      * update button.
       
   311      *
       
   312      * @since   SF4
       
   313      * @param   aValue - True if fota operation is ongoing, false otherwise.
       
   314      * @return  None
       
   315      */
   290     void SetServerActive(TBool aValue);
   316     void SetServerActive(TBool aValue);
   291     
   317     
       
   318     
       
   319     /**
       
   320      * This function is called to free the resources which was taken when update takes place.
       
   321      *
       
   322      * @since   SF4
       
   323      * @return  None
       
   324      */
   292     void FinalizeUpdate();
   325     void FinalizeUpdate();
   293 
   326 
   294 public:
   327 public:
   295     // member variables
   328     // member variables
   296 
   329 
   367      * @param none
   400      * @param none
   368      * @return  None
   401      * @return  None
   369      */
   402      */
   370     void StopServerWhenPossible();
   403     void StopServerWhenPossible();
   371 
   404 
       
   405 		/**
       
   406      * Sets a flag, which determines if server can be shutdown or not.
       
   407      *
       
   408      * @since   SF4
       
   409      * @param aParams - True if server can shut, false otherwise.
       
   410      * @return  None
       
   411      */
   372     void ServerCanShut(TBool aParam);
   412     void ServerCanShut(TBool aParam);
   373     
   413     
       
   414     
       
   415     /**
       
   416      * Decrements the download restart counter, it is used when previous software update is failed
       
   417      * and user tries to resume the same.
       
   418      *
       
   419      * @since   SF4
       
   420      * @param None
       
   421      * @return  None
       
   422      */
   374     TBool DecrementDownloadRestartCount();
   423     TBool DecrementDownloadRestartCount();
   375 	
   424 	
       
   425 	
       
   426 		/**
       
   427      * Calls the fullscreen dialog setvisible function to make it visible.
       
   428      *
       
   429      * @since   SF4
       
   430      * @param aVisible - True if fullscreen dialog is to be visible, false otherwise.
       
   431      * @return  None
       
   432      */
   376     void SetVisible(TBool aVisible);
   433     void SetVisible(TBool aVisible);
   377 
   434 
   378 protected:
   435 protected:
   379     // from base classes
   436     // from base classes
   380 
   437 
   586      * @return None
   643      * @return None
   587      */
   644      */
   588     void ShowFullScreenDialog(TInt aType);
   645     void ShowFullScreenDialog(TInt aType);
   589 
   646 
   590     /**
   647     /**
   591      * Swaps the fota process from background to foreground
   648      * Resets the postpone counter to zero
   592      *
   649      *
   593      * @since SF4
   650      * @since SF4
   594      * @param aState - true will bring to foreground, false to background
   651      * @param None
   595      * @return None
   652      * @return None
   596      */
   653      */
   597     //void swapProcess(TBool aState);
       
   598 
       
   599     void ResetCounters();
   654     void ResetCounters();
   600 
   655 
       
   656 
       
   657 		/**
       
   658      * Checks if user's postpone counter is expired or not.
       
   659      *
       
   660      * @since SF4
       
   661      * @param None
       
   662      * @return Tbool - True if postpone is allowed, false otherwise.
       
   663      */
   601     TBool IsUserPostponeAllowed();
   664     TBool IsUserPostponeAllowed();
   602 
   665 
       
   666 
       
   667 		/**
       
   668      * Decrements the user postpone count, if user has used it.
       
   669      *
       
   670      * @since SF4
       
   671      * @param None
       
   672      * @return None
       
   673      */
   603     void DecrementUserPostponeCount();
   674     void DecrementUserPostponeCount();
   604     
   675     
       
   676     
       
   677     /**
       
   678      * Sets a flag, which stops the shut down of fotaserver.
       
   679      *
       
   680      * @since SF4
       
   681      * @param None
       
   682      * @return None
       
   683      */
   605     void WakeupServer();
   684     void WakeupServer();
   606 
   685 
   607 private:
   686 private:
   608     // Data
   687     // Data
   609 
   688 
   708     static TInt iSessionCount;
   787     static TInt iSessionCount;
   709 
   788 
   710     /**
   789     /**
   711      * The full screen dialog 
   790      * The full screen dialog 
   712      */
   791      */
   713     FotaFullscreenDialog *iFullScreenDialog;
   792     HbFotaFullscreenDialog *iFullScreenDialog;
   714 
   793 
   715     /**
   794     /**
   716      * The notifier params to the dialogs
   795      * The notifier params to the dialogs
   717      */
   796      */
   718     CHbSymbianVariantMap * iNotifParams;
   797     CHbSymbianVariantMap * iNotifParams;
   719 
   798 
       
   799     /**
       
   800      * The notifier which shows the device dialog.
       
   801      */
   720     CFotaDownloadNotifHandler * iNotifier;
   802     CFotaDownloadNotifHandler * iNotifier;
   721     /**
   803     /**
   722      * Can the server shut?
   804      * Can the server shut?
   723      */
   805      */
   724     TBool iServerCanShut;
   806     TBool iServerCanShut;
   726     /**
   808     /**
   727      * Is async operation requested?
   809      * Is async operation requested?
   728      */
   810      */
   729     TBool iAsyncOperation;
   811     TBool iAsyncOperation;
   730 
   812 
   731     TInt iDialogId;
       
   732 
   813 
   733     TBool iConstructed;
   814     TBool iConstructed;
   734     
   815     
   735     HbMainWindow& iMainwindow;
   816     HbMainWindow& iMainwindow;
   736     };
   817     };