|
1 /* |
|
2 * Copyright (c) 2007-2008 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: Provides connection for emergency call when necessary |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_SVPEMERGENCYCONNECTION_H |
|
20 #define C_SVPEMERGENCYCONNECTION_H |
|
21 |
|
22 |
|
23 #include <es_sock.h> // For RSocketServ, RConnection |
|
24 #include <commdbconnpref.h> // For TCommDbConnPref |
|
25 #include <comms-infras/es_config.h> // For TSipServerAddrBuf |
|
26 |
|
27 #include "svpemergencyconnectionobserver.h" |
|
28 #include "svputdefs.h" |
|
29 |
|
30 /** |
|
31 * Connection for emergency call. |
|
32 * Asynchronous services: IAP and SNAP connect, retrieval of used IAP ID of |
|
33 * SNAP connection, and retrieval of SIP proxy address. |
|
34 * |
|
35 * @lib svp.dll |
|
36 * @since S60 v3.2 |
|
37 */ |
|
38 class CSVPEmergencyConnection : public CActive |
|
39 { |
|
40 |
|
41 public: |
|
42 |
|
43 /** Request type */ |
|
44 enum TSVPRequestType |
|
45 { |
|
46 ESVPNone, |
|
47 ESVPSnapConnect, |
|
48 ESVPConnect, |
|
49 ESVPSipProxyAddress |
|
50 }; |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 * @param aPriority Active object priority |
|
55 * @param aObserver Observer |
|
56 */ |
|
57 static CSVPEmergencyConnection* NewL( |
|
58 TPriority aPriority, MSVPEmergencyConnectionObserver& aObserver ); |
|
59 |
|
60 static CSVPEmergencyConnection* NewLC( |
|
61 TPriority aPriority, MSVPEmergencyConnectionObserver& aObserver ); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 virtual ~CSVPEmergencyConnection(); |
|
67 |
|
68 /** |
|
69 * Connects with SNAP ID |
|
70 * |
|
71 * @since S60 v3.2 |
|
72 * @param aSnapId SNAP ID |
|
73 */ |
|
74 void ConnectWithSnapIdL( TUint32 aSnapId ); |
|
75 |
|
76 /** |
|
77 * Returns the IAP ID used by the SNAP connection |
|
78 * |
|
79 * @since S60 v3.2 |
|
80 * @param aIapId IAP ID |
|
81 * @return Error code |
|
82 */ |
|
83 TInt IapId( TUint32& aIapId ); |
|
84 |
|
85 /** |
|
86 * Connects with IAP ID |
|
87 * |
|
88 * @since S60 v3.2 |
|
89 * @param aIapId IAP ID |
|
90 */ |
|
91 void ConnectL( TUint32 aIapId ); |
|
92 |
|
93 /** |
|
94 * Requests for SIP proxy address |
|
95 * |
|
96 * @since S60 v3.2 |
|
97 * @param aIapId IAP ID |
|
98 */ |
|
99 void RequestSipProxyAddressL( TUint32 aIapId ); |
|
100 |
|
101 private: |
|
102 |
|
103 CSVPEmergencyConnection( |
|
104 TPriority aPriority, MSVPEmergencyConnectionObserver& aObserver ); |
|
105 |
|
106 void ConstructL(); |
|
107 |
|
108 // from base class CActive |
|
109 |
|
110 void DoCancel(); |
|
111 |
|
112 void RunL(); |
|
113 |
|
114 private: // data |
|
115 |
|
116 /** |
|
117 * Observer |
|
118 */ |
|
119 MSVPEmergencyConnectionObserver& iObserver; |
|
120 |
|
121 /** |
|
122 * Request type |
|
123 */ |
|
124 TSVPRequestType iRequestType; |
|
125 |
|
126 /** |
|
127 * Snap connection preference |
|
128 */ |
|
129 TCommSnapPref iSnapConnPref; |
|
130 |
|
131 /** |
|
132 * Connection preference overrider |
|
133 */ |
|
134 TCommDbConnPref iConnPref; |
|
135 |
|
136 /** |
|
137 * SIP server address buffer |
|
138 */ |
|
139 TSipServerAddrBuf iSipServerAddrBuf; |
|
140 |
|
141 /** |
|
142 * Connection |
|
143 */ |
|
144 RConnection iConnection; |
|
145 |
|
146 /** |
|
147 * Socket server |
|
148 */ |
|
149 RSocketServ iSocketServer; |
|
150 |
|
151 private: |
|
152 |
|
153 // For testing |
|
154 SVP_UT_DEFS |
|
155 |
|
156 }; |
|
157 |
|
158 #endif // C_SVPEMERGENCYCONNECTION_H |