epoc32/include/mw/cmmanager.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  Connection manager IF class.
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
#ifndef CMMANAGER_H
williamr@2
    19
#define CMMANAGER_H
williamr@2
    20
williamr@2
    21
// System Includes
williamr@2
    22
#include <e32std.h>
williamr@2
    23
#include <e32base.h>
williamr@2
    24
#include <e32cmn.h>
williamr@2
    25
#include <cmdefconnvalues.h>
williamr@4
    26
#include <cmgenconnsettings.h>
williamr@2
    27
williamr@2
    28
// Forward Declarations
williamr@2
    29
class RCmConnectionMethod;
williamr@2
    30
class RCmDestination;
williamr@2
    31
class CCmManagerImpl;
williamr@2
    32
class TBearerPriority;
williamr@2
    33
class CGulIcon;
williamr@2
    34
williamr@2
    35
/**
williamr@2
    36
 *  RCmManager gives access to network destinations and connection methods.
williamr@2
    37
 *
williamr@2
    38
 *  @lib cmmanager.lib
williamr@2
    39
 *  @since S60 v3.2
williamr@2
    40
 */
williamr@2
    41
NONSHARABLE_CLASS(RCmManager)
williamr@2
    42
      {          
williamr@2
    43
    //=====================================================================
williamr@2
    44
    // Constructors/Destructors
williamr@2
    45
    // 
williamr@2
    46
    public:
williamr@2
    47
    
williamr@2
    48
        /**
williamr@2
    49
        * Default constructor. 
williamr@2
    50
        */
williamr@2
    51
        inline RCmManager();
williamr@2
    52
williamr@2
    53
    //=====================================================================
williamr@2
    54
    // API functions
williamr@2
    55
    public:
williamr@2
    56
        
williamr@2
    57
        /**
williamr@2
    58
        * Symbian constructor
williamr@2
    59
        *
williamr@2
    60
        * @since S60 3.2
williamr@2
    61
        */
williamr@2
    62
        IMPORT_C void OpenL();    
williamr@2
    63
        
williamr@2
    64
        /**
williamr@2
    65
        * Symbian constructor
williamr@2
    66
        * Pushes the object on the cleanup stack
williamr@2
    67
        *
williamr@2
    68
        * @since S60 3.2
williamr@2
    69
        */
williamr@2
    70
        IMPORT_C void OpenLC();    
williamr@2
    71
        
williamr@2
    72
        /**
williamr@2
    73
        * Secondary destructor
williamr@2
    74
        *
williamr@2
    75
        * @since S60 3.2
williamr@2
    76
        */
williamr@2
    77
        IMPORT_C void Close();
williamr@2
    78
        
williamr@2
    79
    //=======================================================================
williamr@2
    80
    // Getter API
williamr@2
    81
    public:    
williamr@2
    82
      
williamr@2
    83
        /**
williamr@2
    84
        * Used to query bearer information that doesn't belong
williamr@2
    85
        * to a specific connection method, such as 
williamr@2
    86
        * ECmCoverage or ECmDefaultPriority etc.
williamr@2
    87
        *
williamr@2
    88
        * @since S60 3.2
williamr@2
    89
        * @param aBearerType the bearer
williamr@2
    90
        * @param aAttribute the setting value
williamr@2
    91
        * @return the setting value
williamr@2
    92
        */
williamr@2
    93
        IMPORT_C TUint32 GetBearerInfoIntL( TUint32 aBearerType,
williamr@2
    94
                                  TUint32 aAttribute ) const;
williamr@2
    95
                                  
williamr@2
    96
        
williamr@2
    97
        /**
williamr@2
    98
        * Used to query bearer information that doesn't belong
williamr@2
    99
        * to a specific connection method, such as 
williamr@2
   100
        * ECmCoverage or ECmDefaultPriority etc.
williamr@2
   101
        *
williamr@2
   102
        * @since S60 3.2
williamr@2
   103
        * @param aBearerType the bearer
williamr@2
   104
        * @param aAttribute the setting value
williamr@2
   105
        * @return the setting value
williamr@2
   106
        */
williamr@2
   107
        IMPORT_C TBool GetBearerInfoBoolL( TUint32 aBearerType,
williamr@2
   108
                                 TUint32 aAttribute ) const;
williamr@2
   109
        /**
williamr@2
   110
        * Used to query bearer information that doesn't belong
williamr@2
   111
        * to a specific connection method, such as 
williamr@2
   112
        * ECmCoverage or ECmDefaultPriority etc.
williamr@2
   113
        * HBuf ownership is passed to the caller
williamr@2
   114
        *
williamr@2
   115
        * @since S60 3.2
williamr@2
   116
        * @param aBearerType the bearer
williamr@2
   117
        * @param aAttribute the setting value
williamr@2
   118
        * @return the setting value
williamr@2
   119
        */        
williamr@2
   120
        IMPORT_C HBufC* GetBearerInfoStringL( TUint32 aBearerType,
williamr@2
   121
                                    TUint32 aAttribute ) const;
williamr@2
   122
        /**
williamr@2
   123
        * Used to query bearer information that does not belong
williamr@2
   124
        * to a specific connection method, such as 
williamr@2
   125
        * ECmCoverage or ECmDefaultPriority, etc.
williamr@2
   126
        * HBuf ownership is passed to the caller
williamr@2
   127
        *
williamr@2
   128
        * @since S60 3.2
williamr@2
   129
        * @param aBearerType the bearer
williamr@2
   130
        * @param aAttribute the setting value
williamr@2
   131
        * @return the setting value
williamr@2
   132
        */
williamr@2
   133
        IMPORT_C HBufC8* GetBearerInfoString8L( TUint32 aBearerType,
williamr@2
   134
                                    TUint32 aAttribute ) const;
williamr@2
   135
                    
williamr@2
   136
        /**
williamr@2
   137
        * Used to query any non-bearer specific information about
williamr@2
   138
        * a given connection method. This can be e.g. ECmBearerType,
williamr@2
   139
        * ECmName, ECmStartPage, etc.
williamr@2
   140
        *
williamr@2
   141
        * @since S60 3.2
williamr@2
   142
        * @param aIapId the connection method id
williamr@2
   143
        * @param aAttribute the setting value
williamr@2
   144
        * @return the setting value
williamr@2
   145
        */
williamr@2
   146
        IMPORT_C TUint32 GetConnectionMethodInfoIntL( TUint32 aIapId,
williamr@2
   147
                                             TUint32 aAttribute ) const;
williamr@2
   148
        
williamr@2
   149
        /**
williamr@2
   150
        * Used to query any, non-bearer specific information about
williamr@2
   151
        * a given connection method. This can be e.g. ECmBearerType,
williamr@2
   152
        * ECmName, ECmStartPage, etc.
williamr@2
   153
        *
williamr@2
   154
        * @since S60 3.2
williamr@2
   155
        * @param aIapId the connection method id
williamr@2
   156
        * @param aAttribute the setting value
williamr@2
   157
        * @return the setting value
williamr@2
   158
        */
williamr@2
   159
        IMPORT_C TBool GetConnectionMethodInfoBoolL( TUint32 aIapId,
williamr@2
   160
                                            TUint32 aAttribute ) const;
williamr@2
   161
williamr@2
   162
        /**
williamr@2
   163
        * Used to query any non-bearer specific information about
williamr@2
   164
        * a given connection method. This can be e.g. ECmBearerType,
williamr@2
   165
        * ECmName, ECmStartPage, etc.
williamr@2
   166
        * HBuf ownership is passed to the caller
williamr@2
   167
        *
williamr@2
   168
        * @since S60 3.2
williamr@2
   169
        * @param aIapId the connection method id
williamr@2
   170
        * @param aAttribute the setting value
williamr@2
   171
        * @return the setting value
williamr@2
   172
        */
williamr@2
   173
        IMPORT_C HBufC* GetConnectionMethodInfoStringL( TUint32 aIapId,
williamr@2
   174
                                               TUint32 aAttribute ) const;
williamr@2
   175
williamr@2
   176
        /**
williamr@2
   177
        * Used to query any non-bearer specific information about
williamr@2
   178
        * a given connection method. This can be e.g. ECmBearerType,
williamr@2
   179
        * ECmName, ECmStartPage, etc.
williamr@2
   180
        * HBuf ownership is passed to the caller
williamr@2
   181
        *
williamr@2
   182
        * @since S60 3.2
williamr@2
   183
        * @param aIapId the connection method id
williamr@2
   184
        * @param aAttribute the setting value
williamr@2
   185
        * @return the setting value
williamr@2
   186
        */
williamr@2
   187
        IMPORT_C HBufC8* GetConnectionMethodInfoString8L( TUint32 aIapId,
williamr@2
   188
                                               TUint32 aAttribute ) const;
williamr@2
   189
                
williamr@2
   190
        /**
williamr@2
   191
        * Returns the connection method queried by its ID
williamr@2
   192
        *
williamr@2
   193
        * @since S60 3.2
williamr@2
   194
        * @param aConnectionMethodId id of the connection method
williamr@2
   195
        * @return RCmConnectionMethod connection method
williamr@2
   196
        */
williamr@2
   197
        IMPORT_C RCmConnectionMethod ConnectionMethodL( 
williamr@2
   198
                                     TUint32 aConnectionMethodId ) const;
williamr@2
   199
                        
williamr@2
   200
        /**
williamr@2
   201
        * Returns the list of connection methods. Connection Methods are 
williamr@2
   202
        * filtered by the switch parameters e.g. aLegacyOnly.
williamr@2
   203
        *
williamr@2
   204
        * @since S60 3.2
williamr@2
   205
        * @param aCMArray on return it is the array of IAP ids.
williamr@2
   206
        * @param aCheckBearerType If ETrue only connection methods with 
williamr@2
   207
        *                         supported bearer type are returned
williamr@2
   208
        * @param aLegacyOnly when set to ETrue only Legacy IAP ids will
williamr@2
   209
        *                         be returned
williamr@2
   210
        * @param aEasyWlan when set to ETrue EasyWlan id is returned, too
williamr@2
   211
        */
williamr@2
   212
        IMPORT_C void ConnectionMethodL( RArray<TUint32>& aCMArray, 
williamr@2
   213
                                         TBool aCheckBearerType = ETrue,
williamr@2
   214
                                         TBool aLegacyOnly = ETrue,
williamr@2
   215
                                         TBool aEasyWlan = EFalse ) const;
williamr@2
   216
        
williamr@2
   217
        /**
williamr@2
   218
        * Returns an array of all destination id's
williamr@2
   219
        *
williamr@2
   220
        * @since S60 3.2
williamr@2
   221
        * @param aDestArray list all available destinations' id
williamr@2
   222
        */ 
williamr@2
   223
        IMPORT_C void AllDestinationsL( RArray<TUint32>& aDestArray ) const;
williamr@2
   224
williamr@2
   225
        /**
williamr@2
   226
        * Returns the destination to which a specified 
williamr@2
   227
        * connection method belongs, search is by destination ID
williamr@2
   228
        *
williamr@2
   229
        * @since S60 3.2
williamr@2
   230
        * @param aDestinationId id of destination
williamr@2
   231
        * @return RCmDestination network destination 
williamr@2
   232
        */
williamr@2
   233
        IMPORT_C RCmDestination DestinationL( TUint32 aDestinationId ) const;
williamr@2
   234
       
williamr@2
   235
        /**
williamr@2
   236
        * Returns the copy of the bearer priority array. Ownership is passed.
williamr@2
   237
        *
williamr@2
   238
        * @since S60 3.2
williamr@2
   239
        * @param aArray bearer priority array
williamr@2
   240
        */          
williamr@2
   241
        IMPORT_C void BearerPriorityArrayL( 
williamr@2
   242
                                   RArray<TBearerPriority>& aArray ) const;
williamr@2
   243
       
williamr@2
   244
        /**
williamr@2
   245
        * Clean up passed global bearer priority array. Delete
williamr@2
   246
        * the elements and calls Reset and Close on the array.
williamr@2
   247
        *
williamr@2
   248
        * @since S60 3.2
williamr@2
   249
        * @param aArray array to be cleaned up
williamr@2
   250
        */
williamr@2
   251
        IMPORT_C void CleanupGlobalPriorityArray( 
williamr@2
   252
                                   RArray<TBearerPriority>& aArray ) const;
williamr@2
   253
        
williamr@2
   254
        /**
williamr@2
   255
        * Returns the id of the EasyWlan connection method.
williamr@2
   256
        *
williamr@2
   257
        * @since S60 3.2
williamr@2
   258
        * @return id of the EasyWLan connection method. 0 if not found.
williamr@2
   259
        */
williamr@2
   260
        IMPORT_C TUint32 EasyWlanIdL() const;
williamr@2
   261
        
williamr@2
   262
        /**
williamr@2
   263
        * Returns the default connection method/SNAP.
williamr@2
   264
        *
williamr@2
   265
        * @since S60 3.2
williamr@2
   266
        */
williamr@2
   267
        IMPORT_C void ReadDefConnL( TCmDefConnValue& aDCSetting );
williamr@2
   268
williamr@2
   269
        /**
williamr@2
   270
        * Stores the default connection method/SNAP.
williamr@2
   271
        *
williamr@2
   272
        * @since S60 3.2
williamr@2
   273
        */
williamr@2
   274
        IMPORT_C void WriteDefConnL( const TCmDefConnValue& aDCSetting );  
williamr@2
   275
williamr@2
   276
williamr@4
   277
        /**
williamr@4
   278
        * Returns the general connection settings.
williamr@4
   279
        *
williamr@4
   280
        * @since S60 9.2
williamr@4
   281
        */
williamr@4
   282
        IMPORT_C void ReadGenConnSettingsL( TCmGenConnSettings& aGenConnSettings );
williamr@4
   283
williamr@4
   284
        /**
williamr@4
   285
        * Writes the general connection settings.
williamr@4
   286
        *
williamr@4
   287
        * @since S60 9.2
williamr@4
   288
        */
williamr@4
   289
        IMPORT_C void WriteGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings );
