homescreenapp/hsapplicationlauncher/inc/hsshutdownmonitor.h
changeset 77 4b195f3bea29
equal deleted inserted replaced
61:2b1b11a301d2 77:4b195f3bea29
       
     1 /*
       
     2 * Copyright (c) 1020 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: shutdown monitor.
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef __HS_SHUTDOWN_MONITOR__
       
    19 #define __HS_SHUTDOWN_MONITOR__
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <ssm/ssmstateawaresession.h>
       
    23 
       
    24 class t_hsapplicationlauncher;
       
    25 
       
    26 /**
       
    27  * MHsShutdownMonitorObserver
       
    28  * 
       
    29  * Monitor component observer.
       
    30  * 
       
    31  * @since S60 5.2
       
    32  */
       
    33 class MHsShutdownMonitorObserver
       
    34     {    
       
    35     public:
       
    36         /**
       
    37          * Called when shutdown occurs 
       
    38          */
       
    39         virtual void SystemShutdownEvent() = 0;
       
    40     };
       
    41 
       
    42 /**
       
    43  * HsShutdownMonitor
       
    44  * 
       
    45  * Component for monitoring shutdown
       
    46  * 
       
    47  * @since S60 5.2
       
    48  */  
       
    49 class CHsShutdownMonitor : public CActive
       
    50     {
       
    51     public:
       
    52         /**
       
    53          * Create new monitor
       
    54          * 
       
    55          * @param aObserver monitor observer
       
    56          * @since S60 5.2     
       
    57          */    
       
    58         static CHsShutdownMonitor* NewL(
       
    59                 MHsShutdownMonitorObserver& aObserver );   
       
    60         
       
    61         /**
       
    62          * Destructor
       
    63          * 
       
    64          * @since S60 5.2     
       
    65          */    
       
    66         ~CHsShutdownMonitor();
       
    67     
       
    68         /**
       
    69          * Start monitor
       
    70          * 
       
    71          * @since S60 5.2
       
    72          */        
       
    73         void StartMonitor();        
       
    74 
       
    75     protected:
       
    76         /** 
       
    77          * C++ constructor
       
    78          *
       
    79          * @param aObserver     monitor observer.   
       
    80          * @since S60 5.2      
       
    81          */        
       
    82         CHsShutdownMonitor( MHsShutdownMonitorObserver& aObserver );    
       
    83 
       
    84         /**
       
    85          * Symbian 2nd phase constructor
       
    86          * 
       
    87          * @since S60 5.2
       
    88          */        
       
    89         void ConstructL();
       
    90 
       
    91     private: // From CActive
       
    92         /**
       
    93          * From CActive
       
    94          */        
       
    95         void RunL();
       
    96 
       
    97         /**
       
    98          * From CActive
       
    99          * 
       
   100          * @since S60 5.2
       
   101          */        
       
   102         void DoCancel(); 
       
   103 
       
   104         /**
       
   105          * From CActive
       
   106          * 
       
   107          * @since S60 5.2
       
   108          */        
       
   109         TInt RunError( TInt aError );
       
   110 
       
   111     private:	
       
   112         // watchdog observer
       
   113         MHsShutdownMonitorObserver& iObserver;
       
   114 
       
   115         // State aware session.
       
   116         RSsmStateAwareSession iSAS;
       
   117 
       
   118         friend class t_hsapplicationlauncher;
       
   119     };
       
   120 
       
   121 #endif // __HS_PROCESS_MONITOR__