supl/locationomasuplprotocolhandler/protocolhandlerver1/inc/epos_comasupldialogtimer.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_COMASUPLDIALOGTIMER_H
       
    21 #define C_COMASUPLDIALOGTIMER_H
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 class MOMASuplDialogTimeOutNotifier;
       
    26 
       
    27 enum TDialogTimerPanicCode
       
    28 {
       
    29 	ESuplDialogTimeoutTimerFailed
       
    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 COMASuplDialogTimer : public CTimer
       
    39     {
       
    40 public:
       
    41 			/**
       
    42 			*NewL,Create a COMASuplDialogTimer 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 COMASuplDialogTimer* NewL(MOMASuplDialogTimeOutNotifier& 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 COMASuplDialogTimer* NewLC(MOMASuplDialogTimeOutNotifier& 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 			~COMASuplDialogTimer();
       
    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 			TBool IsTimerStarted();
       
   103 
       
   104 private:
       
   105 
       
   106 			/**
       
   107 			*COMASuplTimeoutTimer,Perform the first phase of two phase construction 
       
   108 			*@since S60 v3.1u
       
   109 			*@param aTimeOutNotify An observer to notify
       
   110 			*/
       
   111 			COMASuplDialogTimer(MOMASuplDialogTimeOutNotifier& aTimeOutNotify);
       
   112 			
       
   113 			/**
       
   114 			*ConstructL,Perform the second phase construction of a COMASuplTimeoutTimer 
       
   115 			*@since S60 v3.1u
       
   116 			*@param None
       
   117 			*@return None
       
   118 			*/
       
   119 			void ConstructL();
       
   120 
       
   121 private: // Member variables
       
   122 
       
   123 			/** The observer for this objects events */
       
   124 			MOMASuplDialogTimeOutNotifier& iNotify;
       
   125 			
       
   126 			//Is TimerExpired on last call
       
   127 			TBool iTimerExpired;
       
   128 			
       
   129 			
       
   130     
       
   131     };
       
   132 
       
   133 #endif // C_COMASuplDialogTimer_H
       
   134 
       
   135