|
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: Handles Vcc settings in provisioning. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_WPVCCADAPTER_H |
|
21 #define C_WPVCCADAPTER_H |
|
22 |
|
23 #include <CWPAdapter.h> |
|
24 #include <MWPContextExtension.h> |
|
25 |
|
26 #include "vccunittesting.h" |
|
27 #include <sipprofileregistryobserver.h> |
|
28 |
|
29 class CWPCharacteristic; |
|
30 class CVccSPSettings; |
|
31 |
|
32 /** |
|
33 * CVccAdapter handles Vcc settings received via provisioning framework. |
|
34 * |
|
35 * CVccAdapter is a plugin for provisioning framework. It indicates to |
|
36 * framwork that it is interested in Vcc settings, and when they're |
|
37 * available CVccAdapter stores them into instance of CVccItem. |
|
38 * |
|
39 * @lib wpvccadapter |
|
40 * @since S60 3.2 |
|
41 */ |
|
42 class CWPVccAdapter : public CWPAdapter, public MWPContextExtension, public MSIPProfileRegistryObserver |
|
43 { |
|
44 |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Symbian OS two-phased constructor |
|
49 */ |
|
50 static CWPVccAdapter* NewL(); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 virtual ~CWPVccAdapter(); |
|
56 |
|
57 // from base class CWPAdapter |
|
58 |
|
59 /** |
|
60 * @see CWPAdapter::ItemCount() |
|
61 */ |
|
62 TInt ItemCount() const; |
|
63 |
|
64 /** |
|
65 * @see CWPAdapter::SummaryTitle() |
|
66 */ |
|
67 const TDesC16& SummaryTitle( TInt aIndex ) const; |
|
68 |
|
69 /** |
|
70 * @see CWPAdapter::SummaryText() |
|
71 */ |
|
72 const TDesC16& SummaryText( TInt aIndex ) const; |
|
73 |
|
74 /** |
|
75 * @see CWPAdapter::SaveL() |
|
76 */ |
|
77 void SaveL( TInt aIndex ); |
|
78 |
|
79 /** |
|
80 * @see CWPAdapter::CanSetAsDefault() |
|
81 */ |
|
82 TBool CanSetAsDefault( TInt aIndex ) const; |
|
83 |
|
84 /** |
|
85 * @see CWPAdapter::SetAsDefaultL() |
|
86 */ |
|
87 void SetAsDefaultL( TInt aIndex ); |
|
88 |
|
89 /** |
|
90 * @see CWPAdapter::DetailsL() |
|
91 */ |
|
92 TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor ); |
|
93 |
|
94 /** |
|
95 * @see CWPAdapter::ContextExtension() |
|
96 */ |
|
97 TInt ContextExtension( MWPContextExtension*& aExtension ); |
|
98 |
|
99 /** |
|
100 * @see CWPAdapter::SettingsSavedL() |
|
101 */ |
|
102 void SettingsSavedL(const TDesC8& aAppIdOfSavingItem, |
|
103 const TDesC8& aAppRef, |
|
104 const TDesC8& aStorageIdValue); |
|
105 |
|
106 // From base class MWPVisitor |
|
107 |
|
108 /** |
|
109 * @see MWPVisitor::VisitL() |
|
110 */ |
|
111 void VisitL( CWPCharacteristic& aCharacteristic ); |
|
112 |
|
113 /** |
|
114 * @see MWPVisitor::SavingFinalizedL() |
|
115 */ |
|
116 void SavingFinalizedL(); |
|
117 |
|
118 |
|
119 /** |
|
120 * @see MWPVisitor::VisitL() |
|
121 */ |
|
122 void VisitL( CWPParameter& aParameter ); |
|
123 |
|
124 /** |
|
125 * @see MWPVisitor:VisitLinkL() |
|
126 */ |
|
127 void VisitLinkL( CWPCharacteristic& aLink ); |
|
128 |
|
129 // from base class MWPContextExtension |
|
130 |
|
131 /** |
|
132 * @see MWPContextExtension::SaveDataL() |
|
133 */ |
|
134 const TDesC8& SaveDataL( TInt aIndex ) const; |
|
135 |
|
136 /** |
|
137 * @see MWPContextExtension::DeleteL() |
|
138 */ |
|
139 void DeleteL( const TDesC8& aSaveData ); |
|
140 |
|
141 /** |
|
142 * @see MWPContextExtension::Uid() |
|
143 */ |
|
144 TUint32 Uid() const; |
|
145 |
|
146 /** |
|
147 * From MSIPProfileRegistryObserver |
|
148 * SIP profile information event. |
|
149 * |
|
150 * @since S60 v3.1 |
|
151 * @param aSIPProfileId id for profile |
|
152 * @param aEvent type of information event |
|
153 */ |
|
154 void ProfileRegistryEventOccurred(TUint32 aProfileId, |
|
155 TEvent aEvent); |
|
156 /** |
|
157 * From MSIPProfileRegistryObserver |
|
158 * An asynchronous error has occurred related to SIP profile. |
|
159 * |
|
160 * @since S60 v3.1 |
|
161 * @param aSIPProfileId the id of failed profile |
|
162 * @param aError a error code |
|
163 * @return none |
|
164 */ |
|
165 void ProfileRegistryErrorOccurred(TUint32 aProfileId, |
|
166 TInt aError); |
|
167 |
|
168 private: |
|
169 |
|
170 /** |
|
171 * C++ constructor |
|
172 */ |
|
173 CWPVccAdapter(); |
|
174 |
|
175 /** |
|
176 * Symbian 2nd phase constructor |
|
177 */ |
|
178 void ConstructL(); |
|
179 |
|
180 /** |
|
181 * Remove old VCC related settings if found |
|
182 */ |
|
183 void RemoveVCCSettingsL(); |
|
184 |
|
185 /** |
|
186 * Remove VCC enabled VoIP network destination from snaplist |
|
187 */ |
|
188 void RemoveNetworkDestinationL(); |
|
189 |
|
190 private: // data |
|
191 |
|
192 /** |
|
193 * The application id of the current characteristic |
|
194 * Own |
|
195 */ |
|
196 HBufC* iAppID; |
|
197 |
|
198 /** |
|
199 * Title for the Vcc settings. |
|
200 * Own. |
|
201 */ |
|
202 HBufC* iTitle; |
|
203 |
|
204 /** |
|
205 * Holds the value of the current characteristic type (state). |
|
206 */ |
|
207 TUint iCurrentCharacteristic; |
|
208 |
|
209 /** |
|
210 * Type of the current characteristics |
|
211 */ |
|
212 TInt iCurrentCharacteristicType; |
|
213 |
|
214 /** |
|
215 * Application references |
|
216 * Own |
|
217 */ |
|
218 RArray<TPtrC> iToAppReferences; |
|
219 |
|
220 /** |
|
221 * Item that saves the provisioned settings |
|
222 * Own |
|
223 */ |
|
224 CVccSPSettings* iVccItem; |
|
225 |
|
226 /** |
|
227 * Item that saves the provisioned settings |
|
228 * Own |
|
229 */ |
|
230 CVccSPSettings* iNewVccItem; |
|
231 |
|
232 /** |
|
233 * RCSE Profile ID |
|
234 * Own |
|
235 */ |
|
236 TUint iVoipProfileId; |
|
237 |
|
238 /** |
|
239 * Old VCC enabled VoIP service name |
|
240 * needed for deleting network destination before saving new VCC enabled VoIP service |
|
241 */ |
|
242 TBuf<200> iOldVoipServiceName; |
|
243 |
|
244 |
|
245 |
|
246 VCC_UNITTEST( T_WpVccAdapter ) |
|
247 }; |
|
248 |
|
249 #endif // C_WPVCCADAPTER_H |