|
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 : TStateInactiveConnecting.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 __TSTATEINACTIVECONNECTING_H__ |
|
30 #define __TSTATEINACTIVECONNECTING_H__ |
|
31 |
|
32 // INCLUDES |
|
33 #include "TStateBase.h" |
|
34 #include "Lwtimer.h" |
|
35 |
|
36 // CLASS DEFINITION |
|
37 /** |
|
38 * TStateInactiveConnecting implements the Inactive:Connecting state |
|
39 */ |
|
40 class TStateInactiveConnecting |
|
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 TStateInactiveConnecting( MStateModel& aOwner, |
|
52 MSIPConnectionContext& aContext, |
|
53 MTimerManager& aTimer ) |
|
54 : TStateBase( aOwner, aContext ), |
|
55 iTimer( aTimer ), |
|
56 iTimerId( 0 ) {}; |
|
57 |
|
58 public: // From TStateBase |
|
59 |
|
60 void Enter( TInt aError ); |
|
61 void Exit(); |
|
62 void NetworkStateChanged( MSIPNetworkObserver::TNetworkState aState, |
|
63 TInt aError ); |
|
64 |
|
65 public: // From MExpirationHandler |
|
66 |
|
67 void TimerExpiredL( TTimerId aTimerId, TAny* aTimerParam ); |
|
68 |
|
69 private: // New functions |
|
70 |
|
71 void OpenConnection(); |
|
72 void StartTimer( TInt aTimeout ); |
|
73 |
|
74 private: // Data |
|
75 |
|
76 /// Reference to the global timer manager. |
|
77 MTimerManager& iTimer; |
|
78 |
|
79 /// Handle to our timer (when active) |
|
80 TTimerId iTimerId; |
|
81 }; |
|
82 |
|
83 #endif // __TSTATEINACTIVECONNECTING_H__ |