idlehomescreen/xmluirendering/uiengine/inc/xninactivitymonitor.h
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Inactivity monitor
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _NXINACTIVITYMONITOR_H
       
    20 #define _NXINACTIVITYMONITOR_H
       
    21 
       
    22 // System includes
       
    23 #include <e32base.h>
       
    24 
       
    25 // User includes
       
    26 
       
    27 // Forward declarations
       
    28 
       
    29 /**
       
    30  * User inactivity observer
       
    31  * 
       
    32  * @ingroup group_xnlayoutengine
       
    33  * @lib xn3layoutengine.lib
       
    34  * @since S60 5.0
       
    35  */
       
    36 NONSHARABLE_CLASS( MXnInactivityObserver )
       
    37     {
       
    38 public:
       
    39     /**
       
    40      * Notifies inactivity timer is expired
       
    41      *
       
    42      * @since S60 5.0
       
    43      */    
       
    44     virtual void InactivityTimerExpired() = 0;
       
    45     };
       
    46 
       
    47 /**
       
    48  * User inactivity monitor
       
    49  * 
       
    50  * @ingroup group_xnlayoutengine
       
    51  * @lib xn3layoutengine.lib
       
    52  * @since S60 5.0
       
    53  */
       
    54 NONSHARABLE_CLASS( CXnInactivityMonitor ) : public CTimer 
       
    55     {
       
    56 public:    
       
    57     // Constructors and destructor
       
    58     
       
    59     /**
       
    60      * Two-phased constructor.
       
    61      */
       
    62     static CXnInactivityMonitor* NewL( MXnInactivityObserver& aObserver );
       
    63 
       
    64     /**
       
    65      * Two-phased constructor. Leaving on stack
       
    66      */
       
    67     static CXnInactivityMonitor* NewLC( MXnInactivityObserver& aObserver );
       
    68 
       
    69     /**
       
    70      * Destructor
       
    71      */
       
    72     ~CXnInactivityMonitor();
       
    73 
       
    74 private:
       
    75     // private constructors
       
    76 
       
    77     /**
       
    78      * Leaving constructor
       
    79      */
       
    80     void ConstructL();
       
    81     
       
    82     /**
       
    83      * C++ default constructor
       
    84      */
       
    85     CXnInactivityMonitor( MXnInactivityObserver& aObserver );
       
    86 
       
    87 private:
       
    88     // from CTimer
       
    89     
       
    90     void RunL();
       
    91     
       
    92 public:
       
    93     // new functions
       
    94     
       
    95     /**
       
    96      * Starts inactivity monitoring 
       
    97      *
       
    98      * @since S60 5.0
       
    99      */
       
   100     void Start();
       
   101 
       
   102     /**
       
   103      * Stops inactivity monitoring 
       
   104      *
       
   105      * @since S60 5.0
       
   106      */    
       
   107     void Stop();
       
   108         
       
   109 private:
       
   110     // data
       
   111     /** Inactivity observer, Not owned */
       
   112     MXnInactivityObserver& iObserver;
       
   113     };
       
   114 
       
   115 #endif // _NXINACTIVITYMONITOR_H