dbcreator/commsdatcreator/Src/cdcprocessorglobal.cpp
changeset 32 5c4486441ae6
parent 20 9c97ad6591ae
child 66 ed07dcc72692
equal deleted inserted replaced
31:c16e04725da3 32:5c4486441ae6
    36 #include <datamobilitycommsdattypes.h>
    36 #include <datamobilitycommsdattypes.h>
    37 #include <metadatabase.h>
    37 #include <metadatabase.h>
    38 #include <cmmanagerext.h>
    38 #include <cmmanagerext.h>
    39 #include <cmmanager.h>
    39 #include <cmmanager.h>
    40 #include <cmdestinationext.h>
    40 #include <cmdestinationext.h>
    41 #include <cmdefconnvalues.h>
       
    42 #include <WlanCdbCols.h>
    41 #include <WlanCdbCols.h>
    43 #include <wlancontainer.h>
    42 #include <wlancontainer.h>
    44 #include <featmgr.h>
    43 #include <featmgr.h>
    45 
    44 
    46 // CONSTANTS
    45 // CONSTANTS
   104                           CReaderBase* aFileReader,
   103                           CReaderBase* aFileReader,
   105                           RCmManagerExt& aCmManager,
   104                           RCmManagerExt& aCmManager,
   106                           RPointerArray< RCmConnectionMethodExt >& aPluginArray,
   105                           RPointerArray< RCmConnectionMethodExt >& aPluginArray,
   107                           RPointerArray< HBufC >& aPluginNames, 
   106                           RPointerArray< HBufC >& aPluginNames, 
   108                           RPointerArray< RCmDestinationExt >& aDestArray,
   107                           RPointerArray< RCmDestinationExt >& aDestArray,
   109                           RPointerArray< HBufC >& aDestNames,
   108                           RPointerArray< HBufC >& aDestNames )
   110                           RPointerArray< HBufC >& aDefCon )
       
   111     {
   109     {
   112     CProcessorGlobal* self = new ( ELeave ) CProcessorGlobal( aFileReader,
   110     CProcessorGlobal* self = new ( ELeave ) CProcessorGlobal( aFileReader,
   113                                                               aCmManager,
   111                                                               aCmManager,
   114                                                               aPluginArray,
   112                                                               aPluginArray,
   115                                                               aPluginNames,
   113                                                               aPluginNames,
   116                                                               aDestArray,
   114                                                               aDestArray,
   117                                                               aDestNames,
   115                                                               aDestNames );
   118                                                               aDefCon );
       
   119     CleanupStack::PushL( self );
   116     CleanupStack::PushL( self );
   120 
   117 
   121     // From base class
   118     // From base class
   122     self->ConstructL();
   119     self->ConstructL();
   123     CleanupStack::Pop( self );
   120     CleanupStack::Pop( self );
   132 CProcessorGlobal::CProcessorGlobal( CReaderBase* aFileReader,
   129 CProcessorGlobal::CProcessorGlobal( CReaderBase* aFileReader,
   133                                     RCmManagerExt& aCmManager,
   130                                     RCmManagerExt& aCmManager,
   134                                     RPointerArray< RCmConnectionMethodExt >& aPluginArray,
   131                                     RPointerArray< RCmConnectionMethodExt >& aPluginArray,
   135                                     RPointerArray< HBufC >& aPluginNames, 
   132                                     RPointerArray< HBufC >& aPluginNames, 
   136                                     RPointerArray< RCmDestinationExt >& aDestArray,
   133                                     RPointerArray< RCmDestinationExt >& aDestArray,
   137                                     RPointerArray< HBufC >& aDestNames,
   134                                     RPointerArray< HBufC >& aDestNames ) :
   138                                     RPointerArray< HBufC >& aDefCon ) :
       
   139     CProcessorBase( aFileReader, aCmManager, aPluginArray, aPluginNames, aDestArray, aDestNames ),
   135     CProcessorBase( aFileReader, aCmManager, aPluginArray, aPluginNames, aDestArray, aDestNames ),
   140     iAttachWhenNeeded ( EFalse )
   136     iAttachWhenNeeded ( EFalse )
   141     {
   137     {
   142     iDefCon = &aDefCon;
       
   143     }
   138     }
   144     
   139     
   145     
   140     
   146 // ---------------------------------------------------------
   141 // ---------------------------------------------------------
   147 // CProcessorGlobal::ConstructL
   142 // CProcessorGlobal::ConstructL
   306                     UpdateGlobalBearerArrayL( fieldId, prio );
   301                     UpdateGlobalBearerArrayL( fieldId, prio );
   307                     }
   302                     }
   308                 break;
   303                 break;
   309                 }
   304                 }
   310                 
   305                 
   311             case EDefaultConnectionType:
       
   312                 {
       
   313                 iDefCon->Append( ptrTag->AllocL() );
       
   314                 //SetDefaultConnectionTypeL( ptrTag )
       
   315                 break;
       
   316                 }
       
   317                 
       
   318             case EDefaultConnectionName:
       
   319                 {
       
   320                 iDefCon->Append( ptrTag->AllocL() );
       
   321                 //SetDefaultConnectionNameL( ptrTag )
       
   322                 break;
       
   323                 }
       
   324                 
       
   325             case EGprsLastSocketActivityTimeout:
   306             case EGprsLastSocketActivityTimeout:
   326             case EGprsLastSessionClosedTimeout:
   307             case EGprsLastSessionClosedTimeout:
   327             case EGprsLastSocketClosedTimeout:		
   308             case EGprsLastSocketClosedTimeout:		
   328                 {            				    
   309                 {            				    
   329                 // Load modem bearer record
   310                 // Load modem bearer record
   609         CleanupStack::PopAndDestroy( tableName ); // tableName 
   590         CleanupStack::PopAndDestroy( tableName ); // tableName 
   610         }
   591         }
   611     }
   592     }
   612 
   593 
   613 // ---------------------------------------------------------
   594 // ---------------------------------------------------------
   614 // CProcessorGlobal::SetDefaultConnectionL
       
   615 // ---------------------------------------------------------
       
   616 //
       
   617 /*void CProcessorGlobal::SetDefaultConnectionL()
       
   618     {
       
   619     if( iDefCon->Count() > 0 )
       
   620         {
       
   621         SetDefaultConnectionTypeL( (*iDefCon)[0] );
       
   622         }
       
   623     if( iDefCon->Count() > 1 )
       
   624         {
       
   625         SetDefaultConnectionNameL( (*iDefCon)[1] );
       
   626         }
       
   627     }*/
       
   628 
       
   629 // ---------------------------------------------------------
       
   630 // CProcessorGlobal::SetDefaultConnectionTypeL
       
   631 // ---------------------------------------------------------
       
   632 //
       
   633 void CProcessorGlobal::SetDefaultConnectionTypeL( HBufC16* aPtrTag )
       
   634     {
       
   635     iDefaultConnectionSet = EFalse;
       
   636     
       
   637     if ( aPtrTag->CompareF( KStrAlwaysAsk ) == 0 ) 
       
   638         {
       
   639         iDefaultConnectionType = ECmDefConnAlwaysAsk;
       
   640         SetDefConnRecordL( 0 );
       
   641         }
       
   642     else if ( aPtrTag->CompareF( KStrAskOnce ) == 0 ) 
       
   643         {
       
   644         iDefaultConnectionType = ECmDefConnAskOnce;
       
   645         SetDefConnRecordL( 0 );
       
   646         }
       
   647     else if ( aPtrTag->CompareF( KStrDestination ) == 0 ) 
       
   648         {
       
   649         iDefaultConnectionType = ECmDefConnDestination;
       
   650         }
       
   651     else if ( aPtrTag->CompareF( KStrConnectionMethod ) == 0 ) 
       
   652         {
       
   653         iDefaultConnectionType = ECmDefConnConnectionMethod;
       
   654         }
       
   655     else
       
   656         {
       
   657         CLOG_WRITE(
       
   658         "Warning: Default connection type is not valid. Always ask is set.")
       
   659         iDefaultConnectionType = ECmDefConnAlwaysAsk;
       
   660         SetDefConnRecordL( 0 );
       
   661         }    
       
   662     }
       
   663 
       
   664 // ---------------------------------------------------------
       
   665 // CProcessorGlobal::SetDefaultConnectionNameL
       
   666 // ---------------------------------------------------------
       
   667 //
       
   668 void CProcessorGlobal::SetDefaultConnectionNameL( HBufC16* aPtrTag )
       
   669     {
       
   670         
       
   671     // Name is ignored if the defconn has been set. It can happen e.g.
       
   672     // if iDefaultConnectionType is ECmDefConnAlwaysAsk or ECmDefConnAskOnce     
       
   673     if ( iDefaultConnectionSet )
       
   674         {
       
   675         return;
       
   676         }
       
   677         
       
   678     TInt uId = KErrNotFound;
       
   679     if ( iDefaultConnectionType == ECmDefConnDestination )
       
   680         {
       
   681         uId = GetDestinationIdL( aPtrTag );
       
   682         }
       
   683     else if ( iDefaultConnectionType == ECmDefConnConnectionMethod )
       
   684         {
       
   685         uId = GetPluginIdL( aPtrTag );
       
   686         }
       
   687         
       
   688     if( uId != KErrNotFound )
       
   689         {
       
   690         SetDefConnRecordL( uId );
       
   691         }
       
   692     }
       
   693 
       
   694 // ---------------------------------------------------------
       
   695 // CProcessorGlobal::SetGenConnSettingWlanUsage
   595 // CProcessorGlobal::SetGenConnSettingWlanUsage
   696 // ---------------------------------------------------------
   596 // ---------------------------------------------------------
   697 //
   597 //
   698 void CProcessorGlobal::SetGenConnSettingWlanUsage( HBufC16* aPtrTag )
   598 void CProcessorGlobal::SetGenConnSettingWlanUsage( HBufC16* aPtrTag )
   699     {
   599     {
   752     cmManager.CreateTablesAndOpenL();
   652     cmManager.CreateTablesAndOpenL();
   753     CleanupClosePushL( cmManager );
   653     CleanupClosePushL( cmManager );
   754     cmManager.WriteGenConnSettingsL( *iGenConnSettings );
   654     cmManager.WriteGenConnSettingsL( *iGenConnSettings );
   755     CleanupStack::PopAndDestroy( &cmManager );
   655     CleanupStack::PopAndDestroy( &cmManager );
   756     }
   656     }
   757 
       
   758 //-----------------------------------------------------------------------------
       
   759 //  CProcessorGlobal::SetDefConnRecordL()
       
   760 //-----------------------------------------------------------------------------
       
   761 //
       
   762 void CProcessorGlobal::SetDefConnRecordL( const TInt /*aId*/ )
       
   763     {
       
   764 
       
   765 /*    TCmDefConnValue value;
       
   766     value.iType = iDefaultConnectionType;
       
   767     value.iId = aId;*/
       
   768     
       
   769 //    iCmManager->WriteDefConnL( value );
       
   770     
       
   771     // It gets true if the defconn was set correctly
       
   772     iDefaultConnectionSet = ETrue;
       
   773 
       
   774     }
       
   775     
       
   776 
   657 
   777 //-----------------------------------------------------------------------------
   658 //-----------------------------------------------------------------------------
   778 //  CProcessorGlobal::SaveGlobalWlanParameterL()
   659 //  CProcessorGlobal::SaveGlobalWlanParameterL()
   779 //-----------------------------------------------------------------------------
   660 //-----------------------------------------------------------------------------
   780 //
   661 //