williamr@4
   290
        
williamr@4
   291
        
williamr@2
   292
        /** Open session and create tables if they don't exist*/
williamr@2
   293
        IMPORT_C void CreateTablesAndOpenL();    
williamr@2
   294
williamr@2
   295
        /**
williamr@2
   296
        * Creates a Destination with the passed name. 
williamr@2
   297
        * @param aName the name of the new destination.
williamr@2
   298
        * @return RCmDestination new destination. ownership is passed to the 
williamr@2
   299
        * caller
williamr@2
   300
        */
williamr@2
   301
        IMPORT_C RCmDestination CreateDestinationL( const TDesC& aName );
williamr@2
   302
williamr@2
   303
        /**
williamr@2
   304
        * Creates a connection method does not belong to any destination
williamr@2
   305
        * @param aImplementationUid - bearer type of the new connection method
williamr@2
   306
        * @return RCmConnectionMethod newly created connection method.
williamr@2
   307
        */
williamr@2
   308
        IMPORT_C RCmConnectionMethod CreateConnectionMethodL( TUint32 aBearerType );        
williamr@2
   309
williamr@2
   310
        /**
williamr@2
   311
        * Copies a connection method belonging to one destination to 
williamr@2
   312
        * another. The connection method becomes shared.
williamr@2
   313
        * Calls UpdateL on the destination
williamr@2
   314
        * @param aTargetDestination
williamr@2
   315
        * @param aConnectionMethodId
williamr@2
   316
        * @return TInt - index in the Connection Method list
williamr@2
   317
        */
