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