|
1 /* |
|
2 * Copyright (c) 2002 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: implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 |
|
21 #include "sipprofile.h" |
|
22 #include "sipmanagedprofile.h" |
|
23 #include "sipprofileregistry.h" |
|
24 #include "sipmanagedprofileregistry.h" |
|
25 |
|
26 /* |
|
27 |
|
28 //#include "sipconcreteprofile.h" |
|
29 //#include "SIPProfileTypeInfo.h" |
|
30 //_LIT8(KSIPProfileExtenstionParameter, "%u"); |
|
31 //const TUint KProfileBufferSize = 25; |
|
32 |
|
33 _LIT8(KSIPProfileDefAOR, "user@aa"); |
|
34 /** |
|
35 * Sets profile parameter |
|
36 * @param aParam a parameter to set |
|
37 * @param aVal values to set; an empty array resets the value |
|
38 * @return KErrNotFound if parameter was not found, |
|
39 * KErrNoMemory if out of memory |
|
40 * KErrNone otherwise |
|
41 */ |
|
42 EXPORT_C TInt CSIPManagedProfile::SetParameter( TUint32 /*aParam*/, |
|
43 const MDesC8Array& /*aVal*/ ) |
|
44 { |
|
45 return KErrNone; |
|
46 } |
|
47 |
|
48 // ============================ MEMBER FUNCTIONS =============================== |
|
49 |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // CSIPManagedProfile::NewL |
|
53 // Two-phased constructor. |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 CSIPManagedProfile* CSIPManagedProfile::NewL(CSIPManagedProfileRegistry* aSIPRegistry) |
|
57 { |
|
58 CSIPManagedProfile* self = CSIPManagedProfile::NewLC (aSIPRegistry); |
|
59 CleanupStack::Pop(); |
|
60 return self; |
|
61 } |
|
62 |
|
63 // ----------------------------------------------------------------------------- |
|
64 // CSIPManagedProfile::NewLC |
|
65 // Two-phased constructor. |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 CSIPManagedProfile* CSIPManagedProfile::NewLC(CSIPManagedProfileRegistry* aSIPRegistry) |
|
69 { |
|
70 CSIPManagedProfile* self = new(ELeave)CSIPManagedProfile(aSIPRegistry); |
|
71 CleanupStack::PushL (self); |
|
72 self->ConstructL (); |
|
73 return self; |
|
74 } |
|
75 |
|
76 // ----------------------------------------------------------------------------- |
|
77 // CSIPManagedProfile::~CSIPManagedProfile |
|
78 // ----------------------------------------------------------------------------- |
|
79 // |
|
80 EXPORT_C CSIPManagedProfile::~CSIPManagedProfile() |
|
81 { |
|
82 } |
|
83 /* |
|
84 // ----------------------------------------------------------------------------- |
|
85 // CSIPManagedProfile::GetParameter |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 EXPORT_C TInt CSIPManagedProfile::GetParameter(TUint32 aParam, TDesC8 const *& aVal ) const |
|
89 { |
|
90 const TDesC8& val= KSIPProfileDefAOR; |
|
91 aVal = &val; |
|
92 return KErrNone; |
|
93 } |
|
94 |
|
95 // ----------------------------------------------------------------------------- |
|
96 // CSIPManagedProfile::GetParameter |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 EXPORT_C TInt CSIPManagedProfile::GetParameter(TUint32 aParam, TUint32& aVal) const |
|
100 { |
|
101 aVal = 1; |
|
102 return KErrNone; |
|
103 } |
|
104 |
|
105 // ----------------------------------------------------------------------------- |
|
106 // CSIPManagedProfile::GetParameter |
|
107 // ----------------------------------------------------------------------------- |
|
108 // |
|
109 EXPORT_C TInt CSIPManagedProfile::GetParameter(TUint32 aParam, TBool& aVal) const |
|
110 { |
|
111 aVal = ETrue; |
|
112 return KErrNone; |
|
113 } |
|
114 */ |
|
115 // ----------------------------------------------------------------------------- |
|
116 // CSIPManagedProfile::CSIPManagedProfile |
|
117 // ----------------------------------------------------------------------------- |
|
118 // |
|
119 CSIPManagedProfile::CSIPManagedProfile(CSIPManagedProfileRegistry* aRegistry) |
|
120 : CSIPProfile( aRegistry ), |
|
121 iProfileReg( aRegistry ) |
|
122 { |
|
123 } |
|
124 |
|
125 /* |
|
126 // ----------------------------------------------------------------------------- |
|
127 // CSIPManagedProfile::IsContextActive |
|
128 // ----------------------------------------------------------------------------- |
|
129 // |
|
130 TBool CSIPManagedProfile::IsContextActive() const |
|
131 { |
|
132 return ETrue; |
|
133 } |
|
134 |
|
135 // ----------------------------------------------------------------------------- |
|
136 // CSIPManagedProfile::ContextId |
|
137 // ----------------------------------------------------------------------------- |
|
138 // |
|
139 TUint32 CSIPManagedProfile::ContextId() const |
|
140 { |
|
141 return 1; |
|
142 } |
|
143 */ |
|
144 |
|
145 // ----------------------------------------------------------------------------- |
|
146 // CSIPManagedProfile::SetParameterL |
|
147 // ----------------------------------------------------------------------------- |
|
148 // |
|
149 TInt CSIPManagedProfile::SetParameter(TUint32 aParam, const TDesC8& aVal) |
|
150 { |
|
151 switch (aParam) |
|
152 { |
|
153 case KSIPProviderName: |
|
154 iProviderNameValue=aVal; |
|
155 break; |
|
156 case KSIPUserAor: |
|
157 iUserAorValue=aVal; |
|
158 break; |
|
159 case KSIPPrivateIdentity: |
|
160 case KSIPProfileId: |
|
161 case KSIPAccessPointId: |
|
162 case KSIPSigComp: |
|
163 case KSIPSecurityNegotiation: |
|
164 case KSIPAutoRegistration: |
|
165 case KSIPProfileRegistered: |
|
166 case KSIPRegisteredAors: |
|
167 case KSIPNegotiatedSecurityMechanism: |
|
168 case KSIPDefaultProfile: |
|
169 case KSIPContactHeaderParams: |
|
170 case KSIPRegistrar: |
|
171 case KSIPOutboundProxy: |
|
172 case KSIPDigestUserName: |
|
173 case KSIPDigestRealm: |
|
174 case KSIPServerAddress: |
|
175 case KSIPDigestPassword: |
|
176 case KSIPHeaders: |
|
177 case KSIPSoIpTOS: |
|
178 return KErrNotFound; |
|
179 case KSIPContactHeaderUser: |
|
180 return KErrAccessDenied; |
|
181 default: |
|
182 break; |
|
183 } |
|
184 |
|
185 return KErrNone; |
|
186 |
|
187 } |
|
188 |
|
189 // ----------------------------------------------------------------------------- |
|
190 // CSIPManagedProfile::SetParameterL |
|
191 // ----------------------------------------------------------------------------- |
|
192 // |
|
193 TInt CSIPManagedProfile::SetParameter(TUint32 aParam, TUint32 aVal) |
|
194 { |
|
195 switch (aParam) |
|
196 { |
|
197 case KSIPAccessPointId: |
|
198 iAccessPointIdValue=aVal; |
|
199 break; |
|
200 case KSIPProfileId: |
|
201 case KSIPProviderName: |
|
202 case KSIPSigComp: |
|
203 case KSIPSecurityNegotiation: |
|
204 case KSIPAutoRegistration: |
|
205 case KSIPUserAor: |
|
206 case KSIPProfileRegistered: |
|
207 case KSIPRegisteredAors: |
|
208 case KSIPNegotiatedSecurityMechanism: |
|
209 case KSIPDefaultProfile: |
|
210 case KSIPContactHeaderParams: |
|
211 case KSIPRegistrar: |
|
212 case KSIPOutboundProxy: |
|
213 case KSIPDigestUserName: |
|
214 case KSIPDigestRealm: |
|
215 case KSIPServerAddress: |
|
216 case KSIPPrivateIdentity: |
|
217 case KSIPDigestPassword: |
|
218 case KSIPHeaders: |
|
219 case KSIPContactHeaderUser: |
|
220 return KErrNotFound; |
|
221 default: |
|
222 break; |
|
223 } |
|
224 |
|
225 return KErrNone; |
|
226 } |
|
227 |
|
228 // ----------------------------------------------------------------------------- |
|
229 // CSIPManagedProfile::SetParameterL |
|
230 // ----------------------------------------------------------------------------- |
|
231 // |
|
232 TInt CSIPManagedProfile::SetParameter(TUint32 aParam, TBool aVal) |
|
233 { |
|
234 switch (aParam) |
|
235 { |
|
236 case KSIPSigComp: |
|
237 iSigCompValue=aVal; |
|
238 break; |
|
239 case KSIPAutoRegistration: |
|
240 iAutoRegistrationValue=aVal; |
|
241 break; |
|
242 case KSIPSecurityNegotiation: |
|
243 iSecurityNegotiationValue=aVal; |
|
244 break; |
|
245 case KSIPDefaultProfile: |
|
246 case KSIPProfileId: |
|
247 case KSIPProviderName: |
|
248 case KSIPAccessPointId: |
|
249 case KSIPUserAor: |
|
250 case KSIPProfileRegistered: |
|
251 case KSIPRegisteredAors: |
|
252 case KSIPNegotiatedSecurityMechanism: |
|
253 case KSIPContactHeaderParams: |
|
254 case KSIPRegistrar: |
|
255 case KSIPOutboundProxy: |
|
256 case KSIPDigestUserName: |
|
257 case KSIPDigestRealm: |
|
258 case KSIPServerAddress: |
|
259 case KSIPPrivateIdentity: |
|
260 case KSIPDigestPassword: |
|
261 case KSIPHeaders: |
|
262 case KSIPContactHeaderUser: |
|
263 case KSIPSoIpTOS: |
|
264 return KErrNotFound; |
|
265 default: |
|
266 break; |
|
267 } |
|
268 |
|
269 return KErrNone; |
|
270 } |
|
271 |
|
272 |
|
273 // ----------------------------------------------------------------------------- |
|
274 // CSIPManagedProfile::SetParameterL |
|
275 // ----------------------------------------------------------------------------- |
|
276 // |
|
277 TInt CSIPManagedProfile::SetParameter(TUint32 aServerType, TUint32 aParam, |
|
278 const TDesC8& aVal) |
|
279 { |
|
280 switch (aParam) |
|
281 { |
|
282 case KSIPDigestPassword: |
|
283 if (aServerType == KSIPOutboundProxy) |
|
284 { |
|
285 iProxyPassword = aVal; |
|
286 } |
|
287 else // KSIPRegistrar |
|
288 { |
|
289 iRegistrarPassword = aVal; |
|
290 } |
|
291 break; |
|
292 |
|
293 default: |
|
294 break; |
|
295 } |
|
296 return KErrNone; |
|
297 } |
|
298 |
|
299 void CSIPManagedProfile::SetType(const TSIPProfileTypeInfo& /*aSIPProfileTypeInfo*/) |
|
300 { |
|
301 |
|
302 } |
|
303 |
|
304 CSIPManagedProfile* CSIPManagedProfile::CloneL() const |
|
305 { |
|
306 //const CSIPManagedProfile* temp = this; |
|
307 //return new (ELeave) CSIPManagedProfile(*this); |
|
308 //return this; |
|
309 CSIPManagedProfile* rValue = |
|
310 CSIPManagedProfile::NewLC( iProfileReg ); |
|
311 |
|
312 return rValue; |
|
313 } |