williamr@2
   318
        IMPORT_C TInt CopyConnectionMethodL( RCmDestination& aTargetDestination,
williamr@2
   319
                                             RCmConnectionMethod& aConnectionMethod );
williamr@2
   320
williamr@2
   321
        /**
williamr@2
   322
        * Moves a connection method belonging to one destination to 
williamr@2
   323
        * another. The connection method is removed from the source destination
williamr@2
   324
        * @param aSourceDestination
williamr@2
   325
        * @param aTargetDestination
williamr@2
   326
        * @param aConnectionMethod
williamr@2
   327
        * @return TInt - index in the Connection Method list
williamr@2
   328
        */
williamr@2
   329
        IMPORT_C TInt MoveConnectionMethodL( RCmDestination& aSourceDestination,
williamr@2
   330
                                             RCmDestination& aTargetDestination,
williamr@2
   331
                                             RCmConnectionMethod& aConnectionMethod );
williamr@2
   332
williamr@2
   333
        /**
williamr@2
   334
        * Remove connection method from the destination
williamr@2
   335
        * @param aDestination destination the connection method is attached to
williamr@2
   336
        * @param aConnectionMethod connection method to be removed
williamr@2
   337
        */
williamr@2
   338
        IMPORT_C void RemoveConnectionMethodL( RCmDestination& aDestination,
williamr@2
   339
                                               RCmConnectionMethod& aConnectionMethod );
