epoc32/include/mw/cmmanager.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/cmmanager.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/cmmanager.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,401 @@
     1.4 -cmmanager.h
     1.5 +/*
     1.6 +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:  Connection manager IF class.
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +#ifndef CMMANAGER_H
    1.23 +#define CMMANAGER_H
    1.24 +
    1.25 +// System Includes
    1.26 +#include <e32std.h>
    1.27 +#include <e32base.h>
    1.28 +#include <e32cmn.h>
    1.29 +#include <cmdefconnvalues.h>
    1.30 +
    1.31 +// Forward Declarations
    1.32 +class RCmConnectionMethod;
    1.33 +class RCmDestination;
    1.34 +class CCmManagerImpl;
    1.35 +class TBearerPriority;
    1.36 +class CGulIcon;
    1.37 +
    1.38 +/**
    1.39 + *  RCmManager gives access to network destinations and connection methods.
    1.40 + *
    1.41 + *  @lib cmmanager.lib
    1.42 + *  @since S60 v3.2
    1.43 + */
    1.44 +NONSHARABLE_CLASS(RCmManager)
    1.45 +      {          
    1.46 +    //=====================================================================
    1.47 +    // Constructors/Destructors
    1.48 +    // 
    1.49 +    public:
    1.50 +    
    1.51 +        /**
    1.52 +        * Default constructor. 
    1.53 +        */
    1.54 +        inline RCmManager();
    1.55 +
    1.56 +    //=====================================================================
    1.57 +    // API functions
    1.58 +    public:
    1.59 +        
    1.60 +        /**
    1.61 +        * Symbian constructor
    1.62 +        *
    1.63 +        * @since S60 3.2
    1.64 +        */
    1.65 +        IMPORT_C void OpenL();    
    1.66 +        
    1.67 +        /**
    1.68 +        * Symbian constructor
    1.69 +        * Pushes the object on the cleanup stack
    1.70 +        *
    1.71 +        * @since S60 3.2
    1.72 +        */
    1.73 +        IMPORT_C void OpenLC();    
    1.74 +        
    1.75 +        /**
    1.76 +        * Secondary destructor
    1.77 +        *
    1.78 +        * @since S60 3.2
    1.79 +        */
    1.80 +        IMPORT_C void Close();
    1.81 +        
    1.82 +    //=======================================================================
    1.83 +    // Getter API
    1.84 +    public:    
    1.85 +      
    1.86 +        /**
    1.87 +        * Used to query bearer information that doesn't belong
    1.88 +        * to a specific connection method, such as 
    1.89 +        * ECmCoverage or ECmDefaultPriority etc.
    1.90 +        *
    1.91 +        * @since S60 3.2
    1.92 +        * @param aBearerType the bearer
    1.93 +        * @param aAttribute the setting value
    1.94 +        * @return the setting value
    1.95 +        */
    1.96 +        IMPORT_C TUint32 GetBearerInfoIntL( TUint32 aBearerType,
    1.97 +                                  TUint32 aAttribute ) const;
    1.98 +                                  
    1.99 +        
   1.100 +        /**
   1.101 +        * Used to query bearer information that doesn't belong
   1.102 +        * to a specific connection method, such as 
   1.103 +        * ECmCoverage or ECmDefaultPriority etc.
   1.104 +        *
   1.105 +        * @since S60 3.2
   1.106 +        * @param aBearerType the bearer
   1.107 +        * @param aAttribute the setting value
   1.108 +        * @return the setting value
   1.109 +        */
   1.110 +        IMPORT_C TBool GetBearerInfoBoolL( TUint32 aBearerType,
   1.111 +                                 TUint32 aAttribute ) const;
   1.112 +        /**
   1.113 +        * Used to query bearer information that doesn't belong
   1.114 +        * to a specific connection method, such as 
   1.115 +        * ECmCoverage or ECmDefaultPriority etc.
   1.116 +        * HBuf ownership is passed to the caller
   1.117 +        *
   1.118 +        * @since S60 3.2
   1.119 +        * @param aBearerType the bearer
   1.120 +        * @param aAttribute the setting value
   1.121 +        * @return the setting value
   1.122 +        */        
   1.123 +        IMPORT_C HBufC* GetBearerInfoStringL( TUint32 aBearerType,
   1.124 +                                    TUint32 aAttribute ) const;
   1.125 +        /**
   1.126 +        * Used to query bearer information that does not belong
   1.127 +        * to a specific connection method, such as 
   1.128 +        * ECmCoverage or ECmDefaultPriority, etc.
   1.129 +        * HBuf ownership is passed to the caller
   1.130 +        *
   1.131 +        * @since S60 3.2
   1.132 +        * @param aBearerType the bearer
   1.133 +        * @param aAttribute the setting value
   1.134 +        * @return the setting value
   1.135 +        */
   1.136 +        IMPORT_C HBufC8* GetBearerInfoString8L( TUint32 aBearerType,
   1.137 +                                    TUint32 aAttribute ) const;
   1.138 +                    
   1.139 +        /**
   1.140 +        * Used to query any non-bearer specific information about
   1.141 +        * a given connection method. This can be e.g. ECmBearerType,
   1.142 +        * ECmName, ECmStartPage, etc.
   1.143 +        *
   1.144 +        * @since S60 3.2
   1.145 +        * @param aIapId the connection method id
   1.146 +        * @param aAttribute the setting value
   1.147 +        * @return the setting value
   1.148 +        */
   1.149 +        IMPORT_C TUint32 GetConnectionMethodInfoIntL( TUint32 aIapId,
   1.150 +                                             TUint32 aAttribute ) const;
   1.151 +        
   1.152 +        /**
   1.153 +        * Used to query any, non-bearer specific information about
   1.154 +        * a given connection method. This can be e.g. ECmBearerType,
   1.155 +        * ECmName, ECmStartPage, etc.
   1.156 +        *
   1.157 +        * @since S60 3.2
   1.158 +        * @param aIapId the connection method id
   1.159 +        * @param aAttribute the setting value
   1.160 +        * @return the setting value
   1.161 +        */
   1.162 +        IMPORT_C TBool GetConnectionMethodInfoBoolL( TUint32 aIapId,
   1.163 +                                            TUint32 aAttribute ) const;
   1.164 +
   1.165 +        /**
   1.166 +        * Used to query any non-bearer specific information about
   1.167 +        * a given connection method. This can be e.g. ECmBearerType,
   1.168 +        * ECmName, ECmStartPage, etc.
   1.169 +        * HBuf ownership is passed to the caller
   1.170 +        *
   1.171 +        * @since S60 3.2
   1.172 +        * @param aIapId the connection method id
   1.173 +        * @param aAttribute the setting value
   1.174 +        * @return the setting value
   1.175 +        */
   1.176 +        IMPORT_C HBufC* GetConnectionMethodInfoStringL( TUint32 aIapId,
   1.177 +                                               TUint32 aAttribute ) const;
   1.178 +
   1.179 +        /**
   1.180 +        * Used to query any non-bearer specific information about
   1.181 +        * a given connection method. This can be e.g. ECmBearerType,
   1.182 +        * ECmName, ECmStartPage, etc.
   1.183 +        * HBuf ownership is passed to the caller
   1.184 +        *
   1.185 +        * @since S60 3.2
   1.186 +        * @param aIapId the connection method id
   1.187 +        * @param aAttribute the setting value
   1.188 +        * @return the setting value
   1.189 +        */
   1.190 +        IMPORT_C HBufC8* GetConnectionMethodInfoString8L( TUint32 aIapId,
   1.191 +                                               TUint32 aAttribute ) const;
   1.192 +                
   1.193 +        /**
   1.194 +        * Returns the connection method queried by its ID
   1.195 +        *
   1.196 +        * @since S60 3.2
   1.197 +        * @param aConnectionMethodId id of the connection method
   1.198 +        * @return RCmConnectionMethod connection method
   1.199 +        */
   1.200 +        IMPORT_C RCmConnectionMethod ConnectionMethodL( 
   1.201 +                                     TUint32 aConnectionMethodId ) const;
   1.202 +                        
   1.203 +        /**
   1.204 +        * Returns the list of connection methods. Connection Methods are 
   1.205 +        * filtered by the switch parameters e.g. aLegacyOnly.
   1.206 +        *
   1.207 +        * @since S60 3.2
   1.208 +        * @param aCMArray on return it is the array of IAP ids.
   1.209 +        * @param aCheckBearerType If ETrue only connection methods with 
   1.210 +        *                         supported bearer type are returned
   1.211 +        * @param aLegacyOnly when set to ETrue only Legacy IAP ids will
   1.212 +        *                         be returned
   1.213 +        * @param aEasyWlan when set to ETrue EasyWlan id is returned, too
   1.214 +        */
   1.215 +        IMPORT_C void ConnectionMethodL( RArray<TUint32>& aCMArray, 
   1.216 +                                         TBool aCheckBearerType = ETrue,
   1.217 +                                         TBool aLegacyOnly = ETrue,
   1.218 +                                         TBool aEasyWlan = EFalse ) const;
   1.219 +        
   1.220 +        /**
   1.221 +        * Returns an array of all destination id's
   1.222 +        *
   1.223 +        * @since S60 3.2
   1.224 +        * @param aDestArray list all available destinations' id
   1.225 +        */ 
   1.226 +        IMPORT_C void AllDestinationsL( RArray<TUint32>& aDestArray ) const;
   1.227 +
   1.228 +        /**
   1.229 +        * Returns the destination to which a specified 
   1.230 +        * connection method belongs, search is by destination ID
   1.231 +        *
   1.232 +        * @since S60 3.2
   1.233 +        * @param aDestinationId id of destination
   1.234 +        * @return RCmDestination network destination 
   1.235 +        */
   1.236 +        IMPORT_C RCmDestination DestinationL( TUint32 aDestinationId ) const;
   1.237 +       
   1.238 +        /**
   1.239 +        * Returns the copy of the bearer priority array. Ownership is passed.
   1.240 +        *
   1.241 +        * @since S60 3.2
   1.242 +        * @param aArray bearer priority array
   1.243 +        */          
   1.244 +        IMPORT_C void BearerPriorityArrayL( 
   1.245 +                                   RArray<TBearerPriority>& aArray ) const;
   1.246 +       
   1.247 +        /**
   1.248 +        * Clean up passed global bearer priority array. Delete
   1.249 +        * the elements and calls Reset and Close on the array.
   1.250 +        *
   1.251 +        * @since S60 3.2
   1.252 +        * @param aArray array to be cleaned up
   1.253 +        */
   1.254 +        IMPORT_C void CleanupGlobalPriorityArray( 
   1.255 +                                   RArray<TBearerPriority>& aArray ) const;
   1.256 +        
   1.257 +        /**
   1.258 +        * Returns the id of the EasyWlan connection method.
   1.259 +        *
   1.260 +        * @since S60 3.2
   1.261 +        * @return id of the EasyWLan connection method. 0 if not found.
   1.262 +        */
   1.263 +        IMPORT_C TUint32 EasyWlanIdL() const;
   1.264 +        
   1.265 +        /**
   1.266 +        * Returns the default connection method/SNAP.
   1.267 +        *
   1.268 +        * @since S60 3.2
   1.269 +        */
   1.270 +        IMPORT_C void ReadDefConnL( TCmDefConnValue& aDCSetting );
   1.271 +
   1.272 +        /**
   1.273 +        * Stores the default connection method/SNAP.
   1.274 +        *
   1.275 +        * @since S60 3.2
   1.276 +        */
   1.277 +        IMPORT_C void WriteDefConnL( const TCmDefConnValue& aDCSetting );  
   1.278 +
   1.279 +
   1.280 +        /** Open session and create tables if they don't exist*/
   1.281 +        IMPORT_C void CreateTablesAndOpenL();    
   1.282 +
   1.283 +        /**
   1.284 +        * Creates a Destination with the passed name. 
   1.285 +        * @param aName the name of the new destination.
   1.286 +        * @return RCmDestination new destination. ownership is passed to the 
   1.287 +        * caller
   1.288 +        */
   1.289 +        IMPORT_C RCmDestination CreateDestinationL( const TDesC& aName );
   1.290 +
   1.291 +        /**
   1.292 +        * Creates a connection method does not belong to any destination
   1.293 +        * @param aImplementationUid - bearer type of the new connection method
   1.294 +        * @return RCmConnectionMethod newly created connection method.
   1.295 +        */
   1.296 +        IMPORT_C RCmConnectionMethod CreateConnectionMethodL( TUint32 aBearerType );        
   1.297 +
   1.298 +        /**
   1.299 +        * Copies a connection method belonging to one destination to 
   1.300 +        * another. The connection method becomes shared.
   1.301 +        * Calls UpdateL on the destination
   1.302 +        * @param aTargetDestination
   1.303 +        * @param aConnectionMethodId
   1.304 +        * @return TInt - index in the Connection Method list
   1.305 +        */
   1.306 +        IMPORT_C TInt CopyConnectionMethodL( RCmDestination& aTargetDestination,
   1.307 +                                             RCmConnectionMethod& aConnectionMethod );
   1.308 +
   1.309 +        /**
   1.310 +        * Moves a connection method belonging to one destination to 
   1.311 +        * another. The connection method is removed from the source destination
   1.312 +        * @param aSourceDestination
   1.313 +        * @param aTargetDestination
   1.314 +        * @param aConnectionMethod
   1.315 +        * @return TInt - index in the Connection Method list
   1.316 +        */
   1.317 +        IMPORT_C TInt MoveConnectionMethodL( RCmDestination& aSourceDestination,
   1.318 +                                             RCmDestination& aTargetDestination,
   1.319 +                                             RCmConnectionMethod& aConnectionMethod );
   1.320 +
   1.321 +        /**
   1.322 +        * Remove connection method from the destination
   1.323 +        * @param aDestination destination the connection method is attached to
   1.324 +        * @param aConnectionMethod connection method to be removed
   1.325 +        */
   1.326 +        IMPORT_C void RemoveConnectionMethodL( RCmDestination& aDestination,
   1.327 +                                               RCmConnectionMethod& aConnectionMethod );
   1.328 +
   1.329 +        /**
   1.330 +        * Removes connection method from every destination and make it 
   1.331 +        * uncategorized.
   1.332 +        * @param aConnectionMethod connection method to be removed
   1.333 +        */
   1.334 +        IMPORT_C void RemoveAllReferencesL( RCmConnectionMethod& aConnectionMethod );
   1.335 +
   1.336 +        /**
   1.337 +        * Update bearer priority array
   1.338 +        * @param aArray array with new global bearer priority
   1.339 +        */          
   1.340 +        IMPORT_C void UpdateBearerPriorityArrayL( const RArray<TBearerPriority>& aArray );
   1.341 +
   1.342 +        /**
   1.343 +        * Creates a Destination with the passed name and id. 
   1.344 +        * @param aName the name of the new destination.
   1.345 +        * @param aDestId Predefined id of the destination.
   1.346 +        * @return RCmDestination newly created destination or leaves with
   1.347 +        * KErrAlreadyExists if there exists CM with the same Id.
   1.348 +        * Ownership is passed to the caller.
   1.349 +        */
   1.350 +        IMPORT_C RCmDestination CreateDestinationL( const TDesC& aName,
   1.351 +                                                       TUint32      aDestId );
   1.352 +
   1.353 +        /**
   1.354 +        * Creates a connection method does not belong to any destination
   1.355 +        * @param aImplementationUid - bearer type of the new connection
   1.356 +        * method
   1.357 +        * @param aConnMethodId Predefined id for the connection method.
   1.358 +        * @return RCmConnectionMethod newly created connection
   1.359 +        * method or leaves with KErrAlreadyExists if there exists CM
   1.360 +        * with the same Id.
   1.361 +        */
   1.362 +        IMPORT_C RCmConnectionMethod CreateConnectionMethodL( TUint32 aImplementationUid,
   1.363 +                                                              TUint32 aConnMethodId );
   1.364 +
   1.365 +        /**
   1.366 +        * Query all of the supported bearer types.
   1.367 +        * @param aArray list of all supported bearer types.
   1.368 +        */          
   1.369 +        IMPORT_C void SupportedBearersL( RArray<TUint32>& aArray ) const;
   1.370 +
   1.371 +        /**
   1.372 +        * Returns "Uncategorized" icon.
   1.373 +        * This fucton leaves if the client does not have a valid UI context
   1.374 +        * @return CGulIcon* Icon of uncategorized connection methods. Ownership 
   1.375 +        * is passed.
   1.376 +        */          
   1.377 +        IMPORT_C CGulIcon* UncategorizedIconL() const;
   1.378 +        
   1.379 +    private:
   1.380 +        /**
   1.381 +        * This is a private copy constructor without implementation.
   1.382 +        * The sole purpose of this declaration is to forbid the copying of 
   1.383 +        * the objects of this class.
   1.384 +        */          
   1.385 +        RCmManager(RCmManager&  );
   1.386 +        /**
   1.387 +        * This is a private copy constructor without implementation.
   1.388 +        * The sole purpose of this declaration is to forbid the copying of 
   1.389 +        * the objects of this class.
   1.390 +        */          
   1.391 +        RCmManager& operator=( RCmManager& );
   1.392 +    //=========================================================================
   1.393 +    // Member data
   1.394 +    
   1.395 +    private:
   1.396 +    
   1.397 +        /**
   1.398 +         * the implementation class
   1.399 +         */
   1.400 +        CCmManagerImpl* iImplementation;
   1.401 +    };
   1.402 +
   1.403 +#include "cmmanager.inl"
   1.404 +    
   1.405 +#endif // CMMANAGER_H