terminalsecurity/SCP/SCPServer/inc/SCPTimer.h
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2000 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: Implementation of terminalsecurity components
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SCPTIMER_H
       
    20 #define SCPTIMER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <bldvariant.hrh>
       
    24 #include <e32base.h>
       
    25 
       
    26 /**
       
    27 *  An interface class that specifies the type of the callback function
       
    28 */
       
    29 class MSCPTimeoutHandler
       
    30     {	    
       
    31 	public:
       
    32 	
       
    33 	/**
       
    34     * This method is called when the timer expires
       
    35     * @param aParam The parameter given to the timer when initialized.
       
    36     */  
       
    37 	virtual void Timeout( TAny* aParam ) = 0;
       
    38 	};
       
    39 
       
    40 
       
    41 /**
       
    42 *  A base class for the active objects responsible for the lock phone functionality
       
    43 */
       
    44 class CSCPTimer : public CActive
       
    45 	{		
       
    46 	public:  // Methods
       
    47 
       
    48         // Constructors and destructor                
       
    49         
       
    50         /**
       
    51         * Static constructor.
       
    52         */
       
    53    	    static CSCPTimer* NewL( TUint aTimeout, TAny* aParam,
       
    54    	        MSCPTimeoutHandler* aHandler );
       
    55         
       
    56         /**
       
    57         * Static constructor, that leaves the pointer to the cleanup stack.
       
    58         */
       
    59         static CSCPTimer* NewLC( TUint aTimeout, TAny* aParam, 
       
    60             MSCPTimeoutHandler* aHandler );         
       
    61 
       
    62         /**
       
    63         * Destructor.
       
    64         */
       
    65         virtual ~CSCPTimer();
       
    66 
       
    67                 
       
    68     protected:  // Methods
       
    69                         
       
    70         // Methods from base classes       
       
    71         
       
    72         /**
       
    73         * From CActive The AO worker method. Called when the timer expires.
       
    74         */
       
    75         void RunL();   
       
    76         
       
    77         /**
       
    78         * From CActive The AO cancellation method.
       
    79         */
       
    80         void DoCancel();
       
    81         
       
    82         
       
    83     private: //Methods 
       
    84         
       
    85         // New Methods   
       
    86                            
       
    87         /**
       
    88         * C++ default constructor.
       
    89         */
       
    90         CSCPTimer( TAny* aParam, MSCPTimeoutHandler* aHandler );
       
    91         
       
    92         /**
       
    93         * Symbian second-phase constructor
       
    94         */
       
    95         void ConstructL( TUint aTimeout );           
       
    96           
       
    97     private:   // Data 
       
    98         /** The timer handle */
       
    99         RTimer iTimer; 
       
   100         /** The parameter given when instanciated (not owned) */                                      
       
   101         TAny*   iParam;        
       
   102         /** A pointer to the timeout handler (not owned) */
       
   103         MSCPTimeoutHandler* iHandler;        
       
   104     };
       
   105 
       
   106 #endif      // SCPTIMER_H   
       
   107             
       
   108 // End of File
       
   109