williamr@2
   340
williamr@2
   341
        /**
williamr@2
   342
        * Removes connection method from every destination and make it 
williamr@2
   343
        * uncategorized.
williamr@2
   344
        * @param aConnectionMethod connection method to be removed
williamr@2
   345
        */
williamr@2
   346
        IMPORT_C void RemoveAllReferencesL( RCmConnectionMethod& aConnectionMethod );
williamr@2
   347
williamr@2
   348
        /**
williamr@2
   349
        * Update bearer priority array
williamr@2
   350
        * @param aArray array with new global bearer priority
williamr@2
   351
        */          
williamr@2
   352
        IMPORT_C void UpdateBearerPriorityArrayL( const RArray<TBearerPriority>& aArray );
williamr@2
   353
williamr@2
   354
        /**
williamr@2
   355
        * Creates a Destination with the passed name and id. 
williamr@2
   356
        * @param aName the name of the new destination.
williamr@2
   357
        * @param aDestId Predefined id of the destination.
williamr@2
   358
        * @return RCmDestination newly created destination or leaves with
williamr@2
   359
        * KErrAlreadyExists if there exists CM with the same Id.
williamr@2
   360
        * Ownership is passed to the caller.
williamr@2
   361
        */
williamr@2
   362
        IMPORT_C RCmDestination CreateDestinationL( const TDesC& aName,
williamr@2
   363
                                                       TUint32      aDestId );
