2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Connection manager IF class.
25 #include <cmdefconnvalues.h>
26 #include <cmgenconnsettings.h>
28 // Forward Declarations
29 class RCmConnectionMethod;
32 class TBearerPriority;
36 * RCmManager gives access to network destinations and connection methods.
41 NONSHARABLE_CLASS(RCmManager)
43 //=====================================================================
44 // Constructors/Destructors
49 * Default constructor.
53 //=====================================================================
62 IMPORT_C void OpenL();
66 * Pushes the object on the cleanup stack
70 IMPORT_C void OpenLC();
73 * Secondary destructor
77 IMPORT_C void Close();
79 //=======================================================================
84 * Used to query bearer information that doesn't belong
85 * to a specific connection method, such as
86 * ECmCoverage or ECmDefaultPriority etc.
89 * @param aBearerType the bearer
90 * @param aAttribute the setting value
91 * @return the setting value
93 IMPORT_C TUint32 GetBearerInfoIntL( TUint32 aBearerType,
94 TUint32 aAttribute ) const;
98 * Used to query bearer information that doesn't belong
99 * to a specific connection method, such as
100 * ECmCoverage or ECmDefaultPriority etc.
103 * @param aBearerType the bearer
104 * @param aAttribute the setting value
105 * @return the setting value
107 IMPORT_C TBool GetBearerInfoBoolL( TUint32 aBearerType,
108 TUint32 aAttribute ) const;
110 * Used to query bearer information that doesn't belong
111 * to a specific connection method, such as
112 * ECmCoverage or ECmDefaultPriority etc.
113 * HBuf ownership is passed to the caller
116 * @param aBearerType the bearer
117 * @param aAttribute the setting value
118 * @return the setting value
120 IMPORT_C HBufC* GetBearerInfoStringL( TUint32 aBearerType,
121 TUint32 aAttribute ) const;
123 * Used to query bearer information that does not belong
124 * to a specific connection method, such as
125 * ECmCoverage or ECmDefaultPriority, etc.
126 * HBuf ownership is passed to the caller
129 * @param aBearerType the bearer
130 * @param aAttribute the setting value
131 * @return the setting value
133 IMPORT_C HBufC8* GetBearerInfoString8L( TUint32 aBearerType,
134 TUint32 aAttribute ) const;
137 * Used to query any non-bearer specific information about
138 * a given connection method. This can be e.g. ECmBearerType,
139 * ECmName, ECmStartPage, etc.
142 * @param aIapId the connection method id
143 * @param aAttribute the setting value
144 * @return the setting value
146 IMPORT_C TUint32 GetConnectionMethodInfoIntL( TUint32 aIapId,
147 TUint32 aAttribute ) const;
150 * Used to query any, non-bearer specific information about
151 * a given connection method. This can be e.g. ECmBearerType,
152 * ECmName, ECmStartPage, etc.
155 * @param aIapId the connection method id
156 * @param aAttribute the setting value
157 * @return the setting value
159 IMPORT_C TBool GetConnectionMethodInfoBoolL( TUint32 aIapId,
160 TUint32 aAttribute ) const;
163 * Used to query any non-bearer specific information about
164 * a given connection method. This can be e.g. ECmBearerType,
165 * ECmName, ECmStartPage, etc.
166 * HBuf ownership is passed to the caller
169 * @param aIapId the connection method id
170 * @param aAttribute the setting value
171 * @return the setting value
173 IMPORT_C HBufC* GetConnectionMethodInfoStringL( TUint32 aIapId,
174 TUint32 aAttribute ) const;
177 * Used to query any non-bearer specific information about
178 * a given connection method. This can be e.g. ECmBearerType,
179 * ECmName, ECmStartPage, etc.
180 * HBuf ownership is passed to the caller
183 * @param aIapId the connection method id
184 * @param aAttribute the setting value
185 * @return the setting value
187 IMPORT_C HBufC8* GetConnectionMethodInfoString8L( TUint32 aIapId,
188 TUint32 aAttribute ) const;
191 * Returns the connection method queried by its ID
194 * @param aConnectionMethodId id of the connection method
195 * @return RCmConnectionMethod connection method
197 IMPORT_C RCmConnectionMethod ConnectionMethodL(
198 TUint32 aConnectionMethodId ) const;
201 * Returns the list of connection methods. Connection Methods are
202 * filtered by the switch parameters e.g. aLegacyOnly.
205 * @param aCMArray on return it is the array of IAP ids.
206 * @param aCheckBearerType If ETrue only connection methods with
207 * supported bearer type are returned
208 * @param aLegacyOnly when set to ETrue only Legacy IAP ids will
210 * @param aEasyWlan when set to ETrue EasyWlan id is returned, too
212 IMPORT_C void ConnectionMethodL( RArray<TUint32>& aCMArray,
213 TBool aCheckBearerType = ETrue,
214 TBool aLegacyOnly = ETrue,
215 TBool aEasyWlan = EFalse ) const;
218 * Returns an array of all destination id's
221 * @param aDestArray list all available destinations' id
223 IMPORT_C void AllDestinationsL( RArray<TUint32>& aDestArray ) const;
226 * Returns the destination to which a specified
227 * connection method belongs, search is by destination ID
230 * @param aDestinationId id of destination
231 * @return RCmDestination network destination
233 IMPORT_C RCmDestination DestinationL( TUint32 aDestinationId ) const;
236 * Returns the copy of the bearer priority array. Ownership is passed.
239 * @param aArray bearer priority array
241 IMPORT_C void BearerPriorityArrayL(
242 RArray<TBearerPriority>& aArray ) const;
245 * Clean up passed global bearer priority array. Delete
246 * the elements and calls Reset and Close on the array.
249 * @param aArray array to be cleaned up
251 IMPORT_C void CleanupGlobalPriorityArray(
252 RArray<TBearerPriority>& aArray ) const;
255 * Returns the id of the EasyWlan connection method.
258 * @return id of the EasyWLan connection method. 0 if not found.
260 IMPORT_C TUint32 EasyWlanIdL() const;
263 * Returns the default connection method/SNAP.
267 IMPORT_C void ReadDefConnL( TCmDefConnValue& aDCSetting );
270 * Stores the default connection method/SNAP.
274 IMPORT_C void WriteDefConnL( const TCmDefConnValue& aDCSetting );
278 * Returns the general connection settings.
282 IMPORT_C void ReadGenConnSettingsL( TCmGenConnSettings& aGenConnSettings );
285 * Writes the general connection settings.
289 IMPORT_C void WriteGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings );
292 /** Open session and create tables if they don't exist*/
293 IMPORT_C void CreateTablesAndOpenL();
296 * Creates a Destination with the passed name.
297 * @param aName the name of the new destination.
298 * @return RCmDestination new destination. ownership is passed to the
301 IMPORT_C RCmDestination CreateDestinationL( const TDesC& aName );
304 * Creates a connection method does not belong to any destination
305 * @param aImplementationUid - bearer type of the new connection method
306 * @return RCmConnectionMethod newly created connection method.
308 IMPORT_C RCmConnectionMethod CreateConnectionMethodL( TUint32 aBearerType );
311 * Copies a connection method belonging to one destination to
312 * another. The connection method becomes shared.
313 * Calls UpdateL on the destination
314 * @param aTargetDestination
315 * @param aConnectionMethodId
316 * @return TInt - index in the Connection Method list
318 IMPORT_C TInt CopyConnectionMethodL( RCmDestination& aTargetDestination,
319 RCmConnectionMethod& aConnectionMethod );
322 * Moves a connection method belonging to one destination to
323 * another. The connection method is removed from the source destination
324 * @param aSourceDestination
325 * @param aTargetDestination
326 * @param aConnectionMethod
327 * @return TInt - index in the Connection Method list
329 IMPORT_C TInt MoveConnectionMethodL( RCmDestination& aSourceDestination,
330 RCmDestination& aTargetDestination,
331 RCmConnectionMethod& aConnectionMethod );
334 * Remove connection method from the destination
335 * @param aDestination destination the connection method is attached to
336 * @param aConnectionMethod connection method to be removed
338 IMPORT_C void RemoveConnectionMethodL( RCmDestination& aDestination,
339 RCmConnectionMethod& aConnectionMethod );
342 * Removes connection method from every destination and make it
344 * @param aConnectionMethod connection method to be removed
346 IMPORT_C void RemoveAllReferencesL( RCmConnectionMethod& aConnectionMethod );
349 * Update bearer priority array
350 * @param aArray array with new global bearer priority
352 IMPORT_C void UpdateBearerPriorityArrayL( const RArray<TBearerPriority>& aArray );
355 * Creates a Destination with the passed name and id.
356 * @param aName the name of the new destination.
357 * @param aDestId Predefined id of the destination.
358 * @return RCmDestination newly created destination or leaves with
359 * KErrAlreadyExists if there exists CM with the same Id.
360 * Ownership is passed to the caller.
362 IMPORT_C RCmDestination CreateDestinationL( const TDesC& aName,
366 * Creates a connection method does not belong to any destination
367 * @param aImplementationUid - bearer type of the new connection
369 * @param aConnMethodId Predefined id for the connection method.
370 * @return RCmConnectionMethod newly created connection
371 * method or leaves with KErrAlreadyExists if there exists CM
374 IMPORT_C RCmConnectionMethod CreateConnectionMethodL( TUint32 aImplementationUid,
375 TUint32 aConnMethodId );
378 * Query all of the supported bearer types.
379 * @param aArray list of all supported bearer types.
381 IMPORT_C void SupportedBearersL( RArray<TUint32>& aArray ) const;
384 * Returns "Uncategorized" icon.
385 * This fucton leaves if the client does not have a valid UI context
386 * @return CGulIcon* Icon of uncategorized connection methods. Ownership
389 IMPORT_C CGulIcon* UncategorizedIconL() const;
393 * This is a private copy constructor without implementation.
394 * The sole purpose of this declaration is to forbid the copying of
395 * the objects of this class.
397 RCmManager(RCmManager& );
399 * This is a private copy constructor without implementation.
400 * The sole purpose of this declaration is to forbid the copying of
401 * the objects of this class.
403 RCmManager& operator=( RCmManager& );
404 //=========================================================================
410 * the implementation class
412 CCmManagerImpl* iImplementation;
415 #include "cmmanager.inl"
417 #endif // CMMANAGER_H