19 |
19 |
20 #include <datamobilitycommsdattypes.h> |
20 #include <datamobilitycommsdattypes.h> |
21 #include <cmpluginbaseeng.h> |
21 #include <cmpluginbaseeng.h> |
22 #include <cmpsettingsconsts.h> |
22 #include <cmpsettingsconsts.h> |
23 #include <featmgr.h> |
23 #include <featmgr.h> |
24 |
24 #include <cmpluginembdestinationdef.h> |
|
25 |
|
26 #include "cmmserverdefs.h" |
25 #include "ccmpluginbaseengtextresolver.h" |
27 #include "ccmpluginbaseengtextresolver.h" |
26 |
28 |
27 #include "OstTraceDefinitions.h" |
29 #include "OstTraceDefinitions.h" |
28 #ifdef OST_TRACE_COMPILER_IN_USE |
30 #ifdef OST_TRACE_COMPILER_IN_USE |
29 #include "ccmpluginbaseengTraces.h" |
31 #include "ccmpluginbaseengTraces.h" |
134 iLocationRecord = NULL; |
136 iLocationRecord = NULL; |
135 iWapAPRecord = NULL; |
137 iWapAPRecord = NULL; |
136 iWapIPBearerRecord = NULL; |
138 iWapIPBearerRecord = NULL; |
137 iMetaDataRecord = NULL; |
139 iMetaDataRecord = NULL; |
138 |
140 |
139 iIapId = 0; |
141 iCmId = 0; |
140 iMetadataTableId = 0; |
142 iMetadataTableId = 0; |
141 iLocationEnabled = EFalse; |
143 iLocationEnabled = EFalse; |
142 |
144 |
143 OstTraceFunctionExit0( CCMPLUGINBASEENG_CCMPLUGINBASEENG_EXIT ); |
145 OstTraceFunctionExit0( CCMPLUGINBASEENG_CCMPLUGINBASEENG_EXIT ); |
144 } |
146 } |
149 // |
151 // |
150 EXPORT_C CCmPluginBaseEng::~CCmPluginBaseEng() |
152 EXPORT_C CCmPluginBaseEng::~CCmPluginBaseEng() |
151 { |
153 { |
152 OstTraceFunctionEntry0( DUP1_CCMPLUGINBASEENG_CCMPLUGINBASEENG_ENTRY ); |
154 OstTraceFunctionEntry0( DUP1_CCMPLUGINBASEENG_CCMPLUGINBASEENG_ENTRY ); |
153 |
155 |
154 iIapId = 0; |
156 iCmId = 0; |
155 delete iIapRecord; iIapRecord = NULL; |
157 delete iIapRecord; iIapRecord = NULL; |
156 delete iProxyRecord; iProxyRecord = NULL; |
158 delete iProxyRecord; iProxyRecord = NULL; |
157 delete iServiceRecord; iServiceRecord = NULL; |
159 delete iServiceRecord; iServiceRecord = NULL; |
158 delete iNetworkRecord; iNetworkRecord = NULL; |
160 delete iNetworkRecord; iNetworkRecord = NULL; |
159 delete iLocationRecord; iLocationRecord = NULL; |
161 delete iLocationRecord; iLocationRecord = NULL; |
364 EnableProxyL( EFalse ); |
373 EnableProxyL( EFalse ); |
365 |
374 |
366 _LIT( KDefaultConnNameTextId, "txt_occ_setlabel_connection_name_val_connection" ); |
375 _LIT( KDefaultConnNameTextId, "txt_occ_setlabel_connection_name_val_connection" ); |
367 HBufC* resolvedText( NULL ); |
376 HBufC* resolvedText( NULL ); |
368 resolvedText = CCmPluginBaseEngTextResolver::ResolveTextL( KDefaultConnNameTextId ); |
377 resolvedText = CCmPluginBaseEngTextResolver::ResolveTextL( KDefaultConnNameTextId ); |
369 if ( resolvedText != NULL ) |
378 if ( resolvedText ) |
370 { |
379 { |
371 SetDefaultNameL( *resolvedText ); |
380 SetDefaultNameL( *resolvedText ); |
372 } |
381 } |
373 else |
382 else |
374 { |
383 { |
484 |
493 |
485 switch ( aRecordIdentifier ) |
494 switch ( aRecordIdentifier ) |
486 { |
495 { |
487 case KIapRecordIndex: |
496 case KIapRecordIndex: |
488 { |
497 { |
489 aCopyInstance->iIapRecord = static_cast<CCDIAPRecord*>( |
498 CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>( |
490 CCDRecordBase::CreateCopyRecordL( *iIapRecord ) ); |
499 CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); |
|
500 CleanupStack::PushL( iapRecord ); |
|
501 CopyRecordFieldsL( *iIapRecord, *iapRecord ); |
|
502 CleanupStack::Pop( iapRecord ); |
|
503 aCopyInstance->iIapRecord = iapRecord; |
491 } |
504 } |
492 break; |
505 break; |
493 case KServiceRecordIndex: |
506 case KServiceRecordIndex: |
494 { |
507 { |
495 aCopyInstance->iServiceRecord = CopyServiceRecordL(); |
508 aCopyInstance->iServiceRecord = CopyServiceRecordL(); |
497 // process, in PrepareToUpdateRecordsL()-method. |
510 // process, in PrepareToUpdateRecordsL()-method. |
498 } |
511 } |
499 break; |
512 break; |
500 case KNetworkRecordIndex: |
513 case KNetworkRecordIndex: |
501 { |
514 { |
502 aCopyInstance->iNetworkRecord = static_cast<CCDNetworkRecord*>( |
515 CCDNetworkRecord* networkRecord = static_cast<CCDNetworkRecord*>( |
503 CCDRecordBase::CreateCopyRecordL( *iNetworkRecord ) ); |
516 CCDRecordBase::RecordFactoryL( KCDTIdNetworkRecord ) ); |
|
517 CleanupStack::PushL( networkRecord ); |
|
518 CopyRecordFieldsL( *iNetworkRecord, *networkRecord ); |
|
519 CleanupStack::Pop( networkRecord ); |
|
520 aCopyInstance->iNetworkRecord = networkRecord; |
504 } |
521 } |
505 break; |
522 break; |
506 case KWAPAPRecordIndex: |
523 case KWAPAPRecordIndex: |
507 { |
524 { |
508 aCopyInstance->iWapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
525 aCopyInstance->iWapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
509 CCDRecordBase::CreateCopyRecordL( *iWapAPRecord ) ); |
526 CCDRecordBase::CreateCopyRecordL( *iWapAPRecord ) );//TODO, convert to generic copy |
510 } |
527 } |
511 break; |
528 break; |
512 case KWAPBearerRecordIndex: |
529 case KWAPBearerRecordIndex: |
513 { |
530 { |
514 aCopyInstance->iWapIPBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
531 aCopyInstance->iWapIPBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
515 CCDRecordBase::CreateCopyRecordL( *iWapIPBearerRecord ) ); |
532 CCDRecordBase::CreateCopyRecordL( *iWapIPBearerRecord ) );//TODO, convert to generic copy |
516 } |
533 } |
517 break; |
534 break; |
518 case KMetaDataRecordIndex: |
535 case KMetaDataRecordIndex: |
519 { |
536 { |
520 CCDIAPMetadataRecord* metadataRecord = |
537 CCDIAPMetadataRecord* metadataRecord = |
527 break; |
544 break; |
528 case KProxyRecordIndex: |
545 case KProxyRecordIndex: |
529 { |
546 { |
530 if ( iProxyRecord ) |
547 if ( iProxyRecord ) |
531 { |
548 { |
532 aCopyInstance->iProxyRecord = static_cast<CCDProxiesRecord*>( |
549 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
533 CCDRecordBase::CreateCopyRecordL( *iProxyRecord ) ); |
550 CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); |
|
551 CleanupStack::PushL( proxyRecord ); |
|
552 CopyRecordFieldsL( *iProxyRecord, *proxyRecord ); |
|
553 CleanupStack::Pop( proxyRecord ); |
|
554 aCopyInstance->iProxyRecord = proxyRecord; |
534 } |
555 } |
535 } |
556 } |
536 break; |
557 break; |
537 default: |
558 default: |
538 { |
559 { |
543 |
564 |
544 OstTraceFunctionExit0( CCMPLUGINBASEENG_COPYRECORDDATAL_EXIT ); |
565 OstTraceFunctionExit0( CCMPLUGINBASEENG_COPYRECORDDATAL_EXIT ); |
545 } |
566 } |
546 |
567 |
547 // --------------------------------------------------------------------------- |
568 // --------------------------------------------------------------------------- |
548 // CCmPluginBaseEng:: CopyRecordFieldsL |
569 // Copies the values and attributes of all fields from aSource-record into |
549 // --------------------------------------------------------------------------- |
570 // aDestination record. Does not copy the record element ID. Also, does not |
550 // |
571 // touch any field in aDestination-record that is NULL in aSource-record. |
551 void CCmPluginBaseEng::CopyRecordFieldsL( |
572 // --------------------------------------------------------------------------- |
|
573 // |
|
574 EXPORT_C void CCmPluginBaseEng::CopyRecordFieldsL( |
552 CommsDat::CMDBRecordBase& aSource, |
575 CommsDat::CMDBRecordBase& aSource, |
553 CommsDat::CMDBRecordBase& aDestination ) |
576 CommsDat::CMDBRecordBase& aDestination ) |
554 { |
577 { |
555 OstTraceFunctionEntry0( CCMPLUGINBASEENG_COPYRECORDFIELDSL_ENTRY ); |
578 OstTraceFunctionEntry0( CCMPLUGINBASEENG_COPYRECORDFIELDSL_ENTRY ); |
556 |
579 |
557 const SRecordTypeInfo* recordInfo = aSource.GetRecordInfo(); |
580 const SRecordTypeInfo* recordInfo = aSource.GetRecordInfo(); |
558 if ( recordInfo == NULL ) |
581 if ( !recordInfo ) |
559 { |
582 { |
560 User::Leave( KErrCorrupt ); |
583 User::Leave( KErrCorrupt ); |
561 } |
584 } |
562 |
585 |
563 CMDBElement* ptrSource( NULL ); |
586 CMDBElement* ptrSource( NULL ); |
564 CMDBElement* ptrDest( NULL ); |
587 CMDBElement* ptrDest( NULL ); |
565 |
588 |
566 while ( recordInfo != NULL && recordInfo->iTypeId != 0 ) |
589 while ( recordInfo && recordInfo->iTypeId != 0 ) |
567 { |
590 { |
568 ptrSource = aSource.GetFieldByIdL( recordInfo->iTypeId ); |
591 ptrSource = aSource.GetFieldByIdL( recordInfo->iTypeId ); |
569 ptrDest = aDestination.GetFieldByIdL( recordInfo->iTypeId ); |
592 ptrDest = aDestination.GetFieldByIdL( recordInfo->iTypeId ); |
570 |
593 |
571 // Make sure we see only basic type info. Masks out any additional info |
594 // Make sure we see only basic type info. Masks out any additional info |
673 // |
696 // |
674 void CCmPluginBaseEng::LoadIAPRecordL( TUint32 aIapId ) |
697 void CCmPluginBaseEng::LoadIAPRecordL( TUint32 aIapId ) |
675 { |
698 { |
676 OstTraceFunctionEntry0( CCMPLUGINBASEENG_LOADIAPRECORDL_ENTRY ); |
699 OstTraceFunctionEntry0( CCMPLUGINBASEENG_LOADIAPRECORDL_ENTRY ); |
677 |
700 |
678 iIapId = aIapId; |
701 iCmId = aIapId; |
679 |
702 |
680 // Load IAP record |
703 // Load IAP record. |
681 CCDIAPRecord *iapRecord = static_cast<CCDIAPRecord *>( |
704 CCDIAPRecord *iapRecord = static_cast<CCDIAPRecord*>( |
682 CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); |
705 CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); |
683 |
706 |
684 CleanupStack::PushL( iapRecord ); |
707 CleanupStack::PushL( iapRecord ); |
685 |
708 |
686 iapRecord->SetRecordId( iIapId ); |
709 iapRecord->SetRecordId( iCmId ); |
687 iapRecord->LoadL( iSession ); |
710 iapRecord->LoadL( iSession ); |
688 |
711 |
689 CleanupStack::Pop( iapRecord ); |
712 CleanupStack::Pop( iapRecord ); |
690 iIapRecord = iapRecord; |
713 iIapRecord = iapRecord; |
691 |
714 |
698 // |
721 // |
699 void CCmPluginBaseEng::LoadProxyRecordL() |
722 void CCmPluginBaseEng::LoadProxyRecordL() |
700 { |
723 { |
701 OstTraceFunctionEntry0( CCMPLUGINBASEENG_LOADPROXYSETTINGL_ENTRY ); |
724 OstTraceFunctionEntry0( CCMPLUGINBASEENG_LOADPROXYSETTINGL_ENTRY ); |
702 |
725 |
703 // Load Proxy record |
726 // Load Proxy record. |
704 CMDBRecordSet<CCDProxiesRecord>* proxieRS = |
727 CMDBRecordSet<CCDProxiesRecord>* proxieRS = |
705 new( ELeave ) CMDBRecordSet<CCDProxiesRecord>( KCDTIdProxiesRecord ); |
728 new( ELeave ) CMDBRecordSet<CCDProxiesRecord>( KCDTIdProxiesRecord ); |
706 CleanupStack::PushL(proxieRS); |
729 CleanupStack::PushL(proxieRS); |
707 |
730 |
708 // Now try to find the linked proxy record |
731 // Now try to find the linked proxy record. |
709 // create new record |
732 // Create new record. |
710 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
733 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
711 CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); |
734 CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); |
712 |
|
713 CleanupStack::PushL( proxyRecord ); |
735 CleanupStack::PushL( proxyRecord ); |
714 |
736 |
715 // Prime record |
737 // Prime record. |
716 TPtrC serviceType( iIapRecord->iServiceType ); |
738 TPtrC serviceType( iIapRecord->iServiceType ); |
717 proxyRecord->iServiceType.SetL( serviceType ); |
739 proxyRecord->iServiceType.SetL( serviceType ); |
718 proxieRS->iRecords.AppendL( proxyRecord ); // Ownership transfered. |
740 proxieRS->iRecords.AppendL( proxyRecord ); // Ownership transfered. |
719 |
741 |
720 CleanupStack::Pop( proxyRecord ); |
742 CleanupStack::Pop( proxyRecord ); |
728 // search for our proxy record and remove it from the array, |
750 // search for our proxy record and remove it from the array, |
729 // then destroy the array. |
751 // then destroy the array. |
730 { |
752 { |
731 CCDProxiesRecord* proxyRecord = (*proxieRS)[i]; |
753 CCDProxiesRecord* proxyRecord = (*proxieRS)[i]; |
732 |
754 |
733 // Compare the record id of these 2 services |
755 // Compare the record id of these 2 services. |
734 if ( TUint32( proxyRecord->iService ) == TUint32( iIapRecord->iService ) ) |
756 if ( TUint32( proxyRecord->iService ) == TUint32( iIapRecord->iService ) ) |
735 { |
757 { |
736 iProxyRecord = proxyRecord; |
758 iProxyRecord = proxyRecord; |
737 // Take ownership of this record |
759 // Take ownership of this record. |
738 proxieRS->iRecords.Remove( i ); |
760 proxieRS->iRecords.Remove( i ); |
739 break; |
761 break; |
740 } |
762 } |
741 ++i; |
763 ++i; |
742 } |
764 } |
840 OstTraceFunctionEntry0( CCMPLUGINBASEENG_UPDATEIAPRECORDL_ENTRY ); |
862 OstTraceFunctionEntry0( CCMPLUGINBASEENG_UPDATEIAPRECORDL_ENTRY ); |
841 |
863 |
842 CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>( |
864 CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>( |
843 aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); |
865 aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); |
844 |
866 |
845 if ( iIapId == 0 ) |
867 if ( iCmId == 0 ) |
846 { |
868 { |
847 // Otherwise predefined iapid. |
869 // Otherwise predefined iapid. |
848 if ( !iIapRecord->RecordId() ) |
870 if ( !iIapRecord->RecordId() ) |
849 { |
871 { |
850 iIapRecord->SetRecordId( KCDNewRecordRequest ); |
872 iIapRecord->SetRecordId( KCDNewRecordRequest ); |
872 CopyAttributes( iapRecord, iIapRecord ); |
894 CopyAttributes( iapRecord, iIapRecord ); |
873 CheckIfNameModifiedL( iapRecord, iIapRecord ); |
895 CheckIfNameModifiedL( iapRecord, iIapRecord ); |
874 |
896 |
875 iIapRecord->StoreL( iSession ); |
897 iIapRecord->StoreL( iSession ); |
876 |
898 |
877 iIapId = iIapRecord->RecordId(); |
899 iCmId = iIapRecord->RecordId(); |
878 aClientPluginInstance->iIapId = iIapId; |
900 aClientPluginInstance->iIapId = iCmId; |
879 |
901 |
880 CCDIAPRecord* tempIapRecord = static_cast<CCDIAPRecord*>( |
902 CCDIAPRecord* tempIapRecord = static_cast<CCDIAPRecord*>( |
881 CCDRecordBase::CreateCopyRecordL( *iIapRecord ) ); |
903 CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); |
882 CleanupStack::PushL( tempIapRecord ); |
904 CleanupStack::PushL( tempIapRecord ); |
|
905 CopyRecordFieldsL( *iIapRecord, *tempIapRecord ); |
883 tempIapRecord->SetElementId( iIapRecord->ElementId() ); |
906 tempIapRecord->SetElementId( iIapRecord->ElementId() ); |
884 |
907 |
885 aClientPluginInstance->iGenRecordArray.Remove( KIapRecordIndex ); |
908 aClientPluginInstance->iGenRecordArray.Remove( KIapRecordIndex ); |
886 CleanupStack::PushL( iapRecord ); |
909 delete iapRecord; |
|
910 iapRecord = NULL; |
887 |
911 |
888 aClientPluginInstance->iGenRecordArray.InsertL( |
912 aClientPluginInstance->iGenRecordArray.InsertL( |
889 static_cast<CommsDat::CCDRecordBase*>( tempIapRecord ), |
913 static_cast<CommsDat::CCDRecordBase*>( tempIapRecord ), |
890 KIapRecordIndex ); |
914 KIapRecordIndex ); |
891 |
915 |
892 CleanupStack::PopAndDestroy( iapRecord ); |
|
893 CleanupStack::Pop( tempIapRecord ); |
916 CleanupStack::Pop( tempIapRecord ); |
894 } |
917 } |
895 else |
918 else |
896 { |
919 { |
897 delete iIapRecord; |
920 delete iIapRecord; |
898 iIapRecord = NULL; |
921 iIapRecord = NULL; |
899 |
|
900 iIapRecord = static_cast<CCDIAPRecord*>( |
922 iIapRecord = static_cast<CCDIAPRecord*>( |
901 CCDRecordBase::CreateCopyRecordL( *iapRecord ) ); |
923 CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); |
|
924 CopyRecordFieldsL( *iapRecord, *iIapRecord ); |
902 |
925 |
903 iIapRecord->SetElementId( iapRecord->ElementId() ); |
926 iIapRecord->SetElementId( iapRecord->ElementId() ); |
904 iIapRecord->ModifyL( iSession ); |
927 iIapRecord->ModifyL( iSession ); |
905 } |
928 } |
906 |
929 |
930 CopyAttributes( iapRecord, proxyRecord ); |
953 CopyAttributes( iapRecord, proxyRecord ); |
931 CheckIfNameModifiedL( iapRecord, proxyRecord ); |
954 CheckIfNameModifiedL( iapRecord, proxyRecord ); |
932 |
955 |
933 delete iProxyRecord; |
956 delete iProxyRecord; |
934 iProxyRecord = NULL; |
957 iProxyRecord = NULL; |
935 |
|
936 iProxyRecord = static_cast<CCDProxiesRecord*>( |
958 iProxyRecord = static_cast<CCDProxiesRecord*>( |
937 CCDRecordBase::CreateCopyRecordL( *proxyRecord ) ); |
959 CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); |
|
960 CopyRecordFieldsL( *proxyRecord, *iProxyRecord ); |
938 iProxyRecord->SetElementId( proxyRecord->ElementId() ); |
961 iProxyRecord->SetElementId( proxyRecord->ElementId() ); |
939 |
962 |
940 if ( !iProxyRecord->RecordId() ) |
963 if ( !iProxyRecord->RecordId() ) |
941 { |
964 { |
942 // New proxy setting -> create new record. |
965 // New proxy setting -> create new record. |
1049 iNetworkRecord = NULL; |
1072 iNetworkRecord = NULL; |
1050 |
1073 |
1051 CheckIfNameModifiedL( iapRecord, networkRecord ); |
1074 CheckIfNameModifiedL( iapRecord, networkRecord ); |
1052 |
1075 |
1053 iNetworkRecord = static_cast<CCDNetworkRecord*>( |
1076 iNetworkRecord = static_cast<CCDNetworkRecord*>( |
1054 CCDRecordBase::CreateCopyRecordL( *networkRecord ) ); |
1077 CCDRecordBase::RecordFactoryL( KCDTIdNetworkRecord ) ); |
|
1078 CopyRecordFieldsL( *networkRecord, *iNetworkRecord ); |
1055 |
1079 |
1056 iNetworkRecord->SetElementId( networkRecord->ElementId() ); |
1080 iNetworkRecord->SetElementId( networkRecord->ElementId() ); |
1057 |
1081 |
1058 if ( !iNetworkRecord->RecordId() ) |
1082 if ( !iNetworkRecord->RecordId() ) |
1059 { |
1083 { |
1103 User::Leave( KErrNotSupported ); |
1127 User::Leave( KErrNotSupported ); |
1104 } |
1128 } |
1105 |
1129 |
1106 if ( !iProxyRecord ) |
1130 if ( !iProxyRecord ) |
1107 { |
1131 { |
1108 iProxyRecord = static_cast<CCDProxiesRecord *>( |
1132 iProxyRecord = static_cast<CCDProxiesRecord*>( |
1109 CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); |
1133 CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); |
1110 } |
1134 } |
1111 |
1135 |
1112 iProxyRecord->iUseProxyServer = aEnable; |
1136 iProxyRecord->iUseProxyServer = aEnable; |
1113 |
1137 |
1213 |
1237 |
1214 CheckIfNameModifiedL( iapRecord, wapAPRecord ); |
1238 CheckIfNameModifiedL( iapRecord, wapAPRecord ); |
1215 CheckIfNameModifiedL( iapRecord, wapIPBearerRecord ); |
1239 CheckIfNameModifiedL( iapRecord, wapIPBearerRecord ); |
1216 |
1240 |
1217 iWapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
1241 iWapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
1218 CCDRecordBase::CreateCopyRecordL( *wapAPRecord ) ); |
1242 CCDRecordBase::CreateCopyRecordL( *wapAPRecord ) );//TODO, convert to generic copy |
1219 iWapAPRecord->SetElementId( wapAPRecord->ElementId() ); |
1243 iWapAPRecord->SetElementId( wapAPRecord->ElementId() ); |
1220 |
1244 |
1221 iWapIPBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
1245 iWapIPBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
1222 CCDRecordBase::CreateCopyRecordL( *wapIPBearerRecord ) ); |
1246 CCDRecordBase::CreateCopyRecordL( *wapIPBearerRecord ) );//TODO, convert to generic copy |
1223 iWapIPBearerRecord->SetElementId( wapIPBearerRecord->ElementId() ); |
1247 iWapIPBearerRecord->SetElementId( wapIPBearerRecord->ElementId() ); |
1224 |
1248 |
1225 if ( !iWapAPRecord->RecordId() ) |
1249 if ( !iWapAPRecord->RecordId() ) |
1226 { |
1250 { |
1227 iWapAPRecord->SetRecordId( KCDNewRecordRequest ); |
1251 iWapAPRecord->SetRecordId( KCDNewRecordRequest ); |
1335 CCDRecordBase* aSrcRecord, |
1359 CCDRecordBase* aSrcRecord, |
1336 CCDRecordBase* aDstRecord ) |
1360 CCDRecordBase* aDstRecord ) |
1337 { |
1361 { |
1338 OstTraceFunctionEntry0( CCMPLUGINBASEENG_COPYATTRIBUTES_ENTRY ); |
1362 OstTraceFunctionEntry0( CCMPLUGINBASEENG_COPYATTRIBUTES_ENTRY ); |
1339 |
1363 |
1340 if ( aSrcRecord == NULL || aDstRecord == NULL ) |
1364 if ( !aSrcRecord || !aDstRecord ) |
1341 { |
1365 { |
1342 OstTraceFunctionExit0( CCMPLUGINBASEENG_COPYATTRIBUTES_EXIT ); |
1366 OstTraceFunctionExit0( CCMPLUGINBASEENG_COPYATTRIBUTES_EXIT ); |
1343 return; |
1367 return; |
1344 } |
1368 } |
1345 |
1369 |
1365 CCDWAPIPBearerRecord* wapBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
1389 CCDWAPIPBearerRecord* wapBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
1366 CCDRecordBase::RecordFactoryL( KCDTIdWAPIPBearerRecord ) ); |
1390 CCDRecordBase::RecordFactoryL( KCDTIdWAPIPBearerRecord ) ); |
1367 |
1391 |
1368 CleanupStack::PushL( wapBearerRecord ); |
1392 CleanupStack::PushL( wapBearerRecord ); |
1369 |
1393 |
1370 wapBearerRecord->iWAPIAP = iIapId; |
1394 wapBearerRecord->iWAPIAP = iCmId; |
1371 wapRS->iRecords.AppendL( wapBearerRecord ); |
1395 wapRS->iRecords.AppendL( wapBearerRecord ); |
1372 |
1396 |
1373 CleanupStack::Pop( wapBearerRecord ); |
1397 CleanupStack::Pop( wapBearerRecord ); |
1374 wapBearerRecord = NULL; |
1398 wapBearerRecord = NULL; |
1375 |
1399 |
1438 const TDesC& aName, |
1462 const TDesC& aName, |
1439 const TUint32& aIapId ) |
1463 const TUint32& aIapId ) |
1440 { |
1464 { |
1441 OstTraceFunctionEntry0( CCMPLUGINBASEENG_DOMAKEVALIDNAMEL_ENTRY ); |
1465 OstTraceFunctionEntry0( CCMPLUGINBASEENG_DOMAKEVALIDNAMEL_ENTRY ); |
1442 |
1466 |
|
1467 const TInt decimalBase = 10; |
1443 TBool changed( EFalse ); |
1468 TBool changed( EFalse ); |
1444 HBufC* temp = HBufC::NewLC( KApMaxConnNameLength ); |
1469 HBufC* temp = HBufC::NewLC( KApMaxConnNameLength ); |
1445 HBufC* temp2 = HBufC::NewLC( KApMaxConnNameLength ); |
1470 HBufC* temp2 = HBufC::NewLC( KApMaxConnNameLength ); |
1446 |
1471 |
1447 HBufC* corrname = EnsureMaxLengthLC( aName, changed ); |
1472 HBufC* corrname = EnsureMaxLengthLC( aName, changed ); |
1462 { |
1487 { |
1463 changed = ETrue; |
1488 changed = ETrue; |
1464 postfix++; |
1489 postfix++; |
1465 // Check the length of postfix, check text length accordingly. |
1490 // Check the length of postfix, check text length accordingly. |
1466 pf = postfix; |
1491 pf = postfix; |
1467 for ( i = 1; i < 10; i++ ) |
1492 for ( i = 1; i < decimalBase; i++ ) |
1468 { |
1493 { |
1469 pf /= 10; |
1494 pf /= decimalBase; |
1470 if ( !pf ) |
1495 if ( !pf ) |
1471 break; |
1496 break; |
1472 } |
1497 } |
1473 TPtr sgdptr( temp->Des() ); |
1498 TPtr sgdptr( temp->Des() ); |
1474 TPtr sgdptr2( temp2->Des() ); |
1499 TPtr sgdptr2( temp2->Des() ); |
1475 if ( postfix ) |
1500 if ( postfix ) |
1476 { |
1501 { |
1477 if ( postfix < 10 ) |
1502 if ( postfix < decimalBase ) |
1478 { |
1503 { |
1479 sgdptr2 = prefix.Left( KApMaxConnNameLength - i - 3 ); |
1504 sgdptr2 = prefix.Left( KApMaxConnNameLength - i - 3 ); |
1480 } |
1505 } |
1481 else |
1506 else |
1482 { |
1507 { |
1488 sgdptr2 = prefix.Left( KApMaxConnNameLength ); |
1513 sgdptr2 = prefix.Left( KApMaxConnNameLength ); |
1489 } |
1514 } |
1490 if ( postfix ) |
1515 if ( postfix ) |
1491 { |
1516 { |
1492 TBuf<KMaxPostfixLength> postfixString; |
1517 TBuf<KMaxPostfixLength> postfixString; |
1493 if ( postfix > 9 ) |
1518 if ( postfix >= decimalBase ) |
1494 { |
1519 { |
1495 postfixString.Format( KFormatLargePostfix, postfix ); |
1520 postfixString.Format( KFormatLargePostfix, postfix ); |
1496 // TODO: AknTextUtils::LanguageSpecificNumberConversion( postfixString ); |
1521 // TODO: AknTextUtils::LanguageSpecificNumberConversion( postfixString ); |
1497 } |
1522 } |
1498 else |
1523 else |
1705 CleanupStack::Pop( iapRecord ); |
1730 CleanupStack::Pop( iapRecord ); |
1706 iapRecord = NULL; |
1731 iapRecord = NULL; |
1707 |
1732 |
1708 if ( iapRS->FindL( iSession ) ) |
1733 if ( iapRS->FindL( iSession ) ) |
1709 { |
1734 { |
1710 if ( iIapId ) |
1735 if ( iCmId ) |
1711 { |
1736 { |
1712 // This is not a new CM. |
1737 // This is not a new CM. |
1713 for ( TInt i = 0; i < iapRS->iRecords.Count(); ++i ) |
1738 for ( TInt i = 0; i < iapRS->iRecords.Count(); ++i ) |
1714 { |
1739 { |
1715 if ( iapRS->iRecords[i]->RecordId() != aIapId ) |
1740 if ( iapRS->iRecords[i]->RecordId() != aIapId ) |
1774 { |
1799 { |
1775 iIapRecord->iRecordName.SetL( aName ); |
1800 iIapRecord->iRecordName.SetL( aName ); |
1776 } |
1801 } |
1777 else if ( iNamingMethod == ENamingUnique ) |
1802 else if ( iNamingMethod == ENamingUnique ) |
1778 { |
1803 { |
1779 HBufC* newName = DoMakeValidNameL( aName, iIapId ); |
1804 HBufC* newName = DoMakeValidNameL( aName, iCmId ); |
1780 |
1805 |
1781 if ( newName ) |
1806 if ( newName ) |
1782 // Name converted to unique. |
1807 // Name converted to unique. |
1783 { |
1808 { |
1784 CleanupStack::PushL( newName ); |
1809 CleanupStack::PushL( newName ); |
2035 aClientPluginInstance->iLocationEnabled = iLocationEnabled; |
2060 aClientPluginInstance->iLocationEnabled = iLocationEnabled; |
2036 |
2061 |
2037 if ( iIapRecord ) |
2062 if ( iIapRecord ) |
2038 { |
2063 { |
2039 CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>( |
2064 CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>( |
2040 CCDRecordBase::CreateCopyRecordL( *iIapRecord ) ); |
2065 CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); |
|
2066 CleanupStack::PushL( iapRecord ); |
|
2067 CopyRecordFieldsL( *iIapRecord, *iapRecord ); |
2041 iapRecord->SetElementId( iIapRecord->ElementId() ); |
2068 iapRecord->SetElementId( iIapRecord->ElementId() ); |
2042 CleanupStack::PushL( iapRecord ); |
|
2043 aClientPluginInstance->iGenRecordArray.AppendL( |
2069 aClientPluginInstance->iGenRecordArray.AppendL( |
2044 static_cast<CommsDat::CCDRecordBase*>( iapRecord ) ); |
2070 static_cast<CommsDat::CCDRecordBase*>( iapRecord ) ); |
2045 CleanupStack::Pop( iapRecord ); |
2071 CleanupStack::Pop( iapRecord ); |
2046 } |
2072 } |
2047 else |
2073 else |
2063 } |
2089 } |
2064 |
2090 |
2065 if ( iNetworkRecord ) |
2091 if ( iNetworkRecord ) |
2066 { |
2092 { |
2067 CCDNetworkRecord* networkRecord = static_cast<CCDNetworkRecord*>( |
2093 CCDNetworkRecord* networkRecord = static_cast<CCDNetworkRecord*>( |
2068 CCDRecordBase::CreateCopyRecordL( *iNetworkRecord ) ); |
2094 CCDRecordBase::RecordFactoryL( KCDTIdNetworkRecord ) ); |
|
2095 CleanupStack::PushL( networkRecord ); |
|
2096 CopyRecordFieldsL( *iNetworkRecord, *networkRecord ); |
2069 networkRecord->SetElementId( iNetworkRecord->ElementId() ); |
2097 networkRecord->SetElementId( iNetworkRecord->ElementId() ); |
2070 CleanupStack::PushL( networkRecord ); |
|
2071 aClientPluginInstance->iGenRecordArray.AppendL( |
2098 aClientPluginInstance->iGenRecordArray.AppendL( |
2072 static_cast<CommsDat::CCDRecordBase*>( networkRecord ) ); |
2099 static_cast<CommsDat::CCDRecordBase*>( networkRecord ) ); |
2073 CleanupStack::Pop( networkRecord ); |
2100 CleanupStack::Pop( networkRecord ); |
2074 } |
2101 } |
2075 else |
2102 else |
2078 } |
2105 } |
2079 |
2106 |
2080 if ( iWapAPRecord ) |
2107 if ( iWapAPRecord ) |
2081 { |
2108 { |
2082 CCDWAPAccessPointRecord* wapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
2109 CCDWAPAccessPointRecord* wapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
2083 CCDRecordBase::CreateCopyRecordL( *iWapAPRecord ) ); |
2110 CCDRecordBase::CreateCopyRecordL( *iWapAPRecord ) );//TODO, convert to generic copy |
2084 wapAPRecord->SetElementId( iWapAPRecord->ElementId() ); |
2111 wapAPRecord->SetElementId( iWapAPRecord->ElementId() ); |
2085 CleanupStack::PushL( wapAPRecord ); |
2112 CleanupStack::PushL( wapAPRecord ); |
2086 aClientPluginInstance->iGenRecordArray.AppendL( |
2113 aClientPluginInstance->iGenRecordArray.AppendL( |
2087 static_cast<CommsDat::CCDRecordBase*>( wapAPRecord ) ); |
2114 static_cast<CommsDat::CCDRecordBase*>( wapAPRecord ) ); |
2088 CleanupStack::Pop( wapAPRecord ); |
2115 CleanupStack::Pop( wapAPRecord ); |
2093 } |
2120 } |
2094 |
2121 |
2095 if ( iWapIPBearerRecord ) |
2122 if ( iWapIPBearerRecord ) |
2096 { |
2123 { |
2097 CCDWAPIPBearerRecord* wapIPBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
2124 CCDWAPIPBearerRecord* wapIPBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
2098 CCDRecordBase::CreateCopyRecordL( *iWapIPBearerRecord ) ); |
2125 CCDRecordBase::CreateCopyRecordL( *iWapIPBearerRecord ) );//TODO, convert to generic copy |
2099 wapIPBearerRecord->SetElementId( iWapIPBearerRecord->ElementId() ); |
2126 wapIPBearerRecord->SetElementId( iWapIPBearerRecord->ElementId() ); |
2100 CleanupStack::PushL( wapIPBearerRecord ); |
2127 CleanupStack::PushL( wapIPBearerRecord ); |
2101 aClientPluginInstance->iGenRecordArray.AppendL( |
2128 aClientPluginInstance->iGenRecordArray.AppendL( |
2102 static_cast<CommsDat::CCDRecordBase*>( wapIPBearerRecord ) ); |
2129 static_cast<CommsDat::CCDRecordBase*>( wapIPBearerRecord ) ); |
2103 CleanupStack::Pop( wapIPBearerRecord ); |
2130 CleanupStack::Pop( wapIPBearerRecord ); |
2129 aClientPluginInstance->iGenRecordArray.AppendL( NULL ); |
2156 aClientPluginInstance->iGenRecordArray.AppendL( NULL ); |
2130 |
2157 |
2131 if ( iProxyRecord ) |
2158 if ( iProxyRecord ) |
2132 { |
2159 { |
2133 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
2160 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
2134 CCDRecordBase::CreateCopyRecordL( *iProxyRecord ) ); |
2161 CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); |
|
2162 CleanupStack::PushL( proxyRecord ); |
|
2163 CopyRecordFieldsL( *iProxyRecord, *proxyRecord ); |
2135 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
2164 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
2136 CleanupStack::PushL( proxyRecord ); |
|
2137 aClientPluginInstance->iGenRecordArray.AppendL( |
2165 aClientPluginInstance->iGenRecordArray.AppendL( |
2138 static_cast<CommsDat::CCDRecordBase*>( proxyRecord ) ); |
2166 static_cast<CommsDat::CCDRecordBase*>( proxyRecord ) ); |
2139 CleanupStack::Pop( proxyRecord ); |
2167 CleanupStack::Pop( proxyRecord ); |
2140 } |
2168 } |
2141 else |
2169 else |
2162 switch ( aAttribute ) |
2190 switch ( aAttribute ) |
2163 { |
2191 { |
2164 case ECmIapId: // If the CM has an ECmIapId then the ECmIapId is the ECmId. |
2192 case ECmIapId: // If the CM has an ECmIapId then the ECmIapId is the ECmId. |
2165 case ECmId: |
2193 case ECmId: |
2166 { |
2194 { |
2167 retVal = static_cast<CCDIAPRecord*>( |
2195 if ( iBearerType == KUidEmbeddedDestination ) |
2168 aClientPluginInstance->iGenRecordArray[KIapRecordIndex] )->RecordId(); |
2196 { |
|
2197 retVal = GetBearerIntAttributeL( |
|
2198 aAttribute, |
|
2199 aClientPluginInstance->iGenRecordArray, |
|
2200 aClientPluginInstance->iBearerSpecRecordArray ); |
|
2201 } |
|
2202 else |
|
2203 { |
|
2204 retVal = static_cast<CCDIAPRecord*>( |
|
2205 aClientPluginInstance->iGenRecordArray[KIapRecordIndex] )->RecordId(); |
|
2206 } |
2169 } |
2207 } |
2170 break; |
2208 break; |
2171 case ECmWapId: |
2209 case ECmWapId: |
2172 { |
2210 { |
2173 retVal = static_cast<CCDWAPIPBearerRecord*>( |
2211 retVal = static_cast<CCDWAPIPBearerRecord*>( |
2174 aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] )->iWAPAccessPointId; |
2212 aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] ) |
|
2213 ->iWAPAccessPointId; |
2175 } |
2214 } |
2176 break; |
2215 break; |
2177 case ECmIapServiceId: |
2216 case ECmIapServiceId: |
2178 { |
2217 { |
2179 retVal = static_cast<CCDIAPRecord*>( |
2218 retVal = static_cast<CCDIAPRecord*>( |
2203 case ECmSeamlessnessLevel: |
2242 case ECmSeamlessnessLevel: |
2204 { |
2243 { |
2205 if ( iMetaDataRecord ) |
2244 if ( iMetaDataRecord ) |
2206 { |
2245 { |
2207 retVal = static_cast<CCDIAPMetadataRecord*>( |
2246 retVal = static_cast<CCDIAPMetadataRecord*>( |
2208 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] )->iSeamlessness; |
2247 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ) |
|
2248 ->iSeamlessness; |
2209 } |
2249 } |
2210 else |
2250 else |
2211 { |
2251 { |
2212 User::Leave( KErrNotFound ); |
2252 User::Leave( KErrNotFound ); |
2213 } |
2253 } |
2287 |
2328 |
2288 switch ( aAttribute ) |
2329 switch ( aAttribute ) |
2289 { |
2330 { |
2290 case ECmProtected: |
2331 case ECmProtected: |
2291 { |
2332 { |
2292 retVal = IsProtected(); |
2333 if ( iBearerType == KUidEmbeddedDestination ) |
|
2334 { |
|
2335 retVal = GetBearerBoolAttributeL( |
|
2336 aAttribute, |
|
2337 aClientPluginInstance->iGenRecordArray, |
|
2338 aClientPluginInstance->iBearerSpecRecordArray ); |
|
2339 } |
|
2340 else |
|
2341 { |
|
2342 retVal = IsProtected(); |
|
2343 } |
2293 } |
2344 } |
2294 break; |
2345 break; |
2295 case ECmHidden: |
2346 case ECmHidden: |
2296 { |
2347 { |
2297 CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>( |
2348 if ( iBearerType == KUidEmbeddedDestination ) |
2298 aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); |
2349 { |
2299 retVal = iapRecord->Attributes() & ECDHidden; |
2350 retVal = GetBearerBoolAttributeL( |
|
2351 aAttribute, |
|
2352 aClientPluginInstance->iGenRecordArray, |
|
2353 aClientPluginInstance->iBearerSpecRecordArray ); |
|
2354 } |
|
2355 else |
|
2356 { |
|
2357 CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>( |
|
2358 aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); |
|
2359 retVal = iapRecord->Attributes() & ECDHidden; |
|
2360 } |
2300 } |
2361 } |
2301 break; |
2362 break; |
2302 case ECmProxyUsageEnabled: |
2363 case ECmProxyUsageEnabled: |
2303 { |
2364 { |
2304 if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
2365 if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
2305 { |
2366 { |
2306 retVal = EFalse; |
2367 retVal = EFalse; |
2307 } |
2368 } |
2308 |
2369 else |
2309 retVal = static_cast<CCDProxiesRecord*>( |
2370 { |
2310 aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )->iUseProxyServer; |
2371 retVal = static_cast<CCDProxiesRecord*>( |
|
2372 aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
|
2373 ->iUseProxyServer; |
|
2374 } |
2311 } |
2375 } |
2312 break; |
2376 break; |
2313 case ECmDestination: |
2377 case ECmDestination: |
2314 { |
2378 { |
2315 TRAPD( err, retVal = GetBearerBoolAttributeL( |
2379 TRAPD( err, retVal = GetBearerBoolAttributeL( |
2364 CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2428 CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2365 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2429 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2366 retVal = metadataRecord->iMetadata & EMetaHiddenAgent; |
2430 retVal = metadataRecord->iMetadata & EMetaHiddenAgent; |
2367 } |
2431 } |
2368 break; |
2432 break; |
|
2433 case ECmMetaHotSpot: |
|
2434 { |
|
2435 CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
|
2436 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
|
2437 retVal = metadataRecord->iMetadata & EMetaHotSpot; |
|
2438 } |
|
2439 break; |
2369 case ECmVirtual: |
2440 case ECmVirtual: |
2370 { |
2441 { |
2371 // This is bearer specific attribute |
2442 // This is bearer specific attribute. |
2372 TRAPD( err, retVal = GetBearerInfoBoolL( aAttribute ) ); |
2443 TRAPD( err, retVal = GetBearerInfoBoolL( aAttribute ) ); |
2373 if ( err ) |
2444 if ( err ) |
2374 { |
2445 { |
2375 retVal = EFalse; |
2446 retVal = EFalse; |
2376 } |
2447 } |
2414 |
2485 |
2415 switch ( aAttribute ) |
2486 switch ( aAttribute ) |
2416 { |
2487 { |
2417 case ECmBearerIcon: |
2488 case ECmBearerIcon: |
2418 { |
2489 { |
2419 //TODO, read icon name from metadata record after commsdat changes implemented. |
2490 CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2420 //CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2491 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2421 // aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2492 |
2422 |
2493 if ( !metadataRecord ) |
2423 //if ( !metadataRecord ) |
2494 { |
2424 // { |
2495 User::Leave( KErrCorrupt ); |
2425 // User::Leave( KErrCorrupt ); |
2496 } |
2426 // } |
2497 |
2427 |
2498 retVal = TPtrC( metadataRecord->iIconFileName ).AllocL(); |
2428 //retVal = TPtrC( metadataRecord->iIconFileName ).AllocL(); |
|
2429 retVal = KNullDesC().AllocL();//TODO, check this freed |
|
2430 } |
2499 } |
2431 break; |
2500 break; |
2432 case ECmStartPage: |
2501 case ECmStartPage: |
2433 { |
2502 { |
2434 CCDWAPAccessPointRecord* wapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
2503 CCDWAPAccessPointRecord* wapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
2624 case ECmProxyPortNumber: |
2693 case ECmProxyPortNumber: |
2625 { |
2694 { |
2626 if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
2695 if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
2627 { |
2696 { |
2628 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
2697 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
2629 CCDRecordBase::CreateCopyRecordL( *iProxyRecord ) ); |
2698 CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); |
2630 CleanupStack::PushL( proxyRecord ); |
2699 CleanupStack::PushL( proxyRecord ); |
|
2700 CopyRecordFieldsL( *iProxyRecord, *proxyRecord ); |
2631 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
2701 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
2632 aClientPluginInstance->iGenRecordArray.AppendL( |
2702 aClientPluginInstance->iGenRecordArray.InsertL( |
2633 static_cast<CommsDat::CCDRecordBase*>( proxyRecord ) ); |
2703 static_cast<CommsDat::CCDRecordBase*>( proxyRecord ), |
|
2704 KProxyRecordIndex ); |
2634 CleanupStack::Pop( proxyRecord ); |
2705 CleanupStack::Pop( proxyRecord ); |
2635 } |
2706 } |
2636 |
2707 |
2637 static_cast<CCDProxiesRecord*>( |
2708 static_cast<CCDProxiesRecord*>( |
2638 aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )-> |
2709 aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )-> |
2725 case ECmProxyUsageEnabled: |
2796 case ECmProxyUsageEnabled: |
2726 { |
2797 { |
2727 if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
2798 if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
2728 { |
2799 { |
2729 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
2800 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
2730 CCDRecordBase::CreateCopyRecordL( *iProxyRecord ) ); |
2801 CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); |
2731 CleanupStack::PushL( proxyRecord ); |
2802 CleanupStack::PushL( proxyRecord ); |
|
2803 CopyRecordFieldsL( *iProxyRecord, *proxyRecord ); |
2732 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
2804 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
2733 aClientPluginInstance->iGenRecordArray.AppendL( |
2805 aClientPluginInstance->iGenRecordArray.InsertL( |
2734 static_cast<CommsDat::CCDRecordBase*>( proxyRecord ) ); |
2806 static_cast<CommsDat::CCDRecordBase*>( proxyRecord ), |
|
2807 KProxyRecordIndex ); |
2735 CleanupStack::Pop( proxyRecord ); |
2808 CleanupStack::Pop( proxyRecord ); |
2736 } |
2809 } |
2737 |
2810 |
2738 static_cast<CCDProxiesRecord*>( |
2811 static_cast<CCDProxiesRecord*>( |
2739 aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )->iUseProxyServer = |
2812 aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )->iUseProxyServer = |
2773 metadataRecord->iMetadata = EMetaHiddenAgent | metadataRecord->iMetadata; |
2846 metadataRecord->iMetadata = EMetaHiddenAgent | metadataRecord->iMetadata; |
2774 } |
2847 } |
2775 else |
2848 else |
2776 { |
2849 { |
2777 metadataRecord->iMetadata = ~EMetaHiddenAgent & metadataRecord->iMetadata; |
2850 metadataRecord->iMetadata = ~EMetaHiddenAgent & metadataRecord->iMetadata; |
|
2851 } |
|
2852 } |
|
2853 break; |
|
2854 case ECmMetaHotSpot: |
|
2855 { |
|
2856 CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
|
2857 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
|
2858 if ( aValue ) |
|
2859 { |
|
2860 metadataRecord->iMetadata = EMetaHotSpot | metadataRecord->iMetadata; |
|
2861 } |
|
2862 else |
|
2863 { |
|
2864 metadataRecord->iMetadata = ~EMetaHotSpot & metadataRecord->iMetadata; |
2778 } |
2865 } |
2779 } |
2866 } |
2780 break; |
2867 break; |
2781 case ECmWapIPSecurity: |
2868 case ECmWapIPSecurity: |
2782 { |
2869 { |
2810 |
2897 |
2811 switch ( aAttribute ) |
2898 switch ( aAttribute ) |
2812 { |
2899 { |
2813 case ECmBearerIcon: |
2900 case ECmBearerIcon: |
2814 { |
2901 { |
2815 //TODO, write icon name to metadata record after commsdat changes implemented. |
2902 CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2816 //CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2903 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2817 // aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2904 |
2818 |
2905 if ( !metadataRecord ) |
2819 //if ( !metadataRecord ) |
2906 { |
2820 // { |
2907 User::Leave( KErrCorrupt ); |
2821 // User::Leave( KErrCorrupt ); |
2908 } |
2822 // } |
2909 metadataRecord->iIconFileName.SetL( aValue ); |
2823 //metadataRecord->iIconFileName.SetL( aValue ); |
|
2824 } |
2910 } |
2825 break; |
2911 break; |
2826 case ECmStartPage: |
2912 case ECmStartPage: |
2827 { |
2913 { |
2828 CCDWAPAccessPointRecord* wapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
2914 CCDWAPAccessPointRecord* wapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |