locationcentre/lcserver/inc/lcservershutdowntimer.h
branchRCL_3
changeset 9 4721bd00d3da
parent 8 3a25f69541ff
child 11 e15b7f06eba6
equal deleted inserted replaced
8:3a25f69541ff 9:4721bd00d3da
     1 /*
       
     2 * Copyright (c) 2007 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 timer for Location Centre server.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_LCSERVERSHUTDOWNTIMER_H
       
    20 #define C_LCSERVERSHUTDOWNTIMER_H
       
    21 
       
    22 // SYSTEM INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 /**
       
    26  *  Shutdown timer for Location Centre Server.
       
    27  *
       
    28  *  This class is used to ensure that Location Centre server does not run
       
    29  *  unnecessarily when there are no outstanding connections. The server object
       
    30  *  uses this class to initiate a timer when there are no connections. If the
       
    31  *  timer is not cancelled before it fires, then this class shuts down the
       
    32  *  Active scheduler hence termination the Location Centre server.
       
    33  *
       
    34  *  @since S60 v5.0
       
    35  */
       
    36 NONSHARABLE_CLASS( CLcServerShutDownTimer ): public CTimer
       
    37     {
       
    38 public:    
       
    39     /**
       
    40      * Constructs a new instance of Location Centre server shut down timer.
       
    41      *
       
    42      * @return The new instance of Location Centre server shut down timer.
       
    43      * @leave System wide error code if the object creation fails.         
       
    44      */
       
    45     static CLcServerShutDownTimer* NewL();
       
    46     
       
    47     /**
       
    48      * Constructs a new instance of Location Centre server shut down timer.
       
    49      * Leaves the created instance on the cleanup stack.
       
    50      *      
       
    51      * @return The new instance of Location Centre server shut down timer.
       
    52      * @leave System wide error code if the object creation fails.         
       
    53      */
       
    54     static CLcServerShutDownTimer* NewLC();        
       
    55 
       
    56     /**
       
    57      * C++ Destructor.
       
    58      * Frees all the resources associated with this Location Centre
       
    59      * server shutdown timer.
       
    60      */
       
    61     virtual ~CLcServerShutDownTimer();
       
    62      
       
    63     /**
       
    64      * Starts the shutdown timer. The funtion doesn't do anything if the
       
    65      * timer is already running.
       
    66      */
       
    67     void StartTimer();
       
    68     
       
    69     /**
       
    70      * Stops an outstanding timer request.
       
    71      */
       
    72     void StopTimer();
       
    73     
       
    74 public: // Inherited from base classes.
       
    75     
       
    76     /**
       
    77      * Inherited from CActive
       
    78      */
       
    79     void RunL();
       
    80     
       
    81     /**
       
    82      * Inherited from CActive
       
    83      */
       
    84     TInt RunError( TInt aError );
       
    85          
       
    86 private:
       
    87     /**
       
    88      * C++ Default constructor.  
       
    89      */
       
    90     CLcServerShutDownTimer();
       
    91     
       
    92     /**
       
    93      * Second phase of the two phase constructor.
       
    94      */
       
    95     void ConstructL();  
       
    96     
       
    97 private:
       
    98     /**
       
    99      * Location Centre Shutdown timer value in MicroSeconds
       
   100      */
       
   101     TInt            iShutDownTimerValue;
       
   102      
       
   103     };
       
   104 
       
   105 #endif // C_LCSERVERSHUTDOWNTIMER_H