williamr@2
   364
williamr@2
   365
        /**
williamr@2
   366
        * Creates a connection method does not belong to any destination
williamr@2
   367
        * @param aImplementationUid - bearer type of the new connection
williamr@2
   368
        * method
williamr@2
   369
        * @param aConnMethodId Predefined id for the connection method.
williamr@2
   370
        * @return RCmConnectionMethod newly created connection
williamr@2
   371
        * method or leaves with KErrAlreadyExists if there exists CM
williamr@2
   372
        * with the same Id.
williamr@2
   373
        */
williamr@2
   374
        IMPORT_C RCmConnectionMethod CreateConnectionMethodL( TUint32 aImplementationUid,
williamr@2
   375
                                                              TUint32 aConnMethodId );
williamr@2
   376
williamr@2
   377
        /**
williamr@2
   378
        * Query all of the supported bearer types.
williamr@2
   379
        * @param aArray list of all supported bearer types.
williamr@2
   380
        */          
williamr@2
   381
        IMPORT_C void SupportedBearersL( RArray<TUint32>& aArray ) const;
williamr@2
   382
williamr@2
   383
        /**
williamr@2
   384
        * Returns "Uncategorized" icon.
williamr@2
   385
        * This fucton leaves if the client does not have a valid UI context
williamr@2
   386
        * @return CGulIcon* Icon of uncategorized connection methods. Ownership 
williamr@2
   387
        * is passed.
williamr@2
   388
        */          
williamr@2
   389
        IMPORT_C CGulIcon* UncategorizedIconL() const;
williamr@2
   390
        
williamr@2
   391
    private:
williamr@2
   392
        /**
williamr@2
   393
        * This is a private copy constructor without implementation.
williamr@2
   394
        * The sole purpose of this declaration is to forbid the copying of 
williamr@2
   395
        * the objects of this class.
williamr@2
   396
        */          
williamr@2
   397
        RCmManager(RCmManager&  );
williamr@2
   398
        /**
williamr@2
   399
        * This is a private copy constructor without implementation.
williamr@2
   400
        * The sole purpose of this declaration is to forbid the copying of 
williamr@2
   401
        * the objects of this class.
williamr@2
   402
        */          
williamr@2
   403
        RCmManager& operator=( RCmManager& );
williamr@2
   404
    //=========================================================================
williamr@2
   405
    // Member data
williamr@2
   406
    
williamr@2
   407
    private:
williamr@2
   408
    
williamr@2
   409
        /**
williamr@2
   410
         * the implementation class
williamr@2
   411
         */
williamr@2
   412
        CCmManagerImpl* iImplementation;
williamr@2
   413
    };
williamr@2
   414
williamr@2
   415
#include "cmmanager.inl"
williamr@2
   416
    
williamr@2
   417
#endif // CMMANAGER_H