|
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 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __RFSPDPOBSERVER_H |
|
20 #define __RFSPDPOBSERVER_H |
|
21 |
|
22 |
|
23 enum TRfsConnectionCloseState |
|
24 { |
|
25 ESipConnectionClose, |
|
26 EPdpConnectionClose // this should be the last enum |
|
27 }; |
|
28 |
|
29 NONSHARABLE_CLASS( CRfsConnectionObserver ): CActive |
|
30 { |
|
31 public: |
|
32 |
|
33 /** |
|
34 * Two-phased constructor |
|
35 */ |
|
36 static CRfsConnectionObserver* NewLC(); |
|
37 |
|
38 /** |
|
39 * Destructor |
|
40 */ |
|
41 virtual ~CRfsConnectionObserver(); |
|
42 |
|
43 public: |
|
44 /** |
|
45 * New methods |
|
46 */ |
|
47 |
|
48 /** |
|
49 * Closes PDP connection. |
|
50 * A wait dialog is shown while the connection is torn down. |
|
51 * |
|
52 * @since S60 v3.1 |
|
53 * @return ETrue if connection was succesfully closed |
|
54 */ |
|
55 TBool CloseAlwaysOnConnectionL(); |
|
56 |
|
57 /** |
|
58 * Re-opens connection in case user does not confirm RFS. |
|
59 * |
|
60 * @since S60 v3.1 |
|
61 */ |
|
62 void ReOpenPDPConnection(); |
|
63 void ReportRfsFailureToSip(); |
|
64 void ReportRfsCompletionToSip(); |
|
65 |
|
66 private: |
|
67 |
|
68 /** |
|
69 * From base class CActive |
|
70 */ |
|
71 |
|
72 /** |
|
73 * From CActive |
|
74 * |
|
75 * @since S60 v3.1 |
|
76 */ |
|
77 void RunL(); |
|
78 |
|
79 /** |
|
80 * From CActive |
|
81 * |
|
82 * @since S60 v3.1 |
|
83 */ |
|
84 void DoCancel(); |
|
85 |
|
86 private: |
|
87 |
|
88 /** |
|
89 * New methods |
|
90 */ |
|
91 |
|
92 /** |
|
93 * Subscribes PDP property |
|
94 * |
|
95 * @since S60 v3.1 |
|
96 */ |
|
97 void Subscribe(); |
|
98 |
|
99 /** |
|
100 * Dismisses closing connections dialog |
|
101 * |
|
102 * @since S60 v3.1 |
|
103 */ |
|
104 void DismissWaitDialog(); |
|
105 |
|
106 /** |
|
107 * 2nd phase constructor |
|
108 * |
|
109 * @since S60 v3.1 |
|
110 */ |
|
111 void ConstructL(); |
|
112 |
|
113 /** |
|
114 * C++ constructor |
|
115 * |
|
116 * @since S60 v3.1 |
|
117 */ |
|
118 CRfsConnectionObserver(); |
|
119 |
|
120 /** |
|
121 * Returns information whether PDP context's Always |
|
122 * online feature is enabled or not |
|
123 */ |
|
124 TInt IsAlwaysOnFeatureEnabledL(); |
|
125 |
|
126 private: |
|
127 |
|
128 /** |
|
129 * Own: Wait dialog |
|
130 */ |
|
131 CAknWaitDialog* iWaitDialog; |
|
132 |
|
133 /** |
|
134 * Own: PDP property |
|
135 */ |
|
136 RProperty iPDPProperty; |
|
137 |
|
138 /** |
|
139 * Own: SIP property |
|
140 */ |
|
141 RProperty iSIPProperty; |
|
142 |
|
143 /** |
|
144 * Following are status flags used to synchronize the code |
|
145 * of publishing the active connection close information to |
|
146 * SIP and PDP. Also they are used to decide the proper execution |
|
147 * of the code in the four cases recognized and can be possible |
|
148 * for the devices. These four cases are |
|
149 * |
|
150 * CASE 1: SIP Key defined, PDP Key not defined |
|
151 * CASE 2: SIP Key defined, PDP key defined |
|
152 * CASE 3. SIP key not defined, PDP key not defined |
|
153 * CASE 4: SIP key not defined, PDP key defined |
|
154 * |
|
155 * N.B The presence of definition the P&S keys gives us the information |
|
156 * whether there will be potential active connections ON. |
|
157 * In that case we need to do the following |
|
158 * 1. Close all active connections |
|
159 * 2. Meanwhile display a WAIT FOR dialog to the user which he can CANCEL at any moment |
|
160 * 3. If failure occurs or if user presses the Cancel Key then cancel the RFS operation |
|
161 */ |
|
162 TBool iAllConnectionClosed; |
|
163 TBool iIsWaitForDialogExecuted; |
|
164 TInt iIsPDPFeatureEnabled; |
|
165 TBool iIsSIPConnectionsPresent; |
|
166 TBool iIsDialogNeedToBeDisplayed; |
|
167 TBool iIsSipInformedForClosingAllConnection; |
|
168 TBool iIsPDPInformedforClosingAllConnection; |
|
169 TBool iIsClosingConnectionsApplicable; |
|
170 |
|
171 TRfsConnectionCloseState iState; |
|
172 }; |
|
173 |
|
174 #endif //RFSPDPOBSERVER_H |