accessoryservices/accessoryserver/inc/ChargerContext/AccSrvResetInactivityTimeTimer.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2008-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:  Timer for calling User::ResetInactivityTimer() function frequently.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_ACCSRVRESETINACTIVITYTIMETIMER_H
       
    21 #define C_ACCSRVRESETINACTIVITYTIMETIMER_H
       
    22 
       
    23 
       
    24 
       
    25 #include <e32base.h>
       
    26 
       
    27 
       
    28 #include "ResetInactivityTimeTimerObserver.h"
       
    29 
       
    30 
       
    31 /**  Timer value must be lower than keylock timers minimun value, i.e. < 5 seconds */
       
    32 const TInt KResetInactivityTimerValueDefault    = 4800000;
       
    33 
       
    34 
       
    35 /**
       
    36  *  Timer class for calling User::ResetInactivityTime() frequently.
       
    37  *  
       
    38  *
       
    39  *  @code
       
    40  *   ?good_class_usage_example(s)
       
    41  *  @endcode
       
    42  *
       
    43  *  @lib AccServer.exe
       
    44  *  @since S60 5.1
       
    45  */
       
    46 NONSHARABLE_CLASS(  CAccSrvResetInactivityTimeTimer ): public CTimer
       
    47     {
       
    48 
       
    49 public:
       
    50 
       
    51 
       
    52     /**
       
    53     * Two-phased constructor.
       
    54     * @param aResetInactivityTimeTimerObserver Observer callback interface.
       
    55     */
       
    56     static CAccSrvResetInactivityTimeTimer* NewL(
       
    57             MResetActivityTimeTimerObserver* aResetInactivityTimeTimerObserver );
       
    58 
       
    59     /**
       
    60     * Destructor.
       
    61     */
       
    62     virtual ~CAccSrvResetInactivityTimeTimer();
       
    63 
       
    64     /**
       
    65      * Starts the timer.
       
    66      * @since S60 5.1
       
    67      * @param aTime Time out value.
       
    68      * @return void
       
    69      */
       
    70      void StartTimer( TInt aTime = KResetInactivityTimerValueDefault );
       
    71 
       
    72 
       
    73 protected:
       
    74 
       
    75     /**
       
    76      * From CActive.
       
    77      * Handles an active object's request completion event.
       
    78      *
       
    79      * @since S60 5.1
       
    80      * @param void
       
    81      */
       
    82    void RunL();
       
    83     
       
    84    /**
       
    85     * From CActive.
       
    86     * Handles RunL's leave cases
       
    87     *
       
    88     * @since S60 5.1
       
    89     * @param aError Error code.
       
    90     */
       
    91    TInt RunError( TInt aError );
       
    92 
       
    93 
       
    94 private:
       
    95 
       
    96     /**
       
    97     * C++ default constructor.
       
    98     * @param aResetInactivityTimeTimerObserver Observer callback interface.
       
    99     */
       
   100     CAccSrvResetInactivityTimeTimer(
       
   101     MResetActivityTimeTimerObserver* aResetInactivityTimeTimerObserver );
       
   102 
       
   103     /**
       
   104      * By default Symbian OS constructor is private.
       
   105      * @param none.
       
   106      */
       
   107     void ConstructL();
       
   108 
       
   109 
       
   110 private: // data
       
   111 
       
   112 
       
   113     /**
       
   114      * TimeOut time
       
   115      */
       
   116     TInt iTime; // 
       
   117 
       
   118     /**
       
   119      * Pointer to ResetInactivityTimeTimerObserver object.
       
   120      * Not own.
       
   121      */
       
   122     MResetActivityTimeTimerObserver* iResetInactivityTimeTimerObserver;
       
   123 
       
   124     };
       
   125 
       
   126 
       
   127 #endif // C_ACCSRVRESETINACTIVITYTIMETIMER_H