syncmlfw/syncmlnotifier/inc/SyncMLFwUpdNotifier.h
branchRCL_3
changeset 26 19bba8228ff0
equal deleted inserted replaced
25:b183ec05bd8c 26:19bba8228ff0
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Synchronisation server alert and application launcher notifier.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CSYNCMLFWUPDNOTIFIER_H
       
    21 #define CSYNCMLFWUPDNOTIFIER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <SyncMLNotifierParams.h>
       
    25 #include "SyncMLNotifierBase.h"    // Base class
       
    26 #include "SyncMLMessageQueryDialog.h"
       
    27 #include <SyncService.h>
       
    28 
       
    29 // CONSTANTS
       
    30 // Taken from S60\OmaDSAppUi\inc\NSmlDMSyncPrivateCRKeys.h
       
    31 const TUid KCRUidNSmlDMSyncApp = {0x101f6de5};
       
    32 const TUint32 KNSmlDMFotaConfigurationKey = 0x00000001;
       
    33 const TUint KNSmlDMFotaEnableFotaViewFlag = 0x0004;
       
    34 
       
    35 //Constants required to indicate key presses in dialogs
       
    36 enum 
       
    37 	{
       
    38     ESyncMLDlgRespKeyNone = -3,
       
    39     ESyncMLDlgRespKeyOk = -2,
       
    40     ESyncMLDlgRespKeyOthers = -1,
       
    41     ESyncMLDlgRespKeyCancel = 0
       
    42     };
       
    43 
       
    44 
       
    45 //Constants used when update happen NSC/DM 
       
    46 enum {
       
    47 		EFotaUpdateNSC=1,
       
    48 		EFotaUpdateNSCBg,
       
    49 		EFotaUpdateDM
       
    50 };
       
    51 
       
    52 // CLASS DECLARATION
       
    53 /**
       
    54 *  Notifier for showing the rsult of the firmware
       
    55 *  update to the user.
       
    56 *
       
    57 *  @lib SyncMLNotifier
       
    58 *  @since Series 60 3.1
       
    59 */
       
    60 NONSHARABLE_CLASS( CSyncMLFwUpdNotifier ) : public CSyncMLNotifierBase
       
    61     {
       
    62     public:  // Constructors and destructor
       
    63         
       
    64         /**
       
    65         * Two-phased constructor.
       
    66         */
       
    67         static CSyncMLFwUpdNotifier* NewL();
       
    68         
       
    69         /**
       
    70         * Destructor.
       
    71         */
       
    72         virtual ~CSyncMLFwUpdNotifier();
       
    73 
       
    74     private: // New functions
       
    75 
       
    76         /**
       
    77         * Shows a note describing the error situation that has been encountered
       
    78         * when checking the prerequisites for firmware update.
       
    79         * @param None
       
    80         * @return Result to the query
       
    81         */
       
    82         TInt ShowUpdateErrorNoteL();
       
    83 
       
    84         /**
       
    85         * Shows a note describing the result of firmware update.
       
    86         * @param None
       
    87         * @return Result to the query
       
    88         */
       
    89         TInt ShowUpdateResultNoteL();
       
    90 
       
    91         /**
       
    92         * Informs the user about the firmware update and its consequences.
       
    93         * Queries if the user wants to continue with the update.
       
    94         * @param None
       
    95         * @return Result to the query
       
    96         */
       
    97         TInt ShowUpdateStartQueryL();
       
    98 		
       
    99         /**
       
   100         * Informs the user about the firmware update while encrypted phone memory.
       
   101         * Queries if the user wants to continue with the update.
       
   102         * @param None
       
   103         * @return Result to the query
       
   104         */
       
   105         TInt ShowUpdateStartQueryEncryptionL();
       
   106         
       
   107         /**
       
   108         * Shows a note describing the result of firmware update. Also queries
       
   109         * user to encrypt memory 
       
   110         * @param None
       
   111         * @return Result to the query
       
   112         */
       
   113         TInt ShowUpdateResultWithEncryptionNoteL();
       
   114 		
       
   115 		
       
   116 		/**
       
   117         * Informs the user about the firmware update and its consequences.
       
   118         * Queries if the user wants to continue with the update.
       
   119         * It also makes sure that the number of postpones the user does
       
   120         * does not exceed the maximum allowed postpones.
       
   121         * @param queryType - Which tells the type of query to be shown.
       
   122         * @return Result to the query
       
   123         */
       
   124         TInt ShowPostLimitUpdateStartQueryL(TInt queryType);
       
   125 
       
   126         /**
       
   127         * Retrieves the profile name using the profile identifier stored
       
   128         * in iNoteInfo.
       
   129         * @param aServerName Returns the clear-text name of the corresponding server.
       
   130         * @return None
       
   131         */
       
   132         void RetrieveProfileNameL( TDes& aServerName );
       
   133         /*Information note shown  to the user after selecting No reminder case in
       
   134 	    * the reminder dialog. This note informs the user that downloaded package 
       
   135  	    * can be installed manually. 
       
   136  	    */
       
   137 
       
   138         TInt ShowNoReminderQueryL();
       
   139         
       
   140         /*Message query note shown  to the user when ever there is no enough memory
       
   141         * space to download the update package
       
   142  	    */
       
   143         TInt ShowNotEnoughMemoryL( TInt &aMemoryNeeded ,TBool aOmaDL );
       
   144 
       
   145 				/*Message query note shown to the user when ever the user cancels the download
       
   146 				 * and whether the user wants to resume the download at a later point of time. 
       
   147 				 * @param None
       
   148          * @return Result to the query
       
   149  	       */
       
   150 				TInt ShowDownloadUserCancelL();
       
   151 		
       
   152 				/*Message note shown to the user when ever 
       
   153 				 * the user postponds the download 
       
   154 		     * @param None
       
   155          * @return Result to the query
       
   156  	       */
       
   157 				TInt ShowDownloadPostponedL();
       
   158 		
       
   159 				/*Message note shown to the user when ever 
       
   160 				 * the user cancels the download 
       
   161 		     * @param None
       
   162          * @return Result to the query
       
   163  	       */
       
   164 				TInt ShowDownloadCancelledL();
       
   165 		
       
   166 				/*Message note shown to the user when ever 
       
   167 				 * the user postpones the update 
       
   168 				 * @param None
       
   169 				 * @return Result to the query
       
   170 				 */
       
   171 				TInt ShowPostponeLimitNoteL();
       
   172 
       
   173 				/*Message note shown to the user when ever 
       
   174 				 * the user wants to resume the download.
       
   175 		     * @param None
       
   176          * @return Result to the query
       
   177  	       */
       
   178 				TInt ShowDownloadResumeL();
       
   179     private: // Functions from base classes
       
   180 
       
   181         /**
       
   182         * From CSyncMLNotifierBase Called when a notifier is first loaded.        
       
   183         * @param None.
       
   184         * @return A structure containing priority and channel info.
       
   185         */
       
   186         TNotifierInfo RegisterL();
       
   187 
       
   188         /**
       
   189         * From CSyncMLNotifierBase The notifier has been deactivated 
       
   190         * so resources can be freed and outstanding messages completed.
       
   191         * @param None.
       
   192         * @return None.
       
   193         */
       
   194         void Cancel();
       
   195 
       
   196         /**
       
   197         * From CSyncMLNotifierBase Gets called when a request completes.
       
   198         * @param None.
       
   199         * @return None.
       
   200         */
       
   201         void RunL();
       
   202 
       
   203         /**
       
   204         * From CSyncMLNotifierBase Used in asynchronous notifier launch to 
       
   205         * store received parameters into members variables and 
       
   206         * make needed initializations.
       
   207         * @param aBuffer A buffer containing received parameters
       
   208         * @param aReturnVal The return value to be passed back.
       
   209         * @param aMessage Should be completed when the notifier is deactivated.
       
   210         * @return None.
       
   211         */
       
   212         void GetParamsL( const TDesC8&       aBuffer,
       
   213                                TInt          aReplySlot,
       
   214                          const RMessagePtr2& aMessage );
       
   215         /**
       
   216         * IsLanguageSupported
       
   217         * @param ret
       
   218         * @return True if the language is supported.
       
   219         */                 
       
   220 				TBool IsLanguageSupportedL();
       
   221     private:
       
   222 
       
   223         /**
       
   224         * C++ default constructor.
       
   225         */
       
   226         CSyncMLFwUpdNotifier();
       
   227 
       
   228     private: // Data
       
   229         // Type of note to be shown
       
   230         TSyncMLFwUpdNoteTypes   iNoteType;
       
   231         
       
   232         // Possible additional information required by the note
       
   233         TInt                    iNoteInfo;
       
   234         
       
   235         //Memory needed for the for the fota update package to be downloaded
       
   236 //        #ifdef RD_FOTA_FLEXIBLE_MEMORY_USAGE
       
   237         TInt        iFotaMemoryNeeded;
       
   238 //        #endif
       
   239         // The Number of times user has postponed the update.
       
   240         TInt iUserPostponeCount;
       
   241         
       
   242         // The Maximum number of times update can be postponed.
       
   243         TInt iMaxPostponeCount;
       
   244         
       
   245         // The option Selected by the user to postpone the update.
       
   246         TBuf<KSyncMLMaxServerMsgLength>    iSelectedReminder;
       
   247         //Checks whether dialog from RUNL popped and waiting for user input
       
   248         TBool iRunLhang;
       
   249         
       
   250         //Reference to the Dialog launched from RunL
       
   251         CSyncMLMessageQueryDialog* iDlg;
       
   252         
       
   253 		//To decide on encryption note or default note.
       
   254         TBool iFotaEncryptReq;
       
   255         
       
   256       // The time interval chosen by the user to postpone the update.
       
   257       TInt iInterval;
       
   258       
       
   259       // The time interval type(in hours or minutes)chosen by the user to postpone the update.
       
   260       TIntervalType iIntervalType;
       
   261 
       
   262     };
       
   263 
       
   264 
       
   265 #endif      // CSYNCMLFWUPDNOTIFIER_H   
       
   266             
       
   267 // End of File