|
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 : TStateBase.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 __TSTATEBASE_H__ |
|
30 #define __TSTATEBASE_H__ |
|
31 |
|
32 // INCLUDES |
|
33 #include "MStateModel.h" |
|
34 |
|
35 class MSIPConnectionContext; |
|
36 class CUri8; |
|
37 |
|
38 // CLASS DEFINITION |
|
39 /** |
|
40 * TStateBase implements a state base class |
|
41 */ |
|
42 class TStateBase |
|
43 { |
|
44 protected: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Constructor. |
|
48 * |
|
49 * @param aOwner Reference to state model owning this state. |
|
50 * @param aContext Reference to SIP Connection Context (~CSipConnection) |
|
51 */ |
|
52 TStateBase( MStateModel& aOwner, |
|
53 MSIPConnectionContext& aContext ); |
|
54 |
|
55 /// Virtual destructor (PC-Lint requires this also for a T-class) |
|
56 virtual ~TStateBase() {}; |
|
57 |
|
58 public: // New methods |
|
59 |
|
60 virtual void SendL( const TSIPTransportParams& aParams, |
|
61 CSIPRequest& aRequest, |
|
62 TBool aForceUDP, |
|
63 const CUri8* aOutboundProxy, |
|
64 const TInetAddr& aRemoteAddr, |
|
65 TRequestStatus& aStatus ); |
|
66 |
|
67 virtual void SendL( const TSIPTransportParams& aParams, |
|
68 CSIPResponse& aResponse, |
|
69 TTransactionId aId, |
|
70 TRequestStatus& aStatus ); |
|
71 |
|
72 /** |
|
73 * Called by state model when a state is entered |
|
74 * |
|
75 * @param aError |
|
76 */ |
|
77 virtual void Enter( TInt aError ); |
|
78 |
|
79 /// Called by state model when a state is left |
|
80 virtual void Exit(); |
|
81 |
|
82 /* |
|
83 * Called by state model when it receveis a network monitoring |
|
84 * state change notification. |
|
85 * |
|
86 * @param aState |
|
87 * @param aError |
|
88 */ |
|
89 virtual void NetworkStateChanged( |
|
90 MSIPNetworkObserver::TNetworkState aState, |
|
91 TInt aError ); |
|
92 |
|
93 protected: // New methods |
|
94 |
|
95 /** |
|
96 * |
|
97 */ |
|
98 void EnterState( MStateModel::TState aState, |
|
99 TInt aError = KErrNone ); |
|
100 |
|
101 private: // Constructors |
|
102 |
|
103 /// Default constructor. Not implemented. |
|
104 TStateBase(); |
|
105 |
|
106 protected: // Data |
|
107 |
|
108 /// Reference to state model owning this state. |
|
109 MStateModel& iOwner; |
|
110 |
|
111 /// Reference to SIP Connection Context (~CSipConnection) |
|
112 MSIPConnectionContext& iContext; |
|
113 |
|
114 }; |
|
115 |
|
116 #endif // __TSTATEBASE_H__ |