appinstaller/AppinstUi/Daemon/Inc/DialogWrapper.h
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
    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 #include <barsc.h>
    25 #include "dialogwatcher.h"
    26 #include "dialogwatcher.h"
    26 
       
    27 class CHbDeviceProgressDialogSymbian;
       
    28 class CHbDeviceNotificationDialogSymbian;
       
    29 class CHbIndicatorSymbian;
       
    30 
    27 
    31 namespace Swi
    28 namespace Swi
    32 {
    29 {
    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 
    30 
    38 class CDialogTimer;
       
    39 /**
    31 /**
    40 * This class wraps functions for showing some global dialogs.
    32 * This class wraps functions for showing some global dialogs.
    41 * 
    33 * 
    42 * @since 3.0 
    34 * @since 3.0 
    43 */
    35 */
    76         
    68         
    77         /**
    69         /**
    78         * Cancel global waiting note (after installing).
    70         * Cancel global waiting note (after installing).
    79         * @since 3.0
    71         * @since 3.0
    80         */
    72         */
    81         void CancelWaitingNote();
    73         void CancelWaitingNoteL();
    82         
    74         
    83         /**
    75         /**
    84          * Sets dialog control flag.
    76          * Sets dialog control flag.
    85          * @since 3.2
    77          * @since 3.2
    86          * @parm TInt Flag for dialog control.
    78          * @parm TInt Flag for dialog control.
    90         /**
    82         /**
    91           * Show global waiting note (during uninstalling).
    83           * Show global waiting note (during uninstalling).
    92           * @since 3.2         
    84           * @since 3.2         
    93           */              
    85           */              
    94         void ShowWaitingNoteForUninstallerL();
    86         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();
       
   129 
    87 
   130     private:
    88     private:
   131 
    89 
   132         /**
    90         /**
   133         * Constructor.
    91         * Constructor.
   146         * @return Read resource buffer.
   104         * @return Read resource buffer.
   147         */
   105         */
   148         HBufC* ReadResourceLC( TInt aResourceId );        
   106         HBufC* ReadResourceLC( TInt aResourceId );        
   149 
   107 
   150     private: //  Data
   108     private: //  Data
   151           
   109 
       
   110         RResourceFile iResourceFile;        
   152         RFs& iFs;        
   111         RFs& iFs;        
   153         TInt iNoteId;  
   112         TInt iNoteId;  
   154         TInt iDisableAllNotes;
   113         TInt iDisableAllNotes;
   155         CDialogWatcher* iWatcher;
   114         CDialogWatcher* iWatcher;
   156         
       
   157         TBool iIsProgressDialog; // Defines that dialog is constructed.  
       
   158         CHbDeviceProgressDialogSymbian* iHbProgressDialog;
       
   159         TBool iIsUninstallerProgressDialog; // Defines that dialog is constructed.                   
       
   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.                     
       
   234     };
   115     };
   235 }
   116 }
   236 
   117 
   237 #endif      // DIALOGWRAPPER_H   
   118 #endif      // DIALOGWRAPPER_H   
   238             
   119