ipcm_plat/extended_connection_settings_api/inc/cmmanagerext.h
branchRCL_3
changeset 57 05bc53fe583b
parent 8 2e6c4614c58e
child 58 83ca720e2b9a
equal deleted inserted replaced
55:fc7b30ed2058 57:05bc53fe583b
     1 /*
     1 /*
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  Connection manager IF class.
    14 * Description:
       
    15 * Connection manager IF class.
    15 *
    16 *
    16 */
    17 */
    17 
    18 
       
    19 
    18 #ifndef CMMANAGEREXT_H
    20 #ifndef CMMANAGEREXT_H
    19 #define CMMANAGEREXT_H
    21 #define CMMANAGEREXT_H
    20 
    22 
    21 // System includes
    23 // Deprecation warning
    22 #include <e32std.h>
    24 #warning This header file is deprecated and shall not be used anymore. Please use cmmanager.h instead. See Polonium CR #461 for details.
       
    25 
    23 #include <e32base.h>
    26 #include <e32base.h>
    24 #include <e32cmn.h>
       
    25 #include <metadatabase.h>
    27 #include <metadatabase.h>
    26 #include <ConeResLoader.h>
       
    27 #include <cmmanagerdef.h>
    28 #include <cmmanagerdef.h>
    28 #include <cmconnectionmethodext.h>
    29 #include <cmconnectionmethodext.h>
    29 #include <cmdefconnvalues.h>
    30 #include <cmdefconnvalues.h>
    30 
    31 
    31 // FORWARD DECLARATIONS
    32 // Forward declarations
    32 class RCmDestinationExt;
    33 class RCmDestinationExt;
    33 class CCmManagerImpl;
    34 class RCmManagerApi;
    34 class CGulIcon;
    35 
    35 
    36 
    36 /**
    37 /**
    37  *  RCmManager is used to query and modify network destinations and connection
    38  *  RCmManager is used to query and modify network destinations and connection
    38  *  methods.
    39  *  methods.
    39  *
    40  *
    40  *  @lib cmmanager.lib
    41  *  @lib cmmanager.lib
    41  *  @since S60 v3.2
    42  *  @since S60 v3.2
    42  */
    43  */
    43 NONSHARABLE_CLASS(RCmManagerExt)
    44 NONSHARABLE_CLASS( RCmManagerExt )
    44     {
    45     {
    45     //=====================================================================
       
    46     // Constructors/Destructors
       
    47     // 
       
    48     public:
    46     public:
    49     
       
    50         /** Inline constructor */
    47         /** Inline constructor */
    51         inline RCmManagerExt();
    48         inline RCmManagerExt();
    52 
    49 
    53     //=====================================================================
       
    54     // API functions
       
    55     public:
    50     public:
    56         
       
    57         /** Open session */
    51         /** Open session */
    58         IMPORT_C void OpenL();    
    52         IMPORT_C void OpenL();
    59 
    53 
    60         /** Open session and create tables if they don't exist*/
    54         /** Open session and create tables if they don't exist */
    61         IMPORT_C void CreateTablesAndOpenL();    
    55         IMPORT_C void CreateTablesAndOpenL();
    62         
    56 
    63         /**
    57         /**
    64         * Symbian constructor
    58         * Symbian constructor
    65         * Pushes the object on the cleanup stack
    59         * Pushes the object on the cleanup stack
    66         *
    60         *
    67         * @since S60 3.2
    61         * @since S60 3.2
    68         */
    62         */
    69         IMPORT_C void OpenLC();    
    63         IMPORT_C void OpenLC();
    70         
    64 
    71         /** Close session */
    65         /** Close session */
    72         IMPORT_C void Close();
    66         IMPORT_C void Close();
    73         
    67 
    74         /**
    68         /**
    75         * GetBearerInfoXXX function can be used to query
    69         * GetBearerInfoXXX function can be used to query bearer informantion
    76         * bearer informantion that doesn't belong
    70         * that doesn't belong to a specific connection method, such as
    77         * to a specific connection method, such as 
       
    78         * ECmCoverage or ECmDefaultPriority etc.
    71         * ECmCoverage or ECmDefaultPriority etc.
    79         * NULL pointer, returned from string functions, means
    72         * NULL pointer, returned from string functions, means attribute exists
    80         * attribute exists but has no value.
    73         * but has no value.
       
    74         * HBuf ownership is passed to the caller.
       
    75         */
       
    76         IMPORT_C TUint32 GetBearerInfoIntL(
       
    77                 TUint32 aBearerType,
       
    78                 TUint32 aAttribute ) const;
       
    79         IMPORT_C TBool GetBearerInfoBoolL(
       
    80                 TUint32 aBearerType,
       
    81                 TUint32 aAttribute ) const;
       
    82         IMPORT_C HBufC* GetBearerInfoStringL(
       
    83                 TUint32 aBearerType,
       
    84                 TUint32 aAttribute ) const;
       
    85         IMPORT_C HBufC8* GetBearerInfoString8L(
       
    86                 TUint32 aBearerType,
       
    87                 TUint32 aAttribute ) const;
       
    88 
       
    89         /**
       
    90         * GetConnectionMethodInfoXXX function can be used to query any,
       
    91         * non-bearer specific information about a given connection method. This
       
    92         * can be e.g. ECmBearerType, ECmName, ECmStartPage etc.
       
    93         * NULL pointer, returned from string functions, means attribute exists
       
    94         * but has no value.
    81         * HBuf ownership is passed to the caller
    95         * HBuf ownership is passed to the caller
    82         */
    96         */
    83         IMPORT_C TUint32 GetBearerInfoIntL( TUint32 aBearerType,
    97         IMPORT_C TUint32 GetConnectionMethodInfoIntL(
    84                                   TUint32 aAttribute ) const;
    98                 TUint32 aIapId,
    85         IMPORT_C TBool GetBearerInfoBoolL( TUint32 aBearerType,
    99                 TUint32 aAttribute ) const;
    86                                  TUint32 aAttribute ) const;
   100         IMPORT_C TBool GetConnectionMethodInfoBoolL(
    87         IMPORT_C HBufC* GetBearerInfoStringL( TUint32 aBearerType,
   101                 TUint32 aIapId,
    88                                     TUint32 aAttribute ) const;
   102                 TUint32 aAttribute ) const;
    89         IMPORT_C HBufC8* GetBearerInfoString8L( TUint32 aBearerType,
   103         IMPORT_C HBufC* GetConnectionMethodInfoStringL(
    90                                     TUint32 aAttribute ) const;
   104                 TUint32 aIapId,
    91 
   105                 TUint32 aAttribute ) const;
    92         /**
   106         IMPORT_C HBufC8* GetConnectionMethodInfoString8L(
    93         * GetConnectionMethodInfoXXX function can be used to 
   107                 TUint32 aIapId,
    94         * query any, non-bearer specific information about
   108                 TUint32 aAttribute ) const;
    95         * a given connection method. This can be e.g. ECmBearerType,
   109 
    96         * ECmName, ECmStartPage etc.
   110         /**
    97         * NULL pointer, returned from string functions, means
   111         * Creates a Destination with the passed name.
    98         * attribute exists but has no value.
       
    99         * HBuf ownership is passed to the caller
       
   100         */
       
   101         IMPORT_C TUint32 GetConnectionMethodInfoIntL( TUint32 aIapId,
       
   102                                              TUint32 aAttribute ) const;
       
   103         IMPORT_C TBool GetConnectionMethodInfoBoolL( TUint32 aIapId,
       
   104                                             TUint32 aAttribute ) const;
       
   105         IMPORT_C HBufC* GetConnectionMethodInfoStringL( TUint32 aIapId,
       
   106                                                TUint32 aAttribute ) const;
       
   107         IMPORT_C HBufC8* GetConnectionMethodInfoString8L( TUint32 aIapId,
       
   108                                                TUint32 aAttribute ) const;
       
   109                 
       
   110         /**
       
   111         * Creates a Destination with the passed name. 
       
   112         * @param aName the name of the new destination.
   112         * @param aName the name of the new destination.
   113         * @return RCmDestinationExt new destination. ownership is passed to the 
   113         * @return RCmDestinationExt new destination. ownership is passed to the
   114         * caller
   114         * caller
   115         */
   115         */
   116         IMPORT_C RCmDestinationExt CreateDestinationL( const TDesC& aName );
   116         IMPORT_C RCmDestinationExt CreateDestinationL( const TDesC& aName );
   117         
   117 
   118         /**
   118         /**
   119         * Creates a connection method does not belong to any destination
   119         * Creates a connection method does not belong to any destination
   120         * @param aImplementationUid - bearer type of the new connection method
   120         * @param aImplementationUid - bearer type of the new connection method
   121         * @return RCmConnectionMethodExt newly created connection method.
   121         * @return RCmConnectionMethodExt newly created connection method.
   122         */
   122         */
   123         IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( 
   123         IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL(
   124                                                           TUint32 aBearerType );        
   124                 TUint32 aBearerType );
   125         
   125 
   126         /**
   126         /**
   127         * Copies a connection method belonging to one destination to 
   127         * Copies a connection method belonging to one destination to another.
   128         * another. The connection method becomes shared.
   128         * The connection method becomes shared. Calls UpdateL on the
   129         * Calls UpdateL on the destination
   129         * destination.
   130         * @param aTargetDestination
   130         * @param aTargetDestination
   131         * @param aConnectionMethodId
   131         * @param aConnectionMethodId
   132         * @return TInt - index in the Connection Method list
   132         * @return TInt - index in the Connection Method list
   133         */
   133         */
   134         IMPORT_C TInt CopyConnectionMethodL( 
   134         IMPORT_C TInt CopyConnectionMethodL(
   135                                     RCmDestinationExt& aTargetDestination,
   135                 RCmDestinationExt& aTargetDestination,
   136                                     RCmConnectionMethodExt& aConnectionMethod );
   136                 RCmConnectionMethodExt& aConnectionMethod );
   137                                         
   137 
   138         /**
   138         /**
   139         * Moves a connection method belonging to one destination to 
   139         * Moves a connection method belonging to one destination to another. The
   140         * another. The connection method is removed from the source destination
   140         * connection method is removed from the source destination.
   141         * @param aSourceDestination
   141         * @param aSourceDestination
   142         * @param aTargetDestination
   142         * @param aTargetDestination
   143         * @param aConnectionMethod
   143         * @param aConnectionMethod
   144         * @return TInt - index in the Connection Method list
   144         * @return TInt - index in the Connection Method list
   145         */
   145         */
   146         IMPORT_C TInt MoveConnectionMethodL( 
   146         IMPORT_C TInt MoveConnectionMethodL(
   147                                     RCmDestinationExt& aSourceDestination,
   147                 RCmDestinationExt& aSourceDestination,
   148                                     RCmDestinationExt& aTargetDestination,
   148                 RCmDestinationExt& aTargetDestination,
   149                                     RCmConnectionMethodExt& aConnectionMethod );
   149                 RCmConnectionMethodExt& aConnectionMethod );
   150                                                                                   
   150 
   151         /**
   151         /**
   152         * Remove connection method from the destination
   152         * Remove connection method from the destination
   153         * @param aDestination destination the connection method is attached to
   153         * @param aDestination destination the connection method is attached to
   154         * @param aConnectionMethod connection method to be removed
   154         * @param aConnectionMethod connection method to be removed
   155         */
   155         */
   156         IMPORT_C void RemoveConnectionMethodL( 
   156         IMPORT_C void RemoveConnectionMethodL(
   157                                    RCmDestinationExt& aDestination,
   157                 RCmDestinationExt& aDestination,
   158                                    RCmConnectionMethodExt& aConnectionMethod );
   158                 RCmConnectionMethodExt& aConnectionMethod );
   159                                    
   159 
   160         /**
   160         /**
   161         * Removes connection method from every destination and make it 
   161         * Removes connection method from every destination and make it
   162         * uncategorized.
   162         * uncategorized.
   163         * @param aConnectionMethod connection method to be removed
   163         * @param aConnectionMethod connection method to be removed
   164         */
   164         */
   165         IMPORT_C void RemoveAllReferencesL( 
   165         IMPORT_C void RemoveAllReferencesL(
   166                                     RCmConnectionMethodExt& aConnectionMethod );
   166                 RCmConnectionMethodExt& aConnectionMethod );
   167 
   167 
   168     //=========================================================================
       
   169     // API functions - Getter-Setter
       
   170     public:
   168     public:
   171     
       
   172         /**
   169         /**
   173         * Returns the connection method queried by its ID.
   170         * Returns the connection method queried by its ID.
   174         * @param aId if of the connection method
   171         * @param aId if of the connection method
   175         * @return RCmConnectionMethodExt connection method instance
   172         * @return RCmConnectionMethodExt connection method instance
   176         */
   173         */
   177         IMPORT_C RCmConnectionMethodExt ConnectionMethodL( 
   174         IMPORT_C RCmConnectionMethodExt ConnectionMethodL(
   178                                                   TUint32 aConnectionMethodId );
   175                 TUint32 aConnectionMethodId );
   179         
   176 
   180         /**
   177         /**
   181         * Returns the list of connection methods that do not belong to any 
   178         * Returns the list of connection methods that do not belong to any
   182         * destination
   179         * destination.
   183         * @param aCMArray on return it is the array of IAP ids.
   180         * @param aCMArray on return it is the array of IAP ids.
   184         * @param aCheckBearerType If ETrue only connection methods with 
   181         * @param aCheckBearerType If ETrue only connection methods with
   185         *                         supported bearer types are returned
   182         * supported bearer types are returned.
   186         * @param aLegacyOnly when set to ETrue only Legacy IAP ids will
   183         * @param aLegacyOnly when set to ETrue only Legacy IAP ids will be
   187         *                         be returned
   184         * returned.
   188         * @param aEasyWlan when set to ETrue EasyWlan id is returned, too
   185         * @param aEasyWlan when set to ETrue EasyWlan id is returned, too.
   189         */
   186         */
   190         IMPORT_C void ConnectionMethodL( RArray<TUint32>& aCMArray,
   187         IMPORT_C void ConnectionMethodL(
   191                                          TBool aCheckBearerType = ETrue,
   188                 RArray<TUint32>& aCmArray,
   192                                          TBool aLegacyOnly = ETrue,
   189                 TBool aCheckBearerType = ETrue,
   193                                          TBool aEasyWlan = EFalse );
   190                 TBool aLegacyOnly = ETrue,
   194         
   191                 TBool aEasyWlan = EFalse );
   195         /**
   192 
   196         * Returns the destination to which a specified 
   193         /**
   197         * connection method belongs, search is by destination ID
   194         * Returns the destination to which a specified connection method
       
   195         * belongs, search is by destination ID.
   198         * @param aDestinationId id of the destination
   196         * @param aDestinationId id of the destination
   199         * @return RCmDestinationExt network destination
   197         * @return RCmDestinationExt network destination
   200         */
   198         */
   201         IMPORT_C RCmDestinationExt DestinationL( TUint32 aDestinationId );
   199         IMPORT_C RCmDestinationExt DestinationL( TUint32 aDestinationId );
   202         
   200 
   203         /**
   201         /**
   204         * Returns an array of all destination id's
   202         * Returns an array of all destination id's
   205         * @param aDestArray array of all available network destination
   203         * @param aDestArray array of all available network destination
   206         */ 
   204         */
   207         IMPORT_C void AllDestinationsL( RArray<TUint32>& aDestArray );
   205         IMPORT_C void AllDestinationsL( RArray<TUint32>& aDestArray );
   208         
   206 
   209         /**
   207         /**
   210         * Returns the copy of the bearer priority array. Ownership is passed.
   208         * Returns the copy of the bearer priority array. Ownership is passed.
   211         * @param aArray bearer priority array
   209         * @param aArray bearer priority array
   212         */          
   210         */
   213         IMPORT_C void BearerPriorityArrayL( RArray<TBearerPriority>& aArray ) const;
   211         IMPORT_C void BearerPriorityArrayL(
   214         
   212                 RArray<TBearerPriority>& aArray ) const;
       
   213 
   215         /**
   214         /**
   216         * Update bearer priority array
   215         * Update bearer priority array
   217         * @param aArray array with new global bearer priority
   216         * @param aArray array with new global bearer priority
   218         */          
   217         */
   219         IMPORT_C void UpdateBearerPriorityArrayL( 
   218         IMPORT_C void UpdateBearerPriorityArrayL(
   220                                         const RArray<TBearerPriority>& aArray );
   219                 const RArray<TBearerPriority>& aArray );
   221         
       
   222 
   220 
   223         /**
   221         /**
   224         * Clean up passed global bearer priority array. Delete
   222         * Clean up passed global bearer priority array. Delete
   225         * the elements and calls Reset and Close on the array.
   223         * the elements and calls Reset and Close on the array.
   226         * @param aArray array to be cleaned up
   224         * @param aArray array to be cleaned up
   227         */
   225         */
   228         IMPORT_C void CleanupGlobalPriorityArray( 
   226         IMPORT_C void CleanupGlobalPriorityArray(
   229                                         RArray<TBearerPriority>& aArray ) const;
   227                 RArray<TBearerPriority>& aArray ) const;
   230         
   228 
   231         /**
   229         /**
   232         * Query all of the supported bearer types.
   230         * Query all of the supported bearer types.
   233         * @param aArray list of all supported bearer types.
   231         * @param aArray list of all supported bearer types.
   234         */          
   232         */
   235         IMPORT_C void SupportedBearersL( RArray<TUint32>& aArray ) const;
   233         IMPORT_C void SupportedBearersL( RArray<TUint32>& aArray ) const;
   236         
   234 
   237         /**
       
   238         * Returns "Uncategorized" icon.
       
   239         * This fucton leaves if the client does not have a valid UI context
       
   240         * @return CGulIcon* Icon of uncategorized connection methods. Ownership 
       
   241         * is passed.
       
   242         */          
       
   243         IMPORT_C CGulIcon* UncategorizedIconL() const;
       
   244         
       
   245         /**
   235         /**
   246         * Returns the id of the EasyWlan connection method.
   236         * Returns the id of the EasyWlan connection method.
   247         *
   237         *
   248         * @since S60 3.2
   238         * @since S60 3.2
   249         * @return id of the EasyWLan connection method. 0 if not found.
   239         * @return id of the EasyWLan connection method. 0 if not found.
   253         /**
   243         /**
   254         * Returns the default connection method/SNAP.
   244         * Returns the default connection method/SNAP.
   255         *
   245         *
   256         * @since S60 3.2
   246         * @since S60 3.2
   257         */
   247         */
   258         IMPORT_C void ReadDefConnL( TCmDefConnValue& aDCSetting );   
   248         IMPORT_C void ReadDefConnL( TCmDefConnValue& aDefConnSetting );
       
   249 
   259         /**
   250         /**
   260         * Stores the default connection method/SNAP.
   251         * Stores the default connection method/SNAP.
   261         *
   252         *
   262         * @since S60 3.2
   253         * @since S60 3.2
   263         */
   254         */
   264         IMPORT_C void WriteDefConnL( const TCmDefConnValue& aDCSetting );  
   255         IMPORT_C void WriteDefConnL( const TCmDefConnValue& aDefConnSetting );
   265 
   256 
   266         /**
   257         /**
   267         * Creates a Destination with the passed name and id. 
   258         * Creates a Destination with the passed name and id.
   268         * @param aName the name of the new destination.
   259         * @param aName the name of the new destination.
   269         * @param aDestId Predefined id of the destination.
   260         * @param aDestId Predefined id of the destination.
   270         * @return RCmDestinationExt newly created destination or leaves with
   261         * @return RCmDestinationExt newly created destination or leaves with
   271         * KErrAlreadyExists if there exists CM with the same Id.
   262         * KErrAlreadyExists if there exists CM with the same Id.
   272         * Ownership is passed to the caller.
   263         * Ownership is passed to the caller.
   273         */
   264         */
   274         IMPORT_C RCmDestinationExt CreateDestinationL( const TDesC& aName,
   265         IMPORT_C RCmDestinationExt CreateDestinationL(
   275                                                        TUint32      aDestId );
   266                 const TDesC& aName,
   276         
   267                 TUint32 aDestId );
       
   268 
   277         /**
   269         /**
   278         * Creates a connection method does not belong to any destination
   270         * Creates a connection method does not belong to any destination
   279         * @param aImplementationUid - bearer type of the new connection
   271         * @param aImplementationUid - bearer type of the new connection
   280         * method
   272         * method
   281         * @param aConnMethodId Predefined id for the connection method
   273         * @param aConnMethodId Predefined id for the connection method
   282         * (id range is from 1 to max IAP record amount in CommsDat).
   274         * (id range is from 1 to max IAP record amount in CommsDat).
   283         * @return RCmConnectionMethodExt newly created connection
   275         * @return RCmConnectionMethodExt newly created connection
   284         * method or leaves with KErrAlreadyExists if there exists CM
   276         * method or leaves with KErrAlreadyExists if there exists CM
   285         * with the same Id.
   277         * with the same Id.
   286         */
   278         */
   287         IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( TUint32 aImplementationUid,
   279         IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL(
   288                                                                  TUint32 aConnMethodId );
   280                 TUint32 aBearerType,
       
   281                 TUint32 aConnMethodId );
   289 
   282 
   290     private:
   283     private:
   291         /**
   284         /**
   292         * This is a private copy constructor without iplemetation.
   285         * This is a private copy constructor without iplemetation.
   293         * The sole purpose of this declaration is to forbid the copying of 
   286         * The sole purpose of this declaration is to forbid the copying of
   294         * the objects of this class.
   287         * the objects of this class.
   295         */          
   288         */
   296         RCmManagerExt(RCmManagerExt&  );
   289         RCmManagerExt( RCmManagerExt& );
       
   290 
   297         /**
   291         /**
   298         * This is a private copy constructor without iplemetation.
   292         * This is a private copy constructor without iplemetation.
   299         * The sole purpose of this declaration is to forbid the copying of 
   293         * The sole purpose of this declaration is to forbid the copying of
   300         * the objects of this class.
   294         * the objects of this class.
   301         */          
   295         */
   302         RCmManagerExt& operator=( RCmManagerExt& );
   296         RCmManagerExt& operator=( RCmManagerExt& );
   303 
   297 
   304     friend class CCmManagerImpl;
       
   305     //=========================================================================
       
   306     // Member data
       
   307     
       
   308     private:
   298     private:
   309     
   299         friend class CCmManagerImpl;
   310         CCmManagerImpl* iImplementation;
   300 
       
   301     private:
       
   302         RCmManagerApi* iCmManagerApi;
   311     };
   303     };
   312     
   304 
   313 inline RCmManagerExt::RCmManagerExt()
   305 
   314     : iImplementation(NULL)
   306 inline RCmManagerExt::RCmManagerExt() : iCmManagerApi( NULL )
   315     {
   307     {
   316     }
   308     }
   317     
   309 
       
   310 
   318 #endif // CMMANAGEREXT_H
   311 #endif // CMMANAGEREXT_H
       
   312 
       
   313 // End of file