creator/src/creator_connectionmethodelement.cpp
changeset 0 d6fe6244b863
equal deleted inserted replaced
-1:000000000000 0:d6fe6244b863
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "creator_connectionmethodelement.h"
       
    20 #include "creator_traces.h"
       
    21 
       
    22 #if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
       
    23 #include "creator_connectionmethod.h"
       
    24 #include <cmpluginpacketdatadef.h>
       
    25 #include <cmplugindialcommondefs.h>
       
    26 #include <cmplugincsddef.h>
       
    27 #include <cmpluginhscsddef.h>
       
    28 #include <cmpluginembdestinationdef.h>
       
    29 #include <cmpluginvpndef.h>
       
    30 #include <cmpluginlanbasedef.h>
       
    31 #else
       
    32 #include "creator_accesspoint.h"
       
    33 #endif
       
    34 
       
    35 
       
    36 using namespace creatorconnectionmethod;
       
    37 
       
    38 // connection name needs extra space for possible renaming
       
    39 const TInt KExtraSpace = 10;
       
    40 
       
    41 /*
       
    42  * 
       
    43  */
       
    44 CCreatorConnectionMethodElement* CCreatorConnectionMethodElement::NewL(CCreatorEngine* aEngine, const TDesC& aName, const TDesC& aContext )
       
    45     {
       
    46     CCreatorConnectionMethodElement* self = new (ELeave) CCreatorConnectionMethodElement(aEngine);
       
    47     CleanupStack::PushL(self);
       
    48     self->ConstructL(aName, aContext);
       
    49     CleanupStack::Pop(self);
       
    50     return self;
       
    51     }
       
    52 /*
       
    53  * 
       
    54  */
       
    55 CCreatorConnectionMethodElement::CCreatorConnectionMethodElement(CCreatorEngine* aEngine) 
       
    56 : 
       
    57 CCreatorScriptElement(aEngine)
       
    58     {
       
    59     iIsCommandElement = ETrue;
       
    60     }
       
    61 
       
    62 #if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
       
    63 void CCreatorConnectionMethodElement::ExecuteCommandL()
       
    64     {
       
    65     const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
       
    66     TInt cmAmount = 1;    
       
    67     if( amountAttr )
       
    68         {
       
    69         cmAmount = ConvertStrToIntL(amountAttr->Value());
       
    70         }
       
    71     // Get 'fields' element 
       
    72     CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
       
    73     if( fieldsElement && fieldsElement->SubElements().Count() > 0 )
       
    74         {
       
    75         // Get sub-elements
       
    76         const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
       
    77         // Create connection method entries, the amount of entries is defined by cmAmount:
       
    78         for( TInt cI = 0; cI < cmAmount; ++cI )
       
    79             {            
       
    80             CConnectionSettingsParameters* param = new (ELeave) CConnectionSettingsParameters;
       
    81             CleanupStack::PushL(param);
       
    82             
       
    83             for( TInt i = 0; i < fields.Count(); ++i )
       
    84                 {
       
    85                 CCreatorScriptElement* field = fields[i];
       
    86                 TPtrC elemName = field->Name();
       
    87                 TPtrC elemContent = field->Content();
       
    88                 const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
       
    89                 TBool useRandom = EFalse;
       
    90                 if( randomAttr || elemContent.Length() == 0 )
       
    91                     {
       
    92                     useRandom = ETrue;
       
    93                     }
       
    94                 
       
    95                 if( elemName == Kconnectionname )
       
    96                     {
       
    97                     if( useRandom )
       
    98                         {
       
    99                         param->SetRandomCMNameL(*iEngine);
       
   100                         }
       
   101                     else
       
   102                         {
       
   103                         SetContentToTextParamL(param->iConnectionName, elemContent);
       
   104                         // reserve extra space for possible renaming
       
   105                         TInt newLen = param->iConnectionName->Length() + KExtraSpace;
       
   106                         param->iConnectionName = param->iConnectionName->ReAllocL(newLen);
       
   107                         }
       
   108                     }
       
   109                 else if( elemName == Kstartpage )
       
   110                     {
       
   111                     if( useRandom )
       
   112                         {
       
   113                         param->SetRandomStartPageL(*iEngine);
       
   114                         }
       
   115                     else
       
   116                         {
       
   117                         SetContentToTextParamL(param->iStartPage, elemContent);
       
   118                         }
       
   119                     }
       
   120                 else if( elemName == Kwapwspoption )
       
   121                     {
       
   122                     if( useRandom )
       
   123                         {
       
   124                         param->SetRandomWapWspOptionL(*iEngine);
       
   125                         }
       
   126                     else
       
   127                         {
       
   128                         if( CompareIgnoreCase(elemContent, Kconnectionless) == 0 )
       
   129                         	{
       
   130                         	param->iWapWspOption = ECmWapWspOptionConnectionless;
       
   131                         	}
       
   132                         else if( CompareIgnoreCase(elemContent, Kconnectionoriented) == 0 )
       
   133                         	{
       
   134                         	param->iWapWspOption = ECmWapWspOptionConnectionOriented;
       
   135                         	}
       
   136                         }
       
   137                     }
       
   138                 else if( elemName == Kprotocoltype )
       
   139                 	{
       
   140                 	if( useRandom )
       
   141                 		{
       
   142                 		param->SetRandomProtocolTypeL(*iEngine);
       
   143                 		}
       
   144                 	else
       
   145                 		{
       
   146                 		if( CompareIgnoreCase(elemContent, Kipv4) == 0 )
       
   147                 			{
       
   148                 			param->iProtocolType = RPacketContext::EPdpTypeIPv4;
       
   149                 			}
       
   150                 		else if( CompareIgnoreCase(elemContent, Kipv6) == 0 )
       
   151                 			{
       
   152                 			param->iProtocolType = RPacketContext::EPdpTypeIPv6;
       
   153                 			}
       
   154                 		}
       
   155                 	}
       
   156                 else if( elemName == Kloginname )
       
   157                 	{
       
   158                 	if( useRandom )
       
   159                 		{
       
   160                 		param->SetRandomLoginNameL(*iEngine);                		
       
   161                 		}
       
   162                 	else
       
   163                 		{
       
   164                 		SetContentToTextParamL(param->iLoginName, elemContent);
       
   165                 		}
       
   166                 	}
       
   167                 else if( elemName == Ksecureauthentication )
       
   168                 	{
       
   169                 	if( useRandom )
       
   170                 		{
       
   171                 		param->SetRandomSecureAuthenticationL(*iEngine);
       
   172                 		}
       
   173                 	else
       
   174                 		{
       
   175                 		param->iSecureAuthentication = ConvertStrToBooleanL(elemContent);
       
   176                 		}
       
   177                 	}
       
   178                 else if( elemName == Kloginpass )
       
   179                 	{
       
   180                 	if( useRandom )
       
   181                 		{
       
   182                 		param->SetRandomLoginPassL(*iEngine);
       
   183                 		}
       
   184                 	else
       
   185                 		{
       
   186                 		SetContentToTextParamL(param->iLoginPass, elemContent);
       
   187                 		}
       
   188                 	}
       
   189                 else if( elemName == Kpromptpassword )
       
   190                 	{
       
   191                 	if( useRandom )
       
   192                 		{
       
   193                 		param->SetRandomPromptPasswordL(*iEngine);
       
   194                 		}
       
   195                 	else
       
   196                 		{
       
   197                 		param->iPromptPassword = ConvertStrToBooleanL(elemContent);
       
   198                 		}
       
   199                 	}
       
   200                 else if( elemName == Kgatewayaddress )
       
   201                 	{
       
   202                 	if( useRandom )
       
   203                 		{
       
   204                 		param->SetRandomGatewayAddressL(*iEngine);
       
   205                 		}
       
   206                 	else
       
   207                 		{
       
   208                 		SetContentToTextParamL(param->iGatewayAddress, elemContent);
       
   209                 		}
       
   210                 	}
       
   211                 else if( elemName == Ksubnetmask )
       
   212                 	{
       
   213                 	if( useRandom )
       
   214                 		{
       
   215                 		param->SetRandomSubnetMaskL(*iEngine);
       
   216                 		}
       
   217                 	else
       
   218                 		{
       
   219                 		SetContentToTextParamL(param->iSubnetMask, elemContent);
       
   220                 		}
       
   221                 	}
       
   222                 else if( elemName == Kdeviceipaddr )
       
   223                 	{
       
   224                 	if( useRandom )
       
   225                 		{
       
   226                 		param->SetRandomIPAddressL(*iEngine);
       
   227                 		}
       
   228                 	else
       
   229                 		{
       
   230                 		SetContentToTextParamL(param->iIPAddr, elemContent);
       
   231                 		}
       
   232                 	}
       
   233                 else if( elemName == Kip4nameserver1 )
       
   234                 	{
       
   235                 	if( useRandom )
       
   236                 		{
       
   237                 		param->SetRandomIP4NameServer1L(*iEngine);
       
   238                 		}
       
   239                 	else
       
   240                 		{
       
   241                 		SetContentToTextParamL(param->iIP4NameServer1, elemContent);
       
   242                 		}
       
   243                 	}
       
   244                 else if( elemName == Kip4nameserver2 )
       
   245                 	{
       
   246                 	if( useRandom )
       
   247                 		{
       
   248                 		param->SetRandomIP4NameServer2L(*iEngine);
       
   249                 		}
       
   250                 	else
       
   251                 		{
       
   252                 		SetContentToTextParamL(param->iIP4NameServer2, elemContent);
       
   253                 		}
       
   254                 	}
       
   255                 else if( elemName == Kdatacalltelnumber )
       
   256                 	{
       
   257                 	if( useRandom )
       
   258                 		{
       
   259                 		param->SetRandomTelephoneNumberL(*iEngine);
       
   260                 		}
       
   261                 	else
       
   262                 		{
       
   263                 		SetContentToTextParamL(param->iDefaultTelNumber, elemContent);
       
   264                 		}
       
   265                 	}
       
   266                 else if( elemName == Kdatacalltypeisdn )
       
   267                 	{
       
   268                 	if( useRandom )
       
   269                 		{
       
   270                 		param->SetRandomBearerTypeIsdnL(*iEngine);
       
   271                 		}
       
   272                 	else
       
   273                 		{
       
   274                 		if( CompareIgnoreCase(elemContent, Kanalogue) == 0 )
       
   275                 			param->iBearerCallTypeIsdn = CMManager::ECmCallTypeAnalogue;
       
   276                 		else if( CompareIgnoreCase( elemContent, Kisdnv110) == 0 )
       
   277                 			param->iBearerCallTypeIsdn = CMManager::ECmCallTypeISDNv110;
       
   278                 		else if( CompareIgnoreCase( elemContent, Kisdnv120) == 0 )
       
   279                 			param->iBearerCallTypeIsdn = CMManager::ECmCallTypeISDNv120;
       
   280                 		}
       
   281                 	}
       
   282                 else if( elemName == Kbearertype )
       
   283                 	{
       
   284                 	if( useRandom )
       
   285                 		{
       
   286                 		param->iBearerType = KRandomBearerType;
       
   287                 		}
       
   288                 	else
       
   289                 		{
       
   290                 		if( CompareIgnoreCase(elemContent, Kwlan) == 0 )
       
   291                 			{
       
   292                 			param->iBearerType = KUidWlanBearerType;
       
   293                 			}
       
   294                 		else if( CompareIgnoreCase(elemContent, Kgprs) == 0 )
       
   295                 			{
       
   296                 			param->iBearerType = KUidPacketDataBearerType;
       
   297                 			}
       
   298                 		else if( CompareIgnoreCase(elemContent, Kdatacall) == 0 )
       
   299                 			{
       
   300                 			param->iBearerType = KUidCSDBearerType;
       
   301                 			}
       
   302                 		else if( CompareIgnoreCase(elemContent, Khsgsm) == 0 )
       
   303                 			{
       
   304                 			param->iBearerType = KUidHSCSDBearerType;
       
   305                 			}
       
   306                 		else if( CompareIgnoreCase(elemContent, Kembedded) == 0 )
       
   307                 			{
       
   308                 			param->iBearerType = KUidEmbeddedDestination;
       
   309                 			}
       
   310                 		else if( CompareIgnoreCase(elemContent, Kvpn) == 0 )
       
   311                 			{
       
   312                 			param->iBearerType = KPluginVPNBearerTypeUid;
       
   313                 			}
       
   314                 		else if( CompareIgnoreCase(elemContent, Klan) == 0 )
       
   315                 			{
       
   316                 			param->iBearerType = KUidLanBearerType;
       
   317                 			}
       
   318                 		}
       
   319                 	}
       
   320                 else if( elemName == Kdatacalllinespeed )
       
   321                 	{
       
   322                 	if( useRandom )
       
   323                 		{
       
   324                 		param->SetRandomBearerSpeedL(*iEngine);
       
   325                 		}
       
   326                 	else
       
   327                 		{
       
   328                 		if( CompareIgnoreCase(elemContent, Kautomatic) == 0 )
       
   329                 			{                			 
       
   330                 			param->iBearerSpeed = CMManager::ECmSpeedAutobaud;
       
   331                 			}
       
   332                 		else
       
   333                 			{
       
   334                 			TUint lineSpeed = ConvertStrToUintL(elemContent);
       
   335                 			if( lineSpeed == 9600 )
       
   336                 				param->iBearerSpeed = CMManager::ECmSpeed9600;
       
   337                 			else if( lineSpeed == 14400 )
       
   338                 				param->iBearerSpeed = CMManager::ECmSpeed14400;
       
   339                 			else if( lineSpeed == 19200 )
       
   340                 				param->iBearerSpeed = CMManager::ECmSpeed19200;
       
   341                 			else if( lineSpeed == 28800 )
       
   342                 				param->iBearerSpeed = CMManager::ECmSpeed28800;
       
   343                 			else if( lineSpeed == 38400 )
       
   344                 				param->iBearerSpeed = CMManager::ECmSpeed38400;
       
   345                 			else if( lineSpeed == 43200 )
       
   346                 				param->iBearerSpeed = CMManager::ECmSpeed43200;
       
   347                 			else if( lineSpeed == 56000 )
       
   348                 				param->iBearerSpeed = CMManager::ECmSpeed56000;
       
   349                 			}                			
       
   350                 		}
       
   351                 	}
       
   352                 else if( elemName == Kuseproxy )
       
   353                 	{
       
   354                 	if( useRandom )
       
   355                 		{
       
   356                 		param->SetRandomUseProxyL(*iEngine);
       
   357                 		}
       
   358                 	else
       
   359                 		{
       
   360                 		param->iUseProxy = ConvertStrToBooleanL(elemContent);
       
   361                 		}
       
   362                 	}
       
   363                 else if( elemName == Kproxyserveraddress )
       
   364                 	{
       
   365                 	if( useRandom )
       
   366                 		{
       
   367                 		param->SetRandomProxyAddressL(*iEngine);
       
   368                 		}
       
   369                 	else
       
   370                 		{
       
   371                 		SetContentToTextParamL(param->iProxyServerAddress, elemContent);                		
       
   372                 		}
       
   373                 	}
       
   374                 else if( elemName == Kproxyportnumber )
       
   375                 	{
       
   376                 	if( useRandom )
       
   377                 		{
       
   378                 		param->SetRandomProxyPortL(*iEngine);
       
   379                 		}
       
   380                 	else
       
   381                 		{
       
   382                 		param->iProxyPortNumber = ConvertStrToUintL(elemContent);                		
       
   383                 		}
       
   384                 	}
       
   385                 else if( elemName == Kip6nameserver1 )
       
   386                 	{
       
   387                 	if( useRandom )
       
   388                 		{
       
   389                 		param->SetRandomIPv6NameServer1L(*iEngine);
       
   390                 		}
       
   391                 	else
       
   392                 		{
       
   393                 		SetContentToTextParamL(param->iIP6NameServer1, elemContent);               		                		
       
   394                 		}
       
   395                 	}
       
   396                 else if( elemName == Kip6nameserver2 )
       
   397                 	{
       
   398                 	if( useRandom )
       
   399                 		{
       
   400                 		param->SetRandomIPv6NameServer2L(*iEngine);
       
   401                 		}
       
   402                 	else
       
   403                 		{
       
   404                 		SetContentToTextParamL(param->iIP6NameServer2, elemContent);               		                		
       
   405                 		}
       
   406                 	}
       
   407                 else if( elemName == Kdisabletextauth )
       
   408                 	{
       
   409                 	if( useRandom )
       
   410                 		{
       
   411                 		param->SetRandomDisableTextAuthL(*iEngine);
       
   412                 		}
       
   413                 	else
       
   414                 		{
       
   415                 		param->iDisableTextAuth = ConvertStrToBooleanL(elemContent);
       
   416                 		}
       
   417                 	}
       
   418                 else if( elemName == Kwlanname )
       
   419                 	{
       
   420                 	if( useRandom )
       
   421                 		{
       
   422                 		param->SetRandomWLANNameL(*iEngine);
       
   423                 		}
       
   424                 	else
       
   425                 		{
       
   426                 		SetContentToTextParamL(param->iWLANName, elemContent);               		                		
       
   427                 		}
       
   428                 	}
       
   429                 else if( elemName == Kwlanipaddr )
       
   430                 	{
       
   431                 	if( useRandom )
       
   432                 		{
       
   433                 		param->SetRandomWlanIpAddrL(*iEngine);
       
   434                 		}
       
   435                 	else
       
   436                 		{
       
   437                 		SetContentToTextParamL(param->iWlanIpAddr, elemContent);               		                		
       
   438                 		}
       
   439                 	}
       
   440                 else if( elemName == Kwlansecmode )
       
   441                 	{
       
   442                 	if( useRandom )
       
   443                 		{
       
   444                 		param->SetRandomWLANSecurityModeL(*iEngine);
       
   445                 		}
       
   446                 	else
       
   447                 		{
       
   448                 		if( CompareIgnoreCase(elemContent, Kopen) == 0)
       
   449                 			param->iWLanSecMode = CMManager::EWlanSecModeOpen;
       
   450                 		else if( CompareIgnoreCase(elemContent, Kwep) == 0 )
       
   451                 			param->iWLanSecMode = CMManager::EWlanSecModeWep;
       
   452                 		else if( CompareIgnoreCase(elemContent, Ke802_1x) == 0 )
       
   453                 			param->iWLanSecMode = CMManager::EWlanSecMode802_1x;
       
   454                 		else if( CompareIgnoreCase(elemContent, Kwpa) == 0 )
       
   455                 			param->iWLanSecMode = CMManager::EWlanSecModeWpa;
       
   456                 		else if( CompareIgnoreCase(elemContent, Kwpa2) == 0 )
       
   457                 			param->iWLanSecMode = CMManager::EWlanSecModeWpa2;                		               		                		
       
   458                 		}
       
   459                 	}
       
   460                 }
       
   461             iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryAccessPoints, param);
       
   462             CleanupStack::Pop(); // param
       
   463             }
       
   464         }
       
   465     else
       
   466     	{
       
   467     	// No fields defined so add random entries:
       
   468     	iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryAccessPoints, 0, cmAmount);
       
   469     	}
       
   470     }
       
   471 #else
       
   472 void CCreatorConnectionMethodElement::ExecuteCommandL()
       
   473 	{
       
   474 	const CCreatorScriptAttribute* amountAttr = FindAttributeByName(KAmount);
       
   475 	TInt cmAmount = 1;    
       
   476 	if( amountAttr )
       
   477 		{
       
   478 		cmAmount = ConvertStrToIntL(amountAttr->Value());
       
   479 		}
       
   480 	// Get 'fields' element 
       
   481 	CCreatorScriptElement* fieldsElement = FindSubElement(KFields);
       
   482 	if( fieldsElement )
       
   483 		{
       
   484 		// Get sub-elements
       
   485 		const RPointerArray<CCreatorScriptElement>& fields = fieldsElement->SubElements();        
       
   486 		// Create connection method entries, the amount of entries is defined by cmAmount:
       
   487 		for( TInt cI = 0; cI < cmAmount; ++cI )
       
   488 			{            
       
   489 			CAccessPointsParameters* param = new (ELeave) CAccessPointsParameters;
       
   490 			CleanupStack::PushL(param);
       
   491 
       
   492 			for( TInt i = 0; i < fields.Count(); ++i )
       
   493 				{
       
   494 				CCreatorScriptElement* field = fields[i];
       
   495 				TPtrC elemName = field->Name();
       
   496 				TPtrC elemContent = field->Content();
       
   497 				const CCreatorScriptAttribute* randomAttr = fields[i]->FindAttributeByName(KRandomLength);
       
   498 				TBool useRandom = EFalse;
       
   499 				if( randomAttr || elemContent.Length() == 0 )
       
   500 					{
       
   501 					useRandom = ETrue;
       
   502 					}
       
   503 
       
   504 				if( elemName == Kconnectionname )
       
   505 					{
       
   506 					if( useRandom )
       
   507 						{
       
   508 						param->SetRandomCMNameL(*iEngine);
       
   509 						}
       
   510 					else
       
   511 						{
       
   512 						SetContentToTextParamL(param->iConnectionName, elemContent);
       
   513                         // reserve extra space for possible renaming
       
   514                         TInt newLen = param->iConnectionName->Length() + KExtraSpace;
       
   515                         param->iConnectionName = param->iConnectionName->ReAllocL(newLen);
       
   516 
       
   517                         SetContentToTextParamL(param->iGprsAcessPointName, elemContent);
       
   518 						}
       
   519 					}
       
   520 				else if( elemName == Kstartpage )
       
   521 					{
       
   522 					if( useRandom )
       
   523 						{
       
   524 						param->SetRandomStartPageL(*iEngine);
       
   525 						}
       
   526 					else
       
   527 						{
       
   528 						SetContentToTextParamL(param->iWapStartPage, elemContent);
       
   529 						}
       
   530 					}
       
   531 				else if( elemName == Kwapwspoption )
       
   532 					{
       
   533 					if( useRandom )
       
   534 						{
       
   535 						param->SetRandomWapWspOptionL(*iEngine);
       
   536 						}
       
   537 					else
       
   538 						{
       
   539 						if( CompareIgnoreCase(elemContent, Kconnectionless) == 0 )
       
   540 							{
       
   541 							param->iWapWspOption = EWapWspOptionConnectionless;
       
   542 							}
       
   543 						else if( CompareIgnoreCase(elemContent, Kconnectionoriented) == 0 )
       
   544 							{
       
   545 							param->iWapWspOption = EWapWspOptionConnectionOriented;
       
   546 							}
       
   547 						}
       
   548 					}
       
   549 				else if( elemName == Kloginname )
       
   550 					{
       
   551 					if( useRandom )
       
   552 						{
       
   553 						param->SetRandomLoginNameL(*iEngine);                		
       
   554 						}
       
   555 					else
       
   556 						{
       
   557 						SetContentToTextParamL(param->iIspLoginName, elemContent);
       
   558 						}
       
   559 					}
       
   560 				else if( elemName == Ksecureauthentication )
       
   561 					{
       
   562 					if( useRandom )
       
   563 						{
       
   564 						param->SetRandomSecureAuthenticationL(*iEngine);
       
   565 						}
       
   566 					else
       
   567 						{
       
   568 						param->iSecureAuthentication = ConvertStrToBooleanL(elemContent);
       
   569 						}
       
   570 					}
       
   571 				else if( elemName == Kloginpass )
       
   572 					{
       
   573 					if( useRandom )
       
   574 						{
       
   575 						param->SetRandomLoginPassL(*iEngine);
       
   576 						}
       
   577 					else
       
   578 						{
       
   579 						SetContentToTextParamL(param->iIspLoginPass, elemContent);
       
   580 						}
       
   581 					}
       
   582 				else if( elemName == Kpromptpassword )
       
   583 					{
       
   584 					if( useRandom )
       
   585 						{
       
   586 						param->SetRandomPromptPasswordL(*iEngine);
       
   587 						}
       
   588 					else
       
   589 						{
       
   590 						param->iPromptPassword = ConvertStrToBooleanL(elemContent);
       
   591 						}
       
   592 					}
       
   593 				else if( elemName == Kgatewayaddress )
       
   594 					{
       
   595 					if( useRandom )
       
   596 						{
       
   597 						param->SetRandomGatewayAddressL(*iEngine);
       
   598 						}
       
   599 					else
       
   600 						{
       
   601 						SetContentToTextParamL(param->iWapGatewayAddress, elemContent);
       
   602 						}
       
   603 					}
       
   604 				else if( elemName == Kdeviceipaddr )
       
   605 					{
       
   606 					if( useRandom )
       
   607 						{
       
   608 						param->SetRandomIPAddressL(*iEngine);
       
   609 						}
       
   610 					else
       
   611 						{
       
   612 						SetContentToTextParamL(param->iIspIPAddr, elemContent);
       
   613 						}
       
   614 					}
       
   615 				else if( elemName == Kip4nameserver1 )
       
   616 					{
       
   617 					if( useRandom )
       
   618 						{
       
   619 						param->SetRandomIP4NameServer1L(*iEngine);
       
   620 						}
       
   621 					else
       
   622 						{
       
   623 						SetContentToTextParamL(param->iIspIPNameServer1, elemContent);
       
   624 						}
       
   625 					}
       
   626 				else if( elemName == Kip4nameserver2 )
       
   627 					{
       
   628 					if( useRandom )
       
   629 						{
       
   630 						param->SetRandomIP4NameServer2L(*iEngine);
       
   631 						}
       
   632 					else
       
   633 						{
       
   634 						SetContentToTextParamL(param->iIspIPNameServer2, elemContent);
       
   635 						}
       
   636 					}
       
   637 				else if( elemName == Kdatacalltelnumber )
       
   638 					{
       
   639 					if( useRandom )
       
   640 						{
       
   641 						param->SetRandomTelephoneNumberL(*iEngine);
       
   642 						}
       
   643 					else
       
   644 						{
       
   645 						SetContentToTextParamL(param->iIspDefaultTelNumber, elemContent);
       
   646 						}
       
   647 					}
       
   648 				else if( elemName == Kdatacalltypeisdn )
       
   649 					{
       
   650 					if( useRandom )
       
   651 						{
       
   652 						param->SetRandomBearerTypeIsdnL(*iEngine);
       
   653 						}
       
   654 					else
       
   655 						{
       
   656 						if( CompareIgnoreCase(elemContent, Kanalogue) == 0 )
       
   657 							param->iIspBearerCallTypeIsdn = ECallTypeAnalogue;
       
   658 						else if( CompareIgnoreCase( elemContent, Kisdnv110) == 0 )
       
   659 							param->iIspBearerCallTypeIsdn = ECallTypeISDNv110;
       
   660 						else if( CompareIgnoreCase( elemContent, Kisdnv120) == 0 )
       
   661 							param->iIspBearerCallTypeIsdn = ECallTypeISDNv120;
       
   662 						}
       
   663 					}
       
   664 				else if( elemName == Kbearertype )
       
   665 					{
       
   666 					if( useRandom )
       
   667 						{
       
   668 						param->iBearerType = EApBearerTypeGPRS;
       
   669 						}
       
   670 					else
       
   671 						{
       
   672 						if( CompareIgnoreCase(elemContent, Kwlan) == 0 )
       
   673 							{
       
   674 							param->iBearerType = EApBearerTypeWLAN;
       
   675 							}
       
   676 						else if( CompareIgnoreCase(elemContent, Kgprs) == 0 )
       
   677 							{
       
   678 							param->iBearerType = EApBearerTypeGPRS;
       
   679 							}
       
   680 						else if( CompareIgnoreCase(elemContent, Kdatacall) == 0 )
       
   681 							{
       
   682 							param->iBearerType = EApBearerTypeCSD;
       
   683 							}
       
   684 						else if( CompareIgnoreCase(elemContent, Khsgsm) == 0 )
       
   685 							{
       
   686 							param->iBearerType = EApBearerTypeHSCSD;
       
   687 							}
       
   688 						else if( CompareIgnoreCase(elemContent, Klan) == 0 )
       
   689 							{
       
   690 							param->iBearerType = EApBearerTypeLAN;
       
   691 							}
       
   692 						}
       
   693 					}
       
   694 				else if( elemName == Kdatacalllinespeed )
       
   695 					{
       
   696 					if( useRandom )
       
   697 						{
       
   698 						param->SetRandomBearerSpeedL(*iEngine);
       
   699 						}
       
   700 					else
       
   701 						{
       
   702 						if( CompareIgnoreCase(elemContent, Kautomatic) == 0 )
       
   703 							{                			 
       
   704 							param->iIspBearerSpeed = KSpeedAutobaud;
       
   705 							}
       
   706 						else
       
   707 							{
       
   708 							TUint lineSpeed = ConvertStrToUintL(elemContent);
       
   709 							if( lineSpeed == 9600 )
       
   710 								param->iIspBearerSpeed = KSpeed9600;
       
   711 							else if( lineSpeed == 14400 )
       
   712 								param->iIspBearerSpeed = KSpeed14400;
       
   713 							else if( lineSpeed == 19200 )
       
   714 								param->iIspBearerSpeed = KSpeed19200;
       
   715 							else if( lineSpeed == 28800 )
       
   716 								param->iIspBearerSpeed = KSpeed28800;
       
   717 							else if( lineSpeed == 38400 )
       
   718 								param->iIspBearerSpeed = KSpeed38400;
       
   719 							else if( lineSpeed == 43200 )
       
   720 								param->iIspBearerSpeed = KSpeed43200;
       
   721 							else if( lineSpeed == 56000 )
       
   722 								param->iIspBearerSpeed = KSpeed56000;
       
   723 							}                			
       
   724 						}
       
   725 					}
       
   726 				else if( elemName == Kproxyserveraddress )
       
   727 					{
       
   728 					if( useRandom )
       
   729 						{
       
   730 						param->SetRandomProxyAddressL(*iEngine);
       
   731 						}
       
   732 					else
       
   733 						{
       
   734 						SetContentToTextParamL(param->iProxyServerAddress, elemContent);                		
       
   735 						}
       
   736 					}
       
   737 				else if( elemName == Kproxyportnumber )
       
   738 					{
       
   739 					if( useRandom )
       
   740 						{
       
   741 						param->SetRandomProxyPortL(*iEngine);
       
   742 						}
       
   743 					else
       
   744 						{
       
   745 						param->iProxyPortNumber = ConvertStrToUintL(elemContent);                		
       
   746 						}
       
   747 					}
       
   748 				}
       
   749 			iEngine->AppendToCommandArrayL(ECmdCreateMiscEntryAccessPoints, param);
       
   750 			CleanupStack::Pop(); // param
       
   751 			}
       
   752 		}
       
   753 	}
       
   754 #endif