satengine/SatServer/EventMonitors/inc/CSatUserActivityMonitor.h
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 2002-2006 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:  Monitor of user activity
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSATUSERACTIVITYMONITOR_H
       
    20 #define CSATUSERACTIVITYMONITOR_H
       
    21 
       
    22 #include <activitymanager.h>
       
    23 #include "CSatEventMonitorHandler.h"
       
    24 
       
    25 /**
       
    26 *  Monitors user activity and informs SAT Engine if there
       
    27 *  is no user activity in certain time.
       
    28 *
       
    29 *  @lib EventMonitors.lib
       
    30 *  @since Series 60 3.0
       
    31 */
       
    32 class CSatUserActivityMonitor : public CSatEventMonitorHandler
       
    33     {
       
    34     public:  // Constructor and destructor
       
    35 
       
    36         /**
       
    37         * Two-phased constructor.
       
    38         * @param aUtils Interface for Event monitor utils
       
    39         */
       
    40         static CSatUserActivityMonitor* NewL(
       
    41             MSatEventMonitorUtils& aUtils );
       
    42 
       
    43         /**
       
    44         * Destructor.
       
    45         */
       
    46         virtual ~CSatUserActivityMonitor();
       
    47 
       
    48     public: // From base class
       
    49 
       
    50         /**
       
    51         * From CSatEventMonitorHandler Cancels event monitoring
       
    52         */
       
    53         void DoCancelMonitor();
       
    54 
       
    55     protected: // New functions
       
    56 
       
    57         /**
       
    58         * From CSatEventMonitorHandler Starts event monitoring
       
    59         * @return Error code indicating the status of starting the monitor
       
    60         */
       
    61         TInt StartMonitor();
       
    62 
       
    63     private:
       
    64 
       
    65         /**
       
    66         * Cancels monitoring of user activity.
       
    67         */
       
    68         void Cancel();
       
    69 
       
    70         /**
       
    71         * C++ default constructor.
       
    72         * @param aUtils Interface for Event monitor utils
       
    73         */
       
    74         CSatUserActivityMonitor( MSatEventMonitorUtils& aUtils );
       
    75 
       
    76         // ConstructL
       
    77         void ConstructL();
       
    78 
       
    79         /**
       
    80         * Starts activity manager for user actions.
       
    81         */
       
    82         void StartActivityManagerL();
       
    83 
       
    84         /**
       
    85         * Called when user has been
       
    86         * passive for a pre-defined period
       
    87         * @param aPtr Pointer to creator, not currently used
       
    88         * @return Completing result value
       
    89         */
       
    90         static TInt DispatchUserInactive( TAny* /* aPtr */ );
       
    91 
       
    92         /**
       
    93         * Called when user does something
       
    94         * @param aPtr Pointer to creator
       
    95         * @return Completing result value
       
    96         */
       
    97         static TInt DispatchUserActive( TAny* aPtr );
       
    98 
       
    99     private: // Data
       
   100 
       
   101         // Activity manager to follow user activity.
       
   102         CUserActivityManager* iActivityManager;
       
   103         // Indicates is this monitor active
       
   104         TBool iMonitoring;
       
   105     };
       
   106 
       
   107 #endif      // CSATUSERACTIVITYMONITOR_H
       
   108 
       
   109 // End of File