666 CLiwMap*& aOutMapParam) |
666 CLiwMap*& aOutMapParam) |
667 { |
667 { |
668 aOutMapParam = CLiwDefaultMap::NewL(); |
668 aOutMapParam = CLiwDefaultMap::NewL(); |
669 CleanupClosePushL(*aOutMapParam); |
669 CleanupClosePushL(*aOutMapParam); |
670 TInt count = 0; |
670 TInt count = 0; |
671 switch (aInSysData->DataType()) |
671 if(aInSysData) |
672 { |
672 { |
673 case CSysData::EStatus: |
673 switch (aInSysData->DataType()) |
674 { |
674 { |
675 TInt32 status = ((CStatus*) aInSysData)->Status(); |
675 case CSysData::EStatus: |
676 aOutMapParam->InsertL(KStatus,(TInt32)status); |
676 { |
677 } |
677 TInt32 status = ((CStatus*) aInSysData)->Status(); |
678 break; |
678 aOutMapParam->InsertL(KStatus,(TInt32)status); |
679 case CSysData::EVersion: |
679 } |
680 { |
680 break; |
681 TBuf<KMaxVersionTxt> majortxt(KNullDesC); |
681 case CSysData::EVersion: |
682 TBuf<KMaxVersionTxt> minortxt(KNullDesC); |
682 { |
683 majortxt.FillZ(0); |
683 TBuf<KMaxVersionTxt> majortxt(KNullDesC); |
684 minortxt.FillZ(0); |
684 TBuf<KMaxVersionTxt> minortxt(KNullDesC); |
685 const CVersion* version = (CVersion*) aInSysData; |
685 majortxt.FillZ(0); |
686 NumberConversion::AppendFormatNumber (majortxt, |
686 minortxt.FillZ(0); |
687 version->MajorVersion(),EDigitTypeWestern); |
687 const CVersion* version = (CVersion*) aInSysData; |
688 aOutMapParam->InsertL(KMajorVersion,majortxt); |
688 NumberConversion::AppendFormatNumber (majortxt, |
689 NumberConversion::AppendFormatNumber (minortxt, |
689 version->MajorVersion(),EDigitTypeWestern); |
690 version->MinorVersion(),EDigitTypeWestern); |
690 aOutMapParam->InsertL(KMajorVersion,majortxt); |
691 aOutMapParam->InsertL(KMinorVersion,minortxt); |
691 NumberConversion::AppendFormatNumber (minortxt, |
692 } |
692 version->MinorVersion(),EDigitTypeWestern); |
693 break; |
693 aOutMapParam->InsertL(KMinorVersion,minortxt); |
694 case CSysData::EConnectionList: |
694 } |
695 { |
695 break; |
696 CConnectionList* dataconnections = (CConnectionList*) aInSysData; |
696 case CSysData::EConnectionList: |
697 CSysInfoConnList* connlist = CSysInfoConnList::NewL(dataconnections); |
697 { |
698 CleanupClosePushL(*connlist); |
698 CConnectionList* dataconnections = (CConnectionList*) aInSysData; |
699 aOutMapParam->InsertL(KConnectionList,connlist); |
699 CSysInfoConnList* connlist = CSysInfoConnList::NewL(dataconnections); |
700 CleanupStack::PopAndDestroy(connlist); |
700 CleanupClosePushL(*connlist); |
701 } |
701 aOutMapParam->InsertL(KConnectionList,connlist); |
702 break; |
702 CleanupStack::PopAndDestroy(connlist); |
703 case CSysData::ENetworkInfo: |
703 } |
704 { |
704 break; |
705 const CNetworkInfo* networkinfo = (CNetworkInfo*) aInSysData; |
705 case CSysData::ENetworkInfo: |
706 aOutMapParam->InsertL(KNetworkName,networkinfo->NetworkName()); |
706 { |
707 aOutMapParam->InsertL(KNetworkStatus, |
707 const CNetworkInfo* networkinfo = (CNetworkInfo*) aInSysData; |
708 (TInt32)networkinfo->NetworkStatus()); |
708 aOutMapParam->InsertL(KNetworkName,networkinfo->NetworkName()); |
709 aOutMapParam->InsertL(KNetworkMode,(TInt32)networkinfo->NetworkMode()); |
709 aOutMapParam->InsertL(KNetworkStatus, |
710 aOutMapParam->InsertL(KCountryCode,networkinfo->CountryCode()); |
710 (TInt32)networkinfo->NetworkStatus()); |
711 aOutMapParam->InsertL(KNetworkCode,networkinfo->NetworkCode()); |
711 aOutMapParam->InsertL(KNetworkMode,(TInt32)networkinfo->NetworkMode()); |
712 aOutMapParam->InsertL(KLocationStatus, |
712 aOutMapParam->InsertL(KCountryCode,networkinfo->CountryCode()); |
713 networkinfo->ValidLocationAreaCode()); |
713 aOutMapParam->InsertL(KNetworkCode,networkinfo->NetworkCode()); |
714 aOutMapParam->InsertL(KAreaCode,(TInt32)networkinfo->LocationAreaCode()); |
714 aOutMapParam->InsertL(KLocationStatus, |
715 aOutMapParam->InsertL(KCellId,(TInt32)networkinfo->CellId()); |
715 networkinfo->ValidLocationAreaCode()); |
716 } |
716 aOutMapParam->InsertL(KAreaCode,(TInt32)networkinfo->LocationAreaCode()); |
717 break; |
717 aOutMapParam->InsertL(KCellId,(TInt32)networkinfo->CellId()); |
718 case CSysData::EConnectionInfo: |
718 } |
719 { |
719 break; |
720 const CConnectionInfo* connectioninfo = |
720 case CSysData::EConnectionInfo: |
721 ((CConnectionInfo*) aInSysData); |
721 { |
722 aOutMapParam->InsertL(KIAPID,(TInt32)connectioninfo->IAPId()); |
722 const CConnectionInfo* connectioninfo = |
723 aOutMapParam->InsertL(KIAPName,connectioninfo->IAPName()); |
723 ((CConnectionInfo*) aInSysData); |
724 aOutMapParam->InsertL(KIAPConnectionName, |
724 aOutMapParam->InsertL(KIAPID,(TInt32)connectioninfo->IAPId()); |
725 connectioninfo->ConnectionName()); |
725 aOutMapParam->InsertL(KIAPName,connectioninfo->IAPName()); |
726 aOutMapParam->InsertL(KNetworkName,connectioninfo->NetworkName()); |
726 aOutMapParam->InsertL(KIAPConnectionName, |
727 aOutMapParam->InsertL(KConnectionType, |
727 connectioninfo->ConnectionName()); |
728 (TInt32)connectioninfo->BearerType()); |
728 aOutMapParam->InsertL(KNetworkName,connectioninfo->NetworkName()); |
729 aOutMapParam->InsertL(KConnectionStatus, |
729 aOutMapParam->InsertL(KConnectionType, |
730 (TInt32)connectioninfo->ConnectionState()); |
730 (TInt32)connectioninfo->BearerType()); |
731 } |
731 aOutMapParam->InsertL(KConnectionStatus, |
732 break; |
732 (TInt32)connectioninfo->ConnectionState()); |
733 case CSysData::EDriveInfo: |
733 } |
734 { |
734 break; |
735 const CDriveInfo* driveinfo = (CDriveInfo*) aInSysData; |
735 case CSysData::EDriveInfo: |
736 |
736 { |
737 TBuf<KMaxDriveLength> drive; |
737 const CDriveInfo* driveinfo = (CDriveInfo*) aInSysData; |
738 drive.FillZ(); |
738 |
739 drive.Append('A'+driveinfo->DriveNumber()); |
|
740 drive.Append(KDriveSeperator); |
|
741 |
|
742 aOutMapParam->InsertL(KDriveNo,drive); |
|
743 aOutMapParam->InsertL(KCriticalSpace, |
|
744 (TInt32)driveinfo->CriticalSpace()); |
|
745 aOutMapParam->InsertL(KMediaType,(TInt32)driveinfo->MediaType()); |
|
746 //totalspace and freespace converted to string . |
|
747 TBuf<KMax64BitNumLen> string64bitnum(KNullDesC); |
|
748 string64bitnum.FillZ(0); |
|
749 string64bitnum.Num(driveinfo->TotalSpace()); |
|
750 aOutMapParam->InsertL(KTotalSpace,string64bitnum); |
|
751 string64bitnum.FillZ(0); |
|
752 string64bitnum.Num(driveinfo->FreeSpace()); |
|
753 aOutMapParam->InsertL(KFreeSpace,string64bitnum); |
|
754 TPtrC drvname; |
|
755 driveinfo->DriveName(drvname); |
|
756 aOutMapParam->InsertL(KDriveName,drvname); |
|
757 aOutMapParam->InsertL(KBatteryState,(TInt32)driveinfo->BatteryState()); |
|
758 } |
|
759 break; |
|
760 |
|
761 case CSysData::EAccessoryInfo: |
|
762 { |
|
763 const CAccessoryInfo* accessoryinfo = ((CAccessoryInfo*) aInSysData); |
|
764 aOutMapParam->InsertL(KAccessoryType, |
|
765 (TInt32)accessoryinfo->AccessoryType()); |
|
766 aOutMapParam->InsertL(KAccessoryState, |
|
767 (TInt32)accessoryinfo->ConnectionState()); |
|
768 } |
|
769 break; |
|
770 case CSysData::EResolution: |
|
771 { |
|
772 const CResolution* resolution = ((CResolution*) aInSysData); |
|
773 aOutMapParam->InsertL(KXPixels,(TInt32)resolution->XPixels()); |
|
774 aOutMapParam->InsertL(KYPixels,(TInt32)resolution->YPixels()); |
|
775 } |
|
776 break; |
|
777 case CSysData::EStringData: |
|
778 { |
|
779 const CStringData* stringdata = ((CStringData*) aInSysData); |
|
780 TPtrC string; |
|
781 stringdata->StringData(string); |
|
782 aOutMapParam->InsertL(KStringData,string); |
|
783 } |
|
784 break; |
|
785 case CSysData::EAccessoryList: |
|
786 { |
|
787 CAccList* accessories = (CAccList*) aInSysData; |
|
788 CSysInfoAccList* accessorylist = CSysInfoAccList::NewL(accessories); |
|
789 CleanupClosePushL(*accessorylist); |
|
790 aOutMapParam->InsertL(KAccessoryList,accessorylist); |
|
791 CleanupStack::PopAndDestroy(accessorylist); |
|
792 } |
|
793 break; |
|
794 case CSysData::ELanguageList: |
|
795 { |
|
796 CLiwList* langlist = CLiwDefaultList::NewL(); |
|
797 CleanupClosePushL(*langlist); |
|
798 const CLanguageList* languages = ((CLanguageList*) aInSysData); |
|
799 count= languages->Count(); |
|
800 for(int index=0; index<count; index++ ) |
|
801 { |
|
802 TInt language = 0; |
|
803 languages->At(index,language); |
|
804 langlist->AppendL(TLiwVariant(((TInt32)language))); |
|
805 } |
|
806 aOutMapParam->InsertL(KLanguageList,langlist); |
|
807 CleanupStack::PopAndDestroy(langlist); |
|
808 } |
|
809 break; |
|
810 |
|
811 case CSysData::EDriveList: |
|
812 { |
|
813 CLiwList* drivelist = CLiwDefaultList::NewL(); |
|
814 CleanupClosePushL(*drivelist); |
|
815 const CDriveList* drives = ((CDriveList*) aInSysData); |
|
816 count = drives->Count(); |
|
817 for(int index=0; index<count; index++ ) |
|
818 { |
|
819 TInt driveVal = 0; |
|
820 drives->At(index,driveVal); |
|
821 TBuf<KMaxDriveLength> drive; |
739 TBuf<KMaxDriveLength> drive; |
822 drive.FillZ(); |
740 drive.FillZ(); |
823 drive.Append('A'+driveVal); |
741 drive.Append('A'+driveinfo->DriveNumber()); |
824 drive.Append(KDriveSeperator); |
742 drive.Append(KDriveSeperator); |
825 drivelist->AppendL(TLiwVariant(drive)); |
743 |
826 } |
744 aOutMapParam->InsertL(KDriveNo,drive); |
827 aOutMapParam->InsertL(KDriveList,drivelist); |
745 aOutMapParam->InsertL(KCriticalSpace, |
828 CleanupStack::PopAndDestroy(drivelist); |
746 (TInt32)driveinfo->CriticalSpace()); |
829 } |
747 aOutMapParam->InsertL(KMediaType,(TInt32)driveinfo->MediaType()); |
830 break; |
748 //totalspace and freespace converted to string . |
831 |
749 TBuf<KMax64BitNumLen> string64bitnum(KNullDesC); |
832 case CSysData::EStringList: |
750 string64bitnum.FillZ(0); |
833 { |
751 string64bitnum.Num(driveinfo->TotalSpace()); |
834 CLiwList* stringlist = CLiwDefaultList::NewL(); |
752 aOutMapParam->InsertL(KTotalSpace,string64bitnum); |
835 CleanupClosePushL(*stringlist); |
753 string64bitnum.FillZ(0); |
836 CStringList* strings = ((CStringList*) aInSysData); |
754 string64bitnum.Num(driveinfo->FreeSpace()); |
837 count = strings->Count(); |
755 aOutMapParam->InsertL(KFreeSpace,string64bitnum); |
838 for(int index=0; index<count; index++ ) |
756 TPtrC drvname; |
839 { |
757 driveinfo->DriveName(drvname); |
|
758 aOutMapParam->InsertL(KDriveName,drvname); |
|
759 aOutMapParam->InsertL(KBatteryState,(TInt32)driveinfo->BatteryState()); |
|
760 } |
|
761 break; |
|
762 |
|
763 case CSysData::EAccessoryInfo: |
|
764 { |
|
765 const CAccessoryInfo* accessoryinfo = ((CAccessoryInfo*) aInSysData); |
|
766 aOutMapParam->InsertL(KAccessoryType, |
|
767 (TInt32)accessoryinfo->AccessoryType()); |
|
768 aOutMapParam->InsertL(KAccessoryState, |
|
769 (TInt32)accessoryinfo->ConnectionState()); |
|
770 } |
|
771 break; |
|
772 case CSysData::EResolution: |
|
773 { |
|
774 const CResolution* resolution = ((CResolution*) aInSysData); |
|
775 aOutMapParam->InsertL(KXPixels,(TInt32)resolution->XPixels()); |
|
776 aOutMapParam->InsertL(KYPixels,(TInt32)resolution->YPixels()); |
|
777 } |
|
778 break; |
|
779 case CSysData::EStringData: |
|
780 { |
|
781 const CStringData* stringdata = ((CStringData*) aInSysData); |
840 TPtrC string; |
782 TPtrC string; |
841 strings->At(index,string); |
783 stringdata->StringData(string); |
842 stringlist->AppendL(TLiwVariant(string)); |
784 aOutMapParam->InsertL(KStringData,string); |
843 } |
785 } |
844 aOutMapParam->InsertL(KStringList,stringlist); |
786 break; |
845 CleanupStack::PopAndDestroy(stringlist); |
787 case CSysData::EAccessoryList: |
846 } |
788 { |
847 break; |
789 CAccList* accessories = (CAccList*) aInSysData; |
848 case CSysData::ECameraInfo: |
790 CSysInfoAccList* accessorylist = CSysInfoAccList::NewL(accessories); |
849 { |
791 CleanupClosePushL(*accessorylist); |
850 CLiwList* camResList = CLiwDefaultList::NewL(); |
792 aOutMapParam->InsertL(KAccessoryList,accessorylist); |
851 CleanupClosePushL( *camResList ); |
793 CleanupStack::PopAndDestroy(accessorylist); |
852 CLiwList* camMimeTypesList = CLiwDefaultList::NewL(); |
794 } |
853 CleanupClosePushL( *camMimeTypesList ); |
795 break; |
854 const CCameraInfo* camInfo = ((CCameraInfo*) aInSysData); |
796 case CSysData::ELanguageList: |
855 count = camInfo->ResolutionList()->Count(); |
797 { |
856 |
798 CLiwList* langlist = CLiwDefaultList::NewL(); |
857 for ( int index=0; index<count; index++ ) |
799 CleanupClosePushL(*langlist); |
858 { |
800 const CLanguageList* languages = ((CLanguageList*) aInSysData); |
859 TInt val = 0; |
801 count= languages->Count(); |
860 CLiwMap* resMap = CLiwDefaultMap::NewL(); |
802 for(int index=0; index<count; index++ ) |
861 CleanupStack::PushL( resMap ); |
803 { |
862 camInfo->ResolutionList()->At( index, 0, val ); |
804 TInt language = 0; |
863 resMap->InsertL( KXPixels, (TInt32)val ); |
805 languages->At(index,language); |
864 camInfo->ResolutionList()->At( index, 1, val ); |
806 langlist->AppendL(TLiwVariant(((TInt32)language))); |
865 resMap->InsertL( KYPixels, (TInt32)val ); |
807 } |
866 camResList->AppendL( resMap ); |
808 aOutMapParam->InsertL(KLanguageList,langlist); |
867 CleanupStack::Pop( resMap ); |
809 CleanupStack::PopAndDestroy(langlist); |
868 resMap->Close(); |
810 } |
869 TPtrC string; |
811 break; |
870 camInfo->MimeTypesList()->At( index, string ); |
812 |
871 camMimeTypesList->AppendL( string ); |
813 case CSysData::EDriveList: |
872 } |
814 { |
873 aOutMapParam->InsertL( KCamResList, camResList ); |
815 CLiwList* drivelist = CLiwDefaultList::NewL(); |
874 aOutMapParam->InsertL( KCamMimeTypesList, camMimeTypesList ); |
816 CleanupClosePushL(*drivelist); |
875 CleanupStack::PopAndDestroy( camMimeTypesList ); |
817 const CDriveList* drives = ((CDriveList*) aInSysData); |
876 CleanupStack::PopAndDestroy( camResList ); |
818 count = drives->Count(); |
877 } |
819 for(int index=0; index<count; index++ ) |
878 break; |
820 { |
879 case CSysData::EVideoDecList: |
821 TInt driveVal = 0; |
880 { |
822 drives->At(index,driveVal); |
881 CLiwList* decResList = CLiwDefaultList::NewL(); |
823 TBuf<KMaxDriveLength> drive; |
882 CleanupClosePushL( *decResList ); |
824 drive.FillZ(); |
883 const CVideoDecDataList* declist = ((CVideoDecDataList*) aInSysData); |
825 drive.Append('A'+driveVal); |
884 count = declist->Count(); |
826 drive.Append(KDriveSeperator); |
885 CVideoDecDataList::CVideoDecData * decinfo = NULL; |
827 drivelist->AppendL(TLiwVariant(drive)); |
886 |
828 } |
887 for ( int index=0; index<count; index++ ) |
829 aOutMapParam->InsertL(KDriveList,drivelist); |
888 { |
830 CleanupStack::PopAndDestroy(drivelist); |
889 TInt val = 0; |
831 } |
890 CLiwMap* resMap = CLiwDefaultMap::NewL(); |
832 break; |
891 CleanupStack::PushL( resMap ); |
833 |
892 decinfo=(*declist)[index]; |
834 case CSysData::EStringList: |
893 TPtrC temp; |
835 { |
894 temp.Set(*(decinfo->Manufacturer)); |
836 CLiwList* stringlist = CLiwDefaultList::NewL(); |
895 TPtrC temp1; |
837 CleanupClosePushL(*stringlist); |
896 temp1.Set(*(decinfo->Identifier)); |
838 CStringList* strings = ((CStringList*) aInSysData); |
|
839 count = strings->Count(); |
|
840 for(int index=0; index<count; index++ ) |
|
841 { |
|
842 TPtrC string; |
|
843 strings->At(index,string); |
|
844 stringlist->AppendL(TLiwVariant(string)); |
|
845 } |
|
846 aOutMapParam->InsertL(KStringList,stringlist); |
|
847 CleanupStack::PopAndDestroy(stringlist); |
|
848 } |
|
849 break; |
|
850 case CSysData::ECameraInfo: |
|
851 { |
|
852 CLiwList* camResList = CLiwDefaultList::NewL(); |
|
853 CleanupClosePushL( *camResList ); |
|
854 CLiwList* camMimeTypesList = CLiwDefaultList::NewL(); |
|
855 CleanupClosePushL( *camMimeTypesList ); |
|
856 const CCameraInfo* camInfo = ((CCameraInfo*) aInSysData); |
|
857 count = camInfo->ResolutionList()->Count(); |
|
858 |
|
859 for ( int index=0; index<count; index++ ) |
|
860 { |
|
861 TInt val = 0; |
|
862 CLiwMap* resMap = CLiwDefaultMap::NewL(); |
|
863 CleanupStack::PushL( resMap ); |
|
864 camInfo->ResolutionList()->At( index, 0, val ); |
|
865 resMap->InsertL( KXPixels, (TInt32)val ); |
|
866 camInfo->ResolutionList()->At( index, 1, val ); |
|
867 resMap->InsertL( KYPixels, (TInt32)val ); |
|
868 camResList->AppendL( resMap ); |
|
869 CleanupStack::Pop( resMap ); |
|
870 resMap->Close(); |
|
871 TPtrC string; |
|
872 camInfo->MimeTypesList()->At( index, string ); |
|
873 camMimeTypesList->AppendL( string ); |
|
874 } |
|
875 aOutMapParam->InsertL( KCamResList, camResList ); |
|
876 aOutMapParam->InsertL( KCamMimeTypesList, camMimeTypesList ); |
|
877 CleanupStack::PopAndDestroy( camMimeTypesList ); |
|
878 CleanupStack::PopAndDestroy( camResList ); |
|
879 } |
|
880 break; |
|
881 case CSysData::EVideoDecList: |
|
882 { |
|
883 CLiwList* decResList = CLiwDefaultList::NewL(); |
|
884 CleanupClosePushL( *decResList ); |
|
885 const CVideoDecDataList* declist = ((CVideoDecDataList*) aInSysData); |
|
886 count = declist->Count(); |
|
887 CVideoDecDataList::CVideoDecData * decinfo = NULL; |
897 |
888 |
898 resMap->InsertL( KDecManufacturer, temp ); |
889 for ( int index=0; index<count; index++ ) |
899 resMap->InsertL( KIdentifier, temp1 ); |
890 { |
900 resMap->InsertL( KMaxBitrate, (TInt32)decinfo->MaxBitrate ); |
891 TInt val = 0; |
901 resMap->InsertL( KAccelerated, (TBool)decinfo->Accelerated ); |
892 CLiwMap* resMap = CLiwDefaultMap::NewL(); |
902 resMap->InsertL( KVersion, decinfo->Version ); |
893 CleanupStack::PushL( resMap ); |
903 |
894 decinfo=(*declist)[index]; |
904 decResList->AppendL( resMap ); |
895 TPtrC temp; |
905 CleanupStack::Pop( resMap ); |
896 temp.Set(*(decinfo->Manufacturer)); |
906 resMap->Close(); |
897 TPtrC temp1; |
907 } |
898 temp1.Set(*(decinfo->Identifier)); |
908 aOutMapParam->InsertL( KCapability, decResList ); |
899 |
909 CleanupStack::PopAndDestroy( decResList ); |
900 resMap->InsertL( KDecManufacturer, temp ); |
910 //aOutMapParam->InsertL( KCapability, 1 ); |
901 resMap->InsertL( KIdentifier, temp1 ); |
911 } |
902 resMap->InsertL( KMaxBitrate, (TInt32)decinfo->MaxBitrate ); |
912 break; |
903 resMap->InsertL( KAccelerated, (TBool)decinfo->Accelerated ); |
913 default: |
904 resMap->InsertL( KVersion, decinfo->Version ); |
914 User::Leave(KErrArgument); |
905 |
|
906 decResList->AppendL( resMap ); |
|
907 CleanupStack::Pop( resMap ); |
|
908 resMap->Close(); |
|
909 } |
|
910 aOutMapParam->InsertL( KCapability, decResList ); |
|
911 CleanupStack::PopAndDestroy( decResList ); |
|
912 //aOutMapParam->InsertL( KCapability, 1 ); |
|
913 } |
|
914 break; |
|
915 default: |
|
916 User::Leave(KErrArgument); |
|
917 } |
915 } |
918 } |
916 CleanupStack::Pop(aOutMapParam); |
919 CleanupStack::Pop(aOutMapParam); |
917 } |
920 } |
918 |
921 |
919 // --------------------------------------------------------------------------- |
922 // --------------------------------------------------------------------------- |