appinstaller/AppinstUi/Daemon/Inc/DialogWrapper.h
changeset 37 6e7b00453237
parent 29 26b6f0522fd8
equal deleted inserted replaced
33:8110bf1194d1 37:6e7b00453237
    20 #define DIALOGWRAPPER_H
    20 #define DIALOGWRAPPER_H
    21 
    21 
    22 //  INCLUDES
    22 //  INCLUDES
    23 #include <e32base.h>
    23 #include <e32base.h>
    24 #include <f32file.h>
    24 #include <f32file.h>
    25 
       
    26 // TODO probably removed in 10.1
       
    27 // #include <barsc.h>
       
    28 #include "dialogwatcher.h"
    25 #include "dialogwatcher.h"
    29 
    26 
    30 class CHbDeviceProgressDialogSymbian;
    27 class CHbDeviceProgressDialogSymbian;
    31 class CHbDeviceNotificationDialogSymbian;
    28 class CHbDeviceNotificationDialogSymbian;
       
    29 class CHbIndicatorSymbian;
    32 
    30 
    33 namespace Swi
    31 namespace Swi
    34 {
    32 {
    35 
    33 // Define uninstaller mode for universal indicator.
       
    34 const TInt KSWIDaemonUninstallerMode = -1; 
       
    35 // Define installer mode for universal indicator.
       
    36 const TInt KSWIDaemonInstallerMode = 0;
       
    37 
       
    38 class CDialogTimer;
    36 /**
    39 /**
    37 * This class wraps functions for showing some global dialogs.
    40 * This class wraps functions for showing some global dialogs.
    38 * 
    41 * 
    39 * @since 3.0 
    42 * @since 3.0 
    40 */
    43 */
    73         
    76         
    74         /**
    77         /**
    75         * Cancel global waiting note (after installing).
    78         * Cancel global waiting note (after installing).
    76         * @since 3.0
    79         * @since 3.0
    77         */
    80         */
    78         void CancelWaitingNoteL();
    81         void CancelWaitingNote();
    79         
    82         
    80         /**
    83         /**
    81          * Sets dialog control flag.
    84          * Sets dialog control flag.
    82          * @since 3.2
    85          * @since 3.2
    83          * @parm TInt Flag for dialog control.
    86          * @parm TInt Flag for dialog control.
    87         /**
    90         /**
    88           * Show global waiting note (during uninstalling).
    91           * Show global waiting note (during uninstalling).
    89           * @since 3.2         
    92           * @since 3.2         
    90           */              
    93           */              
    91         void ShowWaitingNoteForUninstallerL();
    94         void ShowWaitingNoteForUninstallerL();
       
    95         
       
    96         /**
       
    97          * Cancel global waiting note (after installing).
       
    98          * @since 10.1
       
    99          */        
       
   100         void CancelWaitingNoteForUninstaller();
       
   101  
       
   102         /**
       
   103          * Show universal indicator for install or uninstall process.
       
   104          * @since 10.1          
       
   105          */ 
       
   106         void ActivateIndicatorL( TReal aProcessValue );
       
   107         
       
   108         /**
       
   109          * Set mode for universal indicator plugin. 
       
   110          * @since 10.1 
       
   111          * @parm aMode Flag for switchig to uninstaller mode. By default
       
   112          * plugin works as installer mode.       
       
   113          */        
       
   114         void SetModeToIndicatorL( TInt aMode );
       
   115         
       
   116         /**
       
   117          * Close universal indicator for install or uninstall process.
       
   118          * @since 10.1         
       
   119          */        
       
   120         void CancelIndicatorL();
       
   121  
       
   122 //TODO: remove, it seems that this is no needed after wk18.        
       
   123         /**
       
   124          * Check system state. This is needed to know, can Daemon show UI
       
   125          * dialogs.
       
   126          * @since 10.1         
       
   127          */       
       
   128         //void CheckSystemState();
    92 
   129 
    93     private:
   130     private:
    94 
   131 
    95         /**
   132         /**
    96         * Constructor.
   133         * Constructor.
   115         RFs& iFs;        
   152         RFs& iFs;        
   116         TInt iNoteId;  
   153         TInt iNoteId;  
   117         TInt iDisableAllNotes;
   154         TInt iDisableAllNotes;
   118         CDialogWatcher* iWatcher;
   155         CDialogWatcher* iWatcher;
   119         
   156         
   120         TBool iIsProgressDialog;
   157         TBool iIsProgressDialog; // Defines that dialog is constructed.  
   121         CHbDeviceProgressDialogSymbian* iHbProgressDialog;
   158         CHbDeviceProgressDialogSymbian* iHbProgressDialog;
   122         TBool iIsUninstallerProgressDialog;                    
   159         TBool iIsUninstallerProgressDialog; // Defines that dialog is constructed.                   
   123         CHbDeviceProgressDialogSymbian* iHbProgressDialogForUninstaller;                
   160         CHbDeviceProgressDialogSymbian* iHbProgressDialogForUninstaller;
       
   161         TBool iIsIndicator; // Defines that indicator is constructed.
       
   162         CHbIndicatorSymbian* iHbIndicator;  // Univeral indicator.
       
   163         CDialogTimer* iTimer;   // Timer for closing procress dialog.
       
   164         // Defines that dialog has used the time interval and can not be shown.
       
   165         TBool iTimeOffDisableProgress;         
       
   166     };
       
   167 
       
   168 /**
       
   169 * Helper class for closing the progress dialogs shown by 
       
   170 * the DialogWrapper class.
       
   171 * 
       
   172 * @since 10.1 
       
   173 */
       
   174 class CDialogTimer : public CActive
       
   175     {
       
   176     public:
       
   177     
       
   178         /**
       
   179         * Destructor.
       
   180         */
       
   181         virtual ~CDialogTimer();
       
   182         
       
   183         /**
       
   184         * Two-phased constructor.
       
   185         */
       
   186         static CDialogTimer* NewL( CDialogWrapper* aDialog );
       
   187         
       
   188         /**
       
   189          * Function sets time interva for progress dialog.
       
   190          * After this time interval the progress dialog is closed.
       
   191          * @param aRefresTime Time in microseconds.
       
   192          */          
       
   193          void StartDialogTimer( TUint32 aRefreshTime );
       
   194         
       
   195     private:
       
   196 
       
   197         /**
       
   198         * C++ default constructor.
       
   199         */
       
   200         CDialogTimer();
       
   201 
       
   202         /**
       
   203         * 2nd phase constructor. 
       
   204         * @param 
       
   205         */
       
   206         void ConstructL( CDialogWrapper* aDialog );
       
   207         
       
   208         /**
       
   209          * Function sets time.
       
   210          * @param aRefresTime Time in microseconds.
       
   211          */          
       
   212          void TimerSet( TUint32 aRefreshTime );
       
   213       
       
   214         /**
       
   215         * 
       
   216         */        
       
   217         void RunL();
       
   218 
       
   219         /**
       
   220         * Cancel timer.
       
   221         */        
       
   222         void DoCancel();
       
   223         
       
   224         /**
       
   225         * Handles a leave occurring in the request completion 
       
   226         * event handler RunL.
       
   227         */             
       
   228         TInt RunError( TInt aError );
       
   229 
       
   230     private:
       
   231 
       
   232         RTimer          iRTimer;     // Timer.   
       
   233         CDialogWrapper* iDialog;     // Dialog class.                     
   124     };
   234     };
   125 }
   235 }
   126 
   236 
   127 #endif      // DIALOGWRAPPER_H   
   237 #endif      // DIALOGWRAPPER_H   
   128             
   238