74 * Marks the end of bearer |
101 * Marks the end of bearer |
75 * creation related attributes |
102 * creation related attributes |
76 */ |
103 */ |
77 }; |
104 }; |
78 |
105 |
79 class CCmPluginBaseEng; |
|
80 class CCmPluginBase; |
|
81 |
|
82 /** |
106 /** |
83 * Validation function called before data is stored. |
107 * Flags for Iap metadata to indicate: |
84 * @param aThis 'this' pointer of the plugin instance |
108 * EMetaHighlight: If it's set it indicates that a connection method is |
85 * @param aAttribute attribute to be set |
109 * highlighted in Agent dialog. Only one connection |
86 * @param aValue value to be checked |
110 * method can have this flag set. |
87 * @return ETrue if value is stored. |
111 * EMetaHiddenAgent: If it's set it indicates that an connection method is |
88 */ |
112 * hidden connection method in Agent dialog. |
89 typedef TBool (*TValidationFunctionL)( CCmPluginBaseEng* aThis, |
113 */ |
90 TUint32 aAttribute, |
|
91 const TAny* aValue ); |
|
92 |
|
93 /** |
|
94 * Structure of conversion table between CM attributes and |
|
95 * CommsDat ids. The first element must indicate the |
|
96 * range of the conversion table. iAttribId is the lowest Id, |
|
97 * iCommsDatId is the highest one. The last element is a |
|
98 * terminator. e.g. Proxy table: |
|
99 * static const TCmAttribConvTable SProxyConvTbl[] = |
|
100 * { |
|
101 { ECMProxyUsageEnabled, ECMProxyRangeMax, NULL } |
|
102 { ECMProxyUseProxyServer, KCDTIdUseProxyServer, NULL }, |
|
103 { ECmProxyPortNumber, KCDTIdPortNumber, &CheckPortNumberValidityL }, |
|
104 ... |
|
105 { 0, 0 } |
|
106 } |
|
107 */ |
|
108 typedef struct |
|
109 { |
|
110 TInt iAttribId; |
|
111 TInt iCommsDatId; |
|
112 TValidationFunctionL iValidFuncL; |
|
113 TInt iTitleId; |
|
114 TInt iMaxLength; |
|
115 TUint32 iAttribFlags; // see TCmConvAttribFlags |
|
116 TInt iDefSettingResId; |
|
117 TInt iEditorResId; |
|
118 TInt iDefValueResId; |
|
119 TAny* iNotUsed1; |
|
120 TAny* iNotUsed2; |
|
121 }TCmAttribConvTable; |
|
122 |
|
123 enum TCmConvAttribFlags |
|
124 { |
|
125 EConvNoZeroLength = 0x00000001, // Zero length NOT acceptable |
|
126 EConvCompulsory = 0x00000002, |
|
127 EConv8Bits = 0x00000004, |
|
128 EConvReadOnly = 0x00000008, |
|
129 EConvNumber = 0x00000010, |
|
130 EConvIPv4 = 0x00000020, |
|
131 EConvIPv6 = 0x00000040, |
|
132 EConvPassword = 0x00000080, |
|
133 }; |
|
134 |
|
135 typedef struct |
|
136 { |
|
137 CommsDat::CCDRecordBase* *iRecord; |
|
138 TBool* iEnabled; |
|
139 const TCmAttribConvTable* iConvTable; |
|
140 }TCmAttrConvArrayItem; |
|
141 |
|
142 typedef struct |
|
143 { |
|
144 TInt iAttribId; |
|
145 TInt iCommonAttribId; |
|
146 }TCmCommonAttrConvArrayItem; |
|
147 |
|
148 enum TCmMetaDataFields |
114 enum TCmMetaDataFields |
149 { |
115 { |
150 EMetaHighlight = 0x00000001, |
116 EMetaHighlight = 0x00000001, |
151 EMetaHiddenAgent = 0x00000002 |
117 EMetaHiddenAgent = 0x00000002 |
152 }; |
118 }; |
153 |
119 |
154 // FUNCTION PROTOTYPES |
120 // FORWARD DECLARATIONS |
155 |
121 class CCmPluginBaseEng; |
|
122 class CCDIAPMetadataRecord; |
|
123 |
|
124 // CLASS DECLARATION |
156 /** |
125 /** |
157 * TValidationFunctionL functions. |
126 * Initialisation instance for plugin creation. Used in plugin |
158 */ |
127 * construction phase. |
159 |
128 */ |
160 /** |
|
161 * Function should be called if client tries to set attribute that is read-only |
|
162 * @param aThis 'this' pointer of the plugin instance |
|
163 * @param aAttribute not used |
|
164 * @param aValue not used |
|
165 * @leave KErrNotSupported in every cases |
|
166 */ |
|
167 IMPORT_C TBool ReadOnlyAttributeL( CCmPluginBaseEng* aThis, |
|
168 TUint32 aAttribute, |
|
169 const TAny* aValue ); |
|
170 |
|
171 /** |
|
172 * Function to check if the passed IPv4 address is valid. |
|
173 * @param aThis 'this' pointer of the plugin instance |
|
174 * @param aAttribute attribute client wants to set |
|
175 * @param aValue TDesC* IPv4 address buffer to be checked |
|
176 */ |
|
177 IMPORT_C TBool CheckIPv4ValidityL( CCmPluginBaseEng* aThis, |
|
178 TUint32 aAttribute, |
|
179 const TAny* aValue ); |
|
180 |
|
181 /** |
|
182 * Function to check if the passed IPv6 address is valid. |
|
183 * @param aThis 'this' pointer of the plugin instance |
|
184 * @param aAttribute attribute client wants to set |
|
185 * @param aValue TDesC* IPv6 address buffer to be checked |
|
186 */ |
|
187 IMPORT_C TBool CheckIPv6ValidityL( CCmPluginBaseEng* aThis, |
|
188 TUint32 aAttribute, |
|
189 const TAny* aValue ); |
|
190 |
|
191 /** |
|
192 * Function to check if the passed port number is valid. |
|
193 * @param aThis 'this' pointer of the plugin instance |
|
194 * @param aAttribute attribute client wants to set |
|
195 * @param aValue TUint32 the port number to be check |
|
196 */ |
|
197 IMPORT_C TBool CheckPortNumberValidityL( CCmPluginBaseEng* aThis, |
|
198 TUint32 aAttribute, |
|
199 const TAny* aValue ); |
|
200 |
|
201 /** |
|
202 * Function to check if the passed record is valid. |
|
203 * @param aThis 'this' pointer of the plugin instance |
|
204 * @param aAttribute attribute client wants to set |
|
205 * @param aValue TUint32 the record id to be checked |
|
206 */ |
|
207 IMPORT_C TBool CheckRecordIdValidityL( CCmPluginBaseEng* aThis, |
|
208 TUint32 aAttribute, |
|
209 const TAny* aValue ); |
|
210 |
|
211 /** |
|
212 * Function to check if the passed WAPWspOption is valid. |
|
213 * @param aThis 'this' pointer of the plugin instance |
|
214 * @param aAttribute attribute client wants to set |
|
215 * @param TUint32 the WPSOption to be checked |
|
216 */ |
|
217 IMPORT_C TBool CheckWAPWspOptionValidityL( CCmPluginBaseEng* aThis, |
|
218 TUint32 aAttribute, |
|
219 const TAny* aValue ); |
|
220 |
|
221 /** |
|
222 * @param aThis 'this' pointer of the plugin instance |
|
223 * @param aAttribute attribute client wants to set |
|
224 * @param TUint32 the WPSOption to be checked |
|
225 */ |
|
226 IMPORT_C TBool SetProxyServerNameL( CCmPluginBaseEng* aThis, |
|
227 TUint32 aAttribute, |
|
228 const TAny* aValue ); |
|
229 |
|
230 /** |
|
231 * Miscellaneous utility functions. |
|
232 */ |
|
233 |
|
234 /** |
|
235 * Check if the passed IP address is '0.0.0.0' or empty string |
|
236 * @param aIpAddress IP address to be checked |
|
237 */ |
|
238 IMPORT_C TBool IsUnspecifiedIPv4Address( const TDesC& aIpv4Address ); |
|
239 |
|
240 /** |
|
241 * Check if the passed IP address is one of these: |
|
242 * - empty string - |
|
243 * - '0:0:0:0:0:0:0:0' |
|
244 * - 'fec0:000:0000:ffff::1' |
|
245 * - 'fec0:000:0000:ffff::2' |
|
246 * @param aIpAddress IP address to be checked |
|
247 */ |
|
248 IMPORT_C CMManager::TIPv6Types ClassifyIPv6Address( const TDesC& aIpv6Address ); |
|
249 |
|
250 // FORWARD DECLARATIONS |
|
251 class CCmDestinationImpl; |
|
252 class CCmManagerImpl; |
|
253 class CCDIAPMetadataRecord; |
|
254 class CCmTransactionHandler; |
|
255 class CCmPluginBasePrivate; |
|
256 |
|
257 // CLASS DECLARATION |
|
258 NONSHARABLE_CLASS(TCmPluginInitParam) |
129 NONSHARABLE_CLASS(TCmPluginInitParam) |
259 { |
130 { |
260 public: |
131 public: |
261 |
132 /** |
262 TCmPluginInitParam( CCmManagerImpl& aCmMgr ); |
133 * Constructor. |
|
134 * @param aSessionRef Reference for open Session handle to CommsDat. |
|
135 */ |
|
136 IMPORT_C TCmPluginInitParam( CommsDat::CMDBSession& aSessionRef ); |
263 |
137 |
264 public: |
138 public: |
265 |
139 /** |
266 CCmManagerImpl& iCmMgr; |
140 * Reference to CommsDat session handle. |
267 TUint32 iParentDest;// Parent destination |
141 */ |
|
142 CommsDat::CMDBSession& iSessionRef; |
|
143 |
|
144 /** |
|
145 * Reserved for future. |
|
146 */ |
268 TAny* iNotused1; |
147 TAny* iNotused1; |
269 TAny* iNotused2; |
148 TAny* iNotused2; |
270 }; |
149 }; |
271 |
150 |
|
151 // CLASS DECLARATION |
272 /** |
152 /** |
273 * CCmPluginBaseEng is base class for every connection method plugin |
153 * This defines the data object used for moving data between |
|
154 * cmm server and plugins. |
|
155 */ |
|
156 NONSHARABLE_CLASS( CCmClientPluginInstance ): public CBase |
|
157 { |
|
158 public: |
|
159 /** |
|
160 * Two-phase constructor. Returns pointer to the new |
|
161 * CCmClientPluginInstance object. |
|
162 */ |
|
163 IMPORT_C static CCmClientPluginInstance* NewL(); |
|
164 |
|
165 /** |
|
166 * Two-phase constructor. Returns pointer to the new |
|
167 * CCmClientPluginInstance object. |
|
168 */ |
|
169 IMPORT_C static CCmClientPluginInstance* NewLC(); |
|
170 |
|
171 /** |
|
172 * Destructor |
|
173 */ |
|
174 IMPORT_C ~CCmClientPluginInstance(); |
|
175 |
|
176 private: |
|
177 /** |
|
178 * Default constructor. |
|
179 */ |
|
180 CCmClientPluginInstance(); |
|
181 |
|
182 /** |
|
183 * Second phase constructor. |
|
184 */ |
|
185 void ConstructL(); |
|
186 |
|
187 public: |
|
188 /** |
|
189 * Pointer array for generic record pointers. Those are copies |
|
190 * from CommsDat versions for the client usage. |
|
191 */ |
|
192 RPointerArray<CommsDat::CCDRecordBase> iGenRecordArray; |
|
193 |
|
194 /** |
|
195 * Pointer array for bearer specific record pointers. Those are copies |
|
196 * from CommsDat versions for the client usage. These are asked from |
|
197 * the different plugins. |
|
198 */ |
|
199 RPointerArray<CommsDat::CCDRecordBase> iBearerSpecRecordArray; |
|
200 |
|
201 /** Naming way of the CM. e.g. ENamingUnique */ |
|
202 CMManager::TNamingMethod iNamingMethod; |
|
203 |
|
204 /** Boolean to keep the information if location is enabled */ |
|
205 TBool iLocationEnabled; |
|
206 |
|
207 /** Iap Record id of this Connection Method */ |
|
208 TUint32 iIapId; |
|
209 }; |
|
210 |
|
211 /** |
|
212 * CCmPluginBaseEng is base class for every connection method plugin. |
|
213 * It handles all the generic iap informations e.g. record handling |
|
214 * and attribute reaquests to generic records. |
274 * |
215 * |
275 * @lib cmmanager.lib |
216 * @lib cmmpluginbase.lib |
276 * @since S60 v3.2 |
217 * @since S60 v5.2 |
277 */ |
218 */ |
278 class CCmPluginBaseEng : public CBase |
219 class CCmPluginBaseEng : public CBase |
279 { |
220 { |
280 public: |
221 public: |
281 |
222 /** |
282 /** Destructor. */ |
223 * Destructor. |
283 IMPORT_C virtual ~CCmPluginBaseEng(); |
|
284 |
|
285 /** |
|
286 * Create a new instance of the given bearer type plugin. |
|
287 * Used from framework to avoid using slow ECom framework. |
|
288 * @param aInitParam initialization data |
|
289 */ |
224 */ |
|
225 IMPORT_C virtual ~CCmPluginBaseEng(); |
|
226 |
|
227 /** |
|
228 * Create a new instance of the given bearer type plugin. |
|
229 * Used from CMM server to avoid using slow ECom framework. |
|
230 * @param aInitParam initialization data |
|
231 * @return Returns CCmPluginBaseEng type pointer which represents pure |
|
232 * bearer instance for the CMM server. |
|
233 */ |
290 virtual CCmPluginBaseEng* |
234 virtual CCmPluginBaseEng* |
291 CreateInstanceL( TCmPluginInitParam& aInitParam ) const = 0; |
235 CreateInstanceL( TCmPluginInitParam& aInitParam ) const = 0; |
292 |
236 |
293 public: // Attribute handlers |
237 /** |
294 |
238 * Following GetBearerInfoXXXL methods return the values of the |
295 /** |
239 * requested attributes. These values are bearerspecific so they |
296 * Gets the value for a TInt attribute. |
240 * don't vary between CMs with same bearer type. |
297 * @param aAttribute Identifies the attribute to be retrived. |
241 * @param aAttribute An attribute identifier. |
298 * @return contains the requested TInt attribute. |
242 * @return Returns the value requested. If not found leaves with |
299 */ |
243 * KErrNotFound error code. |
300 IMPORT_C virtual TUint32 |
244 */ |
301 GetIntAttributeL( const TUint32 aAttribute ) const; |
245 IMPORT_C virtual TUint32 GetBearerInfoIntL( |
302 |
246 TUint32 aAttribute ) const = 0; |
303 /** |
247 |
304 * Gets the value for a TBool attribute. |
248 IMPORT_C virtual TBool GetBearerInfoBoolL( |
305 * @param aAttribute Identifies the attribute to be retrived. |
249 TUint32 aAttribute ) const = 0; |
306 * @return contains the requested TBool attribute. |
250 |
307 */ |
251 IMPORT_C virtual HBufC* GetBearerInfoStringL( |
308 IMPORT_C virtual TBool |
252 TUint32 aAttribute ) const = 0; |
309 GetBoolAttributeL( const TUint32 aAttribute ) const; |
253 |
310 |
254 IMPORT_C virtual HBufC8* GetBearerInfoString8L( |
311 /** |
255 TUint32 aAttribute ) const = 0; |
312 * Gets the value for a String16 attribute. |
256 |
313 * @param aAttribute Identifies the attribute to be retrived. |
257 /** |
314 * @return copy of the requested attribute. Ownership is passed. |
258 * Checks if the plug-in can handle the Connection Method identified |
315 */ |
259 * with parameter aIapId. |
316 IMPORT_C virtual HBufC* |
260 * @param aIapId IAPId of the AP to be checked |
317 GetStringAttributeL( const TUint32 aAttribute ) const; |
261 * @return ETrue if plug-in can handle the IAP, otherwise EFalse. |
318 |
262 */ |
319 /** |
263 virtual TBool CanHandleIapIdL( TUint32 aIapId ) const = 0; |
320 * Gets the value for a String8 attribute. |
264 |
321 * @param aAttribute Identifies the attribute to be retrived. |
265 /** |
322 * @return copy of the requested attribute. Ownership is passed. |
266 * Checks if the plug-in can handle the given IAP record. |
323 */ |
267 * @param aIapRecord IAP record to be checked |
324 IMPORT_C virtual HBufC8* |
268 * @return ETrue if plug-in can handle the IAP, otherwise EFalse. |
325 GetString8AttributeL( const TUint32 aAttribute ) const; |
269 */ |
326 |
270 virtual TBool CanHandleIapIdL( |
327 /** |
271 CommsDat::CCDIAPRecord* aIapRecord ) const = 0; |
328 * Sets the value for a TInt attribute. |
272 |
329 * @param aAttribute Identifies the attribute to be set. |
273 public: // Client interface |
330 * @param aValue The value to be set. |
274 /** |
331 * @return None. |
275 * Loads all the records belonging to this Connection Method. |
332 */ |
276 * @param aIapId Id of the IAP record. Identifies the CM |
333 IMPORT_C virtual void SetIntAttributeL( |
277 * related records to load. |
334 const TUint32 aAttribute, TUint32 aValue ); |
278 */ |
335 |
279 IMPORT_C void LoadL( TUint32 aIapId ); |
336 /** |
280 |
337 * Sets the value for a TBool attribute. |
281 /** |
338 * @param aAttribute Identifies the attribute to be set. |
282 * Resets and loads all the records belonging to this Connection Method. |
339 * @param aValue The value to be set. |
283 */ |
340 * @return None. |
284 IMPORT_C void ReLoadL(); |
341 */ |
285 |
342 IMPORT_C virtual void SetBoolAttributeL( |
286 /** |
343 const TUint32 aAttribute, TBool aValue ); |
287 * Creates a new Connection Method in memory. Call UpdateL() to store |
344 |
288 * it in CommsDat. No CommsDat transaction operation is needed for this. |
345 /** |
289 * @param aCmId Predefined iapid to be used when saving to CommsDat. |
346 * Sets the value for a String16 attribute. |
290 * 0 means that CommsDat gives the id. |
347 * @param aAttribute Identifies the attribute to be set. |
291 */ |
348 * @param aValue The value to be set. |
292 IMPORT_C void CreateNewL( TUint32 aCmId ); |
349 * @return None. |
293 |
350 */ |
294 /** |
351 IMPORT_C virtual void SetStringAttributeL( |
295 * Creates a copy of an existing Connection Method. |
352 const TUint32 aAttribute, const TDesC16& aValue ); |
296 * @param aClientPluginInstance The source data to create the copy from. |
353 |
297 * @return CCmPluginBaseEng type pointer to an object which represents |
354 /** |
298 * the new plugin to the CMM server. |
355 * Sets the value for a String8 attribute. |
299 */ |
356 * @param aAttribute Identifies the attribute to be set. |
300 IMPORT_C CCmPluginBaseEng* CreateCopyL( |
357 * @param aValue The value to be set. |
301 CCmClientPluginInstance* aClientPluginInstance ); |
358 * @return None. |
302 |
359 */ |
303 /** |
360 IMPORT_C virtual void SetString8AttributeL( |
304 * Updates all records to commsdat. Data is copied from the client's copy |
361 const TUint32 aAttribute, const TDesC8& aValue ); |
305 * to the original data. |
362 |
306 * This method does not open/rollback/commit transaction to CommsDat. |
363 /** |
307 * Caller must handle transactions. |
364 * Restore the original value of the attribute from commsdat field. |
308 */ |
365 * Base implementation can be used only with attributes |
309 IMPORT_C virtual void UpdateL( |
366 * stored directly in commsdat. |
310 CCmClientPluginInstance* aClientPluginInstance ); |
367 * @param aAttribute attribute to be restored |
311 |
368 */ |
|
369 IMPORT_C virtual void RestoreAttributeL( const TUint32 aAttribute ); |
|
370 |
|
371 /** |
|
372 * Returns the CCmDestinationImpl* if this is an |
|
373 * embedded destination CM. Otherwise returns NULL. |
|
374 * @return embedded destination object or NULL |
|
375 */ |
|
376 IMPORT_C virtual CCmDestinationImpl* Destination() const; |
|
377 |
|
378 /** |
|
379 * Update or if this is a new CM, creates CM in CommsDat. |
|
380 * - OpenTransactionLC() |
|
381 * - PrepareToUpdateRecordsL() |
|
382 * - UpdateChargeCardRecordL() |
|
383 * - UpdateServiceRecordL() |
|
384 * - UpdateIAPRecordL() |
|
385 * - UpdateLocationRecordL() |
|
386 * - BearerRecordIdLC() |
|
387 * - UpdateNetworkRecordL() |
|
388 * - UpdateWapRecordL() |
|
389 * - UpdateProxyRecordL() |
|
390 * - UpdateConnPrefSettingL() |
|
391 * - UpdateAdditionalRecordsL() |
|
392 * - CommitTransactionL() |
|
393 * @return None. |
|
394 */ |
|
395 IMPORT_C virtual void UpdateL(); |
|
396 |
|
397 /* |
312 /* |
398 * Delete from the database if this CM has no more reference |
313 * Deletes all the records of this CM from the database. |
399 * from the DN_IAP table. |
314 * All the preventing conditions must be checked before calling this. |
400 * - IsMultipleReferencedL() |
315 * This method does not open/rollback/commit transaction to CommsDat. |
401 * - OpenTransactionLC() |
316 * Caller must handle transactions. |
402 * - PrepareToDeleteL() |
317 */ |
403 * - Delete records (in this order) |
318 IMPORT_C virtual void DeleteL(); |
404 * - IAP |
319 |
405 * - Proxy |
320 /** |
406 * - Service |
321 * Creates a copy of all plugin data( most of them are CommsDat data ) for a client. |
407 * - ChargeCard |
322 * @param aClientPluginInstance An object where to copy the data. |
408 * - Network |
323 */ |
409 * - Location |
324 IMPORT_C void GetPluginDataL( CCmClientPluginInstance* aClientPluginInstance ); |
410 * - WapAP |
325 |
411 * - WapBearer |
326 /** |
412 * - DeleteAdditionalRecordsL() |
327 * Following GetXXXXAttributeL methods return the values of the |
413 * - CommitTransactionL() |
328 * requested attributes. Attributes are returned from the client's |
414 * @param aForced forced delete doesn't check referencies |
329 * copy of the data. These values are CM specific. |
415 * @param aOneRefsAllowed ETrue if one reference from a destination is |
330 * @param aAttribute An attribute identifier. |
416 * acceptable to delete this connection method. |
331 * @param aClientPluginInstance Client's copy of the data where |
417 */ |
332 * to get the return value. |
418 IMPORT_C virtual TBool DeleteL( TBool aForced, |
333 * @return Returns the value requested. If not found leaves with |
419 TBool aOneRefAllowed = ETrue ); |
334 * KErrNotFound error code. |
420 |
335 */ |
421 /** |
336 IMPORT_C TUint32 GetIntAttributeL( |
422 * Performs the basic loading of records related |
337 TUint32 aAttribute, |
423 * to this connection method: |
338 CCmClientPluginInstance* aClientPluginInstance ); |
424 * - OpenTransactionLC(); |
339 |
425 * - PrepareToLoadRecordsL() |
340 IMPORT_C TBool GetBoolAttributeL( |
426 * - LoadIAPRecordL(); |
341 TUint32 aAttribute, |
427 * - load IAP |
342 CCmClientPluginInstance* aClientPluginInstance ); |
428 * - load WAP (AP & IP Bearer) |
343 |
429 * - load proxy |
344 IMPORT_C HBufC* GetStringAttributeL( |
430 * - load charge card |
345 TUint32 aAttribute, |
431 * - load network |
346 CCmClientPluginInstance* aClientPluginInstance ); |
432 * - load location |
347 |
433 * - LoadServiceSettingL(); |
348 IMPORT_C HBufC8* GetString8AttributeL( |
434 * - LoadAdditionalRecordsL(); |
349 TUint32 aAttribute, |
435 */ |
350 CCmClientPluginInstance* aClientPluginInstance ); |
436 IMPORT_C virtual void LoadL( TUint32 aIapId ); |
351 |
437 |
352 /** |
438 /** |
353 * Following SetXXXXAttributeL methods set the given values |
439 * Create a new connection method in memory. |
354 * identified with attributes. Attributes are set to the |
440 * Call UpdateL() to store it in CommsDat. |
355 * client's copy of the data. |
441 * No transaction operation is performed. |
356 * @param aAttribute An attribute identifier. |
442 * - Creates new WAP, IAP, Network records |
357 * @param aValue Value to set. |
443 * - CreateNewServiceRecordL() |
358 * @param aClientPluginInstance Client's copy of the data where |
444 * - CreateAdditionalRecordsL() |
359 * to set the given value. |
445 * - Loads default AP name from resource |
360 */ |
446 * (R_CMMANAGERENG_DEFAULT_AP_NAME) |
361 IMPORT_C void SetIntAttributeL( TUint32 aAttribute, TUint32 aValue, |
447 */ |
362 CCmClientPluginInstance* aClientPluginInstance ); |
448 IMPORT_C virtual void CreateNewL(); |
363 |
449 |
364 IMPORT_C void SetBoolAttributeL( TUint32 aAttribute, TBool aValue, |
450 /** |
365 CCmClientPluginInstance* aClientPluginInstance ); |
451 * Create a copy of the connection method: |
366 |
452 * - CreateInstanceL() |
367 IMPORT_C void SetStringAttributeL( TUint32 aAttribute, const TDesC16& aValue, |
453 * - CreateNewL() |
368 CCmClientPluginInstance* aClientPluginInstance ); |
454 * - PrepareToCopyDataL() |
369 |
455 * - Copies data: |
370 IMPORT_C void SetString8AttributeL( TUint32 aAttribute, const TDesC8& aValue, |
456 * - name |
371 CCmClientPluginInstance* aClientPluginInstance ); |
457 * - bearer type |
372 |
458 * - records added to the convertion table |
373 /** |
459 * - Calls CopyAdditionalDataL(). |
374 * Requests CommsDat table ids to be observed for changes by the cmm |
460 */ |
375 * server. This is only for generic iap related tables. |
461 IMPORT_C virtual CCmPluginBaseEng* CreateCopyL() const; |
376 * @param aTableIdArray A reference to an array where iap related generic |
462 |
377 * table ids are added. |
463 /* |
378 */ |
464 * Returns true if the CM has more than one parent destination |
379 IMPORT_C void GetGenericTableIdsToBeObserved( RArray<TUint32>& aTableIdArray ) const; |
465 */ |
380 |
466 IMPORT_C virtual TInt NumOfConnMethodReferencesL(); |
381 /** |
467 |
382 * Requests CommsDat table ids to be observed for changes by the cmm |
468 public: |
383 * server. If a table used is not mentioned to be modified a bearer |
469 |
384 * shouldn't return this. Bearers do not reset the array before adding |
470 /** |
385 * ids. |
471 * Returns a pointer to the cmmanager |
386 * @param aTableIdArray A reference to an array where plugin must add |
472 * @return a pointer to the cmmanager |
387 * the ids of the tables it want's to be observed. |
473 */ |
388 */ |
474 CCmManagerImpl& CmMgr() const { return iCmMgr; }; |
389 IMPORT_C virtual void GetBearerTableIdsToBeObservedL( |
475 |
390 RArray<TUint32>& aTableIdArray ) const = 0; |
476 IMPORT_C CommsDat::CMDBSession& Session() const; |
391 |
477 |
392 public: // plugin interface |
478 /** |
393 /** |
479 * Launches the settings dialog of the plugin |
394 * Creates a copy of all bearer specific CommsDat data for the client. |
480 * |
395 * Called as result of GetPluginDataL(). |
481 * @since S60 3.2 |
396 * @param aRecordArray An array where the copy the records. Only |
482 * @return soft key selection |
397 * the bearer specific implementation knows the amount and order |
483 */ |
398 * of these records in the array. |
484 virtual TInt RunSettingsL() = 0; |
399 */ |
485 |
400 virtual void GetBearerSpecificRecordsL( |
486 /** |
401 RPointerArray<CommsDat::CCDRecordBase>& aRecordArray ) = 0; |
487 * Called on a newly created connection method to initialize it properly |
402 |
488 * with user interaction (e.g. APN setting for a packet data-, WEP-key |
403 /** |
489 * setting for a WLAN connection method, etc.). |
404 * Following GetBearerXXXXAttribute methods get only the |
490 * Note: each plug-in should set its name (i.e. ECmName) in this |
405 * fields in records in pointer arrays(parameters). |
491 * function call. |
406 * @param aAttribute Identifier of the requested value. |
492 * |
407 * @param aGenRecordArray An array containing pointers to generic |
493 * @since S60 3.2 |
408 * records of the Connection Method. |
494 * @param aManuallyConfigure let's the plugin know if a plugin should |
409 * @param aBearerSpecRecordArray An array containing pointers to bearer |
495 * be configured manually or automatically |
410 * specific records of the Connection Method. aAttribute |
496 * @return ETrue if initialization was successful and wasn't cancelled. |
411 * parameter should identify one field(integer, boolean string) |
497 * EFalse, if initialization process was cancelled (i.e. user pressed |
412 * in one of these records. |
498 * Cancel button). |
413 * @return Returns the requested value. In error case leaves with |
499 */ |
414 * system-wide error code. |
500 virtual TBool InitializeWithUiL( TBool aManuallyConfigure ) = 0; |
415 */ |
501 |
416 |
502 /** |
417 virtual TUint32 GetBearerIntAttributeL( |
503 * Checks if the plug-in can handle the given AP. |
418 TUint32 aAttribute, |
504 * @param aIapId IAPId of the AP to be checked |
419 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
505 * @return ETrue if plug-in can handle the IAP |
420 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) = 0; |
506 */ |
421 |
507 virtual TBool CanHandleIapIdL( TUint32 aIapId ) const = 0; |
422 virtual TBool GetBearerBoolAttributeL( |
508 |
423 TUint32 aAttribute, |
509 /** |
424 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
510 * Checks if the plug-in can handle the given AP. |
425 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) = 0; |
511 * @param aIapRecord IAP record to be checked |
426 |
512 * @return ETrue if plug-in can handle the IAP |
427 virtual HBufC* GetBearerStringAttributeL( |
513 */ |
428 TUint32 aAttribute, |
514 virtual TBool CanHandleIapIdL( CommsDat::CCDIAPRecord* aIapRecord ) const = 0; |
429 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
515 |
430 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) = 0; |
516 /** |
431 |
517 * Return the parent destination of this connection method. |
432 virtual HBufC8* GetBearerString8AttributeL( |
518 * @return parent destination of this connection method |
433 TUint32 aAttribute, |
519 */ |
434 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
520 IMPORT_C CCmDestinationImpl* ParentDestination() const; |
435 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) = 0; |
521 |
436 |
522 /** |
437 /** |
523 * Calls FeatureManager::FeatureSupported directly. |
438 * Following SetBearerXXXXAttribute methods set only the |
524 * @param aFeature feature ID |
439 * fields in records in pointer arrays(parameters). They are not |
525 * @return feature support status |
440 * allowed to update the original records in plugins. |
526 * @since 3.2 |
441 * @param aAttribute Identifier of the field to set. |
527 */ |
442 * @param aValue The value to set. |
528 IMPORT_C static TBool FeatureSupported( TInt aFeature ); |
443 * @param aGenRecordArray An array containing pointers to generic |
529 |
444 * records of the Connection Method. |
530 /** |
445 * @param aBearerSpecRecordArray An array containing pointers to bearer |
531 * Function should be overriden by virtual bearer type plugins. |
446 * specific records of the Connection Method. aAttribute |
532 * Returns if the passed IAP id is linked to that connection method. |
447 * parameter should identify one field(integer, boolean string) |
533 * @param aIapId IAP id to be checked |
448 * in one of these records. |
534 * @return ETrue if the passed IAP id is linked to that connection method. |
449 * @return None. |
535 */ |
450 */ |
536 virtual TBool IsLinkedToIap( TUint32 /*aIapId*/ ){ return EFalse; } |
451 |
537 |
452 virtual void SetBearerIntAttributeL( |
538 /** |
453 TUint32 aAttribute, |
539 * Function should be overriden by virtual bearer type plugins. |
454 TUint32 aValue, |
540 * Returns if the passed SNAP id is linked to that connection method. |
455 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
541 * @param aSnapId SNAP id to be checked |
456 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) = 0; |
542 * @return ETrue if the passed SNAP id is linked to that connection method. |
457 |
543 */ |
458 virtual void SetBearerBoolAttributeL( |
544 virtual TBool IsLinkedToSnap( TUint32 /*aSnapId*/ ){ return EFalse; } |
459 TUint32 aAttribute, |
545 |
460 TBool aValue, |
546 /** |
461 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
547 * Increments the reference counter. Used by the object pool. |
462 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) = 0; |
548 */ |
463 |
549 void IncrementRefCounter(); |
464 virtual void SetBearerStringAttributeL( |
550 /** |
465 TUint32 aAttribute, |
551 * Increments the reference counter. Used by the object pool. |
466 const TDesC16& aValue, |
552 */ |
467 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
553 void DecrementRefCounter(); |
468 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) = 0; |
554 /** |
469 |
555 * Returns the reference counter. Used by the object pool. |
470 virtual void SetBearerString8AttributeL( |
556 * @return TInt |
471 TUint32 aAttribute, |
557 */ |
472 const TDesC8& aValue, |
558 TInt GetRefCounter(); |
473 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
559 |
474 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) = 0; |
560 /** |
475 |
561 * Appends uids of connection methods - which were also created during connection method |
476 /** |
562 * creation - to the array given as parameter |
477 * Inherited class can make some preraration before CCmPluginBaseEng |
563 * @param aIapIds the array the additonal cm uids are appended to |
478 * would start loading bearer specific records. |
564 */ |
479 */ |
565 IMPORT_C virtual void GetAdditionalUids( RArray<TUint32>& aIapIds ); |
480 virtual void PreparePluginToLoadRecordsL() = 0; |
566 |
481 |
567 protected: // Conversion table API |
482 /** |
568 |
483 * Gives the plugin a possibility to do some preparing operations |
569 IMPORT_C void AddConverstionTableL( |
484 * if needed. |
570 CommsDat::CCDRecordBase* *aRecord, |
485 * @param aCopyInstance Client side data instance. |
571 TBool* aEnabled, |
486 */ |
572 const TCmAttribConvTable* aConvTable ); |
487 virtual void PrepareToCopyDataL( CCmPluginBaseEng* aCopyInstance ) = 0; |
573 |
488 |
574 IMPORT_C void AddCommonConversionTableL( |
489 /** |
575 const TCmCommonAttrConvArrayItem* aConvTable ); |
490 * Inherited class can make some preraration before CCmPluginBaseEng |
576 |
491 * would start to update all the records. |
577 IMPORT_C void RemoveConversionTable( |
492 * @param aGenRecordArray Reference to generic records pointer array. |
578 const TCmAttribConvTable* aConvTable ); |
493 * @param aBearerSpecRecordArray Reference to bearer specific records |
579 |
494 * pointer array. |
580 IMPORT_C void RemoveCommonConversionTable( |
495 */ |
581 const TCmCommonAttrConvArrayItem* aConvTable ); |
496 virtual void PreparePluginToUpdateRecordsL( |
582 |
497 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
583 protected: // Resource handling |
498 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) = 0; |
584 |
499 |
585 /** |
500 /** |
586 * Add file name to the resource file array. |
501 * Plugin can prepare to delete the Connection Method with this |
587 * Open it and/or increment reference count. |
502 * function. Called from DeleteL() before any record would be |
588 * @param aName resource file name |
503 * deleted. No records are deleted here. |
589 */ |
504 */ |
590 IMPORT_C void AddResourceFileL( const TDesC& aName ); |
505 virtual void PrepareToDeleteRecordsL(){}; |
591 |
506 |
592 /** |
507 /** |
593 * Remove file name from the resource file name array. |
508 * Loads the service record. Service record type is known and loaded by |
594 * Close the resource file and/or decrement the reference count. |
509 * plugin(bearer specific) part of the implementation even if the record |
595 * @param aName resource file name |
510 * is saved to the generic side. Service record is linked to IAP record. |
596 */ |
511 */ |
597 IMPORT_C void RemoveResourceFile( const TDesC& aName ); |
512 virtual void LoadServiceRecordL() = 0; |
598 |
513 |
599 /** |
514 /** |
600 * Read string from resource file. Resource file has to be |
515 * Creates the service records. |
601 * opened prior this by calling AddResourceFileL(). |
516 */ |
602 */ |
517 virtual void CreateServiceRecordL() = 0; |
603 IMPORT_C HBufC* AllocReadL( TInt aResourceId ) const; |
518 |
604 |
519 /** |
605 |
520 * Update service record. |
|
521 * @param aGenRecordArray Reference to generic records pointer array. |
|
522 * @param aBearerSpecRecordArray Reference to bearer specific records |
|
523 * pointer array. |
|
524 */ |
|
525 virtual void UpdateServiceRecordL( |
|
526 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
527 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) = 0; |
|
528 |
|
529 /** |
|
530 * Copies the service record. Bearer specific part knows the type of it's |
|
531 * service record. |
|
532 * @return Returns the service record pointer. |
|
533 */ |
|
534 virtual CommsDat::CCDRecordBase* CopyServiceRecordL() = 0; |
|
535 |
|
536 /** |
|
537 * Returns the service record id of the Connection Method. |
|
538 * @return Returns the id of the service record id of the Connection Method. |
|
539 */ |
|
540 virtual TUint32 ServiceRecordId() const = 0; |
|
541 |
|
542 /** |
|
543 * Returns the service record name of the Connection Method. |
|
544 * @param aServiceName Name of the service record the CM's iap record |
|
545 * points to. |
|
546 */ |
|
547 virtual void ServiceRecordNameLC( HBufC* &aServiceName ) = 0; |
|
548 |
|
549 /** |
|
550 * Inherited class loads all the bearer specific records after |
|
551 * loading generic records. Called from LoadL(). |
|
552 */ |
|
553 virtual void LoadBearerRecordsL() = 0; |
|
554 |
|
555 /** |
|
556 * Creates bearer specific records. |
|
557 */ |
|
558 virtual void CreateBearerRecordsL(){}; |
|
559 |
|
560 /** |
|
561 * Update bearer specific records. |
|
562 * @param aGenRecordArray Reference to generic records pointer array. |
|
563 * @param aBearerSpecRecordArray Reference to bearer specific records |
|
564 */ |
|
565 virtual void UpdateBearerRecordsL( |
|
566 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
567 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) = 0; |
|
568 |
|
569 /** |
|
570 * Plugin(generic part) can delete bearer specific records |
|
571 * with this function. Called from DeleteL(). |
|
572 */ |
|
573 virtual void DeleteBearerRecordsL() = 0; |
|
574 |
|
575 /** |
|
576 * Resets the bearer specific records. |
|
577 */ |
|
578 virtual void ResetBearerRecords() = 0; |
|
579 |
|
580 /** |
|
581 * Copies the bearer specific records to copy instance given as |
|
582 * parameter. |
|
583 * @param aCopyInstance Pointer to instance where to copy. |
|
584 */ |
|
585 virtual void CopyBearerRecordsL( CCmPluginBaseEng* aCopyInstance ) = 0; |
|
586 |
|
587 /** |
|
588 * Returns the bearer record id of the Connection Method. |
|
589 * @param aRecordId Id of the bearer record this CM's iap record |
|
590 * points to. |
|
591 */ |
|
592 virtual void BearerRecordIdL( TUint32& aRecordId ) = 0; |
|
593 |
|
594 /** |
|
595 * Returns the bearer record name of the Connection Method. |
|
596 * @param aBearerName Name of the bearer record this CM's iap record |
|
597 * points to. |
|
598 */ |
|
599 virtual void BearerRecordNameLC( HBufC* &aBearerName ) = 0; |
|
600 |
606 protected: |
601 protected: |
607 |
602 /** |
608 /** Constructor */ |
603 * Constructor |
|
604 */ |
609 IMPORT_C CCmPluginBaseEng( TCmPluginInitParam *aInitParam ); |
605 IMPORT_C CCmPluginBaseEng( TCmPluginInitParam *aInitParam ); |
610 |
606 |
611 /** Second phase constructor */ |
607 /** |
|
608 * Second phase constructor |
|
609 */ |
612 IMPORT_C virtual void ConstructL(); |
610 IMPORT_C virtual void ConstructL(); |
613 |
611 |
614 /** Open transaction */ |
612 /** |
615 void OpenTransactionLC(); |
613 * Checks if the ECmName attribute was set since the last update. |
616 |
614 * If so, name is updated in passed record |
617 /** |
615 * @param aSrcRecord record to be checked against |
618 * Commit transaction. |
616 * @param aDestRecord record to be checked against aSrcRecord |
619 * @param aError - error id |
617 */ |
620 */ |
618 IMPORT_C void CheckIfNameModifiedL( |
621 void CommitTransactionL( TInt aError ); |
619 CommsDat::CCDRecordBase* aSrcRecord, |
622 |
620 CommsDat::CCDRecordBase* aDestRecord ) const; |
623 /** |
621 |
624 * Rollback transaction. |
622 /** |
625 */ |
623 * Plugins can check DNS setting with this function. |
626 void RollbackTransaction(); |
624 * Suggested to be called from PrepareToUpdateRecordsL(). |
627 |
625 * It checked the DNS server addresses, moves secord into |
628 /** Make a reset on this class. */ |
626 * first if first is dynamic, and update DNSFromServer field |
629 IMPORT_C void Reset(); |
627 * according to address values. |
630 |
628 * @param aIPv6 passed DNS server address are in IPv6 form |
631 /** |
629 * @param aDNS1 first DNS server address |
632 * Plug-in implementation can make its on |
630 * @param aDNS1 secord DNS server address |
633 * cleanup in this function. |
631 * @param aDNSFromServer DNS address from server flag |
634 * Always called from LoadL() and |
632 */ |
635 * should be called from plugin's destructor. |
633 IMPORT_C void CheckDNSServerAddressL( |
636 */ |
634 TBool aIPv6, |
637 virtual void AdditionalReset() = 0; |
635 CommsDat::CMDBField<TDesC>& aDNS1, |
638 |
636 CommsDat::CMDBField<TDesC>& aDNS2, |
639 /** |
637 CommsDat::CMDBField<TBool>& aDNSFromServer ); |
640 * Check if there's connection established with |
|
641 * this connection method (IAP id). |
|
642 */ |
|
643 IMPORT_C virtual TBool CheckIfAlreadyConnected() const; |
|
644 |
|
645 protected: // virtual loader function |
|
646 |
|
647 /** |
|
648 * Inherited class can make some preraration |
|
649 * before CCmPluginBaseEng would start loading |
|
650 * records from tables. |
|
651 */ |
|
652 IMPORT_C virtual void PrepareToLoadRecordsL(); |
|
653 |
|
654 /** |
|
655 * Inherited class can load any additional |
|
656 * records after CCmPluginBaseEng finished. |
|
657 */ |
|
658 virtual void LoadAdditionalRecordsL(){}; |
|
659 |
|
660 /** |
|
661 * Load service record. Default implementation can |
|
662 * create only factory supported record instances. |
|
663 */ |
|
664 IMPORT_C virtual void LoadServiceSettingL(); |
|
665 |
|
666 protected: // virtual update functions |
|
667 |
|
668 /** |
|
669 * Check if connection method data is valid, before |
|
670 * it would be persisted to commsdat. |
|
671 * If invalid data found, set its attribute id in |
|
672 * iInvalidAttribute. |
|
673 * Base class implementation must be called from |
|
674 * overridden one. |
|
675 */ |
|
676 IMPORT_C virtual void PrepareToUpdateRecordsL(); |
|
677 |
|
678 /** |
|
679 * Inherited class can update its additional |
|
680 * records here. |
|
681 */ |
|
682 virtual void UpdateAdditionalRecordsL(){}; |
|
683 |
|
684 /** |
|
685 * Update service record. |
|
686 */ |
|
687 IMPORT_C virtual void UpdateServiceRecordL(); |
|
688 |
|
689 /** |
|
690 * Return the service table name and record id |
|
691 * of this connection in the service table. |
|
692 * @param - aServiceName name of the service table |
|
693 * this connection method points to. |
|
694 * @param - aRecordId record id in the service table. |
|
695 */ |
|
696 virtual void ServiceRecordIdLC( HBufC* &aServiceName, |
|
697 TUint32& aRecordId ) = 0; |
|
698 |
|
699 /** |
|
700 * Return the bearer table name and record id |
|
701 * of this connection in the bearer table. |
|
702 * @param - aBearerName name of the bearer table |
|
703 * this connection method points to. |
|
704 * @param - aRecordId record id in the bearer table. |
|
705 */ |
|
706 virtual void BearerRecordIdLC( HBufC* &aBearerName, |
|
707 TUint32& aRecordId ) = 0; |
|
708 |
|
709 protected: // virtual delete function |
|
710 |
|
711 /** |
|
712 * Plugin can prepare to delete the connection method |
|
713 * with this function. Called from DeleteL() before |
|
714 * any record would be deleted. Do NOT delete any |
|
715 * record here. |
|
716 */ |
|
717 virtual void PrepareToDeleteRecordsL(){}; |
|
718 |
|
719 /** |
|
720 * Plugin can delete additional, bearer specific record |
|
721 * with this function. Called from DeleteL(). |
|
722 */ |
|
723 virtual void DeleteAdditionalRecordsL(){}; |
|
724 |
|
725 protected: // virtual create function |
|
726 |
|
727 /** |
|
728 * Plugin has to create and initialize its bearer specific object |
|
729 * that points to the service record here. Pointer has to be stored in |
|
730 * iServiceRecord data member. |
|
731 * Do NOT store service record in CommsDat yet. |
|
732 */ |
|
733 virtual void CreateNewServiceRecordL() = 0; |
|
734 |
|
735 /** |
|
736 * Plugin can create and initialize its bearer specific record(s) here. |
|
737 * Do NOT store them in CommsDat yet. |
|
738 */ |
|
739 virtual void CreateAdditionalRecordsL(){}; |
|
740 |
|
741 protected: |
|
742 |
|
743 /** |
|
744 * Called from CreateCopyL(). |
|
745 * Plugin can prepare for copying every records |
|
746 * added to the conversion tables. |
|
747 * |
|
748 * @param aDestInst copy attributes into this plugin instance |
|
749 */ |
|
750 virtual void PrepareToCopyDataL( CCmPluginBaseEng& /*aDestInst*/ ) const {}; |
|
751 |
|
752 /** |
|
753 * Copy data of the connection method that is not |
|
754 * added to the conversion table. (e.g. bearer specific |
|
755 * flags) |
|
756 * |
|
757 * @param aDestInst copy attributes into this plugin instance |
|
758 */ |
|
759 virtual void CopyAdditionalDataL( CCmPluginBaseEng& /*aDestInst*/ ) const {}; |
|
760 |
638 |
761 private: |
639 private: |
762 |
640 /** |
|
641 * Handles all the Connection Method data copying to instance given as |
|
642 * parameter. This is called from CreateCopyL(). |
|
643 * @ param aCopyInstance Pointer to plugin to copy the data. |
|
644 */ |
|
645 void CopyDataL( CCmPluginBaseEng* aCopyInstance ); |
|
646 |
|
647 /** |
|
648 * Handles all the Connection Method related record copying. Called from |
|
649 * CopyDataL(). |
|
650 * @ param aCopyInstance Pointer to plugin to copy the data. |
|
651 */ |
|
652 void CopyRecordsL( CCmPluginBaseEng* aCopyInstance ); |
|
653 |
|
654 /** |
|
655 * Copies the record identified by aRecordIdentifier to copy instance. |
|
656 * @param aRecordIdentifier Identifies the record which is copied copy. |
|
657 * @param aCopyInstance Pointer to plugin to copy the data. |
|
658 */ |
|
659 void CopyRecordDataL( TUint32 aRecordIdentifier, |
|
660 CCmPluginBaseEng* aCopyInstance ); |
|
661 |
|
662 /** |
|
663 * Creates proxy record and sets the proxy settings enabled for this |
|
664 * Connection Method. |
|
665 */ |
763 void EnableProxyL( TBool aEnable ); |
666 void EnableProxyL( TBool aEnable ); |
764 void EnableChargeCardL( TBool aEnable ); |
667 |
|
668 /** |
|
669 * Creates location record and sets the location enabled for this |
|
670 * Connection Method. |
|
671 */ |
765 void EnableLocationL( TBool aEnable ); |
672 void EnableLocationL( TBool aEnable ); |
766 |
673 |
767 // Loader functions |
674 /** |
|
675 * Calls all the loading methods. |
|
676 */ |
768 void DoLoadL( TUint32 aIapId ); |
677 void DoLoadL( TUint32 aIapId ); |
|
678 |
|
679 /** |
|
680 * Loads IAP record. |
|
681 * @param aIapId Identifies the IAP record to load. |
|
682 */ |
769 void LoadIAPRecordL( TUint32 aIapId ); |
683 void LoadIAPRecordL( TUint32 aIapId ); |
770 void LoadChargeCardSettingL( TUint32 aChargeCardId ); |
684 |
771 void LoadProxySettingL(); |
685 /** |
772 void LoadNetworkSettingL(); |
686 * Loads proxy record related to this IAP. This is called as a result |
773 void LoadLocationSettingL(); |
687 * of calling LoadL(). |
|
688 */ |
|
689 void LoadProxyRecordL(); |
|
690 |
|
691 /** |
|
692 * Loads network record related to this IAP. This is called as a result |
|
693 * of calling LoadL(). |
|
694 */ |
|
695 void LoadNetworkRecordL(); |
|
696 |
|
697 /** |
|
698 * Loads location record related to this IAP. This is called as a result |
|
699 * of calling LoadL(). |
|
700 */ |
|
701 void LoadLocationRecordL(); |
|
702 |
|
703 /** |
|
704 * Loads WAP AP and WAP IP records related to this IAP. This is called as a result |
|
705 * of calling LoadL(). |
|
706 */ |
774 void LoadWapRecordL(); |
707 void LoadWapRecordL(); |
775 void LoadSeamlessnessRecordL(); |
708 |
776 |
709 /** |
777 // Updater functions |
710 * Loads iap metadata record related to this IAP. This is called as a result |
778 void UpdateIAPRecordL(); |
711 * of calling LoadL(). |
779 void UpdateProxyRecordL(); |
712 */ |
780 void UpdateChargeCardRecordL(); |
713 void LoadMetadataRecordL(); |
|
714 |
|
715 /** |
|
716 * Following methods are called as a result of calling method UpdateL(). |
|
717 * Each method overwrites the original data in memory with the client copy |
|
718 * of that data. Client data has all the possible changes set by client. |
|
719 * After overwrite the data is written to CommsDat. |
|
720 * @param aClientPluginInstance The client copy of the original data with the |
|
721 * possible changes. |
|
722 */ |
|
723 void UpdateIAPRecordL( CCmClientPluginInstance* aClientPluginInstance ); |
|
724 void UpdateProxyRecordL( CCmClientPluginInstance* aClientPluginInstance ); |
781 void UpdateConnPrefSettingL(); |
725 void UpdateConnPrefSettingL(); |
782 void UpdateNetworkRecordL(); |
726 void UpdateNetworkRecordL( CCmClientPluginInstance* aClientPluginInstance ); |
783 void UpdateLocationRecordL(); |
727 void UpdateLocationRecordL( CCmClientPluginInstance* aClientPluginInstance ); |
784 void UpdateWapRecordL(); |
728 void UpdateWapRecordL( CCmClientPluginInstance* aClientPluginInstance ); |
785 void UpdateSeamlessnessRecordL(); |
729 void UpdateMetadataRecordL( CCmClientPluginInstance* aClientPluginInstance ); |
786 |
730 void UpdateServiceRecordL( CCmClientPluginInstance* aClientPluginInstance ); |
787 /** |
731 |
788 * No WAP record found in load process, |
732 /** |
789 * but client wants to set start page. |
733 * Creates new wap records. |
790 */ |
734 */ |
791 void NewWapRecordL(); |
735 void NewWapRecordL(); |
792 |
736 |
793 /** |
737 /** |
794 * Create a new metadata record. |
738 * Searches the WAP records related to this iap. This is called as a |
795 * @param aSetDef ETrue if setting default seamlessness valud is needed |
739 * result of LoadL(). |
796 * @return create metadata record point |
740 * @return Returns pointer to WAP IP record. If it's not found NULL is |
|
741 * returned. |
|
742 */ |
|
743 CommsDat::CCDWAPIPBearerRecord* FindWAPRecordL(); |
|
744 |
|
745 /** |
|
746 * Creates a new metadata record. |
|
747 * @param aSetDef ETrue if setting default seamlessness value is needed |
|
748 * @return Returns metadata record pointer. |
797 */ |
749 */ |
798 CCDIAPMetadataRecord* NewSeamlessnessRecordL( TBool aSetDef ); |
750 CCDIAPMetadataRecord* NewMetadataRecordL( TBool aSetDef ); |
799 |
751 |
800 CommsDat::CCDWAPIPBearerRecord* FindWAPRecordL(); |
752 /** |
801 CCDIAPMetadataRecord* FindSeamlessnessRecordL(); |
753 * Searches the metadata record belonging to this iap. This is called as a |
802 |
754 * result of LoadL(). |
803 /** |
755 * @return Returns pointer to WAP IP record. If it's not found NULL is |
804 * Set attribute flag on the given record |
756 * returned. |
805 * @param aRecord record to be set |
757 */ |
806 * @param aAttribute e.g. ECDHidden |
758 CCDIAPMetadataRecord* FindMetadataRecordL(); |
|
759 |
|
760 /** |
|
761 * Set attribute flag on the given record. |
|
762 * @param aRecord Record to be set. |
|
763 * @param aAttribute Attribute to be set. |
807 * @param aSet ETrue to set, EFalse to clear |
764 * @param aSet ETrue to set, EFalse to clear |
808 */ |
765 */ |
809 void SetAttribute( CommsDat::CCDRecordBase* aRecord, |
766 void SetAttribute( CommsDat::CCDRecordBase* aRecord, |
810 TUint32 aAttribute, |
767 TUint32 aAttribute, |
811 TBool aSet ); |
768 TBool aSet ); |
816 * @param ADstRecord record of which attributes are set |
773 * @param ADstRecord record of which attributes are set |
817 */ |
774 */ |
818 void CopyAttributes( CommsDat::CCDRecordBase* aSrcRecord, |
775 void CopyAttributes( CommsDat::CCDRecordBase* aSrcRecord, |
819 CommsDat::CCDRecordBase* aDstRecord ); |
776 CommsDat::CCDRecordBase* aDstRecord ); |
820 |
777 |
821 /** |
778 |
822 * Find field element associated with the passed attribute. |
779 /** |
823 * @param aAttribute aatribute to find |
780 * Returns the default location record id. |
824 * @aType type of the attribute (e.g. bool, int or string) |
781 * @return Returns the default location record id. |
825 */ |
|
826 TValidationFunctionL FindFieldL( TUint32 aAttribute, |
|
827 TCMFieldTypes aType, |
|
828 CommsDat::CMDBElement* &aElement ) const; |
|
829 |
|
830 |
|
831 /** |
|
832 * Return Location id |
|
833 * @return location id |
|
834 */ |
782 */ |
835 TUint32 GetLocationIdL() const; |
783 TUint32 GetLocationIdL() const; |
836 |
784 |
837 /** |
785 private: |
838 * Search for common attribute and convert it to plugin specific one. |
786 |
839 * @param aAttribute common attribute id |
787 /** |
840 * @return bearer specific attribute id |
788 * Gives a possibility to make some prerarations before |
841 */ |
789 * starting to load bearer specific records. |
842 TUint32 CheckForCommonAttribute( const TUint32 aAttribute ) const; |
790 */ |
843 |
791 void PrepareToLoadRecordsL(); |
844 /** |
792 |
845 * Returns the common attribute for the bearer specific attribute. |
793 /** |
846 * Panics if there is no matching common attribute. |
794 * Gives a possibility to make some prerarations before |
847 * @param aAttribute bearer specific attribute |
795 * starting to update bearer specific records. |
848 * @return common attribute |
796 */ |
849 */ |
797 void PrepareToUpdateRecordsL( |
850 TUint32 CommonAttribute( const TUint32 aAttribute ) const; |
798 CCmClientPluginInstance* aClientPluginInstance ); |
851 |
799 |
852 public: // Util functions |
800 /** |
853 |
801 * Returns the element id of the iap record. |
854 IMPORT_C CommsDat::TMDBElementId IAPRecordElementId() const; |
802 * @return Returns the element id of the iap record. |
855 |
803 */ |
856 IMPORT_C TBool IsProtected() const; |
804 CommsDat::TMDBElementId IAPRecordElementId() const; |
857 |
805 |
858 TBool SetProxyServerNameL( const TDesC& aProxyServer ); |
806 /** |
859 |
807 * Checks the protection attribute of the IAP. |
860 /** |
808 * @return Returns ETrue if the IAP is protected. Otherwise returns |
861 * Return the coversion table item of the attribute |
809 * EFalse. |
862 * @param aAttribute attribute of which conversion item is requested |
810 */ |
863 * @return conversion table item |
811 TBool IsProtected() const; |
864 */ |
812 |
865 IMPORT_C const TCmAttribConvTable* ConvTableItem( TUint32 aAttribute ); |
813 /** |
866 |
814 * Sets the name of the proxy server to proxy record. If name's |
867 /** |
815 * length is 0, proxyport is set to 0 and proxyserver usage |
868 * Function to set up DNS addresses and DNS address from server flag. |
816 * boolean is set to EFalse. If the name is longer than 0, |
869 * Can be used with both IPv4 and IPv6 attribute. |
817 * boolean is set to ETrue. |
870 * Passed bearer specific attributes must be defined in common conversion |
818 * @param aProxyServer Address to be set. |
871 * table. |
819 * @param Record pointer where to set. |
872 * @param aSrv1Attr first DNS server address attribute |
820 */ |
873 * @param aSrv1 DNS first DNS server address |
821 void SetProxyServerNameL( const TDesC& aProxyServer, |
874 * @param aSrv2Attr second DNS server address |
822 CommsDat::CCDRecordBase* aProxyRecord ); |
875 * @param aSrv2 DNS second DNS server address attribute |
823 |
876 * @param aAddrFromSrvAttr DNS address from server flag attribute |
824 /** |
877 * @param aIPv6 ETrue if passed addresses are in IPv6 form |
825 * Sets a name to IAP. |
878 */ |
826 * @param aName Name to set. |
879 IMPORT_C void SetDNSServerAddressL( TUint32 aSrv1Attr, |
827 * @param aClientPluginInstance Client copy of data where to set the |
880 const TDesC& aSrv1, |
828 * name. UpdateL() updates the name to the CommsDat. |
881 TUint32 aSrv2Attr, |
829 */ |
882 const TDesC& aSrv2, |
830 void SetNameL( const TDesC& aName, |
883 TUint32 aAddrFromSrvAttr, |
831 CommsDat::CCDRecordBase* aIapRecord, |
884 TBool aIPv6 ); |
832 const CMManager::TNamingMethod aNamingMethod ); |
885 |
833 |
886 /** |
834 /** |
887 * Plugins can check DNS setting with this function. |
835 * Following methods are called as a result of SetNameL() to |
888 * Suggested to be called from PrepareToUpdateRecordsL(). |
836 * make a valid name of the given string. |
889 * It checked the DNS server addresses, moves secord into |
837 */ |
890 * first if first is dynamic, and update DNSFromServer field |
838 HBufC* DoMakeValidNameL( const TDesC& aName, |
891 * according to address values. |
839 const TUint32& aIapId ); |
892 * @param aIPv6 passed DNS server address are in IPv6 form |
|
893 * @param aDNS1 first DNS server address |
|
894 * @param aDNS1 secord DNS server address |
|
895 * @param aDNSFromServer DNS address from server flag |
|
896 */ |
|
897 IMPORT_C void CheckDNSServerAddressL( TBool aIPv6, |
|
898 CommsDat::CMDBField<TDesC>& aDNS1, |
|
899 CommsDat::CMDBField<TDesC>& aDNS2, |
|
900 CommsDat::CMDBField<TBool>& aDNSFromServer ); |
|
901 |
|
902 protected: |
|
903 |
|
904 /** |
|
905 * Checks if the ECmName attribute was set since the last update. |
|
906 * If so, name is updated in passed record |
|
907 * @param aRecord record to be checked against iIapRecord |
|
908 */ |
|
909 IMPORT_C void CheckIfNameModifiedL( CommsDat::CCDRecordBase* aRecord ) const; |
|
910 |
|
911 /** |
|
912 * Returns the global priority of the passed bearer type |
|
913 * @param aServiceType bearer type of which priority is requested |
|
914 * @return global bearer priority |
|
915 */ |
|
916 IMPORT_C TInt GlobalBearerPriority( const TDesC& aServiceType ) const; |
|
917 |
|
918 /** |
|
919 * Returns the global UI priority of the passed bearer type |
|
920 * @param aServiceType bearer type of which priority is requested |
|
921 * @return global UI bearer priority |
|
922 */ |
|
923 IMPORT_C TInt GlobalUiBearerPriority( const TDesC& aServiceType ) const; |
|
924 |
|
925 private: // Util functions |
|
926 |
|
927 HBufC* DoMakeValidNameL( const TDesC& aName ); |
|
928 HBufC* EnsureMaxLengthLC( const TDesC& aName, |
840 HBufC* EnsureMaxLengthLC( const TDesC& aName, |
929 TBool& aChanged ); |
841 TBool& aChanged ); |
930 |
|
931 TPtrC GetPrefix( const TDesC& aName ); |
842 TPtrC GetPrefix( const TDesC& aName ); |
932 TInt GetPostfix( const TDesC& aName, const TDesC& aPrefix ); |
843 TInt GetPostfix( const TDesC& aName, const TDesC& aPrefix ); |
933 |
844 TBool IsValidNameL( const TDesC& aNameText, |
934 TBool IsValidNameL( const TDesC& aNameText ); |
845 const TUint32& aIapId ); |
935 HBufC* EscapeTextLC( const TDesC& aLiteral ); |
846 HBufC* EscapeTextLC( const TDesC& aLiteral ); |
936 |
847 void SetDefaultNameL( const TDesC& aName ); |
937 void SetNameL( const TDesC& aName ); |
848 |
938 |
849 /** |
939 TCmAttrConvArrayItem* ConversionTable( TUint32 aAttribute ) const; |
850 * Check if the passed IP address is '0.0.0.0' or empty string |
940 CommsDat::CMDBElement& FieldByAttributeL( const TCmAttrConvArrayItem* aItem, |
851 * @param aIpAddress IP address to be checked |
941 const TUint32 aAttribute, |
|
942 TInt& aIndex ) const; |
|
943 |
|
944 /** |
|
945 * Writes the passed text into the passed attribute. |
|
946 * @param aAttribute The attribute to write into |
|
947 * @param aValue The value to write |
|
948 */ |
852 */ |
949 void GenericStringWriterL( const TUint32 aAttribute, |
853 TBool IsUnspecifiedIPv4Address( const TDesC& aIpv4Address ); |
950 const TDesC16& aValue ); |
854 |
951 |
855 /** |
952 /** |
856 * Check if the passed IP address is one of these: |
953 * Returns the common attribute for the bearer specific attribute, if |
857 * - empty string - |
954 * it is mapped to any. Otherwise, it returns the original attribute. |
858 * - '0:0:0:0:0:0:0:0' |
955 * @param aAttribute bearer specific attribute |
859 * - 'fec0:000:0000:ffff::1' |
956 * @return common/original attribute |
860 * - 'fec0:000:0000:ffff::2' |
|
861 * @param aIpAddress IP address to be checked |
957 */ |
862 */ |
958 TUint32 MappedCommonAttribute( const TUint32 aAttribute ) const; |
863 CMManager::TIPv6Types ClassifyIPv6Address( const TDesC& aIpv6Address ); |
959 public: |
|
960 |
|
961 /** |
|
962 * Indicates if the Id is valid or if this is a new object which sitll |
|
963 * haven't been updated. |
|
964 * Used by the object pool. |
|
965 * @return TBool |
|
966 */ |
|
967 TBool IdIsValid(); |
|
968 |
|
969 /** |
|
970 * Sets iIdIsValid attribute |
|
971 * Used by the object pool. |
|
972 */ |
|
973 void SetIdValidity(TBool validity); |
|
974 |
|
975 /** |
|
976 * Scans aDests for destinations that may be valid parents |
|
977 * for this plugin and removes those that may not. The function may be |
|
978 * overriden by virtual bearer type plugins. |
|
979 * @param aDests The array of destination IDs to be filtered. |
|
980 */ |
|
981 virtual void FilterPossibleParentsL( RArray<TUint32>& /*aDests*/ ) {} |
|
982 |
|
983 /** |
|
984 * Sets the predefined id for the plugin. This should only be |
|
985 * used by cmmanager framework. |
|
986 */ |
|
987 IMPORT_C void SetPreDefinedId( const TUint32 aPreDefId ); |
|
988 |
|
989 public: |
|
990 |
|
991 /** |
|
992 * Check if there is space to save record |
|
993 * @return ETrue if space is available; otherwise leave with KLeaveWithoutAlert |
|
994 */ |
|
995 IMPORT_C TBool CheckSpaceBelowCriticalLevelL() const; |
|
996 |
864 |
997 public: // Data |
865 public: // Data |
998 |
866 |
999 // Required attribute for the framework |
867 // Required attribute for the framework |
1000 // (An identifier used during destruction) |
868 // (An identifier used during destruction) |
1001 TUid iDtor_ID_Key; |
869 TUid iDtor_ID_Key; |
1002 |
870 TUint32 iBearerType; |
|
871 |
1003 protected: |
872 protected: |
1004 |
873 /** |
1005 CCmManagerImpl& iCmMgr; //< Not owned |
874 * Reference to cmm's session handle. Initialised at the construction |
1006 TUint32 iParentDest; // id of the parent destinaton |
875 * phase. |
1007 |
876 */ |
1008 // IAP id of the CM. 0 means that this is a newly |
877 CommsDat::CMDBSession& iSession; |
1009 // created one. |
878 |
|
879 /** |
|
880 * Generic record pointers. |
|
881 */ |
|
882 CommsDat::CCDIAPRecord* iIapRecord; |
|
883 CommsDat::CCDProxiesRecord* iProxyRecord; |
|
884 CommsDat::CCDRecordBase* iServiceRecord; |
|
885 CommsDat::CCDNetworkRecord* iNetworkRecord; |
|
886 CommsDat::CCDLocationRecord* iLocationRecord; |
|
887 CommsDat::CCDWAPAccessPointRecord* iWapAPRecord; |
|
888 CommsDat::CCDWAPIPBearerRecord* iWapIPBearerRecord; |
|
889 CCDIAPMetadataRecord* iMetaDataRecord; |
|
890 |
|
891 private: |
|
892 /** |
|
893 * IAP record id of the CM. 0 means that this is not stored to CommsDat |
|
894 * yet. If in UpdateL phase iap record has an id but iIapId == 0 --> |
|
895 * predefined iap id |
|
896 */ |
1010 TUint32 iIapId; |
897 TUint32 iIapId; |
1011 TUint32 iBearerType; //< Should be set by plugin |
898 |
1012 //< constructor |
899 /** |
1013 |
900 * Naming method of the CM. |
1014 CommsDat::CCDIAPRecord* iIapRecord; // created by base class |
901 */ |
1015 CommsDat::CCDProxiesRecord* iProxyRecord; // optional |
902 CMManager::TNamingMethod iNamingMethod; |
1016 CommsDat::CCDRecordBase* iServiceRecord; // created by plugin |
903 |
1017 CommsDat::CCDChargecardRecord* iChargeCardRecord; // optional |
904 /** |
1018 CommsDat::CCDNetworkRecord* iNetworkRecord; // created by base class |
905 * Table id of the iap metadata table. |
1019 CommsDat::CCDLocationRecord* iLocationRecord; // optional |
906 */ |
1020 |
907 CommsDat::TMDBElementId iMetadataTableId; |
1021 TBool iChargeCardEnabled; |
908 |
1022 TBool iLocationEnabled; |
909 /** |
1023 |
910 * Identifies if the location is enabled. |
1024 TUint32 iInvalidAttribute; |
911 */ |
1025 |
912 TBool iLocationEnabled; |
1026 private: // Data |
|
1027 |
|
1028 CCmPluginBasePrivate* iPriv; |
|
1029 //Reference counter for the object pool |
|
1030 TInt iRefCounter; |
|
1031 //indicates if the Id is valid or not (for the object pool) |
|
1032 TBool iIdIsValid; |
|
1033 // Predefined connection method id(iap id) |
|
1034 TUint32 iPreDefIapId; |
|
1035 friend class CCmPluginBase; |
|
1036 }; |
913 }; |
1037 |
914 |
1038 #endif // CMPLUGINBASEENG_H |
915 #endif // CMPLUGINBASEENG_H |