realtimenetprots/sipfw/SIP/TransactionUser/src/TimerBase.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2006-2009 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:
       
    15 * Name          : TimerBase.h
       
    16 * Part of       : TransactionUser
       
    17 * Version       : SIP/6.0
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 
       
    29 #ifndef TIMERBASE_H
       
    30 #define TIMERBASE_H
       
    31 
       
    32 // INCLUDES
       
    33 #include "Lwtimer.h"
       
    34 #include <e32base.h>
       
    35 
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40  * CTimerBase is a base class for all transaction related timers.
       
    41  */
       
    42 class CTimerBase : public CBase
       
    43 	{
       
    44 public: // Destructor
       
    45 
       
    46 	virtual ~CTimerBase();
       
    47 
       
    48 public: // New functions
       
    49 
       
    50 	/**
       
    51 	 * Stops the timer.
       
    52 	 */
       
    53 	void Stop();
       
    54 
       
    55 protected: // Constructors
       
    56 
       
    57 	/**
       
    58 	 * Creates a timer and starts it.
       
    59 	 *
       
    60 	 * Note: since there isn't a StartL() function in the CTimerBase, so if
       
    61 	 * the timer is stopped, it can't be restarted.
       
    62 	 *
       
    63 	 * @param aTimerMgr Timer subsystem
       
    64 	 * @param aObserver Callback for handling timer expiration. Ownership is
       
    65      *  not transferred.
       
    66 	 * @param aDuration Timer duration, in milliseconds	 
       
    67 	 */
       
    68 	CTimerBase(MTimerManager& aTimerMgr,
       
    69 			   MExpirationHandler* aObserver,
       
    70 			   TUint32 aDuration);
       
    71 
       
    72 	void ConstructL();
       
    73 
       
    74 protected: // Data
       
    75 
       
    76     // Provides timer services
       
    77 	MTimerManager& iTimerMgr;
       
    78 
       
    79 	// Timer expiration handler. CTimerBase doesn't implement MExpirationHandler
       
    80 	// itself as it does not know which transaction or UA owns it. Not owned.
       
    81 	MExpirationHandler* iObserver;
       
    82 
       
    83 	// Timer identifier
       
    84 	TTimerId iId;
       
    85 
       
    86 	// Timer duration in milliseconds
       
    87 	TUint32 iDuration;
       
    88 
       
    89 #ifdef CPPUNIT_TEST
       
    90 	friend class CNormalCTa_Trying_Test;
       
    91 	friend class CNormalCTa_Proceeding_Test;
       
    92 	friend class CNormalCTa_Completed_Test;
       
    93 	friend class CNormalSTa_Trying_Test;
       
    94 	friend class CNormalSTa_Proceeding_Test;
       
    95 	friend class CNormalSTa_Completed_Test;
       
    96 	friend class CInviteUAC_Start_Test;
       
    97 	friend class CInviteUAC_ResolveAddress_Test;
       
    98 	friend class CInviteUAC_WaitResponse_Test;
       
    99 	friend class CInviteUAC_WaitAckFromApp_Test;
       
   100 	friend class CInviteUAC_ResolveAckAddress_Test;
       
   101 	friend class CInviteUAC_SendingAck_Test;
       
   102 	friend class CInviteCTa_Calling_Test;
       
   103 	friend class CInviteCTa_Completed_Test;
       
   104 	friend class CTransactionUser_Test;
       
   105 #endif
       
   106 	};
       
   107 
       
   108 #endif // end of TIMERBASE_H
       
   109 
       
   110 // End of File