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 "sipconcreteprofile.h" |
|
25 //#include "SIPProfileTypeInfo.h" |
|
26 //_LIT8(KSIPProfileExtenstionParameter, "%u"); |
|
27 //const TUint KProfileBufferSize = 25; |
|
28 |
|
29 _LIT8(KSIPProfileDefAOR, "user@aa"); |
|
30 |
|
31 // ============================ MEMBER FUNCTIONS =============================== |
|
32 |
|
33 |
|
34 // ----------------------------------------------------------------------------- |
|
35 // CSIPProfile::NewL |
|
36 // Two-phased constructor. |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 CSIPProfile* CSIPProfile::NewL(CSIPProfileRegistry* aSIPRegistry) |
|
40 { |
|
41 CSIPProfile* self = CSIPProfile::NewLC (aSIPRegistry); |
|
42 CleanupStack::Pop(); |
|
43 return self; |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CSIPProfile::NewLC |
|
48 // Two-phased constructor. |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 CSIPProfile* CSIPProfile::NewLC(CSIPProfileRegistry* aSIPRegistry) |
|
52 { |
|
53 CSIPProfile* self = new(ELeave)CSIPProfile(aSIPRegistry); |
|
54 CleanupStack::PushL (self); |
|
55 self->ConstructL (); |
|
56 return self; |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CSIPProfile::~CSIPProfile |
|
61 // ----------------------------------------------------------------------------- |
|
62 // |
|
63 EXPORT_C CSIPProfile::~CSIPProfile() |
|
64 { |
|
65 delete iArray; |
|
66 } |
|
67 |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 // ----------------------------------------------------------------------------- |
|
71 // |
|
72 EXPORT_C const TSIPProfileTypeInfo& CSIPProfile::Type() const |
|
73 { |
|
74 return iTypeInfo; |
|
75 } |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // CSIPProfile::GetParameter |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 EXPORT_C TInt CSIPProfile::GetParameter( TUint32 /*aParam*/, |
|
82 TDesC8 const *& aVal ) const |
|
83 { |
|
84 const TDesC8& val= KSIPProfileDefAOR; |
|
85 aVal = &val; |
|
86 return KErrNone; |
|
87 } |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // CSIPProfile::GetParameter |
|
91 // ----------------------------------------------------------------------------- |
|
92 // |
|
93 EXPORT_C TInt CSIPProfile::GetParameter(TUint32 aParam, TUint32& aVal) const |
|
94 { |
|
95 CSIPProfileBehaviorTls* tls = CSIPProfileBehaviorTls::Storage(); |
|
96 if ( tls ) |
|
97 { |
|
98 if ( tls->iProfileBehavior == KSIPProfileIdFetchFails && |
|
99 aParam == KSIPProfileId ) |
|
100 { |
|
101 return KErrNotFound; |
|
102 } |
|
103 else if ( tls->iProfileBehavior == KSIPIapIdFetchFails && |
|
104 aParam == KSIPAccessPointId ) |
|
105 { |
|
106 return KErrNotFound; |
|
107 } |
|
108 } |
|
109 |
|
110 if ( iTUint32ValueError == KErrNone ) |
|
111 { |
|
112 aVal = iTUint32Value; |
|
113 } |
|
114 return iTUint32ValueError; |
|
115 } |
|
116 |
|
117 // ----------------------------------------------------------------------------- |
|
118 // CSIPProfile::GetParameter |
|
119 // ----------------------------------------------------------------------------- |
|
120 // |
|
121 EXPORT_C TInt CSIPProfile::GetParameter(TUint32 aParam, TBool& aVal) const |
|
122 { |
|
123 if ( iTBoolValueError == KErrNone ) |
|
124 { |
|
125 if ( aParam == KSIPDefaultProfile ) |
|
126 { |
|
127 aVal = iIsDefaultProfile; |
|
128 } |
|
129 else |
|
130 { |
|
131 aVal = iTBoolValue; |
|
132 } |
|
133 } |
|
134 |
|
135 return iTBoolValueError; |
|
136 } |
|
137 |
|
138 |
|
139 // ----------------------------------------------------------------------------- |
|
140 // CSIPProfile::GetParameter |
|
141 // ----------------------------------------------------------------------------- |
|
142 // |
|
143 EXPORT_C TInt CSIPProfile::GetParameter( TUint32 /*aParam*/, |
|
144 MDesC8Array const *& aVal) const |
|
145 { |
|
146 if ( iArray ) |
|
147 { |
|
148 aVal = iArray; |
|
149 } |
|
150 else |
|
151 { |
|
152 aVal = NULL; |
|
153 } |
|
154 return KErrNone; |
|
155 } |
|
156 |
|
157 |
|
158 // ----------------------------------------------------------------------------- |
|
159 // CSIPProfile::CSIPProfile |
|
160 // ----------------------------------------------------------------------------- |
|
161 // |
|
162 CSIPProfile::CSIPProfile(CSIPProfileRegistryBase* aRegistry): |
|
163 iSIPProfileRegistry(aRegistry), |
|
164 iEnabled(EFalse), |
|
165 iTUint32Value( 1 ), |
|
166 iTUint32ValueError( KErrNone ), |
|
167 iTBoolValue( ETrue ), |
|
168 iTBoolValueError( KErrNone ), |
|
169 iIsDefaultProfile( EFalse ) |
|
170 { |
|
171 iTypeInfo.iSIPProfileClass = TSIPProfileTypeInfo::EInternet; |
|
172 } |
|
173 |
|
174 // ----------------------------------------------------------------------------- |
|
175 // CSIPProfile::ConstructL |
|
176 // ----------------------------------------------------------------------------- |
|
177 // |
|
178 void CSIPProfile::ConstructL() |
|
179 { |
|
180 } |
|
181 |
|
182 // ----------------------------------------------------------------------------- |
|
183 // CSIPProfile::IsContextActive |
|
184 // ----------------------------------------------------------------------------- |
|
185 // |
|
186 TBool CSIPProfile::IsContextActive() const |
|
187 { |
|
188 return ETrue; |
|
189 } |
|
190 |
|
191 // ----------------------------------------------------------------------------- |
|
192 // CSIPProfile::ContextId |
|
193 // ----------------------------------------------------------------------------- |
|
194 // |
|
195 TUint32 CSIPProfile::ContextId() const |
|
196 { |
|
197 return 1; |
|
198 } |
|