supl/locationomasuplprotocolhandler/protocolhandlerver2/inc/epos_comasupltimeouttimer.h
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:   General purpose class for timeout notification.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_COMASUPLTIMEOUTTIMER_H
       
    21 #define C_COMASUPLTIMEOUTTIMER_H
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 class MOMASuplTimeOutNotifier;
       
    26 
       
    27 enum TTimerPanicCode
       
    28 {
       
    29 	ESuplTimeoutTimerFailed
       
    30 };
       
    31 
       
    32 /**
       
    33 *  This class will notify an object after a specified timeout.
       
    34 *  @lib eposomasuplprotocolhandler.lib
       
    35 *  @since S60 v3.1u
       
    36 */
       
    37 
       
    38 class COMASuplTimeoutTimer : public CTimer
       
    39     {
       
    40 public:
       
    41 			/**
       
    42 			*NewL,Create a COMASuplTimeoutTimer object
       
    43 			*@since S60 v3.1u
       
    44 			*@param aTimeOutNotify object to notify of timeout event
       
    45 			*@return a pointer to the created instance of COMASuplTimeoutTimer
       
    46 			*/
       
    47 			static COMASuplTimeoutTimer* NewL(MOMASuplTimeOutNotifier& aTimeOutNotify);
       
    48 			
       
    49 			/**
       
    50 			*NewLC
       
    51 			*Create a COMASuplTimeoutTimer object
       
    52 			*@since S60 v3.1u
       
    53 			*@param aTimeOutNotify object to notify of timeout event
       
    54 			*@return a pointer to the created instance of COMASuplTimeoutTimer
       
    55 			*/
       
    56 			static COMASuplTimeoutTimer* NewLC(MOMASuplTimeOutNotifier& aTimeOutNotify);
       
    57 			
       
    58 			/**
       
    59 			*~COMASuplTimeoutTimer,Destroy the object and release all memory objects
       
    60 			*@since S60 v3.1u
       
    61 			*@param None
       
    62 			*@return None
       
    63 			*/
       
    64 			~COMASuplTimeoutTimer();
       
    65 
       
    66 protected: // From CTimer
       
    67 
       
    68 			/**
       
    69 			*RunL,Invoked when a timeout occurs
       
    70 			*@since S60 v3.1u
       
    71 			*@param None
       
    72 			*@return None
       
    73 			*/
       
    74 			virtual void RunL();
       
    75 
       
    76 public:
       
    77 
       
    78 			/**
       
    79 			*StartTimer,Starts the timer with specified timeout value
       
    80 			*@since S60 v3.1u
       
    81 			*@param aTimeOut 
       
    82 			*@return None
       
    83 			*/
       
    84 			void StartTimer( const TInt aTimeOut);
       
    85 			
       
    86 			/**
       
    87 			*StopTimer,Cancels  the timer started timer
       
    88 			*@since S60 v3.1u
       
    89 			*@param None 
       
    90 			*@return None
       
    91 			*/
       
    92 			void StopTimer();
       
    93 			
       
    94 			/**
       
    95 			*IsTimerExpired,Checks if Timer expired on last call
       
    96 			*@since S60 v3.1u
       
    97 			*@param TBool, ETrue if it's expired else EFalse
       
    98 			*@return None
       
    99 			*/
       
   100 			TBool IsTimerExpired();
       
   101 
       
   102 private:
       
   103 
       
   104 			/**
       
   105 			*COMASuplTimeoutTimer,Perform the first phase of two phase construction 
       
   106 			*@since S60 v3.1u
       
   107 			*@param aTimeOutNotify An observer to notify
       
   108 			*/
       
   109 			COMASuplTimeoutTimer(MOMASuplTimeOutNotifier& aTimeOutNotify);
       
   110 			
       
   111 			/**
       
   112 			*ConstructL,Perform the second phase construction of a COMASuplTimeoutTimer 
       
   113 			*@since S60 v3.1u
       
   114 			*@param None
       
   115 			*@return None
       
   116 			*/
       
   117 			void ConstructL();
       
   118 
       
   119 private: // Member variables
       
   120 
       
   121 			/** The observer for this objects events */
       
   122 			MOMASuplTimeOutNotifier& iNotify;
       
   123 			
       
   124 			//Is TimerExpired on last call
       
   125 			TBool iTimerExpired;
       
   126     
       
   127     };
       
   128 
       
   129 #endif // C_COMASuplTimeoutTimer_H
       
   130 
       
   131