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" |
31 |
33 |
32 |
34 |
33 using namespace CMManager; |
35 using namespace CMManager; |
34 using namespace CommsDat; |
36 using namespace CommsDat; |
35 |
37 |
36 const TInt KApMaxConnNameLength = 30; |
38 const TInt KApMaxConnNameLength = 50; |
37 _LIT( KFormatPostfix, "%02d" ); |
39 _LIT( KFormatPostfix, "%02d" ); |
38 _LIT( KFormatLargePostfix, "%d" ); |
40 _LIT( KFormatLargePostfix, "%d" ); |
39 _LIT( KFormatNameWithPostfix, "%S(%S)" ); |
41 _LIT( KFormatNameWithPostfix, "%S(%S)" ); |
40 _LIT( KFormatNoPostfix, "%S" ); |
42 _LIT( KFormatNoPostfix, "%S" ); |
41 const TInt KMaxPostfixLength = 5; |
43 const TInt KMaxPostfixLength = 5; |
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 |
928 } |
951 } |
929 |
952 |
930 CopyAttributes( iapRecord, proxyRecord ); |
953 CopyAttributes( iapRecord, proxyRecord ); |
931 CheckIfNameModifiedL( iapRecord, proxyRecord ); |
954 CheckIfNameModifiedL( iapRecord, proxyRecord ); |
932 |
955 |
933 if ( proxyRecord->iUseProxyServer ) |
956 delete iProxyRecord; |
934 { |
957 iProxyRecord = NULL; |
935 delete iProxyRecord; |
958 iProxyRecord = static_cast<CCDProxiesRecord*>( |
936 iProxyRecord = NULL; |
959 CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); |
937 |
960 CopyRecordFieldsL( *proxyRecord, *iProxyRecord ); |
938 iProxyRecord = static_cast<CCDProxiesRecord*>( |
961 iProxyRecord->SetElementId( proxyRecord->ElementId() ); |
939 CCDRecordBase::CreateCopyRecordL( *proxyRecord ) ); |
962 |
940 iProxyRecord->SetElementId( proxyRecord->ElementId() ); |
963 if ( !iProxyRecord->RecordId() ) |
941 |
964 { |
942 if ( !iProxyRecord->RecordId() ) |
965 // New proxy setting -> create new record. |
943 { |
966 iProxyRecord->iService = iServiceRecord->RecordId(); |
944 // New proxy setting -> create new record. |
967 iProxyRecord->iServiceType.SetL( iIapRecord->iServiceType ); |
945 iProxyRecord->iService = iServiceRecord->RecordId(); |
968 |
946 iProxyRecord->iServiceType.SetL( iIapRecord->iServiceType ); |
969 // By default protocol is set to "http". |
947 |
970 if ( TPtrC( proxyRecord->iProtocolName ).Length() == 0 ) |
948 // By default protocol is set to "http". |
971 { |
949 if ( TPtrC( proxyRecord->iProtocolName ).Length() == 0 ) |
972 iProxyRecord->iProtocolName.SetL( KDefProxyProtocolName ); |
950 { |
973 } |
951 iProxyRecord->iProtocolName.SetL( KDefProxyProtocolName ); |
974 |
952 } |
975 iProxyRecord->SetRecordId( KCDNewRecordRequest ); |
953 |
976 iProxyRecord->StoreL( iSession ); |
954 iProxyRecord->SetRecordId( KCDNewRecordRequest ); |
977 CopyRecordFieldsL( *iProxyRecord, *proxyRecord ); |
955 iProxyRecord->StoreL( iSession ); |
978 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
956 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
|
957 proxyRecord->iService = iServiceRecord->RecordId(); |
|
958 proxyRecord->iServiceType.SetL( iIapRecord->iServiceType ); |
|
959 } |
|
960 else |
|
961 // Already existing record -> update only. |
|
962 { |
|
963 iProxyRecord->ModifyL( iSession ); |
|
964 } |
|
965 } |
979 } |
966 else |
980 else |
967 { |
981 // Already existing record -> update only. |
968 if ( iProxyRecord->RecordId() ) |
982 { |
969 { |
983 iProxyRecord->ModifyL( iSession ); |
970 iProxyRecord->DeleteL( iSession ); |
|
971 } |
|
972 } |
984 } |
973 |
985 |
974 OstTraceFunctionExit0( CCMPLUGINBASEENG_UPDATEPROXYRECORDL_EXIT ); |
986 OstTraceFunctionExit0( CCMPLUGINBASEENG_UPDATEPROXYRECORDL_EXIT ); |
975 } |
987 } |
976 |
988 |
1060 iNetworkRecord = NULL; |
1072 iNetworkRecord = NULL; |
1061 |
1073 |
1062 CheckIfNameModifiedL( iapRecord, networkRecord ); |
1074 CheckIfNameModifiedL( iapRecord, networkRecord ); |
1063 |
1075 |
1064 iNetworkRecord = static_cast<CCDNetworkRecord*>( |
1076 iNetworkRecord = static_cast<CCDNetworkRecord*>( |
1065 CCDRecordBase::CreateCopyRecordL( *networkRecord ) ); |
1077 CCDRecordBase::RecordFactoryL( KCDTIdNetworkRecord ) ); |
|
1078 CopyRecordFieldsL( *networkRecord, *iNetworkRecord ); |
1066 |
1079 |
1067 iNetworkRecord->SetElementId( networkRecord->ElementId() ); |
1080 iNetworkRecord->SetElementId( networkRecord->ElementId() ); |
1068 |
1081 |
1069 if ( !iNetworkRecord->RecordId() ) |
1082 if ( !iNetworkRecord->RecordId() ) |
1070 { |
1083 { |
1224 |
1237 |
1225 CheckIfNameModifiedL( iapRecord, wapAPRecord ); |
1238 CheckIfNameModifiedL( iapRecord, wapAPRecord ); |
1226 CheckIfNameModifiedL( iapRecord, wapIPBearerRecord ); |
1239 CheckIfNameModifiedL( iapRecord, wapIPBearerRecord ); |
1227 |
1240 |
1228 iWapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
1241 iWapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
1229 CCDRecordBase::CreateCopyRecordL( *wapAPRecord ) ); |
1242 CCDRecordBase::CreateCopyRecordL( *wapAPRecord ) );//TODO, convert to generic copy |
1230 iWapAPRecord->SetElementId( wapAPRecord->ElementId() ); |
1243 iWapAPRecord->SetElementId( wapAPRecord->ElementId() ); |
1231 |
1244 |
1232 iWapIPBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
1245 iWapIPBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
1233 CCDRecordBase::CreateCopyRecordL( *wapIPBearerRecord ) ); |
1246 CCDRecordBase::CreateCopyRecordL( *wapIPBearerRecord ) );//TODO, convert to generic copy |
1234 iWapIPBearerRecord->SetElementId( wapIPBearerRecord->ElementId() ); |
1247 iWapIPBearerRecord->SetElementId( wapIPBearerRecord->ElementId() ); |
1235 |
1248 |
1236 if ( !iWapAPRecord->RecordId() ) |
1249 if ( !iWapAPRecord->RecordId() ) |
1237 { |
1250 { |
1238 iWapAPRecord->SetRecordId( KCDNewRecordRequest ); |
1251 iWapAPRecord->SetRecordId( KCDNewRecordRequest ); |
1346 CCDRecordBase* aSrcRecord, |
1359 CCDRecordBase* aSrcRecord, |
1347 CCDRecordBase* aDstRecord ) |
1360 CCDRecordBase* aDstRecord ) |
1348 { |
1361 { |
1349 OstTraceFunctionEntry0( CCMPLUGINBASEENG_COPYATTRIBUTES_ENTRY ); |
1362 OstTraceFunctionEntry0( CCMPLUGINBASEENG_COPYATTRIBUTES_ENTRY ); |
1350 |
1363 |
1351 if ( aSrcRecord == NULL || aDstRecord == NULL ) |
1364 if ( !aSrcRecord || !aDstRecord ) |
1352 { |
1365 { |
1353 OstTraceFunctionExit0( CCMPLUGINBASEENG_COPYATTRIBUTES_EXIT ); |
1366 OstTraceFunctionExit0( CCMPLUGINBASEENG_COPYATTRIBUTES_EXIT ); |
1354 return; |
1367 return; |
1355 } |
1368 } |
1356 |
1369 |
1376 CCDWAPIPBearerRecord* wapBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
1389 CCDWAPIPBearerRecord* wapBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
1377 CCDRecordBase::RecordFactoryL( KCDTIdWAPIPBearerRecord ) ); |
1390 CCDRecordBase::RecordFactoryL( KCDTIdWAPIPBearerRecord ) ); |
1378 |
1391 |
1379 CleanupStack::PushL( wapBearerRecord ); |
1392 CleanupStack::PushL( wapBearerRecord ); |
1380 |
1393 |
1381 wapBearerRecord->iWAPIAP = iIapId; |
1394 wapBearerRecord->iWAPIAP = iCmId; |
1382 wapRS->iRecords.AppendL( wapBearerRecord ); |
1395 wapRS->iRecords.AppendL( wapBearerRecord ); |
1383 |
1396 |
1384 CleanupStack::Pop( wapBearerRecord ); |
1397 CleanupStack::Pop( wapBearerRecord ); |
1385 wapBearerRecord = NULL; |
1398 wapBearerRecord = NULL; |
1386 |
1399 |
1449 const TDesC& aName, |
1462 const TDesC& aName, |
1450 const TUint32& aIapId ) |
1463 const TUint32& aIapId ) |
1451 { |
1464 { |
1452 OstTraceFunctionEntry0( CCMPLUGINBASEENG_DOMAKEVALIDNAMEL_ENTRY ); |
1465 OstTraceFunctionEntry0( CCMPLUGINBASEENG_DOMAKEVALIDNAMEL_ENTRY ); |
1453 |
1466 |
|
1467 const TInt decimalBase = 10; |
1454 TBool changed( EFalse ); |
1468 TBool changed( EFalse ); |
1455 HBufC* temp = HBufC::NewLC( KApMaxConnNameLength ); |
1469 HBufC* temp = HBufC::NewLC( KApMaxConnNameLength ); |
1456 HBufC* temp2 = HBufC::NewLC( KApMaxConnNameLength ); |
1470 HBufC* temp2 = HBufC::NewLC( KApMaxConnNameLength ); |
1457 |
1471 |
1458 HBufC* corrname = EnsureMaxLengthLC( aName, changed ); |
1472 HBufC* corrname = EnsureMaxLengthLC( aName, changed ); |
1473 { |
1487 { |
1474 changed = ETrue; |
1488 changed = ETrue; |
1475 postfix++; |
1489 postfix++; |
1476 // Check the length of postfix, check text length accordingly. |
1490 // Check the length of postfix, check text length accordingly. |
1477 pf = postfix; |
1491 pf = postfix; |
1478 for ( i = 1; i < 10; i++ ) |
1492 for ( i = 1; i < decimalBase; i++ ) |
1479 { |
1493 { |
1480 pf /= 10; |
1494 pf /= decimalBase; |
1481 if ( !pf ) |
1495 if ( !pf ) |
1482 break; |
1496 break; |
1483 } |
1497 } |
1484 TPtr sgdptr( temp->Des() ); |
1498 TPtr sgdptr( temp->Des() ); |
1485 TPtr sgdptr2( temp2->Des() ); |
1499 TPtr sgdptr2( temp2->Des() ); |
1486 if ( postfix ) |
1500 if ( postfix ) |
1487 { |
1501 { |
1488 if ( postfix < 10 ) |
1502 if ( postfix < decimalBase ) |
1489 { |
1503 { |
1490 sgdptr2 = prefix.Left( KApMaxConnNameLength - i - 3 ); |
1504 sgdptr2 = prefix.Left( KApMaxConnNameLength - i - 3 ); |
1491 } |
1505 } |
1492 else |
1506 else |
1493 { |
1507 { |
1499 sgdptr2 = prefix.Left( KApMaxConnNameLength ); |
1513 sgdptr2 = prefix.Left( KApMaxConnNameLength ); |
1500 } |
1514 } |
1501 if ( postfix ) |
1515 if ( postfix ) |
1502 { |
1516 { |
1503 TBuf<KMaxPostfixLength> postfixString; |
1517 TBuf<KMaxPostfixLength> postfixString; |
1504 if ( postfix > 9 ) |
1518 if ( postfix >= decimalBase ) |
1505 { |
1519 { |
1506 postfixString.Format( KFormatLargePostfix, postfix ); |
1520 postfixString.Format( KFormatLargePostfix, postfix ); |
1507 // TODO: AknTextUtils::LanguageSpecificNumberConversion( postfixString ); |
1521 // TODO: AknTextUtils::LanguageSpecificNumberConversion( postfixString ); |
1508 } |
1522 } |
1509 else |
1523 else |
1785 { |
1799 { |
1786 iIapRecord->iRecordName.SetL( aName ); |
1800 iIapRecord->iRecordName.SetL( aName ); |
1787 } |
1801 } |
1788 else if ( iNamingMethod == ENamingUnique ) |
1802 else if ( iNamingMethod == ENamingUnique ) |
1789 { |
1803 { |
1790 HBufC* newName = DoMakeValidNameL( aName, iIapId ); |
1804 HBufC* newName = DoMakeValidNameL( aName, iCmId ); |
1791 |
1805 |
1792 if ( newName ) |
1806 if ( newName ) |
1793 // Name converted to unique. |
1807 // Name converted to unique. |
1794 { |
1808 { |
1795 CleanupStack::PushL( newName ); |
1809 CleanupStack::PushL( newName ); |
1963 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( aProxyRecord ); |
1977 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( aProxyRecord ); |
1964 |
1978 |
1965 proxyRecord->iServerName.SetL( aProxyServer ); |
1979 proxyRecord->iServerName.SetL( aProxyServer ); |
1966 if ( !aProxyServer.Length() ) |
1980 if ( !aProxyServer.Length() ) |
1967 { |
1981 { |
1968 proxyRecord->iPortNumber = 0; |
|
1969 proxyRecord->iUseProxyServer = EFalse; |
1982 proxyRecord->iUseProxyServer = EFalse; |
1970 } |
1983 } |
1971 else |
1984 else |
1972 { |
1985 { |
1973 proxyRecord->iUseProxyServer = ETrue; |
1986 proxyRecord->iUseProxyServer = ETrue; |
2047 aClientPluginInstance->iLocationEnabled = iLocationEnabled; |
2060 aClientPluginInstance->iLocationEnabled = iLocationEnabled; |
2048 |
2061 |
2049 if ( iIapRecord ) |
2062 if ( iIapRecord ) |
2050 { |
2063 { |
2051 CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>( |
2064 CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>( |
2052 CCDRecordBase::CreateCopyRecordL( *iIapRecord ) ); |
2065 CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) ); |
|
2066 CleanupStack::PushL( iapRecord ); |
|
2067 CopyRecordFieldsL( *iIapRecord, *iapRecord ); |
2053 iapRecord->SetElementId( iIapRecord->ElementId() ); |
2068 iapRecord->SetElementId( iIapRecord->ElementId() ); |
2054 CleanupStack::PushL( iapRecord ); |
|
2055 aClientPluginInstance->iGenRecordArray.AppendL( |
2069 aClientPluginInstance->iGenRecordArray.AppendL( |
2056 static_cast<CommsDat::CCDRecordBase*>( iapRecord ) ); |
2070 static_cast<CommsDat::CCDRecordBase*>( iapRecord ) ); |
2057 CleanupStack::Pop( iapRecord ); |
2071 CleanupStack::Pop( iapRecord ); |
2058 } |
2072 } |
2059 else |
2073 else |
2075 } |
2089 } |
2076 |
2090 |
2077 if ( iNetworkRecord ) |
2091 if ( iNetworkRecord ) |
2078 { |
2092 { |
2079 CCDNetworkRecord* networkRecord = static_cast<CCDNetworkRecord*>( |
2093 CCDNetworkRecord* networkRecord = static_cast<CCDNetworkRecord*>( |
2080 CCDRecordBase::CreateCopyRecordL( *iNetworkRecord ) ); |
2094 CCDRecordBase::RecordFactoryL( KCDTIdNetworkRecord ) ); |
|
2095 CleanupStack::PushL( networkRecord ); |
|
2096 CopyRecordFieldsL( *iNetworkRecord, *networkRecord ); |
2081 networkRecord->SetElementId( iNetworkRecord->ElementId() ); |
2097 networkRecord->SetElementId( iNetworkRecord->ElementId() ); |
2082 CleanupStack::PushL( networkRecord ); |
|
2083 aClientPluginInstance->iGenRecordArray.AppendL( |
2098 aClientPluginInstance->iGenRecordArray.AppendL( |
2084 static_cast<CommsDat::CCDRecordBase*>( networkRecord ) ); |
2099 static_cast<CommsDat::CCDRecordBase*>( networkRecord ) ); |
2085 CleanupStack::Pop( networkRecord ); |
2100 CleanupStack::Pop( networkRecord ); |
2086 } |
2101 } |
2087 else |
2102 else |
2090 } |
2105 } |
2091 |
2106 |
2092 if ( iWapAPRecord ) |
2107 if ( iWapAPRecord ) |
2093 { |
2108 { |
2094 CCDWAPAccessPointRecord* wapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
2109 CCDWAPAccessPointRecord* wapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
2095 CCDRecordBase::CreateCopyRecordL( *iWapAPRecord ) ); |
2110 CCDRecordBase::CreateCopyRecordL( *iWapAPRecord ) );//TODO, convert to generic copy |
2096 wapAPRecord->SetElementId( iWapAPRecord->ElementId() ); |
2111 wapAPRecord->SetElementId( iWapAPRecord->ElementId() ); |
2097 CleanupStack::PushL( wapAPRecord ); |
2112 CleanupStack::PushL( wapAPRecord ); |
2098 aClientPluginInstance->iGenRecordArray.AppendL( |
2113 aClientPluginInstance->iGenRecordArray.AppendL( |
2099 static_cast<CommsDat::CCDRecordBase*>( wapAPRecord ) ); |
2114 static_cast<CommsDat::CCDRecordBase*>( wapAPRecord ) ); |
2100 CleanupStack::Pop( wapAPRecord ); |
2115 CleanupStack::Pop( wapAPRecord ); |
2105 } |
2120 } |
2106 |
2121 |
2107 if ( iWapIPBearerRecord ) |
2122 if ( iWapIPBearerRecord ) |
2108 { |
2123 { |
2109 CCDWAPIPBearerRecord* wapIPBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
2124 CCDWAPIPBearerRecord* wapIPBearerRecord = static_cast<CCDWAPIPBearerRecord*>( |
2110 CCDRecordBase::CreateCopyRecordL( *iWapIPBearerRecord ) ); |
2125 CCDRecordBase::CreateCopyRecordL( *iWapIPBearerRecord ) );//TODO, convert to generic copy |
2111 wapIPBearerRecord->SetElementId( iWapIPBearerRecord->ElementId() ); |
2126 wapIPBearerRecord->SetElementId( iWapIPBearerRecord->ElementId() ); |
2112 CleanupStack::PushL( wapIPBearerRecord ); |
2127 CleanupStack::PushL( wapIPBearerRecord ); |
2113 aClientPluginInstance->iGenRecordArray.AppendL( |
2128 aClientPluginInstance->iGenRecordArray.AppendL( |
2114 static_cast<CommsDat::CCDRecordBase*>( wapIPBearerRecord ) ); |
2129 static_cast<CommsDat::CCDRecordBase*>( wapIPBearerRecord ) ); |
2115 CleanupStack::Pop( wapIPBearerRecord ); |
2130 CleanupStack::Pop( wapIPBearerRecord ); |
2141 aClientPluginInstance->iGenRecordArray.AppendL( NULL ); |
2156 aClientPluginInstance->iGenRecordArray.AppendL( NULL ); |
2142 |
2157 |
2143 if ( iProxyRecord ) |
2158 if ( iProxyRecord ) |
2144 { |
2159 { |
2145 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
2160 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
2146 CCDRecordBase::CreateCopyRecordL( *iProxyRecord ) ); |
2161 CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); |
|
2162 CleanupStack::PushL( proxyRecord ); |
|
2163 CopyRecordFieldsL( *iProxyRecord, *proxyRecord ); |
2147 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
2164 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
2148 CleanupStack::PushL( proxyRecord ); |
|
2149 aClientPluginInstance->iGenRecordArray.AppendL( |
2165 aClientPluginInstance->iGenRecordArray.AppendL( |
2150 static_cast<CommsDat::CCDRecordBase*>( proxyRecord ) ); |
2166 static_cast<CommsDat::CCDRecordBase*>( proxyRecord ) ); |
2151 CleanupStack::Pop( proxyRecord ); |
2167 CleanupStack::Pop( proxyRecord ); |
2152 } |
2168 } |
2153 else |
2169 else |
2174 switch ( aAttribute ) |
2190 switch ( aAttribute ) |
2175 { |
2191 { |
2176 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. |
2177 case ECmId: |
2193 case ECmId: |
2178 { |
2194 { |
2179 retVal = static_cast<CCDIAPRecord*>( |
2195 if ( iBearerType == KUidEmbeddedDestination ) |
2180 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 } |
2181 } |
2207 } |
2182 break; |
2208 break; |
2183 case ECmWapId: |
2209 case ECmWapId: |
2184 { |
2210 { |
2185 retVal = static_cast<CCDWAPIPBearerRecord*>( |
2211 retVal = static_cast<CCDWAPIPBearerRecord*>( |
2186 aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] )->iWAPAccessPointId; |
2212 aClientPluginInstance->iGenRecordArray[KWAPBearerRecordIndex] ) |
|
2213 ->iWAPAccessPointId; |
2187 } |
2214 } |
2188 break; |
2215 break; |
2189 case ECmIapServiceId: |
2216 case ECmIapServiceId: |
2190 { |
2217 { |
2191 retVal = static_cast<CCDIAPRecord*>( |
2218 retVal = static_cast<CCDIAPRecord*>( |
2299 |
2328 |
2300 switch ( aAttribute ) |
2329 switch ( aAttribute ) |
2301 { |
2330 { |
2302 case ECmProtected: |
2331 case ECmProtected: |
2303 { |
2332 { |
2304 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 } |
2305 } |
2344 } |
2306 break; |
2345 break; |
2307 case ECmHidden: |
2346 case ECmHidden: |
2308 { |
2347 { |
2309 CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>( |
2348 if ( iBearerType == KUidEmbeddedDestination ) |
2310 aClientPluginInstance->iGenRecordArray[KIapRecordIndex] ); |
2349 { |
2311 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 } |
2312 } |
2361 } |
2313 break; |
2362 break; |
2314 case ECmProxyUsageEnabled: |
2363 case ECmProxyUsageEnabled: |
2315 { |
2364 { |
2316 if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
2365 if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
2317 { |
2366 { |
2318 retVal = EFalse; |
2367 retVal = EFalse; |
2319 } |
2368 } |
2320 |
2369 else |
2321 retVal = static_cast<CCDProxiesRecord*>( |
2370 { |
2322 aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )->iUseProxyServer; |
2371 retVal = static_cast<CCDProxiesRecord*>( |
|
2372 aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
|
2373 ->iUseProxyServer; |
|
2374 } |
2323 } |
2375 } |
2324 break; |
2376 break; |
2325 case ECmDestination: |
2377 case ECmDestination: |
|
2378 { |
|
2379 TRAPD( err, retVal = GetBearerBoolAttributeL( |
|
2380 aAttribute, |
|
2381 aClientPluginInstance->iGenRecordArray, |
|
2382 aClientPluginInstance->iBearerSpecRecordArray ) ); |
|
2383 if ( err ) |
|
2384 { |
|
2385 retVal = EFalse; |
|
2386 } |
|
2387 } |
|
2388 break; |
|
2389 case ECmChargeCardUsageEnabled: |
|
2390 { |
|
2391 retVal = EFalse; |
|
2392 } |
|
2393 break; |
|
2394 case ECmLocationUsageEnabled: |
|
2395 { |
|
2396 retVal = iLocationEnabled; |
|
2397 } |
|
2398 break; |
|
2399 case ECmCoverage: |
|
2400 // By default the plugin has no network coverage. |
2326 { |
2401 { |
2327 TRAPD( err, retVal = GetBearerBoolAttributeL( |
2402 TRAPD( err, retVal = GetBearerBoolAttributeL( |
2328 aAttribute, |
2403 aAttribute, |
2329 aClientPluginInstance->iGenRecordArray, |
2404 aClientPluginInstance->iGenRecordArray, |
2330 aClientPluginInstance->iBearerSpecRecordArray ) ); |
2405 aClientPluginInstance->iBearerSpecRecordArray ) ); |
2339 User::Leave( err ); |
2414 User::Leave( err ); |
2340 } |
2415 } |
2341 } |
2416 } |
2342 } |
2417 } |
2343 break; |
2418 break; |
2344 case ECmChargeCardUsageEnabled: |
|
2345 { |
|
2346 retVal = EFalse; |
|
2347 } |
|
2348 break; |
|
2349 case ECmLocationUsageEnabled: |
|
2350 { |
|
2351 retVal = iLocationEnabled; |
|
2352 } |
|
2353 break; |
|
2354 case ECmCoverage: |
|
2355 // By default the plugin has no network coverage. |
|
2356 { |
|
2357 TRAPD( err, retVal = GetBearerBoolAttributeL( |
|
2358 aAttribute, |
|
2359 aClientPluginInstance->iGenRecordArray, |
|
2360 aClientPluginInstance->iBearerSpecRecordArray ) ); |
|
2361 if ( err ) |
|
2362 { |
|
2363 if ( err == KErrNotFound ) |
|
2364 { |
|
2365 retVal = EFalse; |
|
2366 } |
|
2367 else |
|
2368 { |
|
2369 User::Leave( err ); |
|
2370 } |
|
2371 } |
|
2372 } |
|
2373 break; |
|
2374 case ECmMetaHighlight: |
2419 case ECmMetaHighlight: |
2375 { |
2420 { |
2376 CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2421 CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2377 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2422 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2378 retVal = metadataRecord->iMetadata & EMetaHighlight; |
2423 retVal = metadataRecord->iMetadata & EMetaHighlight; |
2383 CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2428 CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2384 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2429 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2385 retVal = metadataRecord->iMetadata & EMetaHiddenAgent; |
2430 retVal = metadataRecord->iMetadata & EMetaHiddenAgent; |
2386 } |
2431 } |
2387 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; |
2388 case ECmVirtual: |
2440 case ECmVirtual: |
2389 { |
2441 { |
2390 retVal = EFalse; |
2442 // This is bearer specific attribute. |
|
2443 TRAPD( err, retVal = GetBearerInfoBoolL( aAttribute ) ); |
|
2444 if ( err ) |
|
2445 { |
|
2446 retVal = EFalse; |
|
2447 } |
2391 } |
2448 } |
2392 break; |
2449 break; |
2393 case ECmWapIPSecurity: |
2450 case ECmWapIPSecurity: |
2394 { |
2451 { |
2395 retVal = static_cast<CCDWAPIPBearerRecord*>( |
2452 retVal = static_cast<CCDWAPIPBearerRecord*>( |
2428 |
2485 |
2429 switch ( aAttribute ) |
2486 switch ( aAttribute ) |
2430 { |
2487 { |
2431 case ECmBearerIcon: |
2488 case ECmBearerIcon: |
2432 { |
2489 { |
2433 //TODO, read icon name from metadata record after commsdat changes implemented. |
2490 CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2434 //CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2491 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2435 // aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2492 |
2436 |
2493 if ( !metadataRecord ) |
2437 //if ( !metadataRecord ) |
2494 { |
2438 // { |
2495 User::Leave( KErrCorrupt ); |
2439 // User::Leave( KErrCorrupt ); |
2496 } |
2440 // } |
2497 |
2441 |
2498 retVal = TPtrC( metadataRecord->iIconFileName ).AllocL(); |
2442 //retVal = TPtrC( metadataRecord->iIconFileName ).AllocL(); |
|
2443 retVal = KNullDesC().AllocL();//TODO, check this freed |
|
2444 } |
2499 } |
2445 break; |
2500 break; |
2446 case ECmStartPage: |
2501 case ECmStartPage: |
2447 { |
2502 { |
2448 CCDWAPAccessPointRecord* wapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
2503 CCDWAPAccessPointRecord* wapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
2638 case ECmProxyPortNumber: |
2693 case ECmProxyPortNumber: |
2639 { |
2694 { |
2640 if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
2695 if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
2641 { |
2696 { |
2642 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
2697 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
2643 CCDRecordBase::CreateCopyRecordL( *iProxyRecord ) ); |
2698 CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); |
2644 CleanupStack::PushL( proxyRecord ); |
2699 CleanupStack::PushL( proxyRecord ); |
|
2700 CopyRecordFieldsL( *iProxyRecord, *proxyRecord ); |
2645 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
2701 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
2646 aClientPluginInstance->iGenRecordArray.AppendL( |
2702 aClientPluginInstance->iGenRecordArray.InsertL( |
2647 static_cast<CommsDat::CCDRecordBase*>( proxyRecord ) ); |
2703 static_cast<CommsDat::CCDRecordBase*>( proxyRecord ), |
|
2704 KProxyRecordIndex ); |
2648 CleanupStack::Pop( proxyRecord ); |
2705 CleanupStack::Pop( proxyRecord ); |
2649 } |
2706 } |
2650 |
2707 |
2651 static_cast<CCDProxiesRecord*>( |
2708 static_cast<CCDProxiesRecord*>( |
2652 aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )-> |
2709 aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )-> |
2739 case ECmProxyUsageEnabled: |
2796 case ECmProxyUsageEnabled: |
2740 { |
2797 { |
2741 if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
2798 if ( !aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] ) |
2742 { |
2799 { |
2743 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
2800 CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>( |
2744 CCDRecordBase::CreateCopyRecordL( *iProxyRecord ) ); |
2801 CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) ); |
2745 CleanupStack::PushL( proxyRecord ); |
2802 CleanupStack::PushL( proxyRecord ); |
|
2803 CopyRecordFieldsL( *iProxyRecord, *proxyRecord ); |
2746 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
2804 proxyRecord->SetElementId( iProxyRecord->ElementId() ); |
2747 aClientPluginInstance->iGenRecordArray.AppendL( |
2805 aClientPluginInstance->iGenRecordArray.InsertL( |
2748 static_cast<CommsDat::CCDRecordBase*>( proxyRecord ) ); |
2806 static_cast<CommsDat::CCDRecordBase*>( proxyRecord ), |
|
2807 KProxyRecordIndex ); |
2749 CleanupStack::Pop( proxyRecord ); |
2808 CleanupStack::Pop( proxyRecord ); |
2750 } |
2809 } |
2751 |
2810 |
2752 static_cast<CCDProxiesRecord*>( |
2811 static_cast<CCDProxiesRecord*>( |
2753 aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )->iUseProxyServer = |
2812 aClientPluginInstance->iGenRecordArray[KProxyRecordIndex] )->iUseProxyServer = |
2787 metadataRecord->iMetadata = EMetaHiddenAgent | metadataRecord->iMetadata; |
2846 metadataRecord->iMetadata = EMetaHiddenAgent | metadataRecord->iMetadata; |
2788 } |
2847 } |
2789 else |
2848 else |
2790 { |
2849 { |
2791 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; |
2792 } |
2865 } |
2793 } |
2866 } |
2794 break; |
2867 break; |
2795 case ECmWapIPSecurity: |
2868 case ECmWapIPSecurity: |
2796 { |
2869 { |
2824 |
2897 |
2825 switch ( aAttribute ) |
2898 switch ( aAttribute ) |
2826 { |
2899 { |
2827 case ECmBearerIcon: |
2900 case ECmBearerIcon: |
2828 { |
2901 { |
2829 //TODO, write icon name to metadata record after commsdat changes implemented. |
2902 CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2830 //CCDIAPMetadataRecord* metadataRecord = static_cast<CCDIAPMetadataRecord*>( |
2903 aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2831 // aClientPluginInstance->iGenRecordArray[KMetaDataRecordIndex] ); |
2904 |
2832 |
2905 if ( !metadataRecord ) |
2833 //if ( !metadataRecord ) |
2906 { |
2834 // { |
2907 User::Leave( KErrCorrupt ); |
2835 // User::Leave( KErrCorrupt ); |
2908 } |
2836 // } |
2909 metadataRecord->iIconFileName.SetL( aValue ); |
2837 //metadataRecord->iIconFileName.SetL( aValue ); |
|
2838 } |
2910 } |
2839 break; |
2911 break; |
2840 case ECmStartPage: |
2912 case ECmStartPage: |
2841 { |
2913 { |
2842 CCDWAPAccessPointRecord* wapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |
2914 CCDWAPAccessPointRecord* wapAPRecord = static_cast<CCDWAPAccessPointRecord*>( |