|
1 /* |
|
2 * Copyright (c) 2004-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 : TStateInactiveMonitoring.h |
|
16 * Part of : NetworkMonitor |
|
17 * See class definition below. |
|
18 * Version : SIP/4.0 |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 /** |
|
26 @internalComponent |
|
27 */ |
|
28 |
|
29 #ifndef __TSTATEINACTIVEMONITORING_H__ |
|
30 #define __TSTATEINACTIVEMONITORING_H__ |
|
31 |
|
32 // INCLUDES |
|
33 #include "TStateBase.h" |
|
34 #include "Lwtimer.h" |
|
35 |
|
36 // CLASS DEFINITION |
|
37 /** |
|
38 * TStateInactiveMonitoring implements the Inactive:Monitoring state |
|
39 */ |
|
40 class TStateInactiveMonitoring |
|
41 : public TStateBase, |
|
42 public MExpirationHandler |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Constructor. |
|
48 * @param aOwner State model that owns us. |
|
49 * @param aContext Reference to SIP connection context |
|
50 */ |
|
51 TStateInactiveMonitoring( MStateModel& aOwner, |
|
52 MSIPConnectionContext& aContext, |
|
53 MTimerManager& aTimer) |
|
54 : TStateBase( aOwner, aContext ), |
|
55 iTimer( aTimer ), |
|
56 iTimerId( 0 ), |
|
57 iLessFatal( 0 ), |
|
58 iRetryCount( 0 ){}; |
|
59 |
|
60 public: // From TStateBase |
|
61 |
|
62 void Enter( TInt aError ); |
|
63 void Exit(); |
|
64 void NetworkStateChanged( MSIPNetworkObserver::TNetworkState aState, |
|
65 TInt aError ); |
|
66 |
|
67 public: // From MExpirationHandler |
|
68 void TimerExpiredL( TTimerId aTimerId, TAny* aTimerParam ); |
|
69 void StartRecovery(TInt aError); |
|
70 |
|
71 private: // new functions. |
|
72 void StartTimer( TInt aTimeout ); |
|
73 void ResetTimer(); |
|
74 |
|
75 private: // Data |
|
76 |
|
77 /// Reference to the global timer manager. |
|
78 MTimerManager& iTimer; |
|
79 /// Handle to our timer (when active) |
|
80 TTimerId iTimerId; |
|
81 TBool iLessFatal; |
|
82 TInt iRetryCount; |
|
83 }; |
|
84 |
|
85 #endif // __TSTATEINACTIVEMONITORING_